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.
cr_beam_element_3D2N.hpp
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Klaus B. Sautter
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/element.h"
20 #include "includes/define.h"
21 #include "includes/variables.h"
22 #include "includes/serializer.h"
23 
24 namespace Kratos
25 {
34 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) CrBeamElement3D2N : public Element
35 {
36 protected:
37  //const values
38  static constexpr int msNumberOfNodes = 2;
39  static constexpr int msDimension = 3;
40  static constexpr unsigned int msLocalSize = msNumberOfNodes * msDimension;
41  static constexpr unsigned int msElementSize = msLocalSize * 2;
42 
43 public:
45 
46 
47  typedef Element BaseType;
55  typedef BaseType::EquationIdVectorType EquationIdVectorType;
56  typedef BaseType::DofsVectorType DofsVectorType;
57 
59  CrBeamElement3D2N(IndexType NewId, GeometryType::Pointer pGeometry);
60  CrBeamElement3D2N(IndexType NewId, GeometryType::Pointer pGeometry,
61  PropertiesType::Pointer pProperties);
62 
63 
64  ~CrBeamElement3D2N() override;
65 
73  Element::Pointer Create(
74  IndexType NewId,
75  GeometryType::Pointer pGeom,
76  PropertiesType::Pointer pProperties
77  ) const override;
78 
86  Element::Pointer Create(
87  IndexType NewId,
88  NodesArrayType const& ThisNodes,
89  PropertiesType::Pointer pProperties
90  ) const override;
91 
92  void EquationIdVector(
93  EquationIdVectorType& rResult,
94  const ProcessInfo& rCurrentProcessInfo) const override;
95 
96  void GetDofList(
97  DofsVectorType& rElementalDofList,
98  const ProcessInfo& rCurrentProcessInfo) const override;
99 
103  BoundedMatrix<double,msElementSize,msElementSize> CreateElementStiffnessMatrix_Material() const;
104 
108  BoundedMatrix<double,msElementSize,msElementSize> CreateElementStiffnessMatrix_Geometry() const;
109 
113  virtual BoundedMatrix<double,msLocalSize,msLocalSize> CalculateDeformationStiffness() const;
114 
118  BoundedMatrix<double,msElementSize,msLocalSize> CalculateTransformationS() const;
119 
123  BoundedVector<double,msLocalSize> GetCurrentNodalPosition() const;
124 
128  BoundedVector<double,msLocalSize> CalculateElementForces() const;
129 
133  BoundedMatrix<double,msElementSize,msElementSize> CalculateInitialLocalCS() const;
134 
135 
139  BoundedMatrix<double,msDimension,msDimension> UpdateRotationMatrixLocal(Vector& Bisectrix, Vector& VectorDifference) const;
140 
141  void SaveQuaternionParameters();
142 
143  void CalculateLocalSystem(
144  MatrixType& rLeftHandSideMatrix,
145  VectorType& rRightHandSideVector,
146  const ProcessInfo& rCurrentProcessInfo) override;
147 
148  void ConstCalculateLocalSystem(
149  MatrixType& rLeftHandSideMatrix,
150  VectorType& rRightHandSideVector,
151  const ProcessInfo& rCurrentProcessInfo) const;
152 
153  void CalculateRightHandSide(
154  VectorType& rRightHandSideVector,
155  const ProcessInfo& rCurrentProcessInfo) override;
156 
157  void CalculateLeftHandSide(
158  MatrixType& rLeftHandSideMatrix,
159  const ProcessInfo& rCurrentProcessInfo) override;
160 
161  virtual void ConstCalculateRightHandSide(
162  VectorType& rRightHandSideVector,
163  const ProcessInfo& rCurrentProcessInfo) const;
164 
165  void ConstCalculateLeftHandSide(
166  MatrixType& rLeftHandSideMatrix,
167  const ProcessInfo& rCurrentProcessInfo) const;
168 
169  void CalculateMassMatrix(
170  MatrixType& rMassMatrix,
171  const ProcessInfo& rCurrentProcessInfo) override;
172 
173 
179  void CalculateLumpedMassMatrix(
180  MatrixType& rMassMatrix,
181  const ProcessInfo& rCurrentProcessInfo) const;
182 
183 
189  void CalculateConsistentMassMatrix(
190  MatrixType& rMassMatrix,
191  const ProcessInfo& rCurrentProcessInfo) const;
192 
193 
203  void BuildSingleMassMatrix(
204  MatrixType& rMassMatrix,
205  const double Phi, const double CT, const double CR, const double L, const double dir) const;
206 
207  void CalculateDampingMatrix(
208  MatrixType& rDampingMatrix,
209  const ProcessInfo& rCurrentProcessInfo) override;
210 
211  void AddExplicitContribution(const VectorType& rRHSVector,
212  const Variable<VectorType>& rRHSVariable,
213  const Variable<array_1d<double, 3> >& rDestinationVariable,
214  const ProcessInfo& rCurrentProcessInfo) override;
215 
216  void GetValuesVector(
217  Vector& rValues,
218  int Step = 0) const override;
219 
220  void GetSecondDerivativesVector(
221  Vector& rValues,
222  int Step = 0) const override;
223 
224  void GetFirstDerivativesVector(
225  Vector& rValues,
226  int Step = 0) const override;
227 
233  void AssembleSmallInBigMatrix(
234  const Matrix& rSmallMatrix,
236  ) const;
237 
238  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
239 
240 
246  double CalculatePsi(const double I, const double A_eff) const;
247 
251  double CalculateShearModulus() const;
252 
256  BoundedVector<double,msElementSize> CalculateBodyForces() const;
257 
258  void Calculate(const Variable<Matrix>& rVariable, Matrix& rOutput,
259  const ProcessInfo& rCurrentProcessInfo) override;
260 
262  const Variable<array_1d<double, 3 > >& rVariable,
263  std::vector< array_1d<double, 3 > >& rOutput,
264  const ProcessInfo& rCurrentProcessInfo) override;
265 
266  IntegrationMethod GetIntegrationMethod() const override;
267 
268 
275  void CalculateAndAddWorkEquivalentNodalForcesLineLoad(
276  const BoundedVector<double,msDimension> ForceInput,
277  BoundedVector<double,msElementSize>& rRightHandSideVector,
278  const double GeometryLength) const;
279 
280 
284  Vector CalculateSymmetricDeformationMode() const;
285 
289  Vector CalculateAntiSymmetricDeformationMode() const;
290 
296  Vector CalculateLocalNodalForces() const;
297 
298  void FinalizeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
299 
300  Vector CalculateGlobalNodalForces() const;
301 
302  Vector GetIncrementDeformation() const;
303 
304  BoundedMatrix<double, msElementSize, msElementSize> GetTransformationMatrixGlobal() const;
305 
306  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
307 
308 
309  void UpdateQuaternionParameters(double& rScalNodeA,double& rScalNodeB,
310  Vector& rVecNodeA,Vector& rVecNodeB) const;
311 
312  const Parameters GetSpecifications() const override;
313 
314 private:
315 
316 
317  Vector mDeformationCurrentIteration = ZeroVector(msElementSize);
318  Vector mDeformationPreviousIteration = ZeroVector(msElementSize);
319  Vector mQuaternionVEC_A = ZeroVector(msDimension);
320  Vector mQuaternionVEC_B = ZeroVector(msDimension);
321  double mQuaternionSCA_A = 1.00;
322  double mQuaternionSCA_B = 1.00;
323 
324 
325 
326 
327  friend class Serializer;
328  void save(Serializer& rSerializer) const override;
329  void load(Serializer& rSerializer) override;
330 
331 };
332 
333 
334 }
This is a 3D-2node beam element with 3 translational dofs and 3 rotational dof per node.
Definition: cr_beam_element_3D2N.hpp:35
BaseType::VectorType VectorType
Definition: cr_beam_element_3D2N.hpp:54
Element BaseType
Definition: cr_beam_element_3D2N.hpp:47
BaseType::MatrixType MatrixType
Definition: cr_beam_element_3D2N.hpp:53
BaseType::SizeType SizeType
Definition: cr_beam_element_3D2N.hpp:52
BaseType::EquationIdVectorType EquationIdVectorType
Definition: cr_beam_element_3D2N.hpp:55
BaseType::IndexType IndexType
Definition: cr_beam_element_3D2N.hpp:51
BaseType::GeometryType GeometryType
Definition: cr_beam_element_3D2N.hpp:48
BaseType::NodesArrayType NodesArrayType
Definition: cr_beam_element_3D2N.hpp:49
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(CrBeamElement3D2N)
BaseType::DofsVectorType DofsVectorType
Definition: cr_beam_element_3D2N.hpp:56
BaseType::PropertiesType PropertiesType
Definition: cr_beam_element_3D2N.hpp:50
CrBeamElement3D2N()
Definition: cr_beam_element_3D2N.hpp:58
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Defines the index type.
Definition: geometrical_object.h:73
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
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
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
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
std::size_t SizeType
Definition: nurbs_utilities.h:41
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
TDataType Calculate(GeometryType &dummy, const Variable< TDataType > &rVariable)
Definition: add_geometries_to_python.cpp:103
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
Properties PropertiesType
Definition: regenerate_pfem_pressure_conditions_process.h:26
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307
int L
Definition: ode_solve.py:390
def Phi(t)
Definition: quadrature.py:273
dir
Definition: radii_error_plotter.py:10