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.
generic_small_strain_femdem_element.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ \.
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics FemDem Application
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 // Vicente Mataix Ferrandiz
12 // Alejandro Cornejo
13 
14 #pragma once
15 
16 // System includes
17 
18 // External include
19 
20 // Project includes
21 
23 #include "custom_utilities/constitutive_law_utilities.h"
24 
25 namespace Kratos
26 {
30 
34 
37 
41 
45 
52 template<unsigned int TDim, unsigned int TyieldSurf>
53 class KRATOS_API(FEM_TO_DEM_APPLICATION) GenericSmallStrainFemDemElement
54  : public GenericTotalLagrangianFemDemElement<TDim,TyieldSurf> // Derived Element from SolidMechanics
55 {
56 public:
57 
62 
65 
68 
70  typedef Node NodeType;
71 
77 
80 
83 
84  typedef Vector VectorType;
85 
86  typedef Matrix MatrixType;
87 
88  typedef std::size_t IndexType;
89 
90  typedef std::size_t SizeType;
91 
92  typedef std::vector<std::size_t> EquationIdVectorType;
93 
94  typedef std::vector< Dof<double>::Pointer > DofsVectorType;
95 
97 
99 
101  static constexpr SizeType VoigtSize = (TDim == 3) ? 6 : 3;
102 
104  static constexpr SizeType NumberOfEdges = (TDim == 3) ? 6 : 3;
105 
107  typedef ConstitutiveLawType::Pointer ConstitutiveLawPointerType;
108 
110  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
111 
114 
118 
120  GenericSmallStrainFemDemElement(IndexType NewId, GeometryType::Pointer pGeometry);
121  GenericSmallStrainFemDemElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
122 
124  // GenericSmallStrainFemDemElement(GenericSmallStrainFemDemElement const &rOther);
125 
128 
131  : BaseType(rOther)
132  {};
133 
141  Element::Pointer Create(
142  IndexType NewId,
143  GeometryType::Pointer pGeom,
144  PropertiesType::Pointer pProperties
145  ) const override;
146 
154  Element::Pointer Create(
155  IndexType NewId,
156  NodesArrayType const& ThisNodes,
157  PropertiesType::Pointer pProperties
158  ) const override;
159 
167  Element::Pointer Clone(
168  IndexType NewId,
169  NodesArrayType const& rThisNodes
170  ) const override;
171 
173  {
174  }
175 
177  const Variable<Vector>& rVariable,
178  std::vector<Vector>& rOutput,
179  const ProcessInfo& rCurrentProcessInfo) override;
180 
184  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
185 
189  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
190 
194  void CalculateTangentTensor(Matrix& rTangentTensor,const Vector& rStrainVectorGP,const Vector& rStressVectorGP,const Matrix& rElasticMatrix, ConstitutiveLaw::Parameters& rValues);
195  void CalculateTangentTensorSecondOrder(Matrix& rTangentTensor,const Vector& rStrainVectorGP,const Vector& rStressVectorGP,const Matrix& rElasticMatrix, ConstitutiveLaw::Parameters& rValues);
196 
197  void ComputeEquivalentF(Matrix& rF,const Vector& rStrainTensor);
198 protected:
199 
208  void CalculateAll(
209  MatrixType& rLeftHandSideMatrix,
210  VectorType& rRightHandSideVector,
211  const ProcessInfo& rCurrentProcessInfo,
212  const bool CalculateStiffnessMatrixFlag,
213  const bool CalculateResidualVectorFlag
214  ) override;
215 
222  void CalculateKinematicVariables(
223  BaseSolidElement::KinematicVariables& rThisKinematicVariables,
224  const IndexType PointNumber,
225  const GeometryType::IntegrationMethod& rIntegrationMethod) override;
226 
233  void CalculateB(Matrix& rB, const Matrix& rDN_DX);
234  void Calculate2DB(Matrix& rB, const Matrix& rDN_DX);
235  void Calculate3DB(Matrix& rB, const Matrix& rDN_DX);
236 
237  // void ComputeEquivalentF(Matrix& rF, const Vector& rStrainTensor);
238 
239  void CalculateConstitutiveVariables(
240  BaseSolidElement::KinematicVariables& rThisKinematicVariables,
241  BaseSolidElement::ConstitutiveVariables& rThisConstitutiveVariables,
243  const IndexType PointNumber,
244  const GeometryType::IntegrationPointsArrayType& IntegrationPoints,
245  const ConstitutiveLaw::StressMeasure ThisStressMeasure) override;
246 
247  void SetConstitutiveVariables(
248  BaseSolidElement::KinematicVariables& rThisKinematicVariables,
249  BaseSolidElement::ConstitutiveVariables& rThisConstitutiveVariables,
251  const IndexType PointNumber,
252  const GeometryType::IntegrationPointsArrayType& IntegrationPoints) override;
253 
259  void GetValuesVector(
260  Vector& rValues,
261  int Step = 0
262  ) const override;
263 
264  bool UseElementProvidedStrain() const override;
265 
266 
269 
273 
277 
281 
286 
290 }; // Class GenericSmallStrainFemDemElement
291 
292 template<unsigned int TDim, unsigned int TyieldSurf> constexpr SizeType GenericSmallStrainFemDemElement<TDim, TyieldSurf>::VoigtSize;
293 template<unsigned int TDim, unsigned int TyieldSurf> constexpr SizeType GenericSmallStrainFemDemElement<TDim, TyieldSurf>::NumberOfEdges;
294 
302 
303 } // namespace Kratos.
Definition: constitutive_law.h:47
StressMeasure
Definition: constitutive_law.h:69
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Definition: flags.h:74
Small Displacement element for the 2D and 3D cases.
Definition: generic_small_strain_femdem_element.hpp:55
std::size_t SizeType
Definition: generic_small_strain_femdem_element.hpp:90
std::vector< std::size_t > EquationIdVectorType
Definition: generic_small_strain_femdem_element.hpp:92
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: generic_small_strain_femdem_element.hpp:79
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: generic_small_strain_femdem_element.hpp:82
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(GenericSmallStrainFemDemElement)
Counted pointer of GenericSmallStrainFemDemElement.
GeometryData GeometryDataType
Definition: generic_small_strain_femdem_element.hpp:98
Matrix MatrixType
Definition: generic_small_strain_femdem_element.hpp:86
Node NodeType
definition of node type (default is: Node)
Definition: generic_small_strain_femdem_element.hpp:70
std::size_t IndexType
Definition: generic_small_strain_femdem_element.hpp:88
Element ElementType
definition of element type
Definition: generic_small_strain_femdem_element.hpp:64
void CalculateB(Matrix &rB, const Matrix &rDN_DX)
This method computes the deformation matrix B.
GenericSmallStrainFemDemElement(GenericSmallStrainFemDemElement const &rOther)
Assignment operator.
Definition: generic_small_strain_femdem_element.hpp:130
Vector VectorType
Definition: generic_small_strain_femdem_element.hpp:84
ConstitutiveLaw ConstitutiveLawType
Definition: generic_small_strain_femdem_element.hpp:61
ConstitutiveLawType::Pointer ConstitutiveLawPointerType
Pointer type for constitutive laws.
Definition: generic_small_strain_femdem_element.hpp:107
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: generic_small_strain_femdem_element.hpp:96
GenericSmallStrainFemDemElement()
Definition: generic_small_strain_femdem_element.hpp:172
GenericTotalLagrangianFemDemElement< TDim, TyieldSurf > BaseType
base type: an GeometricalObject that automatically has a unique number
Definition: generic_small_strain_femdem_element.hpp:67
Properties PropertiesType
Definition: generic_small_strain_femdem_element.hpp:76
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: generic_small_strain_femdem_element.hpp:94
Total Lagrangian element for 2D and 3D geometries.
Definition: generic_total_lagrangian_femdem_element.h:60
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
Definition: geometry_data.h:60
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
This object defines an indexed object.
Definition: indexed_object.h:54
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
void ComputeEquivalentF(const Element &rElement, const TVectorType &rStrainTensor, TMatrixType &rF)
This method computes the deformation gradient F (for small deformation solid elements)
Definition: structural_mechanics_element_utilities.h:69
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
Definition: base_solid_element.h:112
Definition: base_solid_element.h:73
Definition: constitutive_law.h:189