OOFEM 3.0
Loading...
Searching...
No Matches
oofem::LinearConstraintBC Class Reference

#include <linearconstraintbc.h>

Inheritance diagram for oofem::LinearConstraintBC:
Collaboration diagram for oofem::LinearConstraintBC:

Public Member Functions

 LinearConstraintBC (int n, Domain *d)
virtual ~LinearConstraintBC ()
 Destructor.
void initializeFrom (InputRecord &ir) override
const char * giveInputRecordName () const override
void assemble (SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0, void *lock=nullptr) override
void assembleVector (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorms=nullptr, void *lock=nullptr) override
void giveLocationArrays (std ::vector< IntArray > &rows, std ::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s) override
int giveNumberOfInternalDofManagers () override
 Gives the number of internal dof managers.
DofManagergiveInternalDofManager (int i) override
 Gives an internal dof manager from receiver.
void saveContext (DataStream &stream, ContextMode mode) override
void restoreContext (DataStream &stream, ContextMode mode) override
const char * giveClassName () const override
Public Member Functions inherited from oofem::ActiveBoundaryCondition
 ActiveBoundaryCondition (int n, Domain *d)
virtual ~ActiveBoundaryCondition ()
 Destructor.
virtual void addElementSide (int elem, int side)
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
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 giveInputRecord (DynamicInputRecord &input) override
virtual void updateYourself (TimeStep *tStep)
Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
virtual ~FEMComponent ()=default
 Virtual destructor.
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 void postInitialize ()
 Performs post initialization steps. Called after all components are created and initialized.
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 Member Functions

void giveLocArray (const UnknownNumberingScheme &r_s, IntArray &locr, int &lambdaeq)

Protected Attributes

FloatArray weights
IntArray weightsTf
double rhs
int rhsTf
IntArray dofmans
IntArray dofs
std ::unique_ptr< DofManagermd
IntArray lhsType
IntArray rhsType
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.

Detailed Description

Class implementing linear constraint on selected DOFs in the form \( \sum_i w_i r_i = c \), where \( r_i \) is i-th degree of freedom entering contraint, w_i is corresponding weight, and \( c \) is given value. The weights and constant can have associated loadtime function, so they can evolve in time. By default, the Function value for all weights and constant is set to 1.0. This boundary condition is introduced as additional stationary condition in energy functional using Lagrange multiplier, which is an additional degree of freedom introduced by this boundary condition.

Definition at line 74 of file linearconstraintbc.h.

Constructor & Destructor Documentation

◆ LinearConstraintBC()

oofem::LinearConstraintBC::LinearConstraintBC ( int n,
Domain * d )

◆ ~LinearConstraintBC()

oofem::LinearConstraintBC::~LinearConstraintBC ( )
virtual

Destructor.

Definition at line 66 of file linearconstraintbc.C.

Member Function Documentation

◆ assemble()

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

Assembles B.C. contributions to specified matrix.

Parameters
[in,out]answerMatrix to assemble to.
tStepActive time step.
tStepActive time step.
typeType of matrix to assemble.
r_sRow numbering scheme.
c_sColumn numbering scheme.
scaleScaling factor.
omp_lockoptional OMP lock to ensure correct update of answer

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 106 of file linearconstraintbc.C.

References oofem::SparseMtrx::assemble(), oofem::FloatMatrix::at(), oofem::IntArray::at(), oofem::FloatMatrix::beTranspositionOf(), oofem::FEMComponent::domain, oofem::TimeStep::giveIntrinsicTime(), giveLocArray(), oofem::GeneralBoundaryCondition::isImposed(), lhsType, oofem::GeneralBoundaryCondition::scale(), oofem::FloatMatrix::times(), weights, and weightsTf.

◆ assembleVector()

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

Assembles B.C. contributions to specified vector.

Parameters
[in,out]answerVector to assemble to.
tStepActive time step.
typeType of matrix to assemble.
modeMode of value.
sNumbering scheme.
eNormsNorms for each dofid.
omp_lockoptional OMP lock to ensure correct update of answer
Returns
Equivalent of the sum of the element norm (squared) of assembled vector.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 156 of file linearconstraintbc.C.

References oofem::FloatArray::assemble(), oofem::FloatArray::at(), oofem::IntArray::at(), dofmans, dofs, oofem::FEMComponent::domain, oofem::UnknownNumberingScheme::giveDofEquationNumber(), oofem::TimeStep::giveIntrinsicTime(), giveLocArray(), oofem::Dof::giveUnknown(), md, rhs, rhsTf, rhsType, weights, and weightsTf.

◆ giveClassName()

const char * oofem::LinearConstraintBC::giveClassName ( ) const
inlineoverridevirtual
Returns
Class name of the receiver.

Implements oofem::FEMComponent.

Definition at line 117 of file linearconstraintbc.h.

◆ giveInputRecordName()

