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

#include <slavedof.h>

Inheritance diagram for oofem::SlaveDof:
Collaboration diagram for oofem::SlaveDof:

Public Member Functions

 SlaveDof (DofManager *aNode, DofIDItem id=Undef)
virtual ~SlaveDof (void)
 Destructor.
dofType giveDofType () override
 Returns the type of the receiver.
void initialize (const IntArray &masterNodes, const IntArray &mstrDofID, const FloatArray &mstrContribution)
int giveNumberOfPrimaryMasterDofs () override
void giveMasterDofManArray (IntArray &answer) override
void giveUnknowns (FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep) override
void giveUnknowns (FloatArray &masterUnknowns, PrimaryField &field, ValueModeType mode, TimeStep *tStep) override
void computeDofTransformation (FloatArray &primaryMasterContribs) override
void giveEquationNumbers (IntArray &masterEqNumbers, const UnknownNumberingScheme &s) override
void giveDofIDs (IntArray &masterDofIDs) override
double giveUnknown (ValueModeType mode, TimeStep *tStep) override
double giveUnknown (PrimaryField &field, ValueModeType mode, TimeStep *tStep) override
int __giveEquationNumber () const override
int __givePrescribedEquationNumber () override
int askNewEquationNumber (TimeStep *tStep) override
bool hasBc (TimeStep *tStep) override
bool hasIc () override
bool hasIcOn (ValueModeType) override
int giveBcId () override
int giveIcId () 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.
const char * giveClassName () const override
 Returns class name of the receiver.
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
virtual double giveBcValue (ValueModeType mode, TimeStep *tStep)
int giveEquationNumber (const UnknownNumberingScheme &s)
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

DofgiveMasterDof (int i)
Protected Member Functions inherited from oofem::Dof
virtual BoundaryConditiongiveBc ()
virtual InitialConditiongiveIc ()

Protected Attributes

int countOfMasterDofs
 Count of master DofManagers.
int countOfPrimaryMasterDofs
 Count of master DofManagers.
IntArray masterDofMans
 Array of master DofManagers.
IntArray dofIDs
 Array of master dofIDs.
FloatArray masterContribution
 Vector of master contribution coefficients.
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. This dof is generally linked to some master dofs with various weights - contributions - combination (link slave-slave is allowed). The slave dof is fully dependent upon master dofs, therefore it's equation number is undefined. It can have own boundary conditions - it is not yet implemented.

Definition at line 47 of file slavedof.h.

Constructor & Destructor Documentation

◆ SlaveDof()

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

Constructor. Creates slave dof with number n, belonging to aNode dof manager.

Parameters
aNodeNode receiver will belong to.
idDofID of slave dof.

Definition at line 44 of file slavedof.C.

References countOfMasterDofs, countOfPrimaryMasterDofs, oofem::Dof::Dof(), and masterContribution.

◆ ~SlaveDof()

virtual oofem::SlaveDof::~SlaveDof ( void )
inlinevirtual

Destructor.

Definition at line 69 of file slavedof.h.

Member Function Documentation

◆ __giveEquationNumber()

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

Returns equation number corresponding to receiver. Rigid Arm Slave have equation number undefined. Usually single dof in node connected using rigid arm is contributing to several master dofs (displacement to displacement and rotations in master).

Returns
Prints error message and exits.

Implements oofem::Dof.

Definition at line 202 of file slavedof.C.

References OOFEM_ERROR.

◆ __givePrescribedEquationNumber()

int oofem::SlaveDof::__givePrescribedEquationNumber ( )
overridevirtual

Returns equation number corresponding to receiver. Rigid Arm Slave have equation number undefined. Usually single dof in node connected using rigid arm is contributing to several master dofs (displacement to displacement and rotations in master).

Returns
Prints error message and exits.

Implements oofem::Dof.

Definition at line 208 of file slavedof.C.

References OOFEM_ERROR.

◆ askNewEquationNumber()

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

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

Implements oofem::Dof.

Definition at line 115 of file slavedof.h.

◆ computeDofTransformation()

void oofem::SlaveDof::computeDofTransformation ( FloatArray & masterContribs)
overridevirtual

Computes dof transformation array, which describes the dependence of receiver value on values of master dofs. For primary dof, this transformation is unity, however, for slave DOFs, this array contains weights, which are multiplied by corresponding master DOF values to obtain slave value.

