14 #ifndef KRATOS_STRESS_FAILURE_CHECK_UTILITIES
15 #define KRATOS_STRESS_FAILURE_CHECK_UTILITIES
31 #include "custom_utilities/AuxiliaryFunctions.h"
60 "cylinder_center": [0.0,0.0,0.0],
61 "min_radius": 0.00381,
98 for (
int i = 0;
i < (
int)rElements.size();
i++) {
100 ModelPart::ElementsContainerType::ptr_iterator ptr_itElem = rElements.ptr_begin() +
i;
105 Element* p_element = ptr_itElem->get();
108 if ((pDemElem->
IsNot(DEMFlags::STICKY)) && (Distance2 >= std::pow(
mMinRadius,2)) && (Distance2 <= std::pow(
mMaxRadius,2))) {
111 Vector principal_stresses(3);
113 const double max_stress = *std::max_element(principal_stresses.
begin(), principal_stresses.
end());
114 const double min_stress = *std::min_element(principal_stresses.
begin(), principal_stresses.
end());
115 ThreadSigma1[
k] += max_stress;
116 ThreadSigma3[
k] += min_stress;
117 ThreadNParticles[
k] += 1;
122 double Sigma1Average = 0.0;
123 double Sigma3Average = 0.0;
126 Sigma1Average += ThreadSigma1[
k];
127 Sigma3Average += ThreadSigma3[
k];
128 NParticles += ThreadNParticles[
k];
131 if (NParticles > 0) {
132 Sigma1Average = Sigma1Average / NParticles;
133 Sigma3Average = Sigma3Average / NParticles;
140 std::fstream Sigma1File;
141 std::fstream Sigma3File;
144 Sigma1File.precision(12);
145 Sigma1File << CurrentTime <<
" " << Sigma1Average << std::endl;
149 Sigma3File.precision(12);
150 Sigma3File << CurrentTime <<
" " << Sigma3Average << std::endl;
170 virtual std::string
Info()
const
MeshType & LocalMesh()
Returns the reference to the mesh storing all local entities.
Definition: communicator.cpp:245
Base class for all Elements.
Definition: element.h:60
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
Definition: amatrix_interface.h:41
iterator end()
Definition: amatrix_interface.h:243
iterator begin()
Definition: amatrix_interface.h:241
ElementsContainerType & Elements()
Definition: mesh.h:568
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
Communicator & GetCommunicator()
Definition: model_part.h:1821
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
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
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
Definition: spheric_continuum_particle.h:26
BoundedMatrix< double, 3, 3 > * mSymmStressTensor
Definition: spheric_particle.h:267
Note: For the moment this only works for cylindrical probes with its axis oriented in Z direction.
Definition: stress_failure_check_utilities.hpp:43
array_1d< double, 3 > mCylinderCenter
Definition: stress_failure_check_utilities.hpp:199
ModelPart & mrModelPart
Definition: stress_failure_check_utilities.hpp:198
virtual ~StressFailureCheckUtilities()
Destructor.
Definition: stress_failure_check_utilities.hpp:79
void ExecuteFinalizeSolutionStep()
Definition: stress_failure_check_utilities.hpp:84
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: stress_failure_check_utilities.hpp:177
StressFailureCheckUtilities(ModelPart &rModelPart, Parameters &rParameters)
Default constructor.
Definition: stress_failure_check_utilities.hpp:51
double mMaxRadius
Definition: stress_failure_check_utilities.hpp:201
KRATOS_CLASS_POINTER_DEFINITION(StressFailureCheckUtilities)
virtual std::string Info() const
Turn back information as a stemplate<class T, std::size_t dim> tring.
Definition: stress_failure_check_utilities.hpp:170
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: stress_failure_check_utilities.hpp:183
double mMinRadius
Definition: stress_failure_check_utilities.hpp:200
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
static Vector EigenValuesDirectMethod(const BoundedMatrix< double, 3, 3 > &A)
Definition: AuxiliaryFunctions.h:264
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
out
Definition: isotropic_damage_automatic_differentiation.py:200
int k
Definition: quadrature.py:595
integer i
Definition: TensorModule.f:17