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.
metrics_error_process.h
Go to the documentation of this file.
1 // KRATOS __ __ _____ ____ _ _ ___ _ _ ____
2 // | \/ | ____/ ___|| | | |_ _| \ | |/ ___|
3 // | |\/| | _| \___ \| |_| || || \| | | _
4 // | | | | |___ ___) | _ || || |\ | |_| |
5 // |_| |_|_____|____/|_| |_|___|_| \_|\____| APPLICATION
6 //
7 // License: BSD License
8 // license: MeshingApplication/license.txt
9 //
10 // Main authors: Vicente Mataix Ferrandiz
11 // Anna Rehr
12 //
13 
14 #if !defined(KRATOS_ERROR_METRICS_PROCESS)
15 #define KRATOS_ERROR_METRICS_PROCESS
16 
17 // Project includes
19 #include "includes/model_part.h"
20 #include "processes/process.h"
21 
22 namespace Kratos
23 {
26 
30 
32  typedef std::size_t SizeType;
33 
37 
41 
45 
53 template<SizeType TDim>
54 class KRATOS_API(MESHING_APPLICATION) MetricErrorProcess
55  : public Process
56 {
57 public:
60 
65 
67  typedef Node NodeType;
68 
71  typedef NodesArrayType::iterator NodeItType;
72  typedef ElementsArrayType::iterator ElementItType;
73 
75  typedef std::size_t IndexType;
76 
79 
81  typedef typename std::conditional<TDim == 2, array_1d<double, 3>, array_1d<double, 6>>::type TensorArrayType;
82 
85 
89 
90  // Constructor
91 
98  ModelPart& rThisModelPart,
99  Parameters ThisParameters = Parameters(R"({})")
100  );
101 
103  ~MetricErrorProcess() override = default;
104 
108 
109  void operator()()
110  {
111  Execute();
112  }
113 
117 
121  void Execute() override;
122 
126  const Parameters GetDefaultParameters() const override;
127 
131 
132 
136 
137 
141 
143  std::string Info() const override
144  {
145  return "MetricErrorProcess";
146  }
147 
149  void PrintInfo(std::ostream& rOStream) const override
150  {
151  rOStream << "MetricErrorProcess";
152  }
153 
155  void PrintData(std::ostream& rOStream) const override
156  {
157  }
158 
159 protected:
162 
163 
167 
168 
172 
173 
177 
178 
182 
183 
187 
188 
192 
193 
195 
196 private:
199 
203 
204  ModelPart& mrThisModelPart;
205 
206  double mMinSize;
207  double mMaxSize;
208 
209  bool mSetElementNumber;
210  SizeType mElementNumber;
211  double mTargetError;
212  bool mAverageNodalH;
213 
214  SizeType mEchoLevel;
215 
219 
223 
227  void CalculateElementSize();
228 
232  void CalculateMetric();
233 
237 
241 
245 
249 
252 
254  //MetricErrorProcess(MetricErrorProcess const& rOther);
255 
257 };// class MetricErrorProcess
259 
260 
263 
264 
268 
270 template<unsigned int TDim, class TVarType>
271 inline std::istream& operator >> (std::istream& rIStream,
272  MetricErrorProcess<TDim>& rThis);
273 
275 template<unsigned int TDim, class TVarType>
276 inline std::ostream& operator << (std::ostream& rOStream,
277  const MetricErrorProcess<TDim>& rThis)
278 {
279  rThis.PrintInfo(rOStream);
280  rOStream << std::endl;
281  rThis.PrintData(rOStream);
282 
283  return rOStream;
284 }
285 
286 };// namespace Kratos.
287 #endif /* KRATOS_ERROR_METRICS_PROCESS defined */
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
Definition: amatrix_interface.h:41
This class is can be used to compute the metrics of the model part with a error already computed.
Definition: metrics_error_process.h:56
ElementsArrayType::iterator ElementItType
Definition: metrics_error_process.h:72
Node NodeType
The definition of the node type.
Definition: metrics_error_process.h:67
NodesArrayType::iterator NodeItType
Definition: metrics_error_process.h:71
~MetricErrorProcess() override=default
Destructor.
std::conditional< TDim==2, array_1d< double, 3 >, array_1d< double, 6 > >::type TensorArrayType
The type of array considered for the tensor.
Definition: metrics_error_process.h:81
GlobalPointersVector< Element >::iterator WeakElementItType
Definition of the iterators.
Definition: metrics_error_process.h:70
void PrintData(std::ostream &rOStream) const override
Print object"s data.
Definition: metrics_error_process.h:155
ModelPart::ElementsContainerType ElementsArrayType
Definition: metrics_error_process.h:63
void operator()()
Definition: metrics_error_process.h:109
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: metrics_error_process.h:149
ModelPart::NodesContainerType NodesArrayType
Containers definition.
Definition: metrics_error_process.h:62
std::string Info() const override
Turn back information as a string.
Definition: metrics_error_process.h:143
std::size_t IndexType
Definition of the indextype.
Definition: metrics_error_process.h:75
BoundedMatrix< double, TDim, TDim > MatrixType
Matrix type definition.
Definition: metrics_error_process.h:78
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: metrics_error_process.h:64
KRATOS_CLASS_POINTER_DEFINITION(MetricErrorProcess)
Pointer definition of MetricErrorProcess.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
The base class for all processes in Kratos.
Definition: process.h:49
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
type
Definition: generate_gid_list_file.py:35