26 #include "custom_utilities/structural_mechanics_element_utilities.h"
64 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) BaseSolidElement
71 struct KinematicVariables
98 B =
ZeroMatrix(StrainSize, Dimension * NumberOfNodes);
103 Displacements =
ZeroVector(Dimension * NumberOfNodes);
110 struct ConstitutiveVariables
122 if (StrainVector.size() != StrainSize)
123 StrainVector.
resize(StrainSize);
125 if (StressVector.size() != StrainSize)
126 StressVector.
resize(StrainSize);
128 if (D.size1() != StrainSize || D.size2() != StrainSize)
129 D.
resize(StrainSize, StrainSize);
180 mThisIntegrationMethod = GetGeometry().GetDefaultIntegrationMethod();
186 ,mThisIntegrationMethod(rOther.mThisIntegrationMethod)
274 return mThisIntegrationMethod;
289 return GetGeometry().IntegrationPoints();
294 return GetGeometry().IntegrationPoints(ThisMethod);
299 return GetGeometry().ShapeFunctionsValues(ThisMethod);
425 std::vector<bool>& rOutput,
437 std::vector<int>& rOutput,
449 std::vector<double>& rOutput,
485 std::vector<Vector>& rOutput,
497 std::vector<Matrix>& rOutput,
509 std::vector<ConstitutiveLaw::Pointer>& rValues,
521 const std::vector<bool>& rValues,
533 const std::vector<int>& rValues,
545 const std::vector<double>& rValues,
557 const std::vector<Vector>& rValues,
569 const std::vector<Matrix>& rValues,
581 const std::vector<ConstitutiveLaw::Pointer>& rValues,
637 const Parameters GetSpecifications()
const override;
640 std::string
Info()
const override
642 std::stringstream buffer;
643 buffer <<
"Base Solid Element #" << Id() <<
"\nConstitutive law: " << mConstitutiveLawVector[0]->Info();
650 rOStream <<
"Base Solid Element #" << Id() <<
"\nConstitutive law: " << mConstitutiveLawVector[0]->Info();
656 pGetGeometry()->PrintData(rOStream);
674 std::vector<ConstitutiveLaw::Pointer> mConstitutiveLawVector;
690 mThisIntegrationMethod = ThisIntegrationMethod;
699 mConstitutiveLawVector = ThisConstitutiveLawVector;
729 const bool CalculateStiffnessMatrixFlag,
730 const bool CalculateResidualVectorFlag
770 virtual void CalculateConstitutiveVariables(
777 const bool IsElementRotated =
true
843 const double IntegrationWeight
856 const Vector& rStressVector,
857 const double IntegrationWeight
874 const Vector& rStressVector,
875 const double IntegrationWeight
891 const double IntegrationWeight
917 virtual bool IsElementRotated()
const;
925 void RotateToLocalAxes(
935 void RotateToGlobalAxes(
972 void CalculateLumpedMassVector(
982 void CalculateDampingMatrixWithLumpedMass(
994 template<
class TType>
995 void GetValueOnConstitutiveLaw(
997 std::vector<TType>& rOutput
1002 for (
IndexType point_number = 0; point_number <integration_points.size(); ++point_number ) {
1003 mConstitutiveLawVector[point_number]->GetValue( rVariable,rOutput[point_number]);
1010 void BuildRotationSystem(
1011 BoundedMatrix<double, 3, 3> &rRotationMatrix,
1022 template<
class TType>
1023 void CalculateOnConstitutiveLaw(
1024 const Variable<TType>& rVariable,
1025 std::vector<TType>& rOutput,
1026 const ProcessInfo& rCurrentProcessInfo
1029 const bool is_rotated = IsElementRotated();
1032 const SizeType number_of_nodes = GetGeometry().size();
1037 ConstitutiveVariables this_constitutive_variables(
strain_size);
1040 ConstitutiveLaw::Parameters Values(GetGeometry(),GetProperties(),rCurrentProcessInfo);
1043 Flags& ConstitutiveLawOptions=Values.GetOptions();
1044 ConstitutiveLawOptions.Set(ConstitutiveLaw::USE_ELEMENT_PROVIDED_STRAIN, UseElementProvidedStrain());
1045 ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_STRESS,
true);
1046 ConstitutiveLawOptions.Set(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR,
false);
1048 Values.SetStrainVector(this_constitutive_variables.StrainVector);
1050 for (
IndexType point_number = 0; point_number < integration_points.size(); ++point_number) {
1052 this->CalculateKinematicVariables(this_kinematic_variables, point_number, this->GetIntegrationMethod());
1055 this->SetConstitutiveVariables(this_kinematic_variables, this_constitutive_variables, Values, point_number, integration_points);
1059 RotateToLocalAxes(Values, this_kinematic_variables);
1061 rOutput[point_number] = mConstitutiveLawVector[point_number]->CalculateValue( Values, rVariable, rOutput[point_number] );
1077 friend class Serializer;
1079 void save( Serializer& rSerializer )
const override;
1081 void load( Serializer& rSerializer )
override;
This is base class used to define the solid elements.
Definition: base_solid_element.h:67
void SetValuesOnIntegrationPoints(const Variable< Vector > &rVariable, const std::vector< Vector > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Set a Vector Value on the Element Constitutive Law.
virtual double GetIntegrationWeight(const GeometryType::IntegrationPointsArrayType &rThisIntegrationPoints, const IndexType PointNumber, const double detJ) const
This functions computes the integration weight to consider.
ConstitutiveLaw ConstitutiveLawType
Reference type definition for constitutive laws.
Definition: base_solid_element.h:142
virtual const GeometryType::IntegrationPointsArrayType IntegrationPoints(IntegrationMethod ThisMethod) const
Definition: base_solid_element.h:292
virtual void SetConstitutiveVariables(KinematicVariables &rThisKinematicVariables, ConstitutiveVariables &rThisConstitutiveVariables, ConstitutiveLaw::Parameters &rValues, const IndexType PointNumber, const GeometryType::IntegrationPointsArrayType &IntegrationPoints)
This functions updates the data structure passed to the CL.
Element::Pointer Clone(IndexType NewId, NodesArrayType const &rThisNodes) const override
It creates a new element pointer and clones the previous element data.
void SetValuesOnIntegrationPoints(const Variable< double > &rVariable, const std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Set a double Value on the Element Constitutive Law.
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(BaseSolidElement)
BaseSolidElement(BaseSolidElement const &rOther)
Definition: base_solid_element.h:184
void CalculateOnIntegrationPoints(const Variable< Vector > &rVariable, std::vector< Vector > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a Vector Variable on the Element Constitutive Law.
ConstitutiveLawType::StressMeasure StressMeasureType
StressMeasure from constitutive laws.
Definition: base_solid_element.h:148
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: base_solid_element.h:648
void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< double > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to make the element to assemble an rRHS vector identified by a variable rRH...
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the elemental mass matrix.
void ResetConstitutiveLaw() override
This resets the constitutive law.
std::string Info() const override
Turn back information as a string.
Definition: base_solid_element.h:640
void CalculateOnIntegrationPoints(const Variable< Matrix > &rVariable, std::vector< Matrix > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a Matrix Variable on the Element Constitutive Law.
void InitializeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Called at the beginning of each solution step.
virtual void CalculateKinematicVariables(KinematicVariables &rThisKinematicVariables, const IndexType PointNumber, const GeometryType::IntegrationMethod &rIntegrationMethod)
This functions updates the kinematics variables.
void CalculateShapeGradientOfMassMatrix(MatrixType &rMassMatrix, ShapeParameter Deriv) const
This function computes the shape gradient of mass matrix.
void SetValuesOnIntegrationPoints(const Variable< int > &rVariable, const std::vector< int > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Set a int Value on the Element Constitutive Law.
Matrix & CalculateDeltaDisplacement(Matrix &DeltaDisplacement) const
This methods gives us a matrix with the increment of displacement.
virtual void CalculateAndAddResidualVector(VectorType &rRightHandSideVector, const KinematicVariables &rThisKinematicVariables, const ProcessInfo &rCurrentProcessInfo, const array_1d< double, 3 > &rBodyForce, const Vector &rStressVector, const double IntegrationWeight) const
Calculation of the RHS.
~BaseSolidElement() override
Definition: base_solid_element.h:190
void SetValuesOnIntegrationPoints(const Variable< ConstitutiveLaw::Pointer > &rVariable, const std::vector< ConstitutiveLaw::Pointer > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Set a Constitutive Law Value on the Element.
Element BaseType
The base element type.
Definition: base_solid_element.h:157
Node NodeType
This is the definition of the node.
Definition: base_solid_element.h:154
virtual ConstitutiveLaw::StressMeasure GetStressMeasure() const
Gives the StressMeasure used.
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Sets on rResult the ID's of the element degrees of freedom.
void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a double Variable on the Element Constitutive Law.
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the elemental right hand side vect...
void CalculateOnIntegrationPoints(const Variable< bool > &rVariable, std::vector< bool > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a boolean Variable on the Element Constitutive Law.
virtual bool UseElementProvidedStrain() const
This method returns if the element provides the strain.
double CalculateDerivativesOnCurrentConfiguration(Matrix &rJ, Matrix &rInvJ, Matrix &rDN_DX, const IndexType PointNumber, IntegrationMethod ThisIntegrationMethod) const
This functions calculate the derivatives in the current frame.
BaseSolidElement(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: base_solid_element.h:173
virtual bool UseGeometryIntegrationMethod() const
Definition: base_solid_element.h:282
void GetSecondDerivativesVector(Vector &rValues, int Step=0) const override
Sets on rValues the nodal accelerations.
BaseSolidElement()
Definition: base_solid_element.h:169
void SetValuesOnIntegrationPoints(const Variable< array_1d< double, 3 >> &rVariable, const std::vector< array_1d< double, 3 >> &rValues, const ProcessInfo &rCurrentProcessInfo) override
Set a array of 3 compoenents Value on the Element.
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 6 >> &rVariable, std::vector< array_1d< double, 6 >> &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a 6 components array_1d on the Element Constitutive Law.
virtual void InitializeMaterial()
It initializes the material.
KRATOS_DEFINE_LOCAL_FLAG(ROTATED)
ConstitutiveLawType::Pointer ConstitutiveLawPointerType
Pointer type for constitutive laws.
Definition: base_solid_element.h:145
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Called to initialize the element.
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Sets on rElementalDofList the degrees of freedom of the considered element geometry.
void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< array_1d< double, 3 > > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to make the element to assemble an rRHS vector identified by a variable rRH...
BaseSolidElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: base_solid_element.h:177
void InitializeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
This is called for non-linear analysis at the beginning of the iteration process.
void CalculateOnIntegrationPoints(const Variable< ConstitutiveLaw::Pointer > &rVariable, std::vector< ConstitutiveLaw::Pointer > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Get on rVariable Constitutive Law from the element.
GeometryData::IntegrationMethod IntegrationMethod
Type definition for integration methods.
Definition: base_solid_element.h:151
void CalculateAndAddExtForceContribution(const Vector &rN, const ProcessInfo &rCurrentProcessInfo, const array_1d< double, 3 > &rBodyForce, VectorType &rRightHandSideVector, const double IntegrationWeight) const
This function add the external force contribution.
void SetValuesOnIntegrationPoints(const Variable< Matrix > &rVariable, const std::vector< Matrix > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Set a Matrix Value on the Element Constitutive Law.
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the elemental left hand side matri...
int Check(const ProcessInfo &rCurrentProcessInfo) const override
This function provides the place to perform checks on the completeness of the input.
void SetConstitutiveLawVector(const std::vector< ConstitutiveLaw::Pointer > &ThisConstitutiveLawVector)
Sets the used constitutive laws.
Definition: base_solid_element.h:697
void FinalizeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
This is called for non-linear analysis at the beginning of the iteration process.
void SetValuesOnIntegrationPoints(const Variable< bool > &rVariable, const std::vector< bool > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Set a bool Value on the Element Constitutive Law.
void FinalizeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Called at the end of eahc solution step.
virtual const GeometryType::IntegrationPointsArrayType IntegrationPoints() const
Definition: base_solid_element.h:287
IntegrationMethod GetIntegrationMethod() const override
Returns the used integration method.
Definition: base_solid_element.h:272
virtual void CalculateAndAddKm(MatrixType &rLeftHandSideMatrix, const Matrix &B, const Matrix &D, const double IntegrationWeight) const
Calculation of the Material Stiffness Matrix. Km = B^T * D *B.
virtual double CalculateDerivativesOnReferenceConfiguration(Matrix &rJ0, Matrix &rInvJ0, Matrix &rDN_DX, const IndexType PointNumber, IntegrationMethod ThisIntegrationMethod) const
This functions calculate the derivatives in the reference frame.
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 3 >> &rVariable, std::vector< array_1d< double, 3 >> &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a 3 components array_1d on the Element Constitutive Law.
virtual array_1d< double, 3 > GetBodyForce(const GeometryType::IntegrationPointsArrayType &IntegrationPoints, const IndexType PointNumber) const
This function computes the body force.
void GetValuesVector(Vector &rValues, int Step=0) const override
Sets on rValues the nodal displacements.
void GetFirstDerivativesVector(Vector &rValues, int Step=0) const override
Sets on rValues the nodal velocities.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: base_solid_element.h:654
virtual void CalculateAll(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo, const bool CalculateStiffnessMatrixFlag, const bool CalculateResidualVectorFlag)
This functions calculates both the RHS and the LHS.
void CalculateOnIntegrationPoints(const Variable< int > &rVariable, std::vector< int > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Calculate a integer Variable on the Element Constitutive Law.
void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the elemental damping matrix.
void CalculateAndAddKg(MatrixType &rLeftHandSideMatrix, const Matrix &DN_DX, const Vector &rStressVector, const double IntegrationWeight) const
Calculation of the Geometric Stiffness Matrix. Kg = dB * S.
void SetIntegrationMethod(const IntegrationMethod &ThisIntegrationMethod)
Sets the used integration method.
Definition: base_solid_element.h:688
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
This function provides a more general interface to the element.
virtual const Matrix & ShapeFunctionsValues(IntegrationMethod ThisMethod) const
Definition: base_solid_element.h:297
Definition: constitutive_law.h:47
StressMeasure
Definition: constitutive_law.h:69
@ StressMeasure_PK2
Definition: constitutive_law.h:71
Base class for all Elements.
Definition: element.h:60
std::size_t SizeType
Definition: element.h:94
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
IntegrationMethod
Definition: geometry_data.h:76
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
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
void SetValuesOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const std::vector< TDataType > &values, const ProcessInfo &rCurrentProcessInfo)
Definition: add_mesh_to_python.cpp:185
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
int strain_size
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:16
F
Definition: hinsberg_optimization.py:144
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
def load(f)
Definition: ode_solve.py:307
N
Definition: sensitivityMatrix.py:29
B
Definition: sensitivityMatrix.py:76
Definition: base_solid_element.h:112
ConstitutiveLaw::VoigtSizeMatrixType D
Definition: base_solid_element.h:114
ConstitutiveVariables(const SizeType StrainSize)
Definition: base_solid_element.h:120
ConstitutiveLaw::StressVectorType StressVector
Definition: base_solid_element.h:113
ConstitutiveLaw::StrainVectorType StrainVector
Definition: base_solid_element.h:112
Definition: base_solid_element.h:73
KinematicVariables(const SizeType StrainSize, const SizeType Dimension, const SizeType NumberOfNodes)
Definition: base_solid_element.h:89
Definition: constitutive_law.h:189
Definition: geometrical_sensitivity_utility.h:33