KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
AuxiliaryUtilities.h
Go to the documentation of this file.
1 #pragma once
2 // Author: Miguel Angel Celigueta maceli@cimne.upc.edu
3 
4 #include <pybind11/pybind11.h>
5 #include "includes/define.h"
6 #include "includes/model_part.h"
7 #include "pre_utilities.h"
8 
9 
10 namespace Kratos {
11 
13 
14  public:
15 
20 
22 
24  virtual ~AuxiliaryUtilities() {};
25 
26  void UpdateTimeInOneModelPart(ModelPart& r_model_part, const double& time, const double& dt, const bool& is_time_to_print);
27 
28  double ComputeAverageZStressFor2D(ModelPart& rSpheresModelPart) {
29 
30  ElementsArrayType& pElements = rSpheresModelPart.GetCommunicator().LocalMesh().Elements();
31  double sub_total = 0.0;
32  double average_value = 0.0;
33 
34  #pragma omp parallel for
35  for (int k = 0; k < (int)pElements.size(); k++) {
36 
37  ElementsArrayType::iterator it = pElements.ptr_begin() + k;
38  Element* p_element = &(*it);
39  SphericContinuumParticle* p_sphere = dynamic_cast<SphericContinuumParticle*>(p_element);
40 
41  double z_tensor_value = (*p_sphere->mSymmStressTensor)(2,2);
42  sub_total += z_tensor_value;
43  }
44  average_value = sub_total/(int)pElements.size();
45  return average_value;
46  }
47  };
48 }
Definition: AuxiliaryUtilities.h:12
KRATOS_CLASS_POINTER_DEFINITION(AuxiliaryUtilities)
GlobalPointersVector< Element > ParticleWeakVectorType
Definition: AuxiliaryUtilities.h:18
void UpdateTimeInOneModelPart(ModelPart &r_model_part, const double &time, const double &dt, const bool &is_time_to_print)
Definition: AuxiliaryUtilities.cpp:15
ModelPart::NodesContainerType::ContainerType NodesContainerType
Definition: AuxiliaryUtilities.h:17
AuxiliaryUtilities()
Definition: AuxiliaryUtilities.h:23
double ComputeAverageZStressFor2D(ModelPart &rSpheresModelPart)
Definition: AuxiliaryUtilities.h:28
ModelPart::ElementsContainerType ElementsArrayType
Definition: AuxiliaryUtilities.h:16
virtual ~AuxiliaryUtilities()
Definition: AuxiliaryUtilities.h:24
GlobalPointersVector< Element >::iterator ParticleWeakIteratorType
Definition: AuxiliaryUtilities.h:19
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
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
ptr_iterator ptr_begin()
Returns an iterator pointing to the beginning of the underlying data container.
Definition: pointer_vector_set.h:386
Definition: spheric_continuum_particle.h:26
BoundedMatrix< double, 3, 3 > * mSymmStressTensor
Definition: spheric_particle.h:267
dt
Definition: DEM_benchmarks.py:173
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
time
Definition: face_heat.py:85
int k
Definition: quadrature.py:595
Configure::ContainerType ContainerType
Definition: transfer_utility.h:247