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.
List of all members
Kratos::ContactMasterSlaveConstraint Class Reference

This is a constraint for contact mechanics based in a linear kinematic MPC constriant. More...

#include <contact_master_slave_constraint.h>

Inheritance diagram for Kratos::ContactMasterSlaveConstraint:
Collaboration diagram for Kratos::ContactMasterSlaveConstraint:

Public Member Functions

Life Cycle
 ContactMasterSlaveConstraint (IndexType Id=0)
 The default constructor. More...
 
 ContactMasterSlaveConstraint (IndexType Id, DofPointerVectorType &rMasterDofsVector, DofPointerVectorType &rSlaveDofsVector, const MatrixType &rRelationMatrix, const VectorType &rConstantVector)
 Constructor by passing a vector of Master and slave dofs and corresponding Matrix and constant vector. More...
 
 ContactMasterSlaveConstraint (IndexType Id, Node &rMasterNode, const VariableType &rMasterVariable, Node &rSlaveNode, const VariableType &rSlaveVariable, const double Weight, const double Constant)
 Constructor by passing a single Master and slave dofs and corresponding weight and constant for a variable component. More...
 
 ~ContactMasterSlaveConstraint () override
 Destructor. More...
 
 ContactMasterSlaveConstraint (const ContactMasterSlaveConstraint &rOther)
 Copy Constructor. More...
 
ContactMasterSlaveConstraintoperator= (const ContactMasterSlaveConstraint &rOther)
 Assignment operator. More...
 
Operations
MasterSlaveConstraint::Pointer Create (IndexType Id, DofPointerVectorType &rMasterDofsVector, DofPointerVectorType &rSlaveDofsVector, const MatrixType &rRelationMatrix, const VectorType &rConstantVector) const override
 Create method by passing a single Master and slave dofs and corresponding weight and constant for a variable component. More...
 
MasterSlaveConstraint::Pointer Create (IndexType Id, Node &rMasterNode, const VariableType &rMasterVariable, Node &rSlaveNode, const VariableType &rSlaveVariable, const double Weight, const double Constant) const override
 Create method by passing a single Master and slave dofs and corresponding weight and constant for a variable component. More...
 
void FinalizeNonLinearIteration (const ProcessInfo &rCurrentProcessInfo) override
 This is called for non-linear analysis at the end of the iteration process. More...
 
Input and output
std::string GetInfo () const override
 Returns the string containing a detailed description of this object. More...
 
void PrintInfo (std::ostream &rOStream) const override
 This method prints the current Constraint Id. More...
 
- Public Member Functions inherited from Kratos::LinearMasterSlaveConstraint
 LinearMasterSlaveConstraint (IndexType Id=0)
 The default constructor. More...
 
 LinearMasterSlaveConstraint (IndexType Id, DofPointerVectorType &rMasterDofsVector, DofPointerVectorType &rSlaveDofsVector, const MatrixType &rRelationMatrix, const VectorType &rConstantVector)
 Constructor by passing a vector of Master and slave dofs and corresponding Matrix and constant vector. More...
 
 LinearMasterSlaveConstraint (IndexType Id, NodeType &rMasterNode, const VariableType &rMasterVariable, NodeType &rSlaveNode, const VariableType &rSlaveVariable, const double Weight, const double Constant)
 Constructor by passing a single Master and slave dofs and corresponding weight and constant for a variable component. More...
 
 ~LinearMasterSlaveConstraint () override
 Destructor. More...
 
 LinearMasterSlaveConstraint (const LinearMasterSlaveConstraint &rOther)
 Copy Constructor. More...
 
LinearMasterSlaveConstraintoperator= (const LinearMasterSlaveConstraint &rOther)
 Assignment operator. More...
 
MasterSlaveConstraint::Pointer Clone (IndexType NewId) const override
 It creates a new constraint pointer and clones the previous constraint data. More...
 
void GetDofList (DofPointerVectorType &rSlaveDofsVector, DofPointerVectorType &rMasterDofsVector, const ProcessInfo &rCurrentProcessInfo) const override
 Determines the constrant's slvae and master list of DOFs. More...
 
void SetDofList (const DofPointerVectorType &rSlaveDofsVector, const DofPointerVectorType &rMasterDofsVector, const ProcessInfo &rCurrentProcessInfo) override
 Determines the constrant's slave and master list of DOFs. More...
 
