OOFEM 3.0
Loading...
Searching...
No Matches
oofem::ContactBoundaryCondition Class Referenceabstract

Base class for contact boundary conditions. More...

#include <contactbc.h>

Inheritance diagram for oofem::ContactBoundaryCondition:
Collaboration diagram for oofem::ContactBoundaryCondition:

Public Member Functions

 ContactBoundaryCondition (int n, Domain *d)
virtual ~ContactBoundaryCondition ()
 Virtual destructor.
std::vector< std::unique_ptr< ContactPair > > & getContactPairs ()
 Returns the current list of detected contact pairs (modifiable).
const std::vector< std::unique_ptr< ContactPair > > & getContactPairs () const
virtual void initForNewIteration (TimeStep *tStep, int iter)
 Called at the beginning of a new nonlinear iteration.
void assemble (SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale, void *lock) override
 Assembles contact contributions to the global matrix.
virtual void assembleVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorms, void *lock) override
 Assembles contact contributions to the global right-hand side vector.
void postInitialize () override
 Post-initialization hook called after construction and input parsing.
void assembleExtrapolatedForces (FloatArray &answer, TimeStep *tStep)
 Assembles extrapolated (predictor) contact forces.
void giveExportData (std::vector< ExportRegion > &vtkPieces, FloatArray shift, TimeStep *tStep)
 Exports contact-related data (e.g., for VTK output).
Public Member Functions inherited from oofem::ActiveBoundaryCondition
 ActiveBoundaryCondition (int n, Domain *d)
virtual ~ActiveBoundaryCondition ()
 Destructor.
