OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class representing "slave" degree of freedom. More...
#include <simpleslavedof.h>
Public Member Functions | |
SimpleSlaveDof (DofManager *aNode, int master, DofIDItem id) | |
Constructor. More... | |
SimpleSlaveDof (DofManager *aNode, DofIDItem id=Undef) | |
virtual | ~SimpleSlaveDof () |
Destructor. More... | |
virtual dofType | giveDofType () |
Returns the type of the receiver. More... | |
virtual const char * | giveClassName () const |
Returns class name of the receiver. More... | |
virtual int | __giveEquationNumber () const |
Returns equation number corresponding to receiver. More... | |
virtual int | __givePrescribedEquationNumber () |
Returns prescribed equation number corresponding to receiver. More... | |
virtual int | askNewEquationNumber (TimeStep *tStep) |
Asks new equation number. More... | |
virtual double | giveUnknown (ValueModeType, TimeStep *) |
The key method of class Dof. More... | |
virtual double | giveUnknown (PrimaryField &field, ValueModeType, TimeStep *tStep) |
The key method of class Dof. More... | |
virtual bool | hasBc (TimeStep *tStep) |
Test if Dof has active boundary condition. More... | |
virtual bool | hasIc () |
Test if Dof has initial condition. More... | |
virtual bool | hasIcOn (ValueModeType) |
Test if Dof has initial condition of required ValueModeType. More... | |
virtual int | giveBcId () |
Returns the id of associated boundary condition, if there is any. More... | |
virtual int | giveIcId () |
Returns the id of associated initial condition, if there is any. More... | |
virtual double | giveBcValue (ValueModeType mode, TimeStep *tStep) |
Returns value of boundary condition of dof if it is prescribed. More... | |
virtual contextIOResultType | saveContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
Stores receiver state to output stream. More... | |
virtual contextIOResultType | restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
Restores the receiver state previously written in stream. More... | |
int | giveMasterDofManagerNum () const |
Returns Master Dof Manager Number. More... | |
virtual void | giveMasterDofManArray (IntArray &answer) |
void | setMasterDofManagerNum (int i) |
Sets master dof manager. More... | |
int | giveMasterDofIndx () const |
Returns number of master dof in master dofManager. More... | |
virtual void | updateLocalNumbering (EntityRenumberingFunctor &f) |
Local renumbering support. More... | |
Public Member Functions inherited from oofem::Dof | |
Dof (DofManager *aNode, DofIDItem id=Undef) | |
Constructor. More... | |
virtual | ~Dof () |
Destructor. More... | |
int | giveDofManNumber () const |
DofManager * | giveDofManager () const |
int | giveDofManGlobalNumber () const |
int | giveEquationNumber (const UnknownNumberingScheme &s) |
Returns equation number of receiver for given equation numbering scheme. More... | |
virtual void | giveEquationNumbers (IntArray &masterEqNumbers, const UnknownNumberingScheme &s) |
Returns equation number of receiver. More... | |
virtual void | giveDofIDs (IntArray &masterDofIDs) |
As giveEquationNumbers but for dof IDs. More... | |
virtual void | giveUnknowns (FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep) |
The key method of class Dof. More... | |
virtual void | giveUnknowns (FloatArray &masterUnknowns, PrimaryField &field, ValueModeType mode, TimeStep *tStep) |
The key method of class Dof. More... | |
virtual void | computeDofTransformation (FloatArray &masterContribs) |
Computes dof transformation array, which describes the dependence of receiver value on values of master dofs. More... | |
virtual int | giveNumberOfPrimaryMasterDofs () |
DofIDItem | giveDofID () const |
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e.g., u-displacement, v-displacement, ...). More... | |
void | setDofID (DofIDItem id) |
Sets the ID of receiver. More... | |
virtual bool | isPrimaryDof () |
Tests if receiver is primary DOF. More... | |
virtual void | printSingleOutputAt (FILE *file, TimeStep *tStep, char ch, ValueModeType mode, double scale=1.0) |
Prints Dof output (it prints value of unknown related to dof at given timeStep). More... | |
virtual void | printMultipleOutputAt (FILE *File, TimeStep *tStep, char *ch, ValueModeType *mode, int nite) |
Prints Dof output (it prints value of unknown related to dof at given timeStep). More... | |
void | printSingleOutputWithAdditionAt (FILE *File, TimeStep *tStep, char ch, ValueModeType mode, double addend) |
virtual void | printYourself () |
Prints the receiver state on stdout. More... | |
virtual void | updateYourself (TimeStep *tStep) |
Updates receiver after finishing time step. More... | |
virtual void | updateUnknownsDictionary (TimeStep *tStep, ValueModeType mode, double dofValue) |
Abstract function, allowing Dof to store its unknowns in its own private dictionary. More... | |
virtual double | giveUnknownsDictionaryValue (TimeStep *tStep, ValueModeType mode) |
Access dictionary value, if not present zero is returned. More... | |
std::string | errorInfo (const char *func) const |
Returns string for prepending output (used by error reporting macros). More... | |
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. More... | |
virtual void | setIcId (int icId) |
Overwrites the initial condition id (0-inactive IC) More... | |
virtual void | setEquationNumber (int equationNumber) |
Sets a specific equation number to receiver. More... | |
virtual void | setUnknowns (Dictionary *unknowns) |
Sets the dictionary of unknowns for receiver. More... | |
virtual Dictionary * | giveUnknowns () |
Receives the dictionary of unknowns in receiver. More... | |
virtual int | giveEqn () |
Gives number for equation, negative for prescribed equations. More... | |
virtual int | packUnknowns (DataStream &buff, ValueModeType mode, TimeStep *tStep) |
Packs specific DOF Manager's dofs unknowns into communication buffer. More... | |
virtual int | unpackAndUpdateUnknown (DataStream &buff, ValueModeType mode, TimeStep *tStep) |
Unpacks DOF unknown from communication buffer and updates unknown if necessary. More... | |
Protected Member Functions | |
BoundaryCondition * | giveBc () |
Returns boundary condition of dof if it is prescribed. More... | |
InitialCondition * | giveIc () |
Returns initial condition of dof if it is prescribed. More... | |
Private Member Functions | |
Dof * | giveMasterDof () const |
Returns reference to master dof. More... | |
Private Attributes | |
int | masterDofMngr |
Number of DofManager containing master dof (Master DofManager) More... | |
int | masterDofIndx |
Number of master dof in master dofManager. More... | |
Additional Inherited Members | |
Protected Attributes inherited from oofem::Dof | |
DofManager * | dofManager |
Link to related DofManager. More... | |
DofIDItem | dofID |
Physical meaning of DOF. More... | |
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.
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.
aNode | receiver will belong to aNode dof manager |
master | number of dofManager which contain master dof |
id | DofID of master dof (and slave too). |
Definition at line 43 of file simpleslavedof.C.
References masterDofIndx, and masterDofMngr.
oofem::SimpleSlaveDof::SimpleSlaveDof | ( | DofManager * | aNode, |
DofIDItem | id = Undef |
||
) |
Definition at line 50 of file simpleslavedof.C.
References masterDofIndx, and masterDofMngr.
|
inlinevirtual |
Destructor.
Definition at line 90 of file simpleslavedof.h.
|
virtual |
Returns equation number corresponding to receiver.
Slave simply forwards this message to master.
Implements oofem::Dof.
Definition at line 72 of file simpleslavedof.C.
References oofem::Dof::__giveEquationNumber(), and giveMasterDof().
|
virtual |
Returns prescribed equation number corresponding to receiver.
Slave simply forwards this message to master.
Implements oofem::Dof.
Definition at line 81 of file simpleslavedof.C.
References oofem::Dof::__givePrescribedEquationNumber(), and giveMasterDof().
|
inlinevirtual |
Asks new equation number.
Empty function (master is assumed to receive same message).
Implements oofem::Dof.
Definition at line 109 of file simpleslavedof.h.
|
protectedvirtual |
Returns boundary condition of dof if it is prescribed.
Reimplemented from oofem::Dof.
Definition at line 65 of file simpleslavedof.C.
References oofem::Dof::giveBc(), and giveMasterDof().
|
virtual |
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.
Implements oofem::Dof.
Definition at line 131 of file simpleslavedof.C.
References oofem::Dof::giveBcId(), and giveMasterDof().
|
virtual |
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.
mode | Unknown char type (if total or incremental value is returned). |
tStep | Time step. |
Reimplemented from oofem::Dof.
Definition at line 143 of file simpleslavedof.C.
References oofem::Dof::giveBcValue(), and giveMasterDof().
|
inlinevirtual |
Returns class name of the receiver.
Reimplemented from oofem::Dof.
Definition at line 93 of file simpleslavedof.h.
|
inlinevirtual |
Returns the type of the receiver.
Implements oofem::Dof.
Definition at line 92 of file simpleslavedof.h.
|
protectedvirtual |
Returns initial condition of dof if it is prescribed.
Reimplemented from oofem::Dof.
Definition at line 90 of file simpleslavedof.C.
References oofem::Dof::giveIc(), and giveMasterDof().
|
virtual |
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.
Implements oofem::Dof.
Definition at line 136 of file simpleslavedof.C.
References oofem::Dof::giveIcId(), and giveMasterDof().
|
private |
Returns reference to master dof.
Definition at line 57 of file simpleslavedof.C.
References oofem::Dof::dofID, oofem::Dof::dofManager, oofem::Domain::giveDofManager(), oofem::DofManager::giveDofWithID(), oofem::FEMComponent::giveDomain(), and masterDofMngr.
Referenced by __giveEquationNumber(), __givePrescribedEquationNumber(), giveBc(), giveBcId(), giveBcValue(), giveIc(), giveIcId(), giveUnknown(), hasBc(), hasIc(), and hasIcOn().
|
inline |
Returns number of master dof in master dofManager.
Definition at line 131 of file simpleslavedof.h.
|
inline |
Returns Master Dof Manager Number.
Definition at line 123 of file simpleslavedof.h.
Referenced by oofem::Node::checkConsistency(), and oofem::Subdivision::createMesh().
|
inlinevirtual |
Reimplemented from oofem::Dof.
Definition at line 124 of file simpleslavedof.h.
References oofem::IntArray::at(), and oofem::IntArray::resize().
|
virtual |
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.
mode | Mode of unknown (e.g, total value, velocity or acceleration of unknown). |
tStep | Time 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). |
Implements oofem::Dof.
Definition at line 97 of file simpleslavedof.C.
References giveMasterDof(), and oofem::Dof::giveUnknown().
|
virtual |
The key method of class Dof.
Returns the value of the unknown of the receiver at given time step associated to given field.
field | Field used to provide values. |
mode | Mode of unknown. |
tStep | Time 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). |
Implements oofem::Dof.
Definition at line 102 of file simpleslavedof.C.
References giveMasterDof(), and oofem::Dof::giveUnknown().
|
virtual |
Test if Dof has active boundary condition.
tStep | Time when test is evaluated. |
Implements oofem::Dof.
Definition at line 108 of file simpleslavedof.C.
References giveMasterDof(), and oofem::Dof::hasBc().
|
virtual |
Test if Dof has initial condition.
Implements oofem::Dof.
Definition at line 116 of file simpleslavedof.C.
References giveMasterDof(), and oofem::Dof::hasIc().
|
virtual |
Test if Dof has initial condition of required ValueModeType.
u | Type of required IC. |
Implements oofem::Dof.
Definition at line 124 of file simpleslavedof.C.
References giveMasterDof(), and oofem::Dof::hasIcOn().
|
virtual |
Restores the receiver state previously written in stream.
Reimplemented from oofem::Dof.
Definition at line 178 of file simpleslavedof.C.
References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, masterDofIndx, masterDofMngr, oofem::DataStream::read(), oofem::Dof::restoreContext(), and THROW_CIOERR.
|
virtual |
Stores receiver state to output stream.
Reimplemented from oofem::Dof.
Definition at line 149 of file simpleslavedof.C.
References oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, CM_DefinitionGlobal, oofem::Dof::dofManager, oofem::Domain::giveDofManager(), oofem::FEMComponent::giveDomain(), oofem::DofManager::giveGlobalNumber(), masterDofMngr, oofem::Dof::saveContext(), THROW_CIOERR, and oofem::DataStream::write().
|
inline |
Sets master dof manager.
Definition at line 129 of file simpleslavedof.h.
|
virtual |
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.
f | Function that converts old to new equation number. |
Reimplemented from oofem::Dof.
Definition at line 203 of file simpleslavedof.C.
References oofem::ERS_DofManager, and masterDofMngr.
|
mutableprivate |
Number of master dof in master dofManager.
Definition at line 76 of file simpleslavedof.h.
Referenced by restoreContext(), and SimpleSlaveDof().
|
private |
Number of DofManager containing master dof (Master DofManager)
Definition at line 74 of file simpleslavedof.h.
Referenced by giveMasterDof(), restoreContext(), saveContext(), SimpleSlaveDof(), and updateLocalNumbering().