void EquationIdVector (EquationIdVectorType &rSlaveEquationIds, EquationIdVectorType &rMasterEquationIds, const ProcessInfo &rCurrentProcessInfo) const override
 This determines the master equation IDs connected to this constraint. More...
 
const DofPointerVectorTypeGetSlaveDofsVector () const override
 This method returns the slave dof vector. More...
 
void SetSlaveDofsVector (const DofPointerVectorType &rSlaveDofsVector) override
 This method returns the slave dof vector. More...
 
const DofPointerVectorTypeGetMasterDofsVector () const override
 This method returns the slave dof vector. More...
 
void SetMasterDofsVector (const DofPointerVectorType &rMasterDofsVector) override
 This method returns the slave dof vector. More...
 
void ResetSlaveDofs (const ProcessInfo &rCurrentProcessInfo) override
 This method resets the values of the slave dofs. More...
 
void Apply (const ProcessInfo &rCurrentProcessInfo) override
 This method directly applies the master/slave relationship. More...
 
void SetLocalSystem (const MatrixType &rRelationMatrix, const VectorType &rConstantVector, const ProcessInfo &rCurrentProcessInfo) override
 This method allows to set the Local System in case is not computed on tunning time (internal variable) More...
 
void CalculateLocalSystem (MatrixType &rRelationMatrix, VectorType &rConstantVector, const ProcessInfo &rCurrentProcessInfo) const override
 This is called during the assembling process in order. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (LinearMasterSlaveConstraint)
 Pointer definition of DataValueContainer. More...
 
- Public Member Functions inherited from Kratos::MasterSlaveConstraint
 MasterSlaveConstraint (IndexType Id=0)
 The default constructor. More...
 
virtual ~MasterSlaveConstraint () override
 Destructor. More...
 
 MasterSlaveConstraint (const MasterSlaveConstraint &rOther)
 Copy Constructor. More...
 
MasterSlaveConstraintoperator= (const MasterSlaveConstraint &rOther)
 Assignment operator. More...
 
virtual void Clear ()
 Clears the maps contents. More...
 
virtual void Initialize (const ProcessInfo &rCurrentProcessInfo)
 It is called to initialize the constraint. More...
 
virtual void Finalize (const ProcessInfo &rCurrentProcessInfo)
 It is called to finalize the constraint. More...
 
virtual void InitializeSolutionStep (const ProcessInfo &rCurrentProcessInfo)
 This is called in the beginning of each solution step. More...
 
virtual void InitializeNonLinearIteration (const ProcessInfo &rCurrentProcessInfo)
 This is called for non-linear analysis at the beginning of the iteration process. More...
 
virtual void FinalizeSolutionStep (const ProcessInfo &rCurrentProcessInfo)
 This is called at the end of each solution step. More...
 
virtual void GetLocalSystem (MatrixType &rRelationMatrix, VectorType &rConstantVector, const ProcessInfo &rCurrentProcessInfo) const
 This method allows to get the Local System in case is not computed on running time (internal variable) More...
 
virtual int Check (const ProcessInfo &rCurrentProcessInfo) const
 This method provides the place to perform checks on the completeness of the input and the compatibility with the problem options. More...
 
DataValueContainerData ()
 This method returns the data container of the constraint. More...
 
DataValueContainer const & GetData () const
 This method returns the data container of the constraint (constant) More...
 
void SetData (DataValueContainer const &rThisData)
 This method sets the data container of the constraint. More...
 
template<class TDataType >
bool Has (const Variable< TDataType > &rThisVariable) const
 Check if the Data exists with Has(..) methods: More...
 
template<class TVariableType >
void SetValue (const TVariableType &rThisVariable, typename TVariableType::Type const &rValue)
 Set Data with SetValue and the Variable to set. More...
 
template<class TVariableType >
TVariableType::Type & GetValue (const TVariableType &rThisVariable)
 Get Data with GetValue and the Variable to get. More...
 
template<class TVariableType >
TVariableType::Type & GetValue (const TVariableType &rThisVariable) const
 Get Data with GetValue and the Variable to get. More...
 
bool IsActive () const
 Checks if the GeometricalObject is active. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (MasterSlaveConstraint)
 Pointer definition of MasterSlaveConstraint. More...
 
- Public Member Functions inherited from Kratos::IndexedObject
 IndexedObject (IndexType NewId=0)
 Default constructor. More...
 
