14 #if !defined(KRATOS_CONDITION_UTILITIES )
15 #define KRATOS_CONDITION_UTILITIES
31 template<
unsigned int TDim,
unsigned int TNumNodes >
34 const unsigned int& GPoint)
36 for (
unsigned int i=0;
i < TDim; ++
i) {
37 unsigned int index =
i - TDim;
38 for (
unsigned int j=0;
j < TNumNodes; ++
j) {
40 rNu(
i, index) = NContainer(GPoint,
j);
46 template<
unsigned int TDim,
unsigned int TNumNodes >
50 const unsigned int& GPoint)
54 unsigned int index = 0;
55 for (
unsigned int i=0;
i<TNumNodes; ++
i) {
56 for (
unsigned int idim=0; idim<TDim; ++idim) {
57 rVector[idim] += Ncontainer(GPoint,
i)*VariableWithComponents[index++];
68 unsigned int index = 0;
69 for (
unsigned int i=0;
i<2; ++
i) {
70 noalias(DisplacementAux) = Geom[
i].FastGetSolutionStepValue(DISPLACEMENT);
71 rDisplacementVector[index++] = DisplacementAux[0];
72 rDisplacementVector[index++] = DisplacementAux[1];
82 unsigned int index = 0;
83 for (
unsigned int i=0;
i<4; ++
i) {
84 noalias(DisplacementAux) = Geom[
i].FastGetSolutionStepValue(DISPLACEMENT);
85 rDisplacementVector[index++] = DisplacementAux[0];
86 rDisplacementVector[index++] = DisplacementAux[1];
87 rDisplacementVector[index++] = DisplacementAux[2];
92 template<
unsigned int TNumNodes >
98 const unsigned int TDim = 3;
100 unsigned int index = 0;
101 for (
unsigned int i=0;
i<TNumNodes; ++
i) {
102 noalias(FaceLoadAux) = Geom[
i].FastGetSolutionStepValue(SURFACE_LOAD);
103 for (
unsigned int idim=0; idim<TDim; ++idim) {
104 rFaceLoadVector[index++] = FaceLoadAux[idim];
110 template<
unsigned int TNumNodes >
116 const unsigned int TDim = 2;
118 unsigned int index = 0;
119 for (
unsigned int i=0;
i<TNumNodes; ++
i) {
120 noalias(FaceLoadAux) = Geom[
i].FastGetSolutionStepValue(LINE_LOAD);
121 for (
unsigned int idim=0; idim < TDim; ++idim) {
122 rFaceLoadVector[index++] = FaceLoadAux[idim];
128 template<
unsigned int TDim,
unsigned int TNumNodes >
132 unsigned int Global_i, Local_i;
134 for (
unsigned int i = 0;
i < TNumNodes; ++
i) {
135 Global_i =
i * (TDim + 1);
137 for (
unsigned int idim = 0; idim < TDim; ++idim) {
138 rRightHandSideVector[Global_i + idim] += UBlockVector[Local_i + idim];
144 template<
class TVectorType >
146 const TVectorType& PBlockVector,
147 const unsigned int& Dim,
148 const unsigned int& NumNodes)
150 unsigned int Global_i;
152 for (
unsigned int i = 0;
i < NumNodes; ++
i) {
153 Global_i =
i * (Dim + 1) + Dim;
155 rRightHandSideVector[Global_i] += PBlockVector[
i];
160 template<
unsigned int TDim,
unsigned int TNumNodes >
165 unsigned int Global_i, Global_j, Local_i;
167 for (
unsigned int i = 0;
i < TNumNodes; ++
i) {
168 Global_i =
i * (TDim + 1);
171 for (
unsigned int j = 0;
j < TNumNodes; ++
j) {
172 Global_j =
j * (TDim + 1) + TDim;
173 for (
unsigned int idim = 0; idim < TDim; ++idim) {
174 rLeftHandSideMatrix(Global_i+idim, Global_j) += UPBlockMatrix(Local_i+idim,
j);
181 template<
unsigned int TDim,
unsigned int TNumNodes >
186 unsigned int Global_i, Global_j, Local_j;
188 for (
unsigned int i = 0;
i < TNumNodes; ++
i) {
189 Global_i =
i * (TDim + 1) + TDim;
191 for (
unsigned int j = 0;
j < TNumNodes; ++
j) {
192 Global_j =
j * (TDim + 1);
194 for (
unsigned int idim = 0; idim < TDim; ++idim) {
195 rLeftHandSideMatrix(Global_i, Global_j+idim) += PUBlockMatrix(
i, Local_j+idim);
201 template <
unsigned int TDim,
unsigned int TNumNodes>
204 auto normal_vector =
Vector{TDim, 0.0};
206 if constexpr (TDim == 2)
208 normal_vector =
column(rJacobian, 0);
210 else if constexpr (TDim == 3)
Definition: condition_utilities.hpp:26
static void AssembleUBlockVector(Vector &rRightHandSideVector, const array_1d< double, TDim *TNumNodes > &UBlockVector)
Definition: condition_utilities.hpp:129
static void AssemblePBlockVector(Vector &rRightHandSideVector, const TVectorType &PBlockVector, const unsigned int &Dim, const unsigned int &NumNodes)
Definition: condition_utilities.hpp:145
static void AssemblePUMatrix(Matrix &rLeftHandSideMatrix, const BoundedMatrix< double, TNumNodes, TDim *TNumNodes > &PUBlockMatrix)
Definition: condition_utilities.hpp:182
static void GetDisplacementsVector(array_1d< double, 4 > &rDisplacementVector, const Element::GeometryType &Geom)
Definition: condition_utilities.hpp:63
static double CalculateIntegrationCoefficient(const Matrix &rJacobian, double Weight)
Definition: condition_utilities.hpp:202
static void GetDisplacementsVector(array_1d< double, 12 > &rDisplacementVector, const Element::GeometryType &Geom)
Definition: condition_utilities.hpp:77
static void InterpolateVariableWithComponents(array_1d< double, TDim > &rVector, const Matrix &Ncontainer, const array_1d< double, TDim *TNumNodes > &VariableWithComponents, const unsigned int &GPoint)
Definition: condition_utilities.hpp:47
static void AssembleUPMatrix(Matrix &rLeftHandSideMatrix, const BoundedMatrix< double, TDim *TNumNodes, TNumNodes > &UPBlockMatrix)
Definition: condition_utilities.hpp:161
static void CalculateNuMatrix(BoundedMatrix< double, TDim, TDim *TNumNodes > &rNu, const Matrix &NContainer, const unsigned int &GPoint)
Definition: condition_utilities.hpp:32
static void GetFaceLoadVector(array_1d< double, 2 *TNumNodes > &rFaceLoadVector, const Element::GeometryType &Geom)
Definition: condition_utilities.hpp:111
static void GetFaceLoadVector(array_1d< double, 3 *TNumNodes > &rFaceLoadVector, const Element::GeometryType &Geom)
Definition: condition_utilities.hpp:93
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
static T CrossProduct(const T &a, const T &b)
Performs the vector product of the two input vectors a,b.
Definition: math_utils.h:762
static double Norm(const Vector &a)
Calculates the norm of vector "a".
Definition: math_utils.h:703
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::MatrixColumn< const TExpressionType > column(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t ColumnIndex)
Definition: amatrix_interface.h:637
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17