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

#include <simpleslavedof.h>

Inheritance diagram for oofem::SimpleSlaveDof:
Collaboration diagram for oofem::SimpleSlaveDof:

Public Member Functions

 SimpleSlaveDof (DofManager *aNode, int master, DofIDItem id)
 SimpleSlaveDof (DofManager *aNode, DofIDItem id=Undef)
virtual ~SimpleSlaveDof ()
 Destructor.
dofType giveDofType () override
 Returns the type of the receiver.
const char * giveClassName () const override
 Returns class name of the receiver.
int __giveEquationNumber () const override
int __givePrescribedEquationNumber () override
int askNewEquationNumber (TimeStep *tStep) override
double giveUnknown (ValueModeType, TimeStep *) override
double giveUnknown (PrimaryField &field, ValueModeType, TimeStep *tStep) override
bool hasBc (TimeStep *tStep) override
bool hasIc () override
bool hasIcOn (ValueModeType) override
int giveBcId () override
int giveIcId () override
double giveBcValue (ValueModeType mode, TimeStep *tStep) override
void saveContext (DataStream &stream, ContextMode mode) override
 Stores receiver state to output stream.
void restoreContext (DataStream &stream, ContextMode mode) override
 Restores the receiver state previously written in stream.
int giveMasterDofManagerNum () const
 Returns Master Dof Manager Number.
void giveMasterDofManArray (IntArray &answer) override
void setMasterDofManagerNum (int i)
 Sets master dof manager.
int giveMasterDofIndx () const
 Returns number of master dof in master dofManager.
void updateLocalNumbering (EntityRenumberingFunctor &f) override
Public Member Functions inherited from oofem::Dof
 Dof (DofManager *aNode, DofIDItem id=Undef)
virtual ~Dof ()
 Destructor.
int giveDofManNumber () const
DofManagergiveDofManager () const
int giveDofManGlobalNumber () const
int giveEquationNumber (const UnknownNumberingScheme &s)
virtual void giveEquationNumbers (IntArray &masterEqNumbers, const UnknownNumberingScheme &s)
virtual void giveDofIDs (IntArray &masterDofIDs)
virtual void giveUnknowns (FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep)
virtual void giveUnknowns (FloatArray &masterUnknowns, PrimaryField &field, ValueModeType mode, TimeStep *tStep)
virtual void computeDofTransformation (FloatArray &masterContribs)
virtual int giveNumberOfPrimaryMasterDofs ()
DofIDItem giveDofID () const
void setDofID (DofIDItem id)
virtual bool isPrimaryDof ()
virtual void printSingleOutputAt (FILE *file, TimeStep *tStep, char ch, ValueModeType mode, double scale=1.0)
virtual void printMultipleOutputAt (FILE *File, TimeStep *tStep, char *ch, ValueModeType *mode, int nite)
void printSingleOutputWithAdditionAt (FILE *File, TimeStep *tStep, char ch, ValueModeType mode, double addend)
virtual void printYourself ()
 Prints the receiver state on stdout.
virtual void updateYourself (TimeStep *tStep)
virtual void updateUnknownsDictionary (TimeStep *tStep, ValueModeType mode, double dofValue)
virtual double giveUnknownsDictionaryValue (TimeStep *tStep, ValueModeType mode)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).
virtual void setBcId (int bcId)
 Overwrites the boundary condition id (0-inactive BC), intended for specific purposes such as coupling of bc's in multiscale simulations.
virtual void setIcId (int icId)
 Overwrites the initial condition id (0-inactive IC).
virtual void setEquationNumber (int equationNumber)
virtual void setUnknowns (Dictionary *unknowns)
virtual DictionarygiveUnknowns ()
virtual int giveEqn ()
virtual int packUnknowns (DataStream &buff, ValueModeType mode, TimeStep *tStep)
virtual int unpackAndUpdateUnknown (DataStream &buff, ValueModeType mode, TimeStep *tStep)

Protected Member Functions

BoundaryConditiongiveBc () override
InitialConditiongiveIc () override

Private Member Functions

