14 #if !defined(KRATOS_STREAMLINES_OUTPUT_3D_UTILITIES)
15 #define KRATOS_STREAMLINES_OUTPUT_3D_UTILITIES
25 #include "custom_utilities/solid_mechanics_math_utilities.hpp"
54 const int NNodes =
static_cast<int>(r_model_part.
Nodes().size());
55 ModelPart::NodesContainerType::iterator node_begin = r_model_part.
NodesBegin();
67 #pragma omp parallel for
68 for (
int i = 0;
i < NNodes;
i++)
71 ModelPart::NodesContainerType::iterator itNode = node_begin +
i;
73 const Matrix &NodalStress = itNode->FastGetSolutionStepValue(NODAL_CAUCHY_STRESS_TENSOR);
75 Tangential_components[0] = NodalStress(1, 0);
76 Tangential_components[1] = NodalStress(2, 0);
77 Tangential_components[2] = NodalStress(2, 1);
83 for (
unsigned int i = 0;
i < 3;
i++)
93 for (
unsigned int a = 0;
a < 3;
a++)
99 noalias(StreamlineVi) = Vsi_pos;
101 noalias(StreamlineViii) = Vsiii_pos;
124 const double &Sxy = Tangential_components[0];
125 const double &Sxz = Tangential_components[1];
126 const double &Syz = Tangential_components[2];
128 AutovectorMatrix(0, 0) = S_Sii[0] * S_Siii[0] + Sxy * Sxy + Sxz * Sxz;
129 AutovectorMatrix(1, 1) = S_Sii[1] * S_Siii[1] + Sxy * Sxy + Syz * Syz;
130 AutovectorMatrix(2, 2) = S_Sii[2] * S_Siii[2] + Sxz * Sxz + Syz * Syz;
131 AutovectorMatrix(0, 1) = S_Sii[0] * Sxy + Sxy * S_Siii[1] + Sxz * Syz;
132 AutovectorMatrix(1, 0) = AutovectorMatrix(0, 1);
133 AutovectorMatrix(0, 2) = S_Sii[0] * Sxz + Sxy * Syz + S_Siii[2] * Sxz;
134 AutovectorMatrix(2, 0) = AutovectorMatrix(0, 2);
135 AutovectorMatrix(2, 1) = Sxy * Sxz + S_Sii[1] * Syz + Syz * S_Siii[2];
136 AutovectorMatrix(1, 2) = AutovectorMatrix(2, 1);
138 for (
unsigned int j = 0;
j < 3;
j++)
140 vap1[
j] = AutovectorMatrix(0,
j);
141 vap2[
j] = AutovectorMatrix(1,
j);
142 vap3[
j] = AutovectorMatrix(2,
j);
146 const double norm_vap1 = sqrt(vap1[0] * vap1[0] + vap1[1] * vap1[1] + vap1[2] * vap1[2]);
147 const double norm_vap2 = sqrt(vap2[0] * vap2[0] + vap2[1] * vap2[1] + vap2(2) * vap2[2]);
148 const double norm_vap3 = sqrt(vap3[0] * vap3[0] + vap3[1] * vap3[1] + vap3[2] * vap3[2]);
150 if (norm_vap1 > 1.0e-12)
152 vap1[0] *= 1.0 / norm_vap1;
153 vap1[1] *= 1.0 / norm_vap1;
154 vap1[2] *= 1.0 / norm_vap1;
161 if (norm_vap2 > 1.0e-12)
163 vap2[0] *= 1.0 / norm_vap2;
164 vap2[1] *= 1.0 / norm_vap2;
165 vap2[2] *= 1.0 / norm_vap2;
172 if (norm_vap3 > 1.0e-12)
174 vap3[0] *= 1.0 / norm_vap3;
175 vap3[1] *= 1.0 / norm_vap3;
176 vap3[2] *= 1.0 / norm_vap3;
184 for (
unsigned int l = 0;
l < 3;
l++)
190 else if (vap2[2] > 0.0)
194 else if (vap3[2] > 0.0)
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static Vector EigenValuesDirectMethod(const Matrix &A)
Definition: solid_mechanics_math_utilities.hpp:243
Definition: streamlines_output_3D_utilities.hpp:34
StreamlinesOutput3DUtilities()
Constructor.
Definition: streamlines_output_3D_utilities.hpp:40
~StreamlinesOutput3DUtilities()
Destructor.
Definition: streamlines_output_3D_utilities.hpp:45
void ComputeOutputStep(ModelPart &r_model_part, const int dimension)
Definition: streamlines_output_3D_utilities.hpp:49
array_1d< double, 3 > ComputeVaps(const array_1d< double, 3 > &Tangential_components, const array_1d< double, 3 > &S_Siii, const array_1d< double, 3 > &S_Sii, const Vector &PrincipalStresses)
Member Variables.
Definition: streamlines_output_3D_utilities.hpp:114
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
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
a
Definition: generate_stokes_twofluid_element.py:77
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
PrincipalStresses
Definition: isotropic_damage_automatic_differentiation.py:221
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17