Parameters
masterContribsContributions of master dofs for receiver.

Reimplemented from oofem::Dof.

Definition at line 135 of file slavedof.C.

References oofem::FloatArray::copySubVector(), countOfMasterDofs, giveMasterDof(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), masterContribution, oofem::FloatArray::resize(), and oofem::FloatArray::times().

Referenced by giveUnknown(), and giveUnknown().

◆ giveBcId()

int oofem::SlaveDof::giveBcId ( )
inlineoverridevirtual

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 137 of file slavedof.h.

◆ giveClassName()

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

Returns class name of the receiver.

Reimplemented from oofem::Dof.

Definition at line 143 of file slavedof.h.

◆ giveDofIDs()

void oofem::SlaveDof::giveDofIDs ( IntArray & masterDofIDs)
overridevirtual

As giveEquationNumbers but for dof IDs.

Parameters
[out]masterDofIDsDof IDs of master DOFs for receiver.

Reimplemented from oofem::Dof.

Definition at line 166 of file slavedof.C.

References oofem::IntArray::clear(), countOfMasterDofs, oofem::IntArray::followedBy(), giveMasterDof(), giveNumberOfPrimaryMasterDofs(), and oofem::IntArray::preallocate().

◆ giveDofType()

dofType oofem::SlaveDof::giveDofType ( )
inlineoverridevirtual

Returns the type of the receiver.

Implements oofem::Dof.

Definition at line 71 of file slavedof.h.

◆ giveEquationNumbers()

void oofem::SlaveDof::giveEquationNumbers ( IntArray & masterEqNumbers,
const UnknownNumberingScheme & s )
overridevirtual

Returns equation number of receiver. If Dof has active BC, returned equation number is zero. After initializing Dof by calling constructor, Dof has no equation number assigned. When firstly invoked, this function asks EngngModel object for next equation prescribed equation number (this will increase also total number of equation at EngngModel level). Note: By asking nodal code numbers or element code numbers when initializing code numbers in EngngMode, designer should alter equation numbering strategy.

For slave dofs (dependent on other primary dofs) the array of master equation numbers is returned.

Parameters
[out]masterEqNumbersEquation numbers of master DOFs for receiver.
[in]sNumbering scheme used enumeration of equations.

Reimplemented from oofem::Dof.

Definition at line 150 of file slavedof.C.

References oofem::IntArray::clear(), countOfMasterDofs, oofem::IntArray::followedBy(), giveMasterDof(), giveNumberOfPrimaryMasterDofs(), and oofem::IntArray::preallocate().

◆ giveIcId()

int oofem::SlaveDof::giveIcId ( )
inlineoverridevirtual

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 138 of file slavedof.h.

◆ giveMasterDof()

Dof * oofem::SlaveDof::giveMasterDof ( int i)
inlineprotected

◆ giveMasterDofManArray()

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

Reimplemented from oofem::Dof.

Definition at line 301 of file slavedof.C.

References oofem::IntArray::clear(), countOfMasterDofs, oofem::IntArray::followedBy(), giveMasterDof(), giveNumberOfPrimaryMasterDofs(), and oofem::IntArray::preallocate().

◆ giveNumberOfPrimaryMasterDofs()

int oofem::SlaveDof::giveNumberOfPrimaryMasterDofs ( )
overridevirtual
Returns
Number of primary dofs, on which receiver value depends on (even recursively).

Reimplemented from oofem::Dof.

Definition at line 84 of file slavedof.C.

References countOfMasterDofs, countOfPrimaryMasterDofs, giveMasterDof(), and OOFEM_ERROR.

Referenced by computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), giveUnknowns(), and giveUnknowns().

◆ giveUnknown() [1/2]

double oofem::SlaveDof::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 191 of file slavedof.C.

References computeDofTransformation(), oofem::FloatArray::dotProduct(), and giveUnknowns().

◆ giveUnknown() [2/2]

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

Returns the value of the unknown associated with the receiver at given time step. Slave simply asks vector of corresponding master dofs and own transformation vector and returns result as dot product of these vectors. Standard element services have to transform global unknown vector transform into their local c.s before using it (when computing strain vector by \(\epsilon = B\cdot r \), for example, where B is element geometrical matrix). This transformation should contain also nodal to global coordinate system transformation. So, this specialized standard method for unknown query returns the corresponding master DOF value.