virtual ~IndexedObject ()
 Destructor. More...
 
 IndexedObject (IndexedObject const &rOther)
 Copy constructor. More...
 
IndexedObjectoperator= (IndexedObject const &rOther)
 Assignment operator. More...
 
template<class TObjectType >
IndexType operator() (TObjectType const &rThisObject) const
 
IndexType Id () const
 
IndexType GetId () const
 
virtual void SetId (IndexType NewId)
 
IndexTypeDepricatedIdAccess ()
 TODO: remove this function when removing data_file_io object. More...
 
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (IndexedObject)
 Pointer definition of IndexedObject. More...
 
- Public Member Functions inherited from Kratos::Flags
Flagsoperator= (Flags const &rOther)
 Assignment operator. More...
 
 operator bool () const
 
Flags operator~ () const
 
bool operator! () const
 
void AssignFlags (Flags const &rOther)
 
void Set (const Flags ThisFlag)
 
void Set (const Flags ThisFlag, bool Value)
 
void Reset (const Flags ThisFlag)
 
void Flip (const Flags ThisFlag)
 
void SetPosition (IndexType Position, bool Value=true)
 
bool GetPosition (IndexType Position) const
 
void FlipPosition (IndexType Position)
 
void ClearPosition (IndexType Position)
 
void Clear ()
 
Flags AsFalse () const
 
bool Is (Flags const &rOther) const
 
bool IsDefined (Flags const &rOther) const
 
bool IsNot (Flags const &rOther) const
 
bool IsNotDefined (Flags const &rOther) const
 
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (Flags)
 Pointer definition of Flags. More...
 
const Flagsoperator|= (const Flags &Other)
 
const Flagsoperator&= (const Flags &Other)
 
 Flags ()
 Default constructor. More...
 
 Flags (Flags const &rOther)
 Copy constructor. More...
 
virtual ~Flags ()
 Destructor. More...
 

Type Definitions

using BaseConstraintType = MasterSlaveConstraint
 The definition of the base constraint class. More...
 
using BaseType = LinearMasterSlaveConstraint
 The definition of the base class, we take the rest of the definitions from the base class. More...
 
using IndexType = typename BaseType::IndexType
 The index type definition. More...
 
using DofType = typename BaseType::DofType
 The DoF type definition. More...
 
using DofPointerVectorType = typename BaseType::DofPointerVectorType
 The DoF pointer vector type definition. More...
 
using EquationIdVectorType = typename BaseType::EquationIdVectorType
 The equation Id vector type definition. More...
 
using MatrixType = typename BaseType::MatrixType
 The matrix type definition. More...
 
using VectorType = typename BaseType::VectorType
 The vector type definition. More...
 
using VariableType = typename BaseType::VariableType
 The variable type definition (double) More...
 
 KRATOS_CLASS_POINTER_DEFINITION (ContactMasterSlaveConstraint)
 Pointer definition of DataValueContainer. More...
 

Serialization

class Serializer
 

Additional Inherited Members

- Public Types inherited from Kratos::LinearMasterSlaveConstraint
typedef MasterSlaveConstraint BaseType
 The definition of the base class, we take the rest of the definitions from the base class. More...
 
typedef BaseType::IndexType IndexType
 The index type definition. More...
 
typedef BaseType::DofType DofType
 The DoF type definition. More...
 
typedef BaseType::DofPointerVectorType DofPointerVectorType
 The DoF pointer vector type definition. More...
 
typedef BaseType::NodeType NodeType
 The node type definition. More...
 
typedef BaseType::EquationIdVectorType EquationIdVectorType
 The equation Id vector type definition. More...
 
typedef BaseType::MatrixType MatrixType
 The matrix type definition. More...
 
typedef BaseType::VectorType VectorType
 The vector type definition. More...
 
typedef BaseType::VariableType VariableType
 The variable type definition (double) More...
 
- Public Types inherited from Kratos::MasterSlaveConstraint
typedef IndexedObject BaseType
 The definition of the base class. More...
 
typedef std::size_t IndexType
 The index type definition. More...
 
typedef Dof< doubleDofType
 The DoF type definition. More...
 
typedef std::vector< DofType::PointerDofPointerVectorType
 The DoF pointer vector type definition. More...
 
typedef Node NodeType
 The node type definition. More...
 
typedef std::vector< std::size_t > EquationIdVectorType
 The equation Id vector type definition. More...
 
