25 #include "custom_elements/base_solid_element.h"
27 #include "custom_utilities/constitutive_law_utilities.h"
57 template<
unsigned int TDim,
unsigned int TyieldSurf>
90 static constexpr
double tolerance = std::numeric_limits<double>::epsilon();
93 static constexpr
SizeType VoigtSize = (TDim == 3) ? 6 : 3;
96 static constexpr
SizeType NumberOfEdges = (TDim == 3) ? 6 : 3;
133 GeometryType::Pointer pGeom,
134 PropertiesType::Pointer pProperties
147 PropertiesType::Pointer pProperties
157 Element::Pointer Clone(
189 std::string
Info()
const override
191 std::stringstream buffer;
192 buffer <<
"Total Lagrangian FEMDEM Solid Element #" << Id();
199 rOStream <<
"Total Lagrangian FEMDEM Solid Element #" << Id();
205 pGetGeometry()->PrintData(rOStream);
221 double mThreshold = 0.0;
222 double mDamage = 0.0;
246 const bool CalculateStiffnessMatrixFlag,
247 const bool CalculateResidualVectorFlag)
override;
255 void CalculateKinematicVariables(
256 KinematicVariables& rThisKinematicVariables,
270 void CalculatePerturbation(
const Vector& rStrainVectorGP,
double& rPerturbation,
const int Component);
275 void PerturbateStrainVector(
Vector& rPerturbedStrainVector,
const Vector& rStrainVectorGP,
const double Perturbation,
const int Component);
285 void AssignComponentsToTangentTensor(
Matrix& rTangentTensor,
const Vector& rDeltaStress,
const double Perturbation,
const int Component);
290 void PerturbateDeformationGradient(
Matrix& rPerturbedDeformationGradient,
const Matrix& rDeformationGradientGP,
const double Perturbation,
const int ComponentI,
const int ComponentJ);
295 int CalculateVoigtIndex(
const SizeType VoigtSize,
const int ComponentI,
const int ComponentJ);
301 double CalculateElementalDamage3D(
const Vector& rEdgeDamages);
302 double CalculateElementalDamage2D(
const Vector& rEdgeDamages);
307 void IntegrateStressDamageMechanics(
double& rThreshold,
double& rDamage,
const Vector& rStrainVector,
308 const Vector& rStressVector,
const int Edge,
const double CharacteristicLength,
316 Vector &rStrainVector,
double& rDamageElement,
bool& rIsDamaging,
const double CharacteristicLength,
317 const bool SaveIntVars);
327 void AuxComputeEdgeNeighbours(
const ProcessInfo& rCurrentProcessInfo);
346 rMatrix(0, 0) = 0; rMatrix(0, 1) = 1; rMatrix(1, 0) = 0;
347 rMatrix(1, 1) = 2; rMatrix(2, 0) = 0; rMatrix(2, 1) = 3;
348 rMatrix(3, 0) = 1; rMatrix(3, 1) = 2; rMatrix(4, 0) = 1;
349 rMatrix(4, 1) = 3; rMatrix(5, 0) = 2; rMatrix(5, 1) = 3;
357 void CalculateAverageVariableOnEdge2D(
const Element* pCurrentElement,
const Variable<Vector>& rThisVariable,
Vector& rAverageStress,
const int edge);
358 void CalculateAverageVariableOnEdge3D(
const Element* pCurrentElement,
const Variable<Vector>& rThisVariable,
Vector& rAverageStress,
const int edge);
383 void CalculateExponentialDamage(
double& rDamage,
const double DamageParameter,
const double UniaxialStress,
const double InitialThrehsold);
388 void CalculateGreenLagrangeStrainVector(
Vector& rStrainVector,
const Matrix& rF);
390 std::size_t GetStrainSize()
const;
394 const std::vector<double> &rValues,
399 std::vector<double> &rOutput,
404 std::vector<Vector>& rOutput,
409 std::vector<Matrix>& rOutput,
417 const double max_damage = 0.98;
418 if (mDamage >= max_damage) {
419 this->Set(ACTIVE,
false);
420 mDamage = max_damage;
463 void FinalizeSolutionStep(
const ProcessInfo& rCurrentProcessInfo)
override;
468 void InitializeNonLinearIteration(
const ProcessInfo& rCurrentProcessInfo)
override;
483 void CalculateStress(
Vector& rStrain,
488 void CalculateStress(
Matrix const& rF,
493 void CalculateStrain(
Matrix const& rF,
502 double& rDetJ0_Deriv,
503 std::size_t IntegrationPointIndex);
505 void CalculateBSensitivity(
Matrix const& rDN_DX,
507 Matrix const& rDN_DX_Deriv,
517 std::vector<std::vector<Element*>> mEdgeNeighboursContainer;
526 void save(
Serializer& rSerializer)
const override;
This is base class used to define the solid elements.
Definition: base_solid_element.h:67
Definition: constitutive_law.h:47
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Definition: flags.h:74
Total Lagrangian element for 2D and 3D geometries.
Definition: generic_total_lagrangian_femdem_element.h:60
GenericTotalLagrangianFemDemElement()
Definition: generic_total_lagrangian_femdem_element.h:230
GeometryData::IntegrationMethod IntegrationMethod
Type definition for integration methods.
Definition: generic_total_lagrangian_femdem_element.h:72
void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition: generic_total_lagrangian_femdem_element.h:83
Vector mThresholds
Definition: generic_total_lagrangian_femdem_element.h:218
void CalculateDamageParameter(ConstitutiveLaw::Parameters &rValues, double &rAParameter, const double CharacteristicLength)
std::vector< Element * > GetEdgeNeighbourElements(const int edge)
Definition: generic_total_lagrangian_femdem_element.h:332
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(GenericTotalLagrangianFemDemElement)
Counted pointer of GenericTotalLagrangianFemDemElement.
void ComputeEdgeNeighbours(const ProcessInfo &rCurrentProcessInfo)
ConstitutiveLaw ConstitutiveLawType
Reference type definition for constitutive laws.
Definition: generic_total_lagrangian_femdem_element.h:66
virtual void CheckIfEraseElement(const ProcessInfo &rCurrentProcessInfo, const Properties &rProperties)
Definition: generic_total_lagrangian_femdem_element.h:413
void SaveEdgeNeighboursContainer(const std::vector< std::vector< Element * >> &rtoSave)
Definition: generic_total_lagrangian_femdem_element.h:337
void SetNodeIndexes(Matrix &rMatrix)
Definition: generic_total_lagrangian_femdem_element.h:343
std::string Info() const override
Turn back information as a string.
Definition: generic_total_lagrangian_femdem_element.h:189
BaseSolidElement BaseType
The base element type.
Definition: generic_total_lagrangian_femdem_element.h:75
double CalculateElementalDamage(const Vector &rEdgeDamages)
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: generic_total_lagrangian_femdem_element.h:197
Vector mDamages
Definition: generic_total_lagrangian_femdem_element.h:219
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: generic_total_lagrangian_femdem_element.h:203
void CalculateAverageVariableOnEdge(const Element *pCurrentElement, const Variable< Vector > &rThisVariable, Vector &rAverageStress, const int edge)
ConstitutiveLawType::Pointer ConstitutiveLawPointerType
Pointer type for constitutive laws.
Definition: generic_total_lagrangian_femdem_element.h:69
Properties PropertiesType
Definition: generic_total_lagrangian_femdem_element.h:85
std::size_t IndexType
The definition of the index type.
Definition: generic_total_lagrangian_femdem_element.h:78
Geometry< NodeType > GeometryType
Definition: generic_total_lagrangian_femdem_element.h:87
GenericTotalLagrangianFemDemElement(GenericTotalLagrangianFemDemElement const &rOther)
Definition: generic_total_lagrangian_femdem_element.h:110
void CalculateEquivalentStress(const array_1d< double, VoigtSize > &rPredictiveStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
std::size_t SizeType
The definition of the sizetype.
Definition: generic_total_lagrangian_femdem_element.h:81
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
Short class definition.
Definition: integration_point.h:52
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.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
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
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
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
void SetValuesOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const std::vector< TDataType > &values, const ProcessInfo &rCurrentProcessInfo)
Definition: add_mesh_to_python.cpp:185
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
void CalculateB(const GeometricalObject &rElement, const TMatrixType1 &rDN_DX, TMatrixType2 &rB)
This method computes the deformation tensor B (for small deformation solid elements)
Definition: structural_mechanics_element_utilities.h:105
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
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
def load(f)
Definition: ode_solve.py:307
Definition: base_solid_element.h:112
Definition: base_solid_element.h:73
Definition: constitutive_law.h:189
Definition: geometrical_sensitivity_utility.h:33