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.
replace_multiple_elements_and_conditions_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: Armin Geiser
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/model_part.h"
21 #include "processes/process.h"
22 
23 namespace Kratos
24 {
25 
28 
35 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) ReplaceMultipleElementsAndConditionsProcess
36  : public Process
37 {
38 public:
41 
44 
48 
55  ModelPart& rModelPart,
56  Parameters Settings
57  ) : Process(Flags()) ,
58  mrModelPart(rModelPart),
59  mSettings( Settings)
60  {
62 
63  Parameters default_parameters( R"(
64  {
65  "element_name_table": {},
66  "condition_name_table": {},
67  "ignore_elements" : [],
68  "ignore_conditions" : [],
69  "ignore_undefined_types" : false
70  } )" );
71 
72  Settings.ValidateAndAssignDefaults(default_parameters);
73 
74  KRATOS_CATCH("")
75  }
76 
79 
82 
86 
89 
91  void operator()()
92  {
93  Execute();
94  }
95 
99 
101  void Execute() override;
102 
106 
108  std::string Info() const override
109  {
110  return "ReplaceMultipleElementsAndConditionsProcess";
111  }
112 
114  void PrintInfo(std::ostream& rOStream) const override
115  {
116  rOStream << "ReplaceMultipleElementsAndConditionsProcess";
117  }
118 
120  void PrintData(std::ostream& rOStream) const override
121  {
122  }
123 
125 private:
128 
129  ModelPart& mrModelPart;
130  Parameters mSettings;
131 
133 
136 
142  void UpdateSubModelPart(ModelPart& rModelPart,
143  ModelPart& rRootModelPart);
144 
146 
147 }; // Class ReplaceMultipleElementsAndConditionsProcess
148 
152 
154 inline std::istream& operator >> (std::istream& rIStream,
156 
158 inline std::ostream& operator << (std::ostream& rOStream,
160 {
161  rThis.PrintInfo(rOStream);
162  rOStream << std::endl;
163  rThis.PrintData(rOStream);
164 
165  return rOStream;
166 }
168 
169 } // namespace Kratos.
Definition: flags.h:58
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
The base class for all processes in Kratos.
Definition: process.h:49
This methods replaces elements and conditions in a model part by a given table.
Definition: replace_multiple_elements_and_conditions_process.h:37
ReplaceMultipleElementsAndConditionsProcess & operator=(ReplaceMultipleElementsAndConditionsProcess const &rOther)=delete
Assignment operator.
std::string Info() const override
Turn back information as a string.
Definition: replace_multiple_elements_and_conditions_process.h:108
void operator()()
This operator is provided to call the process as a function and simply calls the Execute method.
Definition: replace_multiple_elements_and_conditions_process.h:91
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: replace_multiple_elements_and_conditions_process.h:120
~ReplaceMultipleElementsAndConditionsProcess() override=default
Destructor.
KRATOS_CLASS_POINTER_DEFINITION(ReplaceMultipleElementsAndConditionsProcess)
Pointer definition of ReplaceMultipleElementsAndConditionsProcess.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: replace_multiple_elements_and_conditions_process.h:114
ReplaceMultipleElementsAndConditionsProcess(ModelPart &rModelPart, Parameters Settings)
Default constructor.
Definition: replace_multiple_elements_and_conditions_process.h:54
ReplaceMultipleElementsAndConditionsProcess(ReplaceMultipleElementsAndConditionsProcess const &rOther)=delete
Copy constructor.
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#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
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432