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

#include <activedof.h>

Inheritance diagram for oofem::ActiveDof:
Collaboration diagram for oofem::ActiveDof:

Public Member Functions

 ActiveDof (DofManager *aNode, DofIDItem id=Undef, int bc=0)
virtual ~ActiveDof ()
 Destructor.
void initialize (int cntOfMstrDfMngr, const IntArray &masterNodes, const IntArray *mstrDofID, const FloatArray &mstrContribution)
int giveNumberOfPrimaryMasterDofs () override
bool isPrimaryDof () override
int giveNumberOfMasterDofs ()
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
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.
dofType giveDofType () override
 Returns the type of the receiver.
const char * giveClassName () const override
 Returns class name of the receiver.
void updateLocalNumbering (EntityRenumberingFunctor &f) override
int __giveEquationNumber () const override
int __givePrescribedEquationNumber () override
int askNewEquationNumber (TimeStep *tStep) override
bool hasBc (TimeStep *tStep) override
int giveBcId () override
void setBcId (int bcId) override
 Overwrites the boundary condition id (0-inactive BC), intended for specific purposes such as coupling of bc's in multiscale simulations.
double giveBcValue (ValueModeType mode, TimeStep *tStep) override
bool hasIcOn (ValueModeType type) override
InitialConditiongiveIc () override
bool hasIc () override
int giveIcId () override
ActiveBoundaryConditiongiveActiveBoundaryCondition ()
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)
DofIDItem giveDofID () const
void setDofID (DofIDItem id)
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 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 ()

Protected Attributes

int equationNumber
 Corresponding equation number (positive value) or prescribed equation number (negative value).
int bc
 Boundary condition number.
ActiveBoundaryConditionactiveBC
 Active boundary condition number.
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 with an active boundary condition. It is similar to SlaveDof, but its actual value is controlled by an active boundary condition. The code is simple, the functions just pass on the evaluation to the corresponding active boundary condition.

Definition at line 48 of file activedof.h.

Constructor & Destructor Documentation

◆ ActiveDof()

oofem::ActiveDof::ActiveDof ( DofManager * aNode,
DofIDItem id = Undef,
int bc = 0 )

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

Parameters
aNodeNode receiver will belong to.
idDofID of slave dof.
bcBoundary condition dof belongs to.

Definition at line 44 of file activedof.C.

References activeBC, bc, oofem::Dof::Dof(), and equationNumber.

◆ ~ActiveDof()

virtual oofem::ActiveDof::~ActiveDof ( )
inlinevirtual

Destructor.

Definition at line 67 of file activedof.h.

Member Function Documentation

◆ __giveEquationNumber()

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

Returns equation number of receiver, usually assigned by emodel. 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.

Returns
Equation number of DOF.

Implements oofem::Dof.

Definition at line 204 of file activedof.C.

References equationNumber.

◆ __givePrescribedEquationNumber()

int oofem::ActiveDof::__givePrescribedEquationNumber ( )
overridevirtual

Returns prescribed equation number of receiver. If Dof has inactive BC, returned prescribed equation number is zero. If Dof has active BC, then the corresponding prescribed equation number is returned. is zero. After initializing Dof by calling constructor, Dof has no prescribed equation number assigned. When firstly invoked, this function asks EngngModel object for next equation or 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.

Returns
Prescribed equation number.

Implements oofem::Dof.

Definition at line 209 of file activedof.C.

References equationNumber.

◆ askNewEquationNumber()

int oofem::ActiveDof::askNewEquationNumber ( TimeStep * tStep)
overridevirtual

Asks EngngModel for new equation number. Necessary for EngngModels supporting changes of static system during solution. Then it is necessary to force equation renumbering after finishing each time step.

Parameters
tStepTime step determining the time.
See also
Dof::updateUnknownsDictionary
EngngModel::requiresUnknownsDictionaryUpdate

Implements oofem::Dof.

Definition at line 214 of file activedof.C.

References oofem::Dof::dofManager, oofem::DofManager_null, equationNumber, oofem::EngngModel::giveNewEquationNumber(), oofem::EngngModel::giveNewPrescribedEquationNumber(), hasBc(), and isPrimaryDof().

◆ computeDofTransformation()

void oofem::ActiveDof::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 172 of file activedof.C.

References oofem::FloatArray::at(), oofem::FloatArray::copySubVector(), giveActiveBoundaryCondition(), giveMasterDof(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), isPrimaryDof(), oofem::FloatArray::resize(), and oofem::FloatArray::times().

◆ giveActiveBoundaryCondition()

◆ giveBcId()

int oofem::ActiveDof::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 241 of file activedof.C.

References bc.

◆ giveBcValue()

double oofem::ActiveDof::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 252 of file activedof.C.

References giveActiveBoundaryCondition().

◆ giveClassName()

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

Returns class name of the receiver.

Reimplemented from oofem::Dof.

Definition at line 87 of file activedof.h.

◆ giveDofIDs()

void oofem::ActiveDof::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 108 of file activedof.C.

