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.
paired_condition.h
Go to the documentation of this file.
1 // KRATOS ______ __ __ _____ __ __ __
2 // / ____/___ ____ / /_____ ______/ /_/ ___// /________ _______/ /___ ___________ _/ /
3 // / / / __ \/ __ \/ __/ __ `/ ___/ __/\__ \/ __/ ___/ / / / ___/ __/ / / / ___/ __ `/ /
4 // / /___/ /_/ / / / / /_/ /_/ / /__/ /_ ___/ / /_/ / / /_/ / /__/ /_/ /_/ / / / /_/ / /
5 // \____/\____/_/ /_/\__/\__,_/\___/\__//____/\__/_/ \__,_/\___/\__/\__,_/_/ \__,_/_/ MECHANICS
6 //
7 // License: BSD License
8 // license: ContactStructuralMechanicsApplication/license.txt
9 //
10 // Main authors: Vicente Mataix Ferrandiz
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/condition.h"
22 
23 namespace Kratos
24 {
27 
31 
35 
39 
43 
51 class KRATOS_API(CONTACT_STRUCTURAL_MECHANICS_APPLICATION) PairedCondition
52  : public Condition
53 {
54 public:
57 
60 
63 
65  using PointType = Point;
66 
69 
72 
75 
78 
81 
83  using GeometryPointerType = BaseType::GeometryType::Pointer;
84 
87 
89  using PropertiesPointerType = BaseType::PropertiesType::Pointer;
90 
94 
97  : Condition()
98  {}
99 
100  // Constructor 1
102  IndexType NewId,
103  GeometryType::Pointer pGeometry
104  ) :Condition(NewId, Kratos::make_shared<CouplingGeometryType>(pGeometry, nullptr))
105  {
106  KRATOS_WARNING_FIRST_N("PairedCondition", 10) << "This class pairs two geometries, please use the other constructor (the one with two geometries as input)" << std::endl;
107  }
108 
109  // Constructor 2
111  IndexType NewId,
112  GeometryType::Pointer pGeometry,
113  PropertiesType::Pointer pProperties
114  ) :Condition( NewId, Kratos::make_shared<CouplingGeometryType>(pGeometry, nullptr), pProperties )
115  {
116  KRATOS_WARNING_FIRST_N("PairedCondition", 10) << "This class pairs two geometries, please use the other constructor (the one with two geometries as input)" << std::endl;
117  }
118 
119  // Constructor 3
121  IndexType NewId,
122  GeometryType::Pointer pGeometry,
123  PropertiesType::Pointer pProperties,
124  GeometryType::Pointer pPairedGeometry
125  )
126  :Condition( NewId, Kratos::make_shared<CouplingGeometryType>(pGeometry, pPairedGeometry), pProperties )
127  {}
128 
131 
133  ~PairedCondition() override;
134 
138 
139 
143 
148  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
149 
154  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
155 
160  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
161 
169  Condition::Pointer Create(
170  IndexType NewId,
171  NodesArrayType const& rThisNodes,
172  PropertiesType::Pointer pProperties
173  ) const override;
174 
182  Condition::Pointer Create(
183  IndexType NewId,
184  GeometryType::Pointer pGeometry,
185  PropertiesType::Pointer pProperties
186  ) const override;
187 
196  virtual Condition::Pointer Create(
197  IndexType NewId,
198  GeometryType::Pointer pGeometry,
199  PropertiesType::Pointer pProperties,
200  GeometryType::Pointer pPairedGeom
201  ) const;
202 
206 
211  GeometryType::Pointer pGetParentGeometry()
212  {
213  return this->GetGeometry().pGetGeometryPart(CouplingGeometryType::Master);
214  }
215 
220  GeometryType::Pointer const pGetParentGeometry() const
221  {
222  return this->GetGeometry().pGetGeometryPart(CouplingGeometryType::Master);
223  }
224 
229  GeometryType::Pointer pGetPairedGeometry()
230  {
231  return this->GetGeometry().pGetGeometryPart(CouplingGeometryType::Slave);
232  }
233 
238  GeometryType::Pointer const pGetPairedGeometry() const
239  {
240  return this->GetGeometry().pGetGeometryPart(CouplingGeometryType::Slave);
241  }
242 
248  {
249  return this->GetGeometry().GetGeometryPart(CouplingGeometryType::Master);
250  }
251 
257  {
258  return this->GetGeometry().GetGeometryPart(CouplingGeometryType::Master);
259  }
260 
266  {
267  return this->GetGeometry().GetGeometryPart(CouplingGeometryType::Slave);
268  }
269 
275  {
276  return this->GetGeometry().GetGeometryPart(CouplingGeometryType::Slave);
277  }
278 
283  void SetPairedNormal(const array_1d<double, 3>& rPairedNormal)
284  {
285  noalias(mPairedNormal) = rPairedNormal;
286  }
287 
293  {
294  return mPairedNormal;
295  }
296 
300 
304 
306  std::string Info() const override
307  {
308  std::stringstream buffer;
309  buffer << "PairedCondition #" << this->Id();
310  return buffer.str();
311  }
312 
314  void PrintInfo(std::ostream& rOStream) const override
315  {
316  rOStream << "PairedCondition #" << this->Id();
317  }
318 
320  void PrintData(std::ostream& rOStream) const override
321  {
322  PrintInfo(rOStream);
323  this->GetParentGeometry().PrintData(rOStream);
324  this->GetPairedGeometry().PrintData(rOStream);
325  }
326 
330 
332 private:
335 
339 
340  array_1d<double, 3> mPairedNormal = ZeroVector(3);
341 
345 
349 
353 
357 
361 
362  // Serialization
363 
364  friend class Serializer;
365 
370  void save(Serializer& rSerializer) const override;
371 
376  void load(Serializer& rSerializer) override;
377 
379 
380 }; // Class PairedCondition
381 
383 
386 
390 
392 
393 }// namespace Kratos.
Base class for all Conditions.
Definition: condition.h:59
The CouplingGeometry connects two or more geometries of different types and entities.
Definition: coupling_geometry.h:41
std::size_t IndexType
Definition: flags.h:74
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
Geometry base class.
Definition: geometry.h:71
virtual GeometryType & GetGeometryPart(const IndexType Index)
Used for composite geometries. It returns the the geometry part, corresponding to the Index.
Definition: geometry.h:1060
This is a base class for the conditions paired.
Definition: paired_condition.h:53
PairedCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties, GeometryType::Pointer pPairedGeometry)
Definition: paired_condition.h:120
PairedCondition(PairedCondition const &rOther)
Copy constructor.
Definition: paired_condition.h:130
BaseType::GeometryType::Pointer GeometryPointerType
Geometry pointer type definition.
Definition: paired_condition.h:83
~PairedCondition() override
Destructor.
array_1d< double, 3 > const & GetPairedNormal() const
This method returns the paired normal.
Definition: paired_condition.h:292
GeometryType const & GetPairedGeometry() const
This method returns the paired geometry (constant version)
Definition: paired_condition.h:274
void SetPairedNormal(const array_1d< double, 3 > &rPairedNormal)
This method sets the paired normal.
Definition: paired_condition.h:283
GeometryType::Pointer pGetPairedGeometry()
This method returns the paired geometry.
Definition: paired_condition.h:229
std::string Info() const override
Turn back information as a string.
Definition: paired_condition.h:306
GeometryType const & GetParentGeometry() const
This method returns the parent geometry (constant version)
Definition: paired_condition.h:256
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(PairedCondition)
Counted pointer of PairedCondition.
GeometryType::Pointer pGetParentGeometry()
This method returns the parent geometry.
Definition: paired_condition.h:211
PairedCondition()
Default constructor.
Definition: paired_condition.h:96
GeometryType & GetPairedGeometry()
This method returns the paired geometry.
Definition: paired_condition.h:265
GeometryType & GetParentGeometry()
This method returns the parent geometry.
Definition: paired_condition.h:247
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: paired_condition.h:314
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: paired_condition.h:320
PairedCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: paired_condition.h:101
GeometryType::Pointer const pGetPairedGeometry() const
This method returns the paired geometry (constant version)
Definition: paired_condition.h:238
BaseType::PropertiesType::Pointer PropertiesPointerType
Properties pointer type definition.
Definition: paired_condition.h:89
PairedCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: paired_condition.h:110
GeometryType::Pointer const pGetParentGeometry() const
This method returns the parent geometry (constant version)
Definition: paired_condition.h:220
Point class.
Definition: point.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_WARNING_FIRST_N(label, logger_count)
Definition: logger.h:272
std::size_t IndexType
Definition: binary_expression.cpp:25
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
shared_ptr< C > make_shared(Args &&...args)
Definition: smart_pointers.h:40
def load(f)
Definition: ode_solve.py:307