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_discontinuous_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: Ruben Zorrilla
11 //
12 
13 #if !defined(KRATOS_EMBEDDED_DISCONTINUOUS_DATA_H)
14 #define KRATOS_EMBEDDED_DISCONTINUOUS_DATA_H
15 
18 
19 namespace Kratos {
20 
23 
26 
27 template< class TFluidData >
28 class EmbeddedDiscontinuousData : 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 
42 constexpr static std::size_t NumEdges = (TFluidData::NumNodes == 3) ? 3 : 6;
43 
47 
48 double SlipLength;
50 
53 
60 
69 
70 std::vector< size_t > PositiveIndices;
71 std::vector< size_t > NegativeIndices;
72 
73 std::size_t NumPositiveNodes;
74 std::size_t NumNegativeNodes;
76 
80 
91  const Element& rElement,
92  const ProcessInfo& rProcessInfo) override
93 {
94  TFluidData::Initialize(rElement, rProcessInfo);
95  this->FillFromElementData(ElementalDistances, ELEMENTAL_DISTANCES, rElement);
96  this->FillFromElementData(ElementalEdgeDistancesExtrapolated, ELEMENTAL_EDGE_DISTANCES_EXTRAPOLATED, rElement);
97 
98  NumPositiveNodes = 0;
99  NumNegativeNodes = 0;
101 }
102 
110 {
111  this->FillFromProcessInfo(SlipLength, SLIP_LENGTH, rProcessInfo);
112  this->FillFromProcessInfo(PenaltyCoefficient, PENALTY_COEFFICIENT, rProcessInfo);
113 }
114 
123 static int Check(
124  const Element& rElement,
125  const ProcessInfo& rProcessInfo)
126 {
127  int out = TFluidData::Check(rElement,rProcessInfo);
128  return out;
129 }
130 
137 bool IsCut()
138 {
139  if (IsIncised()) {
140  return false;
141  } else {
142  return (NumPositiveNodes > 0) && (NumNegativeNodes > 0);
143  }
144 }
145 
154 inline bool IsIncised()
155 {
156  return NumIntersectedEdgesExtrapolated > 0 ? true : false;
157 }
158 
160 
161 };
162 
164 
166 
167 }
168 
169 #endif
Base class for all Elements.
Definition: element.h:60
Definition: embedded_discontinuous_data.h:29
std::vector< size_t > PositiveIndices
Definition: embedded_discontinuous_data.h:70
Matrix NegativeInterfaceN
Definition: embedded_discontinuous_data.h:62
Vector PositiveInterfaceWeights
Definition: embedded_discontinuous_data.h:65
std::vector< size_t > NegativeIndices
Definition: embedded_discontinuous_data.h:71
Vector NegativeSideWeights
Definition: embedded_discontinuous_data.h:59
std::vector< array_1d< double, 3 > > InterfaceNormalsType
Definition: embedded_discontinuous_data.h:39
ShapeFunctionsGradientsType NegativeInterfaceDNDX
Definition: embedded_discontinuous_data.h:64
Vector ElementalEdgeDistancesExtrapolated
Definition: embedded_discontinuous_data.h:52
NodalScalarData ElementalDistances
Definition: embedded_discontinuous_data.h:51
ShapeFunctionsGradientsType PositiveSideDNDX
Definition: embedded_discontinuous_data.h:56
Matrix PositiveSideN
Definition: embedded_discontinuous_data.h:54
void Initialize(const Element &rElement, const ProcessInfo &rProcessInfo) override
Discontinuous embedded formulation data container initialization This method initializes the disconti...
Definition: embedded_discontinuous_data.h:90
std::size_t NumIntersectedEdgesExtrapolated
Definition: embedded_discontinuous_data.h:75
double PenaltyCoefficient
Definition: embedded_discontinuous_data.h:49
typename TFluidData::NodalScalarData NodalScalarData
Definition: embedded_discontinuous_data.h:35
Matrix PositiveInterfaceN
Definition: embedded_discontinuous_data.h:61
ShapeFunctionsGradientsType NegativeSideDNDX
Definition: embedded_discontinuous_data.h:57
InterfaceNormalsType NegativeInterfaceUnitNormals
Definition: embedded_discontinuous_data.h:68
Matrix NegativeSideN
Definition: embedded_discontinuous_data.h:55
std::size_t NumPositiveNodes
Definition: embedded_discontinuous_data.h:73
bool IsCut()
Checks if the current element is intersected Checks if the current element is intersected by checking...
Definition: embedded_discontinuous_data.h:137
GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType
Definition: embedded_discontinuous_data.h:38
double SlipLength
Definition: embedded_discontinuous_data.h:48
void InitializeBoundaryConditionData(const ProcessInfo &rProcessInfo)
Fills the boundary condition data fields This method needs to be called in cut elements....
Definition: embedded_discontinuous_data.h:109
bool IsIncised()
Checks if the current element is partially intersected (incised) and if extrapolated intersections wh...
Definition: embedded_discontinuous_data.h:154
std::size_t NumNegativeNodes
Definition: embedded_discontinuous_data.h:74
InterfaceNormalsType PositiveInterfaceUnitNormals
Definition: embedded_discontinuous_data.h:67
static int Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Discontinous embedded formulation data container check Simple discontinuous embedded formulation data...
Definition: embedded_discontinuous_data.h:123
typename TFluidData::NodalVectorData NodalVectorData
Definition: embedded_discontinuous_data.h:36
ShapeFunctionsGradientsType PositiveInterfaceDNDX
Definition: embedded_discontinuous_data.h:63
constexpr static std::size_t NumEdges
Number of edges of the element (simplex elements are assumed)
Definition: embedded_discontinuous_data.h:42
Vector PositiveSideWeights
Definition: embedded_discontinuous_data.h:58
Vector NegativeInterfaceWeights
Definition: embedded_discontinuous_data.h:66
Definition: amatrix_interface.h:41
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
out
Definition: isotropic_damage_automatic_differentiation.py:200