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.
spr_error_process.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Anna Rehr
10 // Co-author : Vicente Mataix Ferrandiz
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "processes/process.h"
22 #include "includes/model_part.h"
23 
24 namespace Kratos
25 {
28 
32 
34  typedef std::size_t SizeType;
35 
39 
43 
47 
60 template<SizeType TDim>
61 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) SPRErrorProcess
62  : public Process
63 {
64 public:
65 
68 
73 
75  typedef Node NodeType;
76 
79  typedef NodesArrayType::iterator NodeItType;
80  typedef ElementsArrayType::iterator ElementItType;
81 
83  typedef std::size_t IndexType;
84 
87 
89  static constexpr SizeType SigmaSize = (TDim == 2) ? 3 : 6;
90 
94 
102  ModelPart& rThisModelPart,
103  Parameters ThisParameters = Parameters(R"({})")
104  );
105 
107  virtual ~SPRErrorProcess() {}
108 
112 
113  void operator()()
114  {
115  Execute();
116  }
117 
121 
125  void Execute() override;
126 
130  const Parameters GetDefaultParameters() const override;
131 
135 
136 
140 
141 
145 
147  virtual std::string Info() const override
148  {
149  return "SPRErrorProcess";
150  }
151 
153  virtual void PrintInfo(std::ostream& rOStream) const override
154  {
155  rOStream << "SPRErrorProcess";
156  }
157 
159  virtual void PrintData(std::ostream& rOStream) const override
160  {
161  }
162 
163 protected:
166 
167 
171 
173  Variable<Vector>* mpStressVariable = &CAUCHY_STRESS_VECTOR;
175 
179 
180 
184 
188  void CalculateSuperconvergentStresses();
189 
195  void CalculateErrorEstimation(
196  double& rEnergyNormOverall,
197  double& rErrorOverall
198  );
199 
207  virtual void CalculatePatch(
208  NodeItType itNode,
209  NodeItType itPatchNode,
210  const SizeType NeighbourSize,
211  Vector& rSigmaRecovered
212  );
213 
217 
218 
222 
223 
227 
228 
230 
231 private:
234 
238 
242 
246 
251  static inline void FindNodalNeighbours(ModelPart& rModelPart);
252 
256 
260 
264 
268 
271  {
272  return *this;
273  };
274 
276  //SPRErrorProcess(SPRErrorProcess const& rOther);
277 
278 };// class SPRErrorProcess
279 
280 };// namespace Kratos.
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
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
This class is can be used to compute the metrics of the model part with a superconvergent patch recov...
Definition: spr_error_process.h:63
GlobalPointersVector< Element >::iterator WeakElementItType
Definition of the iterators.
Definition: spr_error_process.h:78
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: spr_error_process.h:72
virtual std::string Info() const override
Turn back information as a string.
Definition: spr_error_process.h:147
virtual ~SPRErrorProcess()
Destructor.
Definition: spr_error_process.h:107
void operator()()
Definition: spr_error_process.h:113
Node NodeType
The definition of the node type.
Definition: spr_error_process.h:75
ModelPart::ElementsContainerType ElementsArrayType
Definition: spr_error_process.h:71
NodesArrayType::iterator NodeItType
Definition: spr_error_process.h:79
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: spr_error_process.h:153
ModelPart::NodesContainerType NodesArrayType
Containers definition.
Definition: spr_error_process.h:70
virtual void PrintData(std::ostream &rOStream) const override
Print object"s data.
Definition: spr_error_process.h:159
SizeType mEchoLevel
The stress variable considered.
Definition: spr_error_process.h:174
std::size_t IndexType
Definition of the indextype.
Definition: spr_error_process.h:83
ModelPart & mThisModelPart
Definition: spr_error_process.h:172
KRATOS_CLASS_POINTER_DEFINITION(SPRErrorProcess)
Pointer definition of SPRErrorProcess.
ElementsArrayType::iterator ElementItType
Definition: spr_error_process.h:80
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
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