typedef Matrix MatrixType
 The matrix type definition. More...
 
typedef Vector VectorType
 The vector type definition. More...
 
typedef Kratos::Variable< doubleVariableType
 The variable type definition (double) More...
 
- Public Types inherited from Kratos::IndexedObject
typedef std::size_t IndexType
 The definition of the index type. More...
 
typedef std::size_t result_type
 The definition of the result_type. More...
 
- Public Types inherited from Kratos::Flags
enum  FlagsList {
  Flag0 = BlockType(1) , Flag1 = BlockType(1) << 1 , Flag2 = BlockType(1) << 2 , Flag3 = BlockType(1) << 3 ,
  Flag4 = BlockType(1) << 4 , Flag5 = BlockType(1) << 5 , Flag6 = BlockType(1) << 6 , Flag7 = BlockType(1) << 7 ,
  Flag8 = BlockType(1) << 8 , Flag9 = BlockType(1) << 9 , Flag10 = BlockType(1) << 10 , Flag11 = BlockType(1) << 11 ,
  Flag12 = BlockType(1) << 12 , Flag13 = BlockType(1) << 13 , Flag14 = BlockType(1) << 14 , Flag15 = BlockType(1) << 15 ,
  Flag16 = BlockType(1) << 16 , Flag17 = BlockType(1) << 17 , Flag18 = BlockType(1) << 18 , Flag19 = BlockType(1) << 19 ,
  Flag20 = BlockType(1) << 20 , Flag21 = BlockType(1) << 21 , Flag22 = BlockType(1) << 22 , Flag23 = BlockType(1) << 23 ,
  Flag24 = BlockType(1) << 24 , Flag25 = BlockType(1) << 25 , Flag26 = BlockType(1) << 26 , Flag27 = BlockType(1) << 27 ,
  Flag28 = BlockType(1) << 28 , Flag29 = BlockType(1) << 29 , Flag30 = BlockType(1) << 30
}
 
typedef int64_t BlockType
 
typedef int64_t FlagType
 
typedef std::size_t IndexType
 
- Static Public Member Functions inherited from Kratos::Flags
static const Flags AllDefined ()
 
static const Flags AllTrue ()
 
static Flags Create (IndexType ThisPosition, bool Value=true)
 
- Protected Attributes inherited from Kratos::LinearMasterSlaveConstraint
DofPointerVectorType mSlaveDofsVector
 
DofPointerVectorType mMasterDofsVector
 The DoFs of slave side. More...
 
MatrixType mRelationMatrix
 The DoFs of master side. More...
 
VectorType mConstantVector
 The relation matrix between the master/slave DoF. More...
 

Detailed Description

This is a constraint for contact mechanics based in a linear kinematic MPC constriant.

This constraint is based on LinearMasterSlaveConstraint. It adds additional consideration related with contact

Author
Vicente Mataix Ferrandiz

Member Typedef Documentation

◆ BaseConstraintType

The definition of the base constraint class.

◆ BaseType

The definition of the base class, we take the rest of the definitions from the base class.

◆ DofPointerVectorType

The DoF pointer vector type definition.

◆ DofType

The DoF type definition.

◆ EquationIdVectorType

The equation Id vector type definition.

◆ IndexType

The index type definition.

◆ MatrixType

The matrix type definition.

◆ VariableType

The variable type definition (double)

◆ VectorType

The vector type definition.

Constructor & Destructor Documentation

◆ ContactMasterSlaveConstraint() [1/4]

Kratos::ContactMasterSlaveConstraint::ContactMasterSlaveConstraint ( IndexType  Id = 0)
explicit

The default constructor.

Parameters
IndexTypeThe Id of the new created constraint

◆ ContactMasterSlaveConstraint() [2/4]

Kratos::ContactMasterSlaveConstraint::ContactMasterSlaveConstraint ( IndexType  Id,
DofPointerVectorType rMasterDofsVector,
DofPointerVectorType rSlaveDofsVector,
const MatrixType rRelationMatrix,
const VectorType rConstantVector 
)

Constructor by passing a vector of Master and slave dofs and corresponding Matrix and constant vector.

Parameters
IndexTypeThe Id of the new created constraint
rMasterDofsVectorThe vector containing the DoF of the master side
rSlaveDofsVectorThe vector containing the DoF of the slave side
rRelationMatrixThe relation matrix between the master/slave DoF
rConstantVectorThe vector containing the additional kinematic relationship