const char * oofem::LinearConstraintBC::giveInputRecordName ( ) const
inlineoverridevirtual
Returns
Input record name of the receiver.

Implements oofem::FEMComponent.

Definition at line 97 of file linearconstraintbc.h.

References _IFT_LinearConstraintBC_Name.

◆ giveInternalDofManager()

DofManager * oofem::LinearConstraintBC::giveInternalDofManager ( int i)
inlineoverridevirtual

Gives an internal dof manager from receiver.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 112 of file linearconstraintbc.h.

◆ giveLocArray()

void oofem::LinearConstraintBC::giveLocArray ( const UnknownNumberingScheme & r_s,
IntArray & locr,
int & lambdaeq )
protected

◆ giveLocationArrays()

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

Gives a list of location arrays that will be assembled. This should only be used to construct zero structure in sparse matrices. The rows and columns location arrays returned in tuples (stored in vector), allowing to efficiently assemble and allocate off-diagonal blocks. The nonzero entries are assembled and allocated for entries at (rows[i], cols[i]) positions.

Parameters
rowsList of location arrays for r_s.
colsList of location arrays for c_s.
typeType of matrix to assemble.
r_sRow numbering scheme.
c_sColumn numbering scheme.

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 220 of file linearconstraintbc.C.

References oofem::IntArray::at(), and giveLocArray().

◆ giveNumberOfInternalDofManagers()

int oofem::LinearConstraintBC::giveNumberOfInternalDofManagers ( )
inlineoverridevirtual

Gives the number of internal dof managers.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 111 of file linearconstraintbc.h.

◆ initializeFrom()

void oofem::LinearConstraintBC::initializeFrom ( InputRecord & ir)
overridevirtual

Initializes receiver according to object description stored in input record. This function is called immediately after creating object using constructor. Input record can be imagined as data record in component database belonging to receiver. Receiver may use value-name extracting functions to extract particular field from record. Note that initializeFrom may be called mutiple times.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
priorityPriority of the input record. This is used to determine the order of initialization

Reimplemented from oofem::ActiveBoundaryCondition.

Definition at line 71 of file linearconstraintbc.C.

References _IFT_LinearConstraintBC_dofmans, _IFT_LinearConstraintBC_dofs, _IFT_LinearConstraintBC_lhstype, _IFT_LinearConstraintBC_rhs, _IFT_LinearConstraintBC_rhsfuncs, _IFT_LinearConstraintBC_rhstype, _IFT_LinearConstraintBC_weights, _IFT_LinearConstraintBC_weightsfuncs, dofmans, dofs, IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, lhsType, rhs, rhsTf, rhsType, weights, and weightsTf.

◆ restoreContext()

void oofem::LinearConstraintBC::restoreContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Restores the receiver state previously written in stream.

See also
saveContext
Parameters
streamInput stream.
modeDetermines amount of info available in stream (state, definition, ...).
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 275 of file linearconstraintbc.C.

References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, dofmans, dofs, lhsType, md, oofem::DataStream::read(), rhs, rhsTf, rhsType, THROW_CIOERR, weights, and weightsTf.

◆ saveContext()

void oofem::LinearConstraintBC::saveContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Stores receiver state to output stream.

Parameters
streamOutput stream.
modeDetermines amount of info required in stream (state, definition, ...).
Exceptions
throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::GeneralBoundaryCondition.

Definition at line 240 of file linearconstraintbc.C.

References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, dofmans, dofs, lhsType, md, rhs, rhsTf, rhsType, THROW_CIOERR, weights, weightsTf, and oofem::DataStream::write().

Member Data Documentation

◆ dofmans

IntArray oofem::LinearConstraintBC::dofmans
protected

◆ dofs

IntArray oofem::LinearConstraintBC::dofs
protected

◆ lhsType

IntArray oofem::LinearConstraintBC::lhsType
protected

Definition at line 88 of file linearconstraintbc.h.

Referenced by assemble(), initializeFrom(), restoreContext(), and saveContext().

◆ md

std :: unique_ptr< DofManager > oofem::LinearConstraintBC::md
protected

◆ rhs

double oofem::LinearConstraintBC::rhs
protected

Definition at line 79 of file linearconstraintbc.h.

Referenced by assembleVector(), initializeFrom(), restoreContext(), and saveContext().

◆ rhsTf

int oofem::LinearConstraintBC::rhsTf
protected

Definition at line 80 of file linearconstraintbc.h.

Referenced by assembleVector(), initializeFrom(), restoreContext(), and saveContext().

◆ rhsType

IntArray oofem::LinearConstraintBC::rhsType
protected

Definition at line 89 of file linearconstraintbc.h.

Referenced by assembleVector(), initializeFrom(), restoreContext(), and saveContext().

◆ weights

FloatArray oofem::LinearConstraintBC::weights
protected

◆ weightsTf

IntArray oofem::LinearConstraintBC::weightsTf
protected

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