14 #if !defined(KRATOS_GLOBAL_JOINT_STRESS_UTILITIES)
15 #define KRATOS_GLOBAL_JOINT_STRESS_UTILITIES
107 for (
int k = 0;
k < nelements;
k++)
109 ModelPart::ElementsContainerType::iterator it = el_begin +
k;
119 MyIntegrationMethod = it->GetIntegrationMethod();
121 unsigned int NumGPoints = IntegrationPoints.size();
122 std::vector<array_1d<double, 3>> LocalStressVector;
125 it->CalculateOnIntegrationPoints(LOCAL_STRESS_VECTOR, LocalStressVector, CurrentProcessInfo);
127 for (
unsigned int GPoint = 0; GPoint < NumGPoints; GPoint++)
129 noalias(LocalElementStress) += LocalStressVector[GPoint];
133 double InvNumGP = 1.0 /
static_cast<double>(NumGPoints);
134 LocalElementStress[0] *= InvNumGP;
135 LocalElementStress[1] *= InvNumGP;
136 LocalElementStress[2] *= InvNumGP;
138 this->
AreaMidPlane(Area, point_mid0, point_mid1, point_mid2);
139 noalias(LocalElementVectorForce) = LocalElementStress * Area;
140 noalias(GlobalElementVectorForce) +=
prod(
trans(RotationMatrix), LocalElementVectorForce);
143 noalias(VectorForceinPlane) =
prod(RotationPlane, GlobalElementVectorForce);
144 const double TangentialForce = sqrt(VectorForceinPlane[0] * VectorForceinPlane[0] + VectorForceinPlane[1] * VectorForceinPlane[1]);
146 std::cout <<
" Tangential Force (N) " << TangentialForce << std::endl;
147 std::cout <<
" Normal Force (N) " << fabs(VectorForceinPlane[2]) << std::endl;
167 noalias(Vx) = point_mid1 - point_mid0;
168 double inv_norm_x = 1.0 /
norm_2(Vx);
175 noalias(Vy) = point_mid2 - point_mid0;
178 double inv_norm_z = 1.0 /
norm_2(Vz);
187 rRotationMatrix(0, 0) = Vx[0];
188 rRotationMatrix(0, 1) = Vx[1];
189 rRotationMatrix(0, 2) = Vx[2];
191 rRotationMatrix(1, 0) = Vy[0];
192 rRotationMatrix(1, 1) = Vy[1];
193 rRotationMatrix(1, 2) = Vy[2];
195 rRotationMatrix(2, 0) = Vz[0];
196 rRotationMatrix(2, 1) = Vz[1];
197 rRotationMatrix(2, 2) = Vz[2];
214 noalias(Vx) = point_mid1 - point_mid0;
215 noalias(Vy) = point_mid2 - point_mid0;
217 rArea = sqrt(Vz[0] * Vz[0] + Vz[1] * Vz[1] + Vz[2] * Vz[2]) / 2.0;
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
const IntegrationPointsArrayType & IntegrationPoints() const
Definition: geometry.h:2284
TPointType const & GetPoint(const int Index) const
Definition: geometry.h:1816
Definition: global_joint_stress_utility.hpp:44
ModelPart & mr_model_part
Member Variables.
Definition: global_joint_stress_utility.hpp:154
void ComputingGlobalStress()
Definition: global_joint_stress_utility.hpp:77
GlobalJointStressUtility(ModelPart &model_part, Parameters rParameters)
Constructor.
Definition: global_joint_stress_utility.hpp:50
void AreaMidPlane(double &rArea, array_1d< double, 3 > &point_mid0, array_1d< double, 3 > &point_mid1, array_1d< double, 3 > &point_mid2)
Definition: global_joint_stress_utility.hpp:204
array_1d< double, 9 > m_plane_coordinates
Definition: global_joint_stress_utility.hpp:155
~GlobalJointStressUtility()
Destructor.
Definition: global_joint_stress_utility.hpp:72
void CalculateRotationMatrix(BoundedMatrix< double, 3, 3 > &rRotationMatrix, array_1d< double, 3 > &point_mid0, array_1d< double, 3 > &point_mid1, array_1d< double, 3 > &point_mid2)
Definition: global_joint_stress_utility.hpp:161
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
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
#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
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
model_part
Definition: face_heat.py:14
int k
Definition: quadrature.py:595