KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
mapper_base.h
Go to the documentation of this file.
1 // ==============================================================================
2 // KratosShapeOptimizationApplication
3 //
4 // License: BSD License
5 // license: ShapeOptimizationApplication/license.txt
6 //
7 // Main authors: Baumgaertner Daniel, https://github.com/dbaumgaertner
8 //
9 // ==============================================================================
10 
11 #ifndef MAPPER_H
12 #define MAPPER_H
13 
14 // ------------------------------------------------------------------------------
15 // System includes
16 // ------------------------------------------------------------------------------
17 #include <iostream>
18 #include <string>
19 
20 // ------------------------------------------------------------------------------
21 // Project includes
22 // ------------------------------------------------------------------------------
23 #include "includes/node.h"
25 
26 // ==============================================================================
27 
28 namespace Kratos
29 {
30 
33 
37 
41 
45 
49 
51 
55 class Mapper
56 {
57 public:
60 
61  // Type definitions for better reading later
63 
64  typedef Node NodeType;
65 
68 
72 
75  {
76  }
77 
79  virtual ~Mapper()
80  {
81  }
82 
86 
90 
91  // --------------------------------------------------------------------------
92  virtual void Initialize(){};
93 
94  // --------------------------------------------------------------------------
95  virtual void Update(){};
96 
97  // --------------------------------------------------------------------------
98  virtual void Map(const Variable<array_3d> &rOriginVariable, const Variable<array_3d> &rDestinationVariable) = 0;
99 
100  // --------------------------------------------------------------------------
101  virtual void Map(const Variable<double> &rOriginVariable, const Variable<double> &rDestinationVariable) = 0;
102 
103  // --------------------------------------------------------------------------
104  virtual void InverseMap(const Variable<array_3d> &rDestinationVariable, const Variable<array_3d> &rOriginVariable) = 0;
105 
106  // --------------------------------------------------------------------------
107  virtual void InverseMap(const Variable<double> &rDestinationVariable, const Variable<double> &rOriginVariable) = 0;
108 
109  // --------------------------------------------------------------------------
110 
114 
118 
122 
124  virtual std::string Info() const
125  {
126  return "Mapper";
127  }
128 
130  virtual void PrintInfo(std::ostream &rOStream) const
131  {
132  rOStream << "Mapper";
133  }
134 
136  virtual void PrintData(std::ostream &rOStream) const
137  {
138  }
139 
143 
145 
146 protected:
149 
153 
157 
158  virtual double GetVertexMorphingRadius(const NodeType& rNode) const
159  {
160  KRATOS_ERROR << "Please implement this method in the derrived class.";
161  }
162 
166 
170 
174 
178 
180 
181 private:
184 
188 
192 
196 
200 
204 
208 
210  // Mapper& operator=(Mapper const& rOther);
211 
213  // Mapper(Mapper const& rOther);
214 
216 
217 }; // Class Mapper
218 
220 
223 
227 
229 
230 } // namespace Kratos.
231 
232 #endif // MAPPER_H
Base Class for all Mappers.
Definition: mapper.h:43
virtual void Update()
Definition: mapper_base.h:95
Node NodeType
Definition: mapper_base.h:64
virtual void Initialize()
Definition: mapper_base.h:92
Mapper()
Default constructor.
Definition: mapper_base.h:74
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: mapper_base.h:136
virtual void Map(const Variable< array_3d > &rOriginVariable, const Variable< array_3d > &rDestinationVariable)=0
array_1d< double, 3 > array_3d
Definition: mapper_base.h:62
virtual std::string Info() const
Turn back information as a string.
Definition: mapper_base.h:124
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: mapper_base.h:130
virtual void Map(const Variable< double > &rOriginVariable, const Variable< double > &rDestinationVariable)=0
virtual ~Mapper()
Destructor.
Definition: mapper_base.h:79
KRATOS_CLASS_POINTER_DEFINITION(Mapper)
Pointer definition of Mapper.
virtual void InverseMap(const Variable< array_3d > &rDestinationVariable, const Variable< array_3d > &rOriginVariable)=0
virtual double GetVertexMorphingRadius(const NodeType &rNode) const
Definition: mapper_base.h:158
virtual void InverseMap(const Variable< double > &rDestinationVariable, const Variable< double > &rOriginVariable)=0
This class defines the node.
Definition: node.h:65
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Mapper
Definition: MappingApplication.py:39