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.
embedded_data.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: Jordi Cotela
11 //
12 
13 #if !defined(KRATOS_EMBEDDED_DATA_H)
14 #define KRATOS_EMBEDDED_DATA_H
15 
18 
19 namespace Kratos {
20 
23 
26 
27 template< class TFluidData >
28 class EmbeddedData : public TFluidData
29 {
30 public:
31 
34 
35 using NodalScalarData = typename TFluidData::NodalScalarData;
36 using NodalVectorData = typename TFluidData::NodalVectorData;
37 
39 typedef std::vector<array_1d<double,3>> InterfaceNormalsType;
40 
44 
45 bool IsSlip;
46 
47 double SlipLength;
49 
51 
55 
60 
61 std::vector< size_t > PositiveIndices;
62 std::vector< size_t > NegativeIndices;
63 
66 
70 
72  const Element& rElement,
73  const ProcessInfo& rProcessInfo) override
74 {
75  TFluidData::Initialize(rElement, rProcessInfo);
76  const Geometry<Node >& r_geometry = rElement.GetGeometry();
77  this->FillFromHistoricalNodalData(Distance, DISTANCE, r_geometry);
78 
79  NumPositiveNodes = 0;
80  NumNegativeNodes = 0;
81 
82  IsSlip = rElement.Is(SLIP) ? true : false;
83 }
84 
92 {
93  if (IsSlip){
94  this->FillFromProcessInfo(SlipLength, SLIP_LENGTH, rProcessInfo);
95  }
96  this->FillFromProcessInfo(PenaltyCoefficient, PENALTY_COEFFICIENT, rProcessInfo);
97 }
98 
99 static int Check(const Element& rElement, const ProcessInfo& rProcessInfo)
100 {
101  const Geometry< Node >& r_geometry = rElement.GetGeometry();
102  for (unsigned int i = 0; i < TFluidData::NumNodes; i++) {
103  KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(DISTANCE,r_geometry[i]);
104  }
105 
106  int out = TFluidData::Check(rElement,rProcessInfo);
107  return out;
108 }
109 
110 bool IsCut() {
111  return (NumPositiveNodes > 0) && (NumNegativeNodes > 0);
112 }
113 
115 
116 };
117 
119 
121 
122 }
123 
124 #endif
Base class for all Elements.
Definition: element.h:60
Definition: embedded_data.h:29
void InitializeBoundaryConditionData(const ProcessInfo &rProcessInfo)
Fills the boundary condition data fields This method needs to be called in cut elements....
Definition: embedded_data.h:91
Vector PositiveInterfaceWeights
Definition: embedded_data.h:58
std::vector< size_t > NegativeIndices
Definition: embedded_data.h:62
Vector PositiveSideWeights
Definition: embedded_data.h:54
typename TFluidData::NodalScalarData NodalScalarData
Definition: embedded_data.h:35
NodalScalarData Distance
Definition: embedded_data.h:50
Matrix PositiveSideN
Definition: embedded_data.h:52
void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo) override
Definition: embedded_data.h:71
static int Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: embedded_data.h:99
size_t NumNegativeNodes
Definition: embedded_data.h:65
double PenaltyCoefficient
Definition: embedded_data.h:48
GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: embedded_data.h:38
ShapeFunctionsGradientsType PositiveInterfaceDNDX
Definition: embedded_data.h:57
std::vector< array_1d< double, 3 > > InterfaceNormalsType
Definition: embedded_data.h:39
size_t NumPositiveNodes
Definition: embedded_data.h:64
ShapeFunctionsGradientsType PositiveSideDNDX
Definition: embedded_data.h:53
bool IsSlip
Definition: embedded_data.h:45
InterfaceNormalsType PositiveInterfaceUnitNormals
Definition: embedded_data.h:59
typename TFluidData::NodalVectorData NodalVectorData
Definition: embedded_data.h:36
std::vector< size_t > PositiveIndices
Definition: embedded_data.h:61
double SlipLength
Definition: embedded_data.h:47
bool IsCut()
Definition: embedded_data.h:110
Matrix PositiveInterfaceN
Definition: embedded_data.h:56
bool Is(Flags const &rOther) const
Definition: flags.h:274
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
#define KRATOS_CHECK_VARIABLE_IN_NODAL_DATA(TheVariable, TheNode)
Definition: checks.h:171
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
out
Definition: isotropic_damage_automatic_differentiation.py:200
integer i
Definition: TensorModule.f:17