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.
save_structure_model_part_process.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last Modified by: $Author: anonymous $
4 // Date: $Date: 2008-10-02 10:47:21 $
5 // Revision: $Revision: 1.8 $
6 //
7 // this process save structural elements in a separate list
8 
9 #if !defined(KRATOS_SAVE_STRUCTURE_MODEL_PART_PROCESS_INCLUDED )
10 #define KRATOS_SAVE_STRUCTURE_MODEL_PART_PROCESS_INCLUDED
11 
12 
13 
14 // System includes
15 #include <string>
16 #include <iostream>
17 #include <algorithm>
18 
19 // External includes
20 
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "processes/process.h"
25 #include "includes/node.h"
26 #include "includes/element.h"
27 #include "includes/model_part.h"
32 
33 
34 namespace Kratos
35 {
36 
39 
43 
44 
48 
52 
56 
58 
65  : public Process
66 {
67 public:
70 
73 
77 
80  {
81  }
82 
85  {
86  }
87 
88 
92 
93 // void operator()()
94 // {
95 // SaveStructure();
96 // }
97 
98 
102 
104  {
105  KRATOS_TRY
106 
107  //number of structure nodes
108  KRATOS_WATCH("SAVING STRUCTURE")
109  for(ModelPart::ElementsContainerType::iterator im = fluid_model_part.ElementsBegin() ;
110  im != fluid_model_part.ElementsEnd() ; ++im)
111  {
112  //PointerVector<Element> struct_elements_list;
113  //check number of structure nodes
114  unsigned int n_struct=0;
115  //unsigned int n_fluid = 0;
116  for (unsigned int i=0; i<im->GetGeometry().size(); i++)
117  {
118  n_struct += int( im->GetGeometry()[i].FastGetSolutionStepValue(IS_STRUCTURE) );
119  //n_fluid += int( im->GetGeometry()[i].FastGetSolutionStepValue(IS_FLUID) );
120 
121  }
122 
123  if(n_struct==im->GetGeometry().size())// && n_fluid != im->GetGeometry().size())
124  {
125  structure_model_part.Elements().push_back(*(im.base()));
126  }
127 
128  }
129  //WE HAVE TO COPY THE ProcessInfo pointer to the new part, otherwise it is empty
130  structure_model_part.SetProcessInfo(fluid_model_part.pGetProcessInfo());
131 
132  KRATOS_CATCH("")
133  }
134 
135 
139 
140 
144 
145 
149 
151  std::string Info() const override
152  {
153  return "SaveStructureModelPartProcess";
154  }
155 
157  void PrintInfo(std::ostream& rOStream) const override
158  {
159  rOStream << "SaveStructureModelPartProcess";
160  }
161 
163  void PrintData(std::ostream& rOStream) const override
164  {
165  }
166 
167 
171 
172 
174 
175 protected:
178 
179 
183 
184 
188 
189 
193 
194 
198 
199 
203 
204 
208 
209 
211 
212 private:
215 
216 
220  //ModelPart& mr_fluid_model_part;
221  //ModelPart& mr_structure_model_part;
222 
226 
227 
231 
232 
236 
237 
241 
242 
246 
248 // SaveStructureModelPartProcess& operator=(SaveStructureModelPartProcess const& rOther);
249 
251 // SaveStructureModelPartProcess(SaveStructureModelPartProcess const& rOther);
252 
253 
255 
256 }; // Class SaveStructureModelPartProcess
257 
259 
262 
263 
267 
268 
270 inline std::istream& operator >> (std::istream& rIStream,
272 
274 inline std::ostream& operator << (std::ostream& rOStream,
275  const SaveStructureModelPartProcess& rThis)
276 {
277  rThis.PrintInfo(rOStream);
278  rOStream << std::endl;
279  rThis.PrintData(rOStream);
280 
281  return rOStream;
282 }
284 
285 
286 } // namespace Kratos.
287 
288 #endif // KRATOS_SAVE_STRUCTURE_MODEL_PART_PROCESS_INCLUDED defined
289 
290 
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
The base class for all processes in Kratos.
Definition: process.h:49
Short class definition.
Definition: save_structure_model_part_process.h:66
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: save_structure_model_part_process.h:163
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: save_structure_model_part_process.h:157
KRATOS_CLASS_POINTER_DEFINITION(SaveStructureModelPartProcess)
Pointer definition of PushStructureProcess.
std::string Info() const override
Turn back information as a string.
Definition: save_structure_model_part_process.h:151
SaveStructureModelPartProcess()
Default constructor.
Definition: save_structure_model_part_process.h:79
~SaveStructureModelPartProcess() override
Destructor.
Definition: save_structure_model_part_process.h:84
void SaveStructure(ModelPart &fluid_model_part, ModelPart &structure_model_part)
Definition: save_structure_model_part_process.h:103
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
im
Definition: GenerateCN.py:100
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
fluid_model_part
Definition: edgebased_PureConvection.py:18
structure_model_part
Definition: script.py:23
integer i
Definition: TensorModule.f:17