DofgiveMasterDof () const
 Returns reference to master dof.

Private Attributes

int masterDofMngr
 Number of DofManager containing master dof (Master DofManager).
int masterDofIndx
 Number of master dof in master dofManager.

Additional Inherited Members

Protected Attributes inherited from oofem::Dof
DofManagerdofManager
 Link to related DofManager.
DofIDItem dofID
 Physical meaning of DOF.

Detailed Description

Class representing "slave" degree of freedom. Slave dof is linked to some master dof (link slave-slave is not allowed). Slaves can be used to implement duplicated joints (by specifying some dof in node as masters and some as slaves linked to dofs in other node (with same or possibly different coordinates). Slave dof share the same equation number with master. Almost all operation as request for BC or IC or equation number are simply forwarded to master. Other functions (which change internal state) like updateYourself, updateUnknownsDictionary, askNewEquationNumber or context storing/restoring functions are empty functions, relying on fact that same function will be called also for master. From this point of view, one can see slave dof as link to other dof.

It is important to ensure (on input) that both slave dofManager and master dofManager are using the same local coordinate system. In future releases, this can be checked using checkConsistency function, where this check could be performed.

Slave dof is special dof - connected to some master dof on other node (side), with same equation number and same boundary and initial conditions. Typically, slave dof's node and master node are sharing the same space position. This will allow to have multiple dof's (i.e. displacement in x-dir, or rotations) in such node.

Definition at line 70 of file simpleslavedof.h.

Constructor & Destructor Documentation

◆ SimpleSlaveDof() [1/2]

oofem::SimpleSlaveDof::SimpleSlaveDof ( DofManager * aNode,
int master,
DofIDItem id )

Constructor. Creates slave dof vith number i, belonging to aNode dof manager. Slave will be linked to master dof with id type belonging to dofManager with number given in master variable.

Parameters
aNodereceiver will belong to aNode dof manager
masternumber of dofManager which contain master dof
idDofID of master dof (and slave too).

Definition at line 43 of file simpleslavedof.C.

References oofem::Dof::Dof(), masterDofIndx, and masterDofMngr.

◆ SimpleSlaveDof() [2/2]

oofem::SimpleSlaveDof::SimpleSlaveDof ( DofManager * aNode,
DofIDItem id = Undef )

Definition at line 50 of file simpleslavedof.C.

References oofem::Dof::Dof(), masterDofIndx, and masterDofMngr.

◆ ~SimpleSlaveDof()

virtual oofem::SimpleSlaveDof::~SimpleSlaveDof ( )
inlinevirtual

Destructor.

Definition at line 90 of file simpleslavedof.h.

Member Function Documentation

◆ __giveEquationNumber()

int oofem::SimpleSlaveDof::__giveEquationNumber ( ) const
overridevirtual

Returns equation number corresponding to receiver. Slave simply forwards this message to master.

Returns
Equation number, if active BC exists, returns zero

Implements oofem::Dof.

Definition at line 72 of file simpleslavedof.C.

References giveMasterDof().

◆ __givePrescribedEquationNumber()

int oofem::SimpleSlaveDof::__givePrescribedEquationNumber ( )
overridevirtual

Returns prescribed equation number corresponding to receiver. Slave simply forwards this message to master.

Returns
Prescribed equation number, if active BC exists, returns zero

Implements oofem::Dof.

Definition at line 81 of file simpleslavedof.C.

References giveMasterDof().

◆ askNewEquationNumber()

int oofem::SimpleSlaveDof::askNewEquationNumber ( TimeStep * tStep)
inlineoverridevirtual

Asks new equation number. Empty function (master is assumed to receive same message).

Implements oofem::Dof.

Definition at line 109 of file simpleslavedof.h.

◆ giveBc()

BoundaryCondition * oofem::SimpleSlaveDof::giveBc ( )
overrideprotectedvirtual

Returns boundary condition of dof if it is prescribed.

Returns
NULL if no BC applied, otherwise pointer to corresponding BC.

Reimplemented from oofem::Dof.

Definition at line 65 of file simpleslavedof.C.

References giveMasterDof().

◆ giveBcId()

int oofem::SimpleSlaveDof::giveBcId ( )
overridevirtual

Returns the id of associated boundary condition, if there is any. Used only for printing purposes. In general, id could not be used to decide whether BC is active. Use appropriate services instead.

Returns
Id of associated Boundary condition, zero otherwise

Implements oofem::Dof.

Definition at line 131 of file simpleslavedof.C.

References giveMasterDof().

◆ giveBcValue()

double oofem::SimpleSlaveDof::giveBcValue ( ValueModeType mode,
TimeStep * tStep )
overridevirtual

Returns value of boundary condition of dof if it is prescribed. Use hasBc service to determine, if boundary condition is active. The physical meaning of BC is determined by corresponding DOF.

Parameters
modeUnknown char type (if total or incremental value is returned).
tStepTime step.
Returns
Prescribed value of unknown or zero if not prescribed.

Reimplemented from oofem::Dof.

Definition at line 143 of file simpleslavedof.C.

References giveMasterDof().

◆ giveClassName()

const char * oofem::SimpleSlaveDof::giveClassName ( ) const
inlineoverridevirtual

Returns class name of the receiver.

Reimplemented from oofem::Dof.

Definition at line 93 of file simpleslavedof.h.

◆ giveDofType()

dofType oofem::SimpleSlaveDof::giveDofType ( )
inlineoverridevirtual

Returns the type of the receiver.

Implements oofem::Dof.

Definition at line 92 of file simpleslavedof.h.

◆ giveIc()

InitialCondition * oofem::SimpleSlaveDof::giveIc ( )
overrideprotectedvirtual

Returns initial condition of dof if it is prescribed.

Returns
NULL if no IC applied, otherwise pointer to corresponding IC.

Reimplemented from oofem::Dof.

Definition at line 90 of file simpleslavedof.C.

References giveMasterDof().

◆ giveIcId()

int oofem::SimpleSlaveDof::giveIcId ( )
overridevirtual

Returns the id of associated initial condition, if there is any. Used only for printing purposes. In general, id could not be used to decide whether IC is active. Use appropriate services instead.

Returns
Id of associated initial condition, zero otherwise

Implements oofem::Dof.

Definition at line 136 of file simpleslavedof.C.

References giveMasterDof().

◆ giveMasterDof()

Dof * oofem::SimpleSlaveDof::giveMasterDof ( ) const
private

◆ giveMasterDofIndx()

int oofem::SimpleSlaveDof::giveMasterDofIndx ( ) const
inline

Returns number of master dof in master dofManager.

Definition at line 131 of file simpleslavedof.h.

References masterDofIndx.

◆ giveMasterDofManagerNum()

int oofem::SimpleSlaveDof::giveMasterDofManagerNum ( ) const
inline

Returns Master Dof Manager Number.

Definition at line 123 of file simpleslavedof.h.

References masterDofMngr.

Referenced by oofem::Node::checkConsistency(), and oofem::Subdivision::createMesh().

◆ giveMasterDofManArray()

void oofem::SimpleSlaveDof::giveMasterDofManArray ( IntArray & answer)
inlineoverridevirtual
Returns
Array of master DofManagers to which the receiver is linked.

Reimplemented from oofem::Dof.

Definition at line 124 of file simpleslavedof.h.

References oofem::IntArray::at(), masterDofMngr, and oofem::IntArray::resize().

◆ giveUnknown() [1/2]

double oofem::SimpleSlaveDof::giveUnknown ( PrimaryField & field,
ValueModeType mode,
TimeStep * tStep )
overridevirtual

The key method of class Dof. Returns the value of the unknown of the receiver at given time step associated to given field.

Parameters
fieldField used to provide values.
modeMode of unknown.
tStepTime step when unknown is requested. See documentation of particular EngngModel class for valid tStep values (most implementation can return only values for current and possibly for previous time step).
Returns
Value of unknown. If activeBC exist then returns value prescribed by BC. If tStep is time step when IC apply, returns value given by this IC.

Implements oofem::Dof.

Definition at line 102 of file simpleslavedof.C.

References giveMasterDof().

◆ giveUnknown() [2/2]

double oofem::SimpleSlaveDof::giveUnknown ( ValueModeType mode,
TimeStep * tStep )
overridevirtual

The key method of class Dof. Returns the value of the unknown of the receiver at given time step. Unknown is characterized by its physical meaning (i.g., displacement) an by its mode (e.g., value of displacement, velocity of displacement or acceleration of displacement). UnknownType of requested unknown must be same as UnknownType of Dof.

Parameters
modeMode of unknown (e.g, total value, velocity or acceleration of unknown).
tStepTime step when unknown is requested. See documentation of particular EngngModel class for valid tStep values (most implementation can return only values for current and possibly for previous time step).
Returns
Value of unknown. If activeBC exist then returns value prescribed by BC. If tStep is time step when IC apply, returns value given by this IC.

Implements oofem::Dof.

Definition at line 97 of file simpleslavedof.C.

References giveMasterDof().

◆ hasBc()

bool oofem::SimpleSlaveDof::hasBc ( TimeStep * tStep)
overridevirtual

Test if Dof has active boundary condition.

Parameters
tStepTime when test is evaluated.
Returns
True if active BC exists, false otherwise.

Implements oofem::Dof.

Definition at line 108 of file simpleslavedof.C.

References giveMasterDof().

◆ hasIc()

bool oofem::SimpleSlaveDof::hasIc ( )
overridevirtual

Test if Dof has initial condition.

Returns
True if IC exists, false otherwise.

Implements oofem::Dof.

Definition at line 116 of file simpleslavedof.C.

References giveMasterDof().

◆ hasIcOn()

bool oofem::SimpleSlaveDof::hasIcOn ( ValueModeType u)
overridevirtual

Test if Dof has initial condition of required ValueModeType.

Parameters
uType of required IC.
Returns
True if IC exists, false otherwise.
See also
ValueModeType

Implements oofem::Dof.

Definition at line 124 of file simpleslavedof.C.

References giveMasterDof().

◆ restoreContext()

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

Restores the receiver state previously written in stream.

Reimplemented from oofem::Dof.

Definition at line 169 of file simpleslavedof.C.

References oofem::CIO_IOERR, CM_Definition, masterDofIndx, masterDofMngr, oofem::DataStream::read(), and THROW_CIOERR.

◆ saveContext()

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

Stores receiver state to output stream.

Reimplemented from oofem::Dof.

Definition at line 149 of file simpleslavedof.C.

References oofem::CIO_IOERR, CM_Definition, CM_DefinitionGlobal, oofem::Dof::dofManager, masterDofMngr, THROW_CIOERR, and oofem::DataStream::write().

◆ setMasterDofManagerNum()

void oofem::SimpleSlaveDof::setMasterDofManagerNum ( int i)
inline

Sets master dof manager.

Definition at line 129 of file simpleslavedof.h.

References masterDofMngr.

◆ updateLocalNumbering()

void oofem::SimpleSlaveDof::updateLocalNumbering ( EntityRenumberingFunctor & f)
overridevirtual

Local renumbering support. For some tasks (parallel load balancing, for example) it is necessary to renumber the entities. The various FEM components (such as nodes or elements) typically contain links to other entities in terms of their local numbers, etc. This service allows to update these relations to reflect updated numbering. The renumbering function is passed, which is supposed to return an updated number of specified entity type based on old number.

Parameters
fFunction that converts old to new equation number.

Reimplemented from oofem::Dof.

Definition at line 183 of file simpleslavedof.C.

References oofem::ERS_DofManager, and masterDofMngr.

Member Data Documentation

◆ masterDofIndx

int oofem::SimpleSlaveDof::masterDofIndx
mutableprivate

Number of master dof in master dofManager.

Definition at line 76 of file simpleslavedof.h.

Referenced by giveMasterDofIndx(), restoreContext(), SimpleSlaveDof(), and SimpleSlaveDof().

◆ masterDofMngr

int oofem::SimpleSlaveDof::masterDofMngr
private

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