|
OOFEM 3.0
|
Base class for contact boundary conditions. More...
#include <contactbc.h>
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 Dof * | giveMasterDof (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 DofManager * | giveInternalDofManager (int i) |
| Gives an internal dof manager from receiver. | |
| Function * | giveTimeFunction () |
| int | getIsImposedTimeFunctionNumber () const |
| void | setIsImposedTimeFunctionNumber (int funcIndx) |
| virtual bcValType | giveBCValType () const |
| virtual bool | isImposed (TimeStep *tStep) |
| virtual const IntArray & | giveDofIDs () 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 |
| Domain * | giveDomain () 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 Interface * | giveInterface (InterfaceType t) |
| std::string | errorInfo (const char *func) const |
| Returns string for prepending output (used by error reporting macros). | |
Protected Attributes | |
| std::unique_ptr< ContactSearchAlgorithm > | contactSearchAlgorithm |
| 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. | |
| Domain * | domain |
| 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 ContactSearchAlgorithm * | giveContactSearchAlgorithm () |
| 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. | |
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.
|
inline |
Constructor. Creates an element with number n belonging to domain aDomain.
| n | Element's number |
| aDomain | Pointer to the domain to which element belongs. |
Definition at line 90 of file contactbc.h.
References oofem::ActiveBoundaryCondition::ActiveBoundaryCondition().
Referenced by oofem::StructuralPenaltyContactBoundaryCondition::StructuralPenaltyContactBoundaryCondition().
|
inlinevirtual |
Virtual destructor.
Definition at line 92 of file contactbc.h.
|
overridevirtual |
Assembles contact contributions to the global matrix.
| answer | Global sparse matrix to assemble into. |
| tStep | Current time step. |
| type | Assembly type selector (as used by the framework). |
| r_s | Row numbering scheme. |
| c_s | Column numbering scheme. |
| scale | Scaling factor. |
| lock | Optional 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().
| void oofem::ContactBoundaryCondition::assembleExtrapolatedForces | ( | FloatArray & | answer, |
| TimeStep * | tStep ) |
Assembles extrapolated (predictor) contact forces.
Used e.g. for output or predictor-corrector schemes.
Definition at line 115 of file contactbc.C.
References oofem::FloatArray::assemble(), oofem::FloatArray::beProductOf(), computeTangentFromContact(), getContactPairs(), giveLocationArray(), oofem::FloatMatrix::giveNumberOfColumns(), oofem::FloatMatrix::giveNumberOfRows(), oofem::TimeStep::givePreviousStep(), oofem::TimeStep::isTheFirstStep(), oofem::FloatArray::subtract(), and oofem::FloatArray::zero().
|
overridevirtual |
Assembles contact contributions to the global right-hand side vector.
| answer | Output global vector. |
| tStep | Current time step. |
| type | Assembly type selector. |
| mode | Value mode. |
| s | Numbering scheme. |
| eNorms | Optional element norms. |
| lock | Optional 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().
|
privatepure virtual |
Computes internal force contribution for one contact pair (pure virtual).
Concrete contact formulations compute and assemble the corresponding force vector.
| answer | Output internal force contribution. |
| cp | Contact pair. |
| tStep | Current time step. |
Implemented in oofem::StructuralPenaltyContactBoundaryCondition.
Referenced by assembleVector().
|
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.
| answer | Output tangent matrix contribution. |
| cp | Contact pair. |
| tStep | Current time step. |
Implemented in oofem::StructuralPenaltyContactBoundaryCondition.
Referenced by assemble(), and assembleExtrapolatedForces().
|
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().
|
inline |
Definition at line 102 of file contactbc.h.
References contactSearchAlgorithm.
|
inlineprivatevirtual |
Returns the configured contact search algorithm.
Definition at line 197 of file contactbc.h.
References contactSearchAlgorithm.
Referenced by initForNewIteration(), and postInitialize().
| void oofem::ContactBoundaryCondition::giveExportData | ( | std::vector< ExportRegion > & | vtkPieces, |
| FloatArray | shift, | ||
| TimeStep * | tStep ) |
Exports contact-related data (e.g., for VTK output).
| vtkPieces | Output regions/pieces. |
| shift | Coordinate shift (for periodicity or visualization). |
| tStep | Current 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().
|
private |
Builds a location array for a given contact pair and numbering scheme.
| loc | Output location array. |
| ns | Numbering scheme. |
| cp | Contact pair. |
Definition at line 154 of file contactbc.C.
References oofem::GeneralBoundaryCondition::dofs, and oofem::ContactPair::giveLocationArray().
Referenced by assemble(), assembleExtrapolatedForces(), and assembleVector().
|
overrideprivatepure virtual |
Builds row/column location arrays for contact assembly (pure virtual).
This defines the DOF layout used by the concrete contact boundary condition.
| rows | Output row location arrays. |
| cols | Output column location arrays. |
| r_s | Row numbering scheme. |
| c_s | Column numbering scheme. |
Implemented in oofem::StructuralPenaltyContactBoundaryCondition.
|
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.
| tStep | Current time step. |
| iter | Iteration counter. |
Definition at line 53 of file contactbc.C.
References giveContactSearchAlgorithm(), and updateEachNthIter.
Referenced by oofem::EngngModel::initForNewIteration().
|
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().
|
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().
|
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().
|
protected |
contactSearchAlgorithm
Definition at line 82 of file contactbc.h.
Referenced by getContactPairs(), getContactPairs(), giveContactSearchAlgorithm(), and oofem::StructuralPenaltyContactBoundaryCondition::setupContactSearchAlgorithm().
|
protected |
Definition at line 83 of file contactbc.h.
Referenced by initForNewIteration().