void initializeFrom (InputRecord &ir) override
virtual void addElementSide (int elem, int side)
virtual void giveLocationArrays (std ::vector< IntArray > &rows, std ::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
virtual bool requiresActiveDofs ()
virtual bool isPrimaryDof (ActiveDof *dof)
virtual double giveBcValue (Dof *dof, ValueModeType mode, TimeStep *tStep)
virtual bool hasBc (Dof *dof, TimeStep *tStep)
virtual int giveNumberOfMasterDofs (ActiveDof *dof)
virtual DofgiveMasterDof (ActiveDof *dof, int mdof)
virtual void computeDofTransformation (ActiveDof *dof, FloatArray &masterContribs)
virtual double giveUnknown (PrimaryField &field, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
virtual double giveUnknown (ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
Public Member Functions inherited from oofem::GeneralBoundaryCondition
 GeneralBoundaryCondition (int n, Domain *d)
virtual ~GeneralBoundaryCondition ()
 Destructor.
int giveSetNumber () const
virtual int giveNumberOfInternalDofManagers ()
 Gives the number of internal dof managers.
virtual DofManagergiveInternalDofManager (int i)
 Gives an internal dof manager from receiver.
FunctiongiveTimeFunction ()
int getIsImposedTimeFunctionNumber () const
void setIsImposedTimeFunctionNumber (int funcIndx)
virtual bcValType giveBCValType () const
virtual bool isImposed (TimeStep *tStep)
virtual const IntArraygiveDofIDs () const
virtual bcType giveType () const
virtual bcGeomType giveBCGeoType () const
virtual void scale (double s)
virtual double giveProperty (int aProperty, TimeStep *tStep) const
void initializeFrom (InputRecord &ir) override
void giveInputRecord (DynamicInputRecord &input) override
void saveContext (DataStream &stream, ContextMode mode) override
void restoreContext (DataStream &stream, ContextMode mode) override
Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
virtual ~FEMComponent ()=default
 Virtual destructor.
virtual const char * giveClassName () const =0
virtual const char * giveInputRecordName () const =0
DomaingiveDomain () const
virtual void setDomain (Domain *d)
int giveNumber () const
void setNumber (int num)
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
virtual void initializeFrom (InputRecord &ir, int priority)
virtual void initializeFinish ()
virtual int checkConsistency ()
virtual void printOutputAt (FILE *file, TimeStep *tStep)
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging.
virtual InterfacegiveInterface (InterfaceType t)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Protected Attributes

std::unique_ptr< ContactSearchAlgorithmcontactSearchAlgorithm
 contactSearchAlgorithm
int updateEachNthIter = 1
Protected Attributes inherited from oofem::GeneralBoundaryCondition
int timeFunction
 Associated load time function.
bcValType valType
 Physical meaning of BC value.
IntArray dofs
 Dofs that b.c. is applied to (relevant for Dirichlet type b.c.s).
int isImposedTimeFunction
int set
 Set number for boundary condition to be applied to.
Protected Attributes inherited from oofem::FEMComponent
int number
 Component number.
Domaindomain
 Link to domain object, useful for communicating with other FEM components.

Private Member Functions

void giveLocationArray (IntArray &loc, const UnknownNumberingScheme &ns, const ContactPair *cp) const
 Builds a location array for a given contact pair and numbering scheme.
void giveLocationArrays (std::vector< IntArray > &rows, std::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s) override=0
 Builds row/column location arrays for contact assembly (pure virtual).
virtual void computeTangentFromContact (FloatMatrix &answer, ContactPair *cp, TimeStep *tStep)=0
 Computes a consistent tangent contribution for one contact pair (pure virtual).
virtual void computeInternalForcesFromContact (FloatArray &answer, ContactPair *cp, TimeStep *tStep)=0
 Computes internal force contribution for one contact pair (pure virtual).
virtual ContactSearchAlgorithmgiveContactSearchAlgorithm ()
 Returns the configured contact search algorithm.
virtual void setupContactSearchAlgorithm ()=0
 Creates and configures the contact search algorithm (pure virtual).
void updateYourself (TimeStep *tStep) override
 Updates internal BC state for the given time step.

Detailed Description

Base class for contact boundary conditions.

The ContactBC class represents boundary conditions associated with contact interactions in a finite element analysis. It serves as a common base for concrete contact boundary condition implementations responsible for enforcing contact constraints and assembling their contributions to the global system of equations.

Contact boundary conditions typically operate on contact pairs identified by a contact search algorithm and may enforce contact using different formulations, such as penalty methods, Lagrange multipliers, or augmented Lagrangian approaches.

This class does not define a specific contact enforcement strategy; instead, it provides a unified interface for contact-related boundary conditions used by the engineering model.

Definition at line 78 of file contactbc.h.

Constructor & Destructor Documentation

◆ ContactBoundaryCondition()

oofem::ContactBoundaryCondition::ContactBoundaryCondition ( int n,
Domain * d )
inline

Constructor. Creates an element with number n belonging to domain aDomain.

Parameters
nElement's number
aDomainPointer to the domain to which element belongs.

Definition at line 90 of file contactbc.h.

References oofem::ActiveBoundaryCondition::ActiveBoundaryCondition().

Referenced by oofem::StructuralPenaltyContactBoundaryCondition::StructuralPenaltyContactBoundaryCondition().

◆ ~ContactBoundaryCondition()

virtual oofem::ContactBoundaryCondition::~ContactBoundaryCondition ( )
inlinevirtual

Virtual destructor.

Definition at line 92 of file contactbc.h.

Member Function Documentation

◆ assemble()

void oofem::ContactBoundaryCondition::assemble ( SparseMtrx & answer,
TimeStep * tStep,
CharType type,
const UnknownNumberingScheme & r_s,
const UnknownNumberingScheme & c_s,
double scale,
void * lock )
overridevirtual

Assembles contact contributions to the global matrix.

Parameters
answerGlobal sparse matrix to assemble into.
tStepCurrent time step.
typeAssembly type selector (as used by the framework).
r_sRow numbering scheme.
c_sColumn numbering scheme.
scaleScaling factor.
lockOptional lock for thread-safe assembly.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 65 of file contactbc.C.

References oofem::SparseMtrx::assemble(), computeTangentFromContact(), getContactPairs(), giveLocationArray(), oofem::FloatMatrix::giveNumberOfColumns(), oofem::FloatMatrix::giveNumberOfRows(), and oofem::GeneralBoundaryCondition::scale().

◆ assembleExtrapolatedForces()

void oofem::ContactBoundaryCondition::assembleExtrapolatedForces ( FloatArray & answer,
TimeStep * tStep )

◆ assembleVector()

void oofem::ContactBoundaryCondition::assembleVector ( FloatArray & answer,
TimeStep * tStep,
CharType type,
ValueModeType mode,
const UnknownNumberingScheme & s,
FloatArray * eNorms,
void * lock )
overridevirtual

Assembles contact contributions to the global right-hand side vector.

Parameters
answerOutput global vector.
tStepCurrent time step.
typeAssembly type selector.
modeValue mode.
sNumbering scheme.
eNormsOptional element norms.
lockOptional lock for thread-safe assembly.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 89 of file contactbc.C.

References oofem::FloatArray::assemble(), computeInternalForcesFromContact(), getContactPairs(), giveLocationArray(), and oofem::FloatArray::giveSize().

◆ computeInternalForcesFromContact()

virtual void oofem::ContactBoundaryCondition::computeInternalForcesFromContact ( FloatArray & answer,
ContactPair * cp,
TimeStep * tStep )
privatepure virtual

Computes internal force contribution for one contact pair (pure virtual).

Concrete contact formulations compute and assemble the corresponding force vector.

Parameters
answerOutput internal force contribution.
cpContact pair.
tStepCurrent time step.

Implemented in oofem::StructuralPenaltyContactBoundaryCondition.

Referenced by assembleVector().

◆ computeTangentFromContact()

virtual void oofem::ContactBoundaryCondition::computeTangentFromContact ( FloatMatrix & answer,
ContactPair * cp,
TimeStep * tStep )
privatepure virtual

Computes a consistent tangent contribution for one contact pair (pure virtual).

Concrete contact formulations (penalty, AL, LM, friction) provide their own linearization and fill answer accordingly.

Parameters
answerOutput tangent matrix contribution.
cpContact pair.
tStepCurrent time step.

Implemented in oofem::StructuralPenaltyContactBoundaryCondition.

Referenced by assemble(), and assembleExtrapolatedForces().

◆ getContactPairs() [1/2]

std::vector< std::unique_ptr< ContactPair > > & oofem::ContactBoundaryCondition::getContactPairs ( )
inline

Returns the current list of detected contact pairs (modifiable).

The pairs are provided by the configured ContactSearchAlgorithm instance.

Definition at line 99 of file contactbc.h.

References contactSearchAlgorithm.

Referenced by assemble(), assembleExtrapolatedForces(), assembleVector(), giveExportData(), oofem::StructuralPenaltyContactBoundaryCondition::giveLocationArrays(), and updateYourself().

◆ getContactPairs() [2/2]

const std::vector< std::unique_ptr< ContactPair > > & oofem::ContactBoundaryCondition::getContactPairs ( ) const
inline

Definition at line 102 of file contactbc.h.

References contactSearchAlgorithm.

◆ giveContactSearchAlgorithm()

virtual ContactSearchAlgorithm * oofem::ContactBoundaryCondition::giveContactSearchAlgorithm ( )
inlineprivatevirtual

Returns the configured contact search algorithm.

Definition at line 197 of file contactbc.h.

References contactSearchAlgorithm.

Referenced by initForNewIteration(), and postInitialize().

◆ giveExportData()

void oofem::ContactBoundaryCondition::giveExportData ( std::vector< ExportRegion > & vtkPieces,
FloatArray shift,
TimeStep * tStep )

Exports contact-related data (e.g., for VTK output).

Parameters
vtkPiecesOutput regions/pieces.
shiftCoordinate shift (for periodicity or visualization).
tStepCurrent time step.

Definition at line 181 of file contactbc.C.

References oofem::FloatArray::add(), oofem::FloatArray::at(), oofem::IntArray::at(), getContactPairs(), and oofem::FloatArray::giveSize().

Referenced by setupContactSearchAlgorithm().

◆ giveLocationArray()

void oofem::ContactBoundaryCondition::giveLocationArray ( IntArray & loc,
const UnknownNumberingScheme & ns,
const ContactPair * cp ) const
private

Builds a location array for a given contact pair and numbering scheme.

Parameters
locOutput location array.
nsNumbering scheme.
cpContact pair.

Definition at line 154 of file contactbc.C.

References oofem::GeneralBoundaryCondition::dofs, and oofem::ContactPair::giveLocationArray().

Referenced by assemble(), assembleExtrapolatedForces(), and assembleVector().

◆ giveLocationArrays()

void oofem::ContactBoundaryCondition::giveLocationArrays ( std::vector< IntArray > & rows,
std::vector< IntArray > & cols,
CharType type,
const UnknownNumberingScheme & r_s,
const UnknownNumberingScheme & c_s )
overrideprivatepure virtual

Builds row/column location arrays for contact assembly (pure virtual).

This defines the DOF layout used by the concrete contact boundary condition.

Parameters
rowsOutput row location arrays.
colsOutput column location arrays.
r_sRow numbering scheme.
c_sColumn numbering scheme.

Implemented in oofem::StructuralPenaltyContactBoundaryCondition.

◆ initForNewIteration()

void oofem::ContactBoundaryCondition::initForNewIteration ( TimeStep * tStep,
int iter )
virtual

Called at the beginning of a new nonlinear iteration.

Implementations typically decide whether contact pairs must be updated (e.g., every N-th iteration) and refresh contact kinematics if needed.

Parameters
tStepCurrent time step.
iterIteration counter.

Definition at line 53 of file contactbc.C.

References giveContactSearchAlgorithm(), and updateEachNthIter.

Referenced by oofem::EngngModel::initForNewIteration().

◆ postInitialize()

void oofem::ContactBoundaryCondition::postInitialize ( )
overridevirtual

Post-initialization hook called after construction and input parsing.

Typical responsibilities include creating/configuring the contact search algorithm and initializing contact data structures.

Reimplemented from oofem::FEMComponent.

Reimplemented in oofem::StructuralPenaltyContactBoundaryCondition.

Definition at line 160 of file contactbc.C.

References giveContactSearchAlgorithm(), and setupContactSearchAlgorithm().

◆ setupContactSearchAlgorithm()

virtual void oofem::ContactBoundaryCondition::setupContactSearchAlgorithm ( )
privatepure virtual

Creates and configures the contact search algorithm (pure virtual).

Concrete boundary conditions decide which search algorithm to use and how it is parameterized.

Implemented in oofem::StructuralPenaltyContactBoundaryCondition.

References giveExportData(), and updateYourself().

Referenced by postInitialize().

◆ updateYourself()

void oofem::ContactBoundaryCondition::updateYourself ( TimeStep * tStep)
overrideprivatevirtual

Updates internal BC state for the given time step.

Typically triggers contact search updates and stores time-step dependent data.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 168 of file contactbc.C.

References getContactPairs().

Referenced by setupContactSearchAlgorithm().

Member Data Documentation

◆ contactSearchAlgorithm

std::unique_ptr<ContactSearchAlgorithm> oofem::ContactBoundaryCondition::contactSearchAlgorithm
protected

◆ updateEachNthIter

int oofem::ContactBoundaryCondition::updateEachNthIter = 1
protected

Definition at line 83 of file contactbc.h.

Referenced by initForNewIteration().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011