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_conditions_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 15:38:16 $
5 // Revision: $Revision: 1.1 $
6 //
7 // this process save structural elements in a separate list
8 
9 #if !defined(KRATOS_SAVE_STRUCTURE_CONDITIONS_PROCESS_INCLUDED )
10 #define KRATOS_SAVE_STRUCTURE_CONDITIONS_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/condition.h"
27 #include "includes/model_part.h"
28 //#include "custom_elements/updated_lagrangian_fluid.h"
29 //#include "custom_elements/updated_lagrangian_fluid3D.h"
30 //#include "custom_elements/updated_lagrangian_fluid_inc.h"
31 //#include "custom_elements/updated_lagrangian_fluid3D_inc.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 CONDITION")
109  for(ModelPart::ConditionsContainerType::iterator ic = fluid_model_part.ConditionsBegin() ;
110  ic != fluid_model_part.ConditionsEnd() ; ++ic)
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<ic->GetGeometry().size(); i++)
117  {
118  n_struct += int( ic->GetGeometry()[i].FastGetSolutionStepValue(IS_STRUCTURE) );
119  //n_fluid += int( ic->GetGeometry()[i].FastGetSolutionStepValue(IS_FLUID) );
120 
121  }
122 
123  if(n_struct==ic->GetGeometry().size())// && n_fluid != im->GetGeometry().size())
124  {
125  structure_model_part.Conditions().push_back(*(ic.base()));
126  /*
127  for (unsigned int i=0;i<ic->GetGeometry().size();i++)
128  {
129  ic->GetGeometry()[i].FastGetSolutionStepValue(IS_FLUID)=0.0;
130  }
131  */
132  }
133 
134 
135  }
136  KRATOS_CATCH("")
137  }
138 
139 
143 
144 
148 
149 
153 
155  std::string Info() const override
156  {
157  return "SaveStructureConditionsProcess";
158  }
159 
161  void PrintInfo(std::ostream& rOStream) const override
162  {
163  rOStream << "SaveStructureConditionsProcess";
164  }
165 
167  void PrintData(std::ostream& rOStream) const override
168  {
169  }
170 
171 
175 
176 
178 
179 protected:
182 
183 
187 
188 
192 
193 
197 
198 
202 
203 
207 
208 
212 
213 
215 
216 private:
219 
220 
224  //ModelPart& mr_fluid_model_part;
225  //ModelPart& mr_structure_model_part;
226 
230 
231 
235 
236 
240 
241 
245 
246 
250 
252 // SaveStructureConditionsProcess& operator=(SaveStructureConditionsProcess const& rOther);
253 
255 // SaveStructureConditionsProcess(SaveStructureConditionsProcess const& rOther);
256 
257 
259 
260 }; // Class SaveStructureConditionsProcess
261 
263 
266 
267 
271 
272 
274 inline std::istream& operator >> (std::istream& rIStream,
276 
278 inline std::ostream& operator << (std::ostream& rOStream,
279  const SaveStructureConditionsProcess& rThis)
280 {
281  rThis.PrintInfo(rOStream);
282  rOStream << std::endl;
283  rThis.PrintData(rOStream);
284 
285  return rOStream;
286 }
288 
289 
290 } // namespace Kratos.
291 
292 #endif // KRATOS_SAVE_STRUCTURE_CONDITIONS_PROCESS_INCLUDED defined
293 
294 
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_conditions_process.h:66
SaveStructureConditionsProcess()
Default constructor.
Definition: save_structure_conditions_process.h:79
std::string Info() const override
Turn back information as a string.
Definition: save_structure_conditions_process.h:155
KRATOS_CLASS_POINTER_DEFINITION(SaveStructureConditionsProcess)
Pointer definition of PushStructureProcess.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: save_structure_conditions_process.h:167
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: save_structure_conditions_process.h:161
void SaveStructureConditions(ModelPart &fluid_model_part, ModelPart &structure_model_part)
Definition: save_structure_conditions_process.h:103
~SaveStructureConditionsProcess() override
Destructor.
Definition: save_structure_conditions_process.h:84
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
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