References oofem::IntArray::at(), oofem::IntArray::clear(), oofem::IntArray::followedBy(), oofem::Dof::giveDofID(), giveMasterDof(), giveNumberOfMasterDofs(), isPrimaryDof(), oofem::IntArray::preallocate(), and oofem::IntArray::resize().

◆ giveDofType()

dofType oofem::ActiveDof::giveDofType ( )
inlineoverridevirtual

Returns the type of the receiver.

Implements oofem::Dof.

Definition at line 86 of file activedof.h.

◆ giveEquationNumbers()

void oofem::ActiveDof::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 89 of file activedof.C.

References oofem::IntArray::at(), oofem::IntArray::clear(), oofem::IntArray::followedBy(), oofem::Dof::giveEquationNumber(), giveMasterDof(), giveNumberOfMasterDofs(), isPrimaryDof(), oofem::IntArray::preallocate(), and oofem::IntArray::resize().

◆ giveIc()

InitialCondition * oofem::ActiveDof::giveIc ( )
overridevirtual

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 262 of file activedof.C.

◆ giveIcId()

int oofem::ActiveDof::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 261 of file activedof.C.

◆ giveMasterDof()

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

◆ giveMasterDofManArray()

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

Reimplemented from oofem::Dof.

Definition at line 127 of file activedof.C.

References oofem::IntArray::at(), oofem::IntArray::followedBy(), oofem::Dof::giveDofManNumber(), giveMasterDof(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), isPrimaryDof(), and oofem::IntArray::resize().

◆ giveNumberOfMasterDofs()

int oofem::ActiveDof::giveNumberOfMasterDofs ( )

◆ giveNumberOfPrimaryMasterDofs()

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

Reimplemented from oofem::Dof.

Definition at line 64 of file activedof.C.

References giveActiveBoundaryCondition(), giveMasterDof(), and isPrimaryDof().

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

◆ giveUnknown() [1/2]

double oofem::ActiveDof::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 198 of file activedof.C.

References giveActiveBoundaryCondition().

◆ giveUnknown() [2/2]

double oofem::ActiveDof::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 193 of file activedof.C.

References giveActiveBoundaryCondition().

◆ giveUnknowns() [1/2]

void oofem::ActiveDof::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 159 of file activedof.C.

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

◆ giveUnknowns() [2/2]

void oofem::ActiveDof::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 146 of file activedof.C.

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

◆ hasBc()

bool oofem::ActiveDof::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 236 of file activedof.C.

References giveActiveBoundaryCondition().

Referenced by askNewEquationNumber().

◆ hasIc()

bool oofem::ActiveDof::hasIc ( )
overridevirtual

Test if Dof has initial condition.

Returns
True if IC exists, false otherwise.

Implements oofem::Dof.

Definition at line 260 of file activedof.C.

◆ hasIcOn()

bool oofem::ActiveDof::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 259 of file activedof.C.

◆ initialize()

void oofem::ActiveDof::initialize ( int cntOfMstrDfMngr,
const IntArray & masterNodes,
const IntArray * mstrDofID,
const FloatArray & mstrContribution )

Definition at line 48 of file activedof.C.

References OOFEM_ERROR.

◆ isPrimaryDof()

bool oofem::ActiveDof::isPrimaryDof ( )
overridevirtual

Tests if receiver is primary DOF. Dof is primary if it possess or directly represent certain DOF. If it is linked somehow (rigid arm, doubled node) to other DOF(s) then it is not primary DOF.

Returns
True if receiver is primary DOF, false otherwise (default).

Reimplemented from oofem::Dof.

Definition at line 78 of file activedof.C.

References giveActiveBoundaryCondition().

Referenced by askNewEquationNumber(), computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), and giveNumberOfPrimaryMasterDofs().

◆ restoreContext()

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

Restores the receiver state previously written in stream.

Reimplemented from oofem::Dof.

Definition at line 270 of file activedof.C.

◆ saveContext()

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

Stores receiver state to output stream.

Reimplemented from oofem::Dof.

Definition at line 265 of file activedof.C.

◆ setBcId()

void oofem::ActiveDof::setBcId ( int bcId)
overridevirtual

Overwrites the boundary condition id (0-inactive BC), intended for specific purposes such as coupling of bc's in multiscale simulations.

Reimplemented from oofem::Dof.

Definition at line 246 of file activedof.C.

References activeBC, and bc.

◆ updateLocalNumbering()

void oofem::ActiveDof::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 279 of file activedof.C.

Member Data Documentation

◆ activeBC

ActiveBoundaryCondition* oofem::ActiveDof::activeBC
protected

Active boundary condition number.

Definition at line 56 of file activedof.h.

Referenced by ActiveDof(), giveActiveBoundaryCondition(), and setBcId().

◆ bc

int oofem::ActiveDof::bc
protected

Boundary condition number.

Definition at line 54 of file activedof.h.

Referenced by ActiveDof(), giveActiveBoundaryCondition(), giveBcId(), and setBcId().

◆ equationNumber

int oofem::ActiveDof::equationNumber
protected

Corresponding equation number (positive value) or prescribed equation number (negative value).

Definition at line 52 of file activedof.h.

Referenced by __giveEquationNumber(), __givePrescribedEquationNumber(), ActiveDof(), and askNewEquationNumber().


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