◆ ContactMasterSlaveConstraint() [3/4]

Kratos::ContactMasterSlaveConstraint::ContactMasterSlaveConstraint ( IndexType  Id,
Node rMasterNode,
const VariableType rMasterVariable,
Node rSlaveNode,
const VariableType rSlaveVariable,
const double  Weight,
const double  Constant 
)

Constructor by passing a single Master and slave dofs and corresponding weight and constant for a variable component.

Parameters
IndexTypeThe Id of the new created constraint
rMasterNodeThe node of master side
rMasterVariableThe variable of the master DoF
rSlaveNodeThe node of slave side
rSlaveVariableThe variable of the slave DoF
WeightThe relation between the master/slave DoF
ConstantThe additional kinematic relationship

◆ ~ContactMasterSlaveConstraint()

Kratos::ContactMasterSlaveConstraint::~ContactMasterSlaveConstraint ( )
override

Destructor.

◆ ContactMasterSlaveConstraint() [4/4]

Kratos::ContactMasterSlaveConstraint::ContactMasterSlaveConstraint ( const ContactMasterSlaveConstraint rOther)

Copy Constructor.

Member Function Documentation

◆ Create() [1/2]

MasterSlaveConstraint::Pointer Kratos::ContactMasterSlaveConstraint::Create ( IndexType  Id,
DofPointerVectorType rMasterDofsVector,
DofPointerVectorType rSlaveDofsVector,
const MatrixType rRelationMatrix,
const VectorType rConstantVector 
) const
overridevirtual

Create method by passing a single Master and slave dofs and corresponding weight and constant for a variable component.

Parameters
IndexTypeThe Id of the new created constraint
rMasterDofsVectorThe DoFs of master side
rSlaveDofsVectorThe DoFs of slave side
rRelationMatrixThe relation matrix between the master/slave DoF
rConstantVectorThe vector containing the additional kinematic relationship
Returns
A Pointer to the new constraint

Reimplemented from Kratos::LinearMasterSlaveConstraint.

◆ Create() [2/2]

MasterSlaveConstraint::Pointer Kratos::ContactMasterSlaveConstraint::Create ( IndexType  Id,
Node rMasterNode,
const VariableType rMasterVariable,
Node rSlaveNode,
const VariableType rSlaveVariable,
const double  Weight,
const double  Constant 
) const
overridevirtual

Create method by passing a single Master and slave dofs and corresponding weight and constant for a variable component.

Parameters
IndexTypeThe Id of the new created constraint
rMasterNodeThe node of master side
rMasterVariableThe variable of the master DoF
rSlaveNodeThe node of slave side
rSlaveVariableThe variable of the slave DoF
WeightThe relation between the master/slave DoF
ConstantThe additional kinematic relationship
Returns
A Pointer to the new constraint

Reimplemented from Kratos::LinearMasterSlaveConstraint.

◆ FinalizeNonLinearIteration()

void Kratos::ContactMasterSlaveConstraint::FinalizeNonLinearIteration ( const ProcessInfo rCurrentProcessInfo)
overridevirtual

This is called for non-linear analysis at the end of the iteration process.

Reimplemented from Kratos::MasterSlaveConstraint.

◆ GetInfo()

std::string Kratos::ContactMasterSlaveConstraint::GetInfo ( ) const
overridevirtual

Returns the string containing a detailed description of this object.

Returns
the string with informations

Reimplemented from Kratos::LinearMasterSlaveConstraint.

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::ContactMasterSlaveConstraint::KRATOS_CLASS_POINTER_DEFINITION ( ContactMasterSlaveConstraint  )

Pointer definition of DataValueContainer.

◆ operator=()

ContactMasterSlaveConstraint & Kratos::ContactMasterSlaveConstraint::operator= ( const ContactMasterSlaveConstraint rOther)

Assignment operator.

◆ PrintInfo()

void Kratos::ContactMasterSlaveConstraint::PrintInfo ( std::ostream &  rOStream) const
overridevirtual

This method prints the current Constraint Id.

Parameters
rOStreamThe buffer where the information is given

Reimplemented from Kratos::LinearMasterSlaveConstraint.

Friends And Related Function Documentation

◆ Serializer

friend class Serializer
friend

The documentation for this class was generated from the following files: