14 #if !defined(KRATOS_TRANSFER_SELFWEIGHT_STRESS_UTILITIES)
15 #define KRATOS_TRANSFER_SELFWEIGHT_STRESS_UTILITIES
55 const int NNodes =
static_cast<int>(r_model_part.
Nodes().size());
56 ModelPart::NodesContainerType::iterator node_begin = r_model_part.
NodesBegin();
57 ModelPart::NodesContainerType::iterator node_begin_selfweight = selfweight_model_part.
NodesBegin();
59 #pragma omp parallel for
60 for (
int i = 0;
i < NNodes;
i++)
62 ModelPart::NodesContainerType::iterator itNode = node_begin +
i;
63 ModelPart::NodesContainerType::iterator itNodeSelf = node_begin_selfweight +
i;
65 const Matrix &NodalStressSelfweight = itNodeSelf->FastGetSolutionStepValue(NODAL_CAUCHY_STRESS_TENSOR);
66 Matrix &NodalStress = itNode->FastGetSolutionStepValue(NODAL_CAUCHY_STRESS_TENSOR);
68 for (
int j = 0;
j < TDim;
j++)
70 for (
int k = 0;
k < TDim;
k++)
72 NodalStress(
j,
k) += NodalStressSelfweight(
j,
k);
88 const int NNodes =
static_cast<int>(r_model_part.
Nodes().size());
89 ModelPart::NodesContainerType::iterator node_begin = r_model_part.
NodesBegin();
91 #pragma omp parallel for
92 for (
int i = 0;
i < NNodes;
i++)
94 ModelPart::NodesContainerType::iterator itNode = node_begin +
i;
96 const Matrix &InitialNodalStress = itNode->FastGetSolutionStepValue(INITIAL_NODAL_CAUCHY_STRESS_TENSOR);
97 Matrix &NodalStress = itNode->FastGetSolutionStepValue(NODAL_CAUCHY_STRESS_TENSOR);
99 for (
int j = 0;
j < TDim;
j++)
101 for (
int k = 0;
k < TDim;
k++)
103 NodalStress(
j,
k) += InitialNodalStress(
j,
k);
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
Definition: transfer_selfweight_stress_utility.hpp:34
~TransferSelfweightStressUtility()
Destructor.
Definition: transfer_selfweight_stress_utility.hpp:45
void Transfer(ModelPart &selfweight_model_part, ModelPart &r_model_part, const int TDim)
Definition: transfer_selfweight_stress_utility.hpp:50
void TransferInitialStress(ModelPart &r_model_part, const int TDim)
Definition: transfer_selfweight_stress_utility.hpp:83
TransferSelfweightStressUtility()
Constructor.
Definition: transfer_selfweight_stress_utility.hpp:40
#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
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17