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.
mapping_geometries_modeler.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: Philipp Bucher
11 // Peter Wilson
12 // Tobias Teschemacher
13 //
14 
15 #pragma once
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
22 #include "modeler/modeler.h"
24 
25 namespace Kratos
26 {
27 
30 
32 
34 class KRATOS_API(MAPPING_APPLICATION) MappingGeometriesModeler
35  : public Modeler
36 {
37 public:
40 
43 
44  typedef std::size_t SizeType;
45  typedef std::size_t IndexType;
46  typedef Node NodeType;
48  typedef typename GeometryType::Pointer GeometryPointerType;
49 
53 
56  : Modeler()
57  {
58  }
59 
62  Model& rModel,
63  Parameters ModelerParameters = Parameters())
64  : Modeler(rModel, ModelerParameters)
65  {
66  mpModels.resize(1);
67  mpModels[0] = &rModel;
68  }
69 
71  virtual ~MappingGeometriesModeler() = default;
72 
74  Modeler::Pointer Create(
75  Model& rModel, const Parameters ModelParameters) const override
76  {
77  return Kratos::make_shared<MappingGeometriesModeler>(rModel, ModelParameters);
78  }
79 
81  void GenerateNodes(ModelPart& ThisModelPart) override
82  {
83  mpModels.push_back(&ThisModelPart.GetModel());
84  }
85 
89 
90  void SetupGeometryModel() override;
91 
95 
97  std::string Info() const override
98  {
99  return "MappingGeometriesModeler";
100  }
101 
103  void PrintInfo(std::ostream & rOStream) const override
104  {
105  rOStream << Info();
106  }
107 
109  void PrintData(std::ostream & rOStream) const override
110  {
111  }
112 
114 
115 private:
116  std::vector<Model*> mpModels;
117 
118  void CopySubModelPart(ModelPart& rDestinationMP, ModelPart& rReferenceMP)
119  {
120  rDestinationMP.SetNodes(rReferenceMP.pNodes());
122  ModelPart& coupling_conditions = rReferenceMP.GetSubModelPart("coupling_conditions");
123  rDestinationMP.SetConditions(coupling_conditions.pConditions());
124  }
125 
126  void CreateInterfaceLineCouplingConditions(ModelPart& rInterfaceModelPart);
127 
128  void CheckParameters();
129 
130 }; // Class MappingGeometriesModeler
131 
135 
137 inline std::istream& operator >> (
138  std::istream& rIStream,
139  MappingGeometriesModeler& rThis);
140 
142 inline std::ostream& operator << (
143  std::ostream& rOStream,
144  const MappingGeometriesModeler& rThis)
145 {
146  rThis.PrintInfo(rOStream);
147  rOStream << std::endl;
148  rThis.PrintData(rOStream);
149 
150  return rOStream;
151 }
152 
154 
155 } // namespace Kratos.
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Geometry base class.
Definition: geometry.h:71
Short class definition.
Definition: mapping_geometries_modeler.h:36
GeometryType::Pointer GeometryPointerType
Definition: mapping_geometries_modeler.h:48
KRATOS_CLASS_POINTER_DEFINITION(MappingGeometriesModeler)
Pointer definition of Modeler.
std::size_t SizeType
Definition: mapping_geometries_modeler.h:44
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mapping_geometries_modeler.h:109
MappingGeometriesModeler(Model &rModel, Parameters ModelerParameters=Parameters())
Constructor.
Definition: mapping_geometries_modeler.h:61
Geometry< NodeType > GeometryType
Definition: mapping_geometries_modeler.h:47
virtual ~MappingGeometriesModeler()=default
Destructor.
Modeler::Pointer Create(Model &rModel, const Parameters ModelParameters) const override
Creates the Modeler Pointer.
Definition: mapping_geometries_modeler.h:74
MappingGeometriesModeler()
Default constructor.
Definition: mapping_geometries_modeler.h:55
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mapping_geometries_modeler.h:103
std::string Info() const override
Turn back information as a string.
Definition: mapping_geometries_modeler.h:97
std::size_t IndexType
Definition: mapping_geometries_modeler.h:45
Node NodeType
Definition: mapping_geometries_modeler.h:46
void GenerateNodes(ModelPart &ThisModelPart) override
Adds the second model part to the modeler.
Definition: mapping_geometries_modeler.h:81
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
void SetNodes(NodesContainerType::Pointer pOtherNodes, IndexType ThisIndex=0)
Definition: model_part.h:522
NodesContainerType::Pointer pNodes(IndexType ThisIndex=0)
Definition: model_part.h:517
void SetNodalSolutionStepVariablesList()
Definition: model_part.cpp:526
VariablesList::Pointer pGetNodalSolutionStepVariablesList() const
Definition: model_part.h:559
ModelPart & GetSubModelPart(std::string const &SubModelPartName)
Definition: model_part.cpp:2029
ConditionsContainerType::Pointer pConditions(IndexType ThisIndex=0)
Definition: model_part.h:1391
void SetConditions(ConditionsContainerType::Pointer pOtherConditions, IndexType ThisIndex=0)
Definition: model_part.h:1396
Model & GetModel()
Definition: model_part.h:323
Modeler to interact with ModelParts.
Definition: modeler.h:39
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
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