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.
beam_point_rigid_contact_condition.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosContactMechanicsApplication $
3 // Last modified by: $Author: JMCarbonell $
4 // Date: $Date: July 2013 $
5 // Revision: $Revision: 0.0 $
6 //
7 //
8 
9 #if !defined(KRATOS_BEAM_POINT_RIGID_CONTACT_CONDITION_H_INCLUDED )
10 #define KRATOS_BEAM_POINT_RIGID_CONTACT_CONDITION_H_INCLUDED
11 
12 
13 
14 // System includes
15 
16 // External includes
17 #include "boost/smart_ptr.hpp"
18 
19 // Project includes
20 #include "includes/define.h"
21 #include "includes/serializer.h"
22 #include "includes/condition.h"
24 #include "includes/variables.h"
26 
28 
29 namespace Kratos
30 {
45 
47 
52 class KRATOS_API(CONTACT_MECHANICS_APPLICATION) BeamPointRigidContactCondition
53  : public Condition
54 {
55 public:
56 
58 
60  //typedef BoundedVector<double, 3> PointType;
62 
65 
67  // Counted pointer of BeamPointRigidContactCondition
70 
71 protected:
72 
77  KRATOS_DEFINE_LOCAL_FLAG( COMPUTE_RHS_VECTOR );
78  KRATOS_DEFINE_LOCAL_FLAG( COMPUTE_LHS_MATRIX );
79  KRATOS_DEFINE_LOCAL_FLAG( COMPUTE_RHS_VECTOR_WITH_COMPONENTS );
80  KRATOS_DEFINE_LOCAL_FLAG( COMPUTE_LHS_MATRIX_WITH_COMPONENTS );
81 
82 
87  typedef struct
88  {
89  PointType Normal; //normal direction
90  PointType Tangent; //tangent direction
91 
92  } SurfaceVector;
93 
94  typedef struct
95  {
96  double Normal; //normal component
97  double Tangent; //tangent component
98 
99  } SurfaceScalar;
100 
101  typedef struct
102  {
103  Flags Options; //calculation options
104 
105  //Geometrical gaps:
106  SurfaceScalar Gap; //normal and tangential gap
107 
108  //Friction:
109  PointType RelativeDisplacement; //relative displacement
110  double FrictionCoefficient; //total friction coeffitient mu
111 
112  SurfaceScalar Penalty; //Penalty Parameter normal and tangent
113 
114  //Geometric variables
115  SurfaceVector Surface; //normal and tangent vector to the surface
116 
117 
118  //for axisymmetric use only
121 
122 
124 
125 
134  {
135  private:
136 
137  //for calculation local system with compacted LHS and RHS
138  MatrixType *mpLeftHandSideMatrix;
139  VectorType *mpRightHandSideVector;
140 
141  //for calculation local system with LHS and RHS components
142  std::vector<MatrixType> *mpLeftHandSideMatrices;
143  std::vector<VectorType> *mpRightHandSideVectors;
144 
145  //LHS variable components
146  const std::vector< Variable< MatrixType > > *mpLeftHandSideVariables;
147 
148  //RHS variable components
149  const std::vector< Variable< VectorType > > *mpRightHandSideVariables;
150 
151 
152  public:
153 
154  //calculation flags
156 
160  void SetLeftHandSideMatrix( MatrixType& rLeftHandSideMatrix ) { mpLeftHandSideMatrix = &rLeftHandSideMatrix; };
161  void SetLeftHandSideMatrices( std::vector<MatrixType>& rLeftHandSideMatrices ) { mpLeftHandSideMatrices = &rLeftHandSideMatrices; };
162  void SetLeftHandSideVariables(const std::vector< Variable< MatrixType > >& rLeftHandSideVariables ) { mpLeftHandSideVariables = &rLeftHandSideVariables; };
163 
164  void SetRightHandSideVector( VectorType& rRightHandSideVector ) { mpRightHandSideVector = &rRightHandSideVector; };
165  void SetRightHandSideVectors( std::vector<VectorType>& rRightHandSideVectors ) { mpRightHandSideVectors = &rRightHandSideVectors; };
166  void SetRightHandSideVariables(const std::vector< Variable< VectorType > >& rRightHandSideVariables ) { mpRightHandSideVariables = &rRightHandSideVariables; };
167 
168 
172  MatrixType& GetLeftHandSideMatrix() { return *mpLeftHandSideMatrix; };
173  std::vector<MatrixType>& GetLeftHandSideMatrices() { return *mpLeftHandSideMatrices; };
174  const std::vector< Variable< MatrixType > >& GetLeftHandSideVariables() { return *mpLeftHandSideVariables; };
175 
176  VectorType& GetRightHandSideVector() { return *mpRightHandSideVector; };
177  std::vector<VectorType>& GetRightHandSideVectors() { return *mpRightHandSideVectors; };
178  const std::vector< Variable< VectorType > >& GetRightHandSideVariables() { return *mpRightHandSideVariables; };
179 
180  };
181 
182 
183 public:
184 
185 
188 
190  BeamPointRigidContactCondition( IndexType NewId, GeometryType::Pointer pGeometry );
191 
192  BeamPointRigidContactCondition( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties );
193 
194 
195  BeamPointRigidContactCondition( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties, SpatialBoundingBox::Pointer pRigidWall );
196 
199 
202 
206 
207 
211 
219  Condition::Pointer Create(IndexType NewId,
220  NodesArrayType const& ThisNodes,
221  PropertiesType::Pointer pProperties ) const;
222 
223 
231  Condition::Pointer Clone(IndexType NewId,
232  NodesArrayType const& ThisNodes) const;
233 
234 
235  //************* STARTING - ENDING METHODS
236 
237 
241  void InitializeNonLinearIteration(ProcessInfo& rCurrentProcessInfo);
242 
243 
247  void FinalizeNonLinearIteration(ProcessInfo& rCurrentProcessInfo);
248 
249 
253  virtual void InitializeSolutionStep(ProcessInfo& rCurrentProcessInfo);
254 
255 
259  void FinalizeSolutionStep(ProcessInfo& rCurrentProcessInfo);
260 
261 
262  //************* GETTING METHODS
263 
267  void GetDofList(DofsVectorType& rConditionDofList,
268  ProcessInfo& rCurrentProcessInfo );
269 
273  void EquationIdVector(EquationIdVectorType& rResult,
274  ProcessInfo& rCurrentProcessInfo );
275 
279  void GetValuesVector(Vector& rValues,
280  int Step = 0 );
281 
285  void GetFirstDerivativesVector(Vector& rValues,
286  int Step = 0 );
287 
291  void GetSecondDerivativesVector(Vector& rValues,
292  int Step = 0 );
293 
294 
295  //************* COMPUTING METHODS
296 
305  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
306  VectorType& rRightHandSideVector,
307  ProcessInfo& rCurrentProcessInfo );
308 
309 
319  void CalculateLocalSystem(std::vector< MatrixType >& rLeftHandSideMatrices,
320  const std::vector< Variable< MatrixType > >& rLHSVariables,
321  std::vector< VectorType >& rRightHandSideVectors,
322  const std::vector< Variable< VectorType > >& rRHSVariables,
323  ProcessInfo& rCurrentProcessInfo);
324 
331  void CalculateRightHandSide(VectorType& rRightHandSideVector,
332  ProcessInfo& rCurrentProcessInfo );
333 
334 
342  void CalculateRightHandSide(std::vector< VectorType >& rRightHandSideVectors,
343  const std::vector< Variable< VectorType > >& rRHSVariables,
344  ProcessInfo& rCurrentProcessInfo);
345 
352  void CalculateMassMatrix(
353  MatrixType& rMassMatrix,
354  ProcessInfo& rCurrentProcessInfo );
355 
362  void CalculateDampingMatrix(
363  MatrixType& rDampingMatrix,
364  ProcessInfo& rCurrentProcessInfo );
365 
366 
376  virtual void AddExplicitContribution(const VectorType& rRHSVector,
377  const Variable<VectorType>& rRHSVariable,
378  const Variable<array_1d<double,3> >& rDestinationVariable,
379  const ProcessInfo& rCurrentProcessInfo);
380 
381  //************************************************************************************
382  //************************************************************************************
390  virtual int Check( const ProcessInfo& rCurrentProcessInfo );
391 
392 
397  void SetRigidWall(SpatialBoundingBox::Pointer pRigidWall);
398 
399 
413 
414 protected:
421 
426 
427 
431  SpatialBoundingBox::Pointer mpRigidWall;
432 
433 
440 
444  void ClearNodalForces ();
445 
446 
451  virtual void InitializeSystemMatrices(MatrixType& rLeftHandSideMatrix,
452  VectorType& rRightHandSideVector,
453  Flags& rCalculationFlags);
454 
458  virtual void InitializeConditionVariables(ConditionVariables& rVariables,
459  const ProcessInfo& rCurrentProcessInfo);
460 
464  virtual void CalculateKinematics(ConditionVariables& rVariables,
465  const ProcessInfo& rCurrentProcessInfo,
466  const double& rPointNumber);
467 
471  virtual double& CalculateIntegrationWeight(double& rIntegrationWeight);
472 
473 
477  virtual void CalculateConditionSystem(LocalSystemComponents& rLocalSystem,
478  ProcessInfo& rCurrentProcessInfo);
479 
480 
484  virtual void CalculateAndAddLHS(LocalSystemComponents& rLocalSystem,
485  ConditionVariables& rVariables,
486  double& rIntegrationWeight);
487 
491  virtual void CalculateAndAddRHS(LocalSystemComponents& rLocalSystem,
492  ConditionVariables& rVariables,
493  double& rIntegrationWeight);
494 
495 
499  virtual void CalculateAndAddKuug(MatrixType& rLeftHandSideMatrix,
500  ConditionVariables& rVariables,
501  double& rIntegrationWeight);
502 
503 
507  virtual void CalculateAndAddContactForces(Vector& rRightHandSideVector,
508  ConditionVariables& rVariables,
509  double& rIntegrationWeight );
510 
514 
515 
519 
520 
524 
525 
527 
528 private:
531 
532 
536 
540 
541 
545 
546 
550 
551 
555 
559 
560  friend class Serializer;
561 
562  virtual void save( Serializer& rSerializer ) const
563  {
565  }
566 
567  virtual void load( Serializer& rSerializer )
568  {
570  }
571 
572 
573 }; // class BeamPointRigidContactCondition.
574 
575 } // namespace Kratos.
576 
577 #endif // KRATOS_BEAM_POINT_RIGID_CONTACT_CONDITION_H_INCLUDED defined
Definition: beam_math_utilities.hpp:31
Beam Point Rigid Contact Condition for 3D and 2D geometries. (base class)
Definition: beam_point_rigid_contact_condition.hpp:54
array_1d< double, 3 > PointType
Tensor order 1 definition.
Definition: beam_point_rigid_contact_condition.hpp:61
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_LHS_MATRIX_WITH_COMPONENTS)
BeamPointRigidContactCondition()
Definition: beam_point_rigid_contact_condition.hpp:420
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_LHS_MATRIX)
SpatialBoundingBox::Pointer mpRigidWall
Definition: beam_point_rigid_contact_condition.hpp:431
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_RHS_VECTOR)
IntegrationMethod mThisIntegrationMethod
Definition: beam_point_rigid_contact_condition.hpp:420
BeamMathUtils< double > BeamMathUtilsType
Type definition for beam utilities.
Definition: beam_point_rigid_contact_condition.hpp:64
void SetRigidWall(SpatialBoundingBox::Pointer pRigidWall)
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(BeamPointRigidContactCondition)
KRATOS_DEFINE_LOCAL_FLAG(COMPUTE_RHS_VECTOR_WITH_COMPONENTS)
Base class for all Conditions.
Definition: condition.h:59
Definition: flags.h:58
IntegrationMethod
Definition: geometry_data.h:76
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
#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
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
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307
Definition: beam_point_rigid_contact_condition.hpp:102
SurfaceScalar Penalty
Definition: beam_point_rigid_contact_condition.hpp:112
double ReferenceRadius
Definition: beam_point_rigid_contact_condition.hpp:120
SurfaceScalar Gap
Definition: beam_point_rigid_contact_condition.hpp:106
SurfaceVector Surface
Definition: beam_point_rigid_contact_condition.hpp:115
PointType RelativeDisplacement
Definition: beam_point_rigid_contact_condition.hpp:109
Flags Options
Definition: beam_point_rigid_contact_condition.hpp:103
double FrictionCoefficient
Definition: beam_point_rigid_contact_condition.hpp:110
double CurrentRadius
Definition: beam_point_rigid_contact_condition.hpp:119
Definition: beam_point_rigid_contact_condition.hpp:134
const std::vector< Variable< VectorType > > & GetRightHandSideVariables()
Definition: beam_point_rigid_contact_condition.hpp:178
void SetRightHandSideVector(VectorType &rRightHandSideVector)
Definition: beam_point_rigid_contact_condition.hpp:164
Flags CalculationFlags
Definition: beam_point_rigid_contact_condition.hpp:155
void SetLeftHandSideVariables(const std::vector< Variable< MatrixType > > &rLeftHandSideVariables)
Definition: beam_point_rigid_contact_condition.hpp:162
void SetLeftHandSideMatrices(std::vector< MatrixType > &rLeftHandSideMatrices)
Definition: beam_point_rigid_contact_condition.hpp:161
const std::vector< Variable< MatrixType > > & GetLeftHandSideVariables()
Definition: beam_point_rigid_contact_condition.hpp:174
std::vector< MatrixType > & GetLeftHandSideMatrices()
Definition: beam_point_rigid_contact_condition.hpp:173
VectorType & GetRightHandSideVector()
Definition: beam_point_rigid_contact_condition.hpp:176
MatrixType & GetLeftHandSideMatrix()
Definition: beam_point_rigid_contact_condition.hpp:172
std::vector< VectorType > & GetRightHandSideVectors()
Definition: beam_point_rigid_contact_condition.hpp:177
void SetLeftHandSideMatrix(MatrixType &rLeftHandSideMatrix)
Definition: beam_point_rigid_contact_condition.hpp:160
void SetRightHandSideVariables(const std::vector< Variable< VectorType > > &rRightHandSideVariables)
Definition: beam_point_rigid_contact_condition.hpp:166
void SetRightHandSideVectors(std::vector< VectorType > &rRightHandSideVectors)
Definition: beam_point_rigid_contact_condition.hpp:165
Definition: beam_point_rigid_contact_condition.hpp:95
double Normal
Definition: beam_point_rigid_contact_condition.hpp:96
double Tangent
Definition: beam_point_rigid_contact_condition.hpp:97
Definition: beam_point_rigid_contact_condition.hpp:88
PointType Tangent
Definition: beam_point_rigid_contact_condition.hpp:90
PointType Normal
Definition: beam_point_rigid_contact_condition.hpp:89