8 #if !defined(KRATOS_TRUSS_ELEMENT_H_INCLUDED)
9 #define KRATOS_TRUSS_ELEMENT_H_INCLUDED
45 GeometryType::Pointer pGeometry)
52 GeometryType::Pointer pGeometry,
53 PropertiesType::Pointer pProperties)
54 :
Element(NewId, pGeometry, pProperties)
72 GeometryType::Pointer pGeom,
73 PropertiesType::Pointer pProperties
76 return Kratos::make_intrusive<TrussElement>(
77 NewId, pGeom, pProperties);
84 PropertiesType::Pointer pProperties
87 return Kratos::make_intrusive<TrussElement>(
119 const SizeType nb_dofs = nb_nodes * 3;
121 if (rRightHandSideVector.size() != nb_dofs)
122 rRightHandSideVector.
resize(nb_dofs);
127 CalculateAll(left_hand_side_matrix, rRightHandSideVector,
128 rCurrentProcessInfo,
false,
true);
137 const SizeType nb_dofs = nb_nodes * 3;
141 if (rLeftHandSideMatrix.size1() != nb_dofs && rLeftHandSideMatrix.size2() != nb_dofs)
142 rLeftHandSideMatrix.
resize(nb_dofs, nb_dofs);
145 CalculateAll(rLeftHandSideMatrix, right_hand_side_vector,
146 rCurrentProcessInfo,
true,
false);
156 const SizeType nb_dofs = nb_nodes * 3;
158 if (rRightHandSideVector.size() != nb_dofs)
159 rRightHandSideVector.
resize(nb_dofs);
162 if (rLeftHandSideMatrix.size1() != nb_dofs && rLeftHandSideMatrix.size2() != nb_dofs)
163 rLeftHandSideMatrix.
resize(nb_dofs, nb_dofs);
167 rCurrentProcessInfo,
true,
true);
174 const bool ComputeLeftHandSide,
175 const bool ComputeRightHandSide);
220 const ProcessInfo &rCurrentProcessInfo)
const override;
225 int Step = 0)
const override;
230 int Step = 0)
const override;
235 int Step = 0)
const override;
243 std::vector<double>& rOutput,
254 rOStream <<
"\"TrussElement\" #" <<
Id()
255 <<
" with geometry #" << this->
GetGeometry().
Id() <<
" with center in: "
264 std::vector<array_1d<double, 3>> mReferenceBaseVector;
267 std::vector<ConstitutiveLaw::Pointer> mConstitutiveLawVector;
274 void InitializeMaterial();
280 void CalculateGreenLagrangeStrain(
281 std::vector<double>& rGreenLagrangeVector)
const;
283 void CalculateTangentModulus(
284 std::vector<double>& rTangentModulusVector,
288 double CalculatePrestressPK2(
double reference_a,
double actual_a)
const;
291 void CalculateStressPK2(
292 std::vector<double>& rStressVector,
296 void CalculateStressCauchy(
297 std::vector<double>& rStressVector,
306 void save(
Serializer& rSerializer)
const override
309 rSerializer.
save(
"ReferenceBaseVector", mReferenceBaseVector);
310 rSerializer.
save(
"ConstitutiveLawVector", mConstitutiveLawVector);
315 rSerializer.
load(
"ReferenceBaseVector", mReferenceBaseVector);
316 rSerializer.
load(
"ConstitutiveLawVector", mConstitutiveLawVector);
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
Matrix MatrixType
Definition: element.h:90
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
virtual Point Center() const
Definition: geometry.h:1514
IndexType Id() const
Definition: indexed_object.h:107
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
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
Definition: truss_element.h:27
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Definition: truss_element.cpp:63
void GetValuesVector(Vector &rValues, int Step=0) const override
Get Displacemnts.
Definition: truss_element.cpp:582
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Computes RHS.
Definition: truss_element.h:114
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create with Id, pointer to geometry and pointer to property.
Definition: truss_element.h:81
void GetSecondDerivativesVector(Vector &rValues, int Step=0) const override
Get Accelerations.
Definition: truss_element.cpp:620
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Computes LHS and RHS.
Definition: truss_element.h:150
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Sets the ID's of the element degrees of freedom.
Definition: truss_element.cpp:20
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Check provided parameters.
Definition: truss_element.cpp:680
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(TrussElement)
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Computes LHS.
Definition: truss_element.h:132
std::size_t IndexType
Definition: truss_element.h:36
void CalculateAll(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo, const bool ComputeLeftHandSide, const bool ComputeRightHandSide)
Definition: truss_element.cpp:111
void FinalizeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Updates the constitutive law.
Definition: truss_element.cpp:205
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Create with Id, pointer to geometry and pointer to property.
Definition: truss_element.h:70
bool HasSelfWeight() const
Checks if volume acceleration is bigger than 0.
Definition: truss_element.cpp:393
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...
Definition: truss_element.cpp:405
TrussElement(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using an array of nodes.
Definition: truss_element.h:43
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Calculates the mass matrix with use of the lumped mass vector.
Definition: truss_element.cpp:525
~TrussElement() override=default
Destructor.
void GetFirstDerivativesVector(Vector &rValues, int Step=0) const override
Get Velocities.
Definition: truss_element.cpp:601
void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: truss_element.cpp:643
void CalculateLumpedMassVector(VectorType &rLumpedMassVector, const ProcessInfo &rCurrentProcessInfo) const override
Calculates lumped mass vector.
Definition: truss_element.cpp:549
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Relates the degrees of freedom of the element geometry.
Definition: truss_element.cpp:41
void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: truss_element.cpp:487
TrussElement()
Default constructor necessary for serialization.
Definition: truss_element.h:58
TrussElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor using an array of nodes with properties.
Definition: truss_element.h:50
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: truss_element.h:253
void CalculateBodyForces(Vector &rBodyForces)
Definition: truss_element.cpp:357
std::size_t SizeType
Size types.
Definition: truss_element.h:35
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
def load(f)
Definition: ode_solve.py:307