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.
calculate_nodal_area_process.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 // Collaborators: Vicente Mataix Ferrandiz
12 //
13 
14 #if !defined(KRATOS_CALCULATE_NODAL_AREA_PROCESS_H_INCLUDED )
15 #define KRATOS_CALCULATE_NODAL_AREA_PROCESS_H_INCLUDED
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
22 #include "processes/process.h"
23 #include "includes/model_part.h"
24 
25 namespace Kratos
26 {
29 
33 
37 
41 
45 
50 {
51  // Defining clearer options
52  constexpr static bool SaveAsHistoricalVariable = true;
53  constexpr static bool SaveAsNonHistoricalVariable = false;
54 };
55 
64 template<bool THistorical = true>
65 class KRATOS_API(KRATOS_CORE) CalculateNodalAreaProcess
66  : public Process
67 {
68 public:
71 
73  typedef std::size_t IndexType;
74 
76  typedef std::size_t SizeType;
77 
79  typedef Node NodeType;
80 
83 
87 
94  ModelPart& rModelPart,
95  const SizeType DomainSize = 0
96  ): mrModelPart(rModelPart),
97  mDomainSize(DomainSize)
98  {
99  // In case is not provided we will take from the model part
100  if (mDomainSize == 0) {
101  KRATOS_ERROR_IF_NOT(rModelPart.GetProcessInfo().Has(DOMAIN_SIZE)) << "\"DOMAIN_SIZE\" has to be specified in the ProcessInfo" << std::endl;
102  mDomainSize = rModelPart.GetProcessInfo()[DOMAIN_SIZE];
103  }
104  }
105 
108  {
109  }
110 
114 
115  void operator()()
116  {
117  Execute();
118  }
119 
120 
124 
125  void Execute() override;
126 
130 
134 
135 
139 
141  std::string Info() const override
142  {
143  return "CalculateNodalAreaProcess";
144  }
145 
147  void PrintInfo(std::ostream& rOStream) const override
148  {
149  rOStream << "CalculateNodalAreaProcess";
150  }
151 
153  void PrintData(std::ostream& rOStream) const override
154  {
155  }
156 
157 
161 
162 
164 
165 protected:
168 
169 
173 
174 
178 
179 
183 
184 
188 
189 
193 
194 
198 
199 
201 
202 private:
205 
206 
210 
211  ModelPart& mrModelPart;
212  SizeType mDomainSize;
213 
217 
218 
222 
228  double& GetAreaValue(NodeType& rNode);
229 
233 
234 
238 
239 
243 
246 
248  //CalculateNodalAreaProcess(CalculateNodalAreaProcess const& rOther);
249 
250 
252 
253 }; // Class CalculateNodalAreaProcess
254 
256 
259 
260 
264 
265 
267 template<bool THistorical = true>
268 inline std::istream& operator >> (std::istream& rIStream,
270 
272 template<bool THistorical = true>
273 inline std::ostream& operator << (std::ostream& rOStream,
275 {
276  rThis.PrintInfo(rOStream);
277  rOStream << std::endl;
278  rThis.PrintData(rOStream);
279 
280  return rOStream;
281 }
283 
284 
285 } // namespace Kratos.
286 
287 #endif // KRATOS_CALCULATE_NODAL_AREA_PROCESS_H_INCLUDED defined
288 
289 
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Computes NODAL_AREA.
Definition: calculate_nodal_area_process.h:67
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: calculate_nodal_area_process.h:147
std::size_t SizeType
Size type definition.
Definition: calculate_nodal_area_process.h:76
CalculateNodalAreaProcess(ModelPart &rModelPart, const SizeType DomainSize=0)
Default constructor.
Definition: calculate_nodal_area_process.h:93
std::size_t IndexType
Index type definition.
Definition: calculate_nodal_area_process.h:73
KRATOS_CLASS_POINTER_DEFINITION(CalculateNodalAreaProcess)
Pointer definition of CalculateNodalAreaProcess.
std::string Info() const override
Turn back information as a string.
Definition: calculate_nodal_area_process.h:141
~CalculateNodalAreaProcess() override
Destructor.
Definition: calculate_nodal_area_process.h:107
Node NodeType
The definition of the node.
Definition: calculate_nodal_area_process.h:79
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: calculate_nodal_area_process.h:153
void operator()()
Definition: calculate_nodal_area_process.h:115
bool Has(const Variable< TDataType > &rThisVariable) const
Checks if the data container has a value associated with a given variable.
Definition: data_value_container.h:382
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
This class defines the node.
Definition: node.h:65
The base class for all processes in Kratos.
Definition: process.h:49
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
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
This struct is used in order to identify when using the hitorical and non historical variables.
Definition: calculate_nodal_area_process.h:50
constexpr static bool SaveAsHistoricalVariable
Definition: calculate_nodal_area_process.h:52
constexpr static bool SaveAsNonHistoricalVariable
Definition: calculate_nodal_area_process.h:53