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.
interface_vector_container.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, Jordi Cotela
11 //
12 // See Master-Thesis P.Bucher
13 // "Development and Implementation of a Parallel
14 // Framework for Non-Matching Grid Mapping"
15 
16 #pragma once
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "includes/model_part.h"
25 #include "mapper_utilities.h"
26 
27 namespace Kratos
28 {
31 
34 
36 
38 template<class TSparseSpace, class TDenseSpace>
39 class KRATOS_API(MAPPING_APPLICATION) InterfaceVectorContainer
40 {
41 public:
44 
47 
49 
51 
55 
57  explicit InterfaceVectorContainer(ModelPart& rModelPart) : mrModelPart(rModelPart) {}
58 
60  virtual ~InterfaceVectorContainer() = default;
61 
62 
66 
68  const Kratos::Flags& rMappingOptions);
69 
71  const Kratos::Flags& rMappingOptions);
72 
76 
78  {
79  KRATOS_DEBUG_ERROR_IF_NOT(mpInterfaceVector)
80  << "The Interface-Vector was not initialized" << std::endl;
81  return *mpInterfaceVector;
82  }
83 
85  {
86  KRATOS_DEBUG_ERROR_IF_NOT(mpInterfaceVector)
87  << "The Interface-Vector was not initialized" << std::endl;
88  return *mpInterfaceVector;
89  }
90 
91  TSystemVectorUniquePointerType& pGetVector() { return mpInterfaceVector; }
92  const TSystemVectorUniquePointerType& pGetVector() const { return mpInterfaceVector; }
93 
94  ModelPart& GetModelPart() { return mrModelPart; }
95  const ModelPart& GetModelPart() const { return mrModelPart; }
96 
98 
99 private:
102 
103  ModelPart& mrModelPart;
104  TSystemVectorUniquePointerType mpInterfaceVector = nullptr;
105 
109 
112 
115 
117 
118 }; // Class InterfaceVectorContainer
119 
121 
123 
124 } // namespace Kratos.
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: flags.h:58
Short class definition.
Definition: interface_vector_container.h:40
const TSystemVectorType & GetVector() const
Definition: interface_vector_container.h:84
Kratos::unique_ptr< TSystemVectorType > TSystemVectorUniquePointerType
Definition: interface_vector_container.h:50
ModelPart & GetModelPart()
Definition: interface_vector_container.h:94
TSystemVectorType & GetVector()
Definition: interface_vector_container.h:77
const TSystemVectorUniquePointerType & pGetVector() const
Definition: interface_vector_container.h:92
TSparseSpace::VectorType TSystemVectorType
Definition: interface_vector_container.h:48
InterfaceVectorContainer(ModelPart &rModelPart)
Default constructor.
Definition: interface_vector_container.h:57
const ModelPart & GetModelPart() const
Definition: interface_vector_container.h:95
KRATOS_CLASS_POINTER_DEFINITION(InterfaceVectorContainer)
Pointer definition of InterfaceVectorContainer.
TSystemVectorUniquePointerType & pGetVector()
Definition: interface_vector_container.h:91
virtual ~InterfaceVectorContainer()=default
Destructor.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
#define KRATOS_DEBUG_ERROR_IF_NOT(conditional)
Definition: exception.h:172
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
void UpdateModelPartFromSystemVector(const TVectorType &rVector, ModelPart &rModelPart, const Variable< double > &rVariable, const Kratos::Flags &rMappingOptions, const bool InParallel=true)
Definition: mapper_utilities.h:148
void UpdateSystemVectorFromModelPart(TVectorType &rVector, const ModelPart &rModelPart, const Variable< double > &rVariable, const Kratos::Flags &rMappingOptions, const bool InParallel=true)
Definition: mapper_utilities.h:118
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33