See also
MasterDof::giveUnknown

Implements oofem::Dof.

Definition at line 181 of file slavedof.C.

References computeDofTransformation(), oofem::FloatArray::dotProduct(), and giveUnknowns().

◆ giveUnknowns() [1/2]

void oofem::SlaveDof::giveUnknowns ( FloatArray & masterUnknowns,
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. For primary dof it returns is associated unknown value, for slave dofs it returns an array of master values (in recursive way).

Parameters
masterUnknowns
fieldThe field to pick unknowns from.
modeValue mode for unknowns.
tStepTime step for when unknowns are requested.

Reimplemented from oofem::Dof.

Definition at line 121 of file slavedof.C.

References oofem::FloatArray::copySubVector(), countOfMasterDofs, giveMasterDof(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), and oofem::FloatArray::resize().

◆ giveUnknowns() [2/2]

void oofem::SlaveDof::giveUnknowns ( FloatArray & masterUnknowns,
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. For primary dof it returns is associated unknown value, for slave dofs it returns an array of master values (in recursive way).

Parameters
masterUnknownsValues of master unknowns for receiver.
modeValue mode for unknowns.
tStepTime step for when unknowns are requested.

Reimplemented from oofem::Dof.

Definition at line 107 of file slavedof.C.

References oofem::FloatArray::copySubVector(), countOfMasterDofs, giveMasterDof(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), and oofem::FloatArray::resize().

Referenced by giveUnknown(), and giveUnknown().

◆ hasBc()

bool oofem::SlaveDof::hasBc ( TimeStep * tStep)
inlineoverridevirtual

Returns boundary condition of dof if it is prescribed. HangingDof can not be subjected to BC, it is only mapping to master

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

Implements oofem::Dof.

Definition at line 122 of file slavedof.h.

◆ hasIc()

bool oofem::SlaveDof::hasIc ( )
inlineoverridevirtual

Returns initial condition of dof if it is prescribed. HangingDof can not be subjected to IC, it is only mapping to master

See also
MasterDof::hasIc

Implements oofem::Dof.

Definition at line 129 of file slavedof.h.

◆ hasIcOn()

bool oofem::SlaveDof::hasIcOn ( ValueModeType )
inlineoverridevirtual

RigidArmSlaveDof can not be subjected to IC - it is only mapping to master.

See also
MasterDof::hasIc

Implements oofem::Dof.

Definition at line 135 of file slavedof.h.

◆ initialize()

◆ restoreContext()

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

Restores the receiver state previously written in stream.

Reimplemented from oofem::Dof.

Definition at line 250 of file slavedof.C.

References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, countOfMasterDofs, countOfPrimaryMasterDofs, dofIDs, masterContribution, masterDofMans, oofem::DataStream::read(), and THROW_CIOERR.

◆ saveContext()

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

◆ updateLocalNumbering()

void oofem::SlaveDof::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 292 of file slavedof.C.

References countOfMasterDofs, oofem::ERS_DofManager, and masterDofMans.

Member Data Documentation

◆ countOfMasterDofs

int oofem::SlaveDof::countOfMasterDofs
protected

◆ countOfPrimaryMasterDofs

int oofem::SlaveDof::countOfPrimaryMasterDofs
protected

Count of master DofManagers.

Definition at line 53 of file slavedof.h.

Referenced by giveNumberOfPrimaryMasterDofs(), restoreContext(), saveContext(), and SlaveDof().

◆ dofIDs

IntArray oofem::SlaveDof::dofIDs
protected

Array of master dofIDs.

Definition at line 57 of file slavedof.h.

Referenced by giveMasterDof(), initialize(), restoreContext(), and saveContext().

◆ masterContribution

FloatArray oofem::SlaveDof::masterContribution
protected

Vector of master contribution coefficients.

Definition at line 59 of file slavedof.h.

Referenced by computeDofTransformation(), initialize(), restoreContext(), saveContext(), and SlaveDof().

◆ masterDofMans

IntArray oofem::SlaveDof::masterDofMans
protected

Array of master DofManagers.

Definition at line 55 of file slavedof.h.

Referenced by giveMasterDof(), initialize(), restoreContext(), saveContext(), and updateLocalNumbering().


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