OOFEM
2.4
OOFEM.org  Object Oriented Finite Element Solver

Class representing "master" degree of freedom. More...
#include <masterdof.h>
Public Member Functions  
MasterDof (DofManager *aNode, int nbc, int nic, DofIDItem id)  
Constructor. More...  
MasterDof (DofManager *aNode, DofIDItem id=Undef)  
virtual  ~MasterDof () 
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 of receiver, usually assigned by emodel. More...  
virtual int  __givePrescribedEquationNumber () 
Returns prescribed equation number of receiver. More...  
virtual int  askNewEquationNumber (TimeStep *tStep) 
Asks EngngModel for new equation number. More...  
virtual double  giveUnknown (ValueModeType mode, TimeStep *tStep) 
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 bool  isPrimaryDof () 
Tests if receiver is primary DOF. 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 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...  
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...  
virtual void  setBcId (int bcId) 
Overwrites the boundary condition id (0inactive 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 (0inactive IC) More...  
virtual void  setEquationNumber (int newEquationNumber) 
Sets a specific equation number to 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...  
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 
virtual double  giveBcValue (ValueModeType mode, TimeStep *tStep) 
Returns value of boundary condition of dof if it is prescribed. More...  
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., udisplacement, vdisplacement, ...). More...  
void  setDofID (DofIDItem id) 
Sets the ID of receiver. More...  
virtual void  giveMasterDofManArray (IntArray &answer) 
virtual void  updateLocalNumbering (EntityRenumberingFunctor &f) 
Local renumbering support. 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) 
std::string  errorInfo (const char *func) const 
Returns string for prepending output (used by error reporting macros). More...  
virtual void  setUnknowns (Dictionary *unknowns) 
Sets the dictionary of unknowns for receiver. 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...  
Protected Attributes  
int  equationNumber 
Corresponding equation number (positive value) or prescribed equation number (negative value). More...  
int  bc 
Boundary condition number associated to dof. More...  
int  ic 
Initial condition number associated to dof. More...  
Dictionary  unknowns 
Unknowns dictionary to support changes of static system. More...  
Protected Attributes inherited from oofem::Dof  
DofManager *  dofManager 
Link to related DofManager. More...  
DofIDItem  dofID 
Physical meaning of DOF. More...  
Class representing "master" degree of freedom.
Master is degree of freedom, which has its related unknown and corresponding equation number.
This class implements a nodal degree of freedom. A dof is usually attribute of one node.
'number' and 'node' are used for reading/writing data in the data file. 'equationNumber' keeps the number of the associated equation in the linear system (value>0) or the associated prescribed equation number if the dof is subjected to a boundary condition (b.c.) (value<0). 'bc' is the number of the b.c. the dof is subjected to, if any. 'DofID' is parameter determining physical meaning of receiver. This parameter is also used in member function giveUnknownType, which returns CharType type according to DofID parameter.
I don't know whether to implement following feature (now not implemented) 'unknowns' and 'pastUnknowns' are the dictionaries where the dof stores its unknowns (e.g., the displacement 'd', the velocity 'v' and the acceleration 'a'), at the current time step and at the previous one.
TASKS
REMARKS
Definition at line 92 of file masterdof.h.
oofem::MasterDof::MasterDof  (  DofManager *  aNode, 
int  nbc,  
int  nic,  
DofIDItem  id  
) 
Constructor.
Creates master dof with number i, belonging to DofManager aNode and with physical meaning described by id.
i  DOF number. 
aNode  DofManager which possess DOF. 
nbc  Number of associated boundary condition, zero if none. 
nic  Number of associated initial condition, zero if none. 
id  Physical meaning type. 
Definition at line 48 of file masterdof.C.
References bc, equationNumber, and ic.
oofem::MasterDof::MasterDof  (  DofManager *  aNode, 
DofIDItem  id = Undef 

) 
Definition at line 57 of file masterdof.C.
References bc, equationNumber, and ic.

virtual 
Destructor.
Definition at line 63 of file masterdof.C.

virtual 
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.
Implements oofem::Dof.
Definition at line 83 of file masterdof.C.
References equationNumber.

virtual 
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.
Implements oofem::Dof.
Definition at line 95 of file masterdof.C.
References equationNumber.

virtual 
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.
tStep  Time step determining the time. 
Implements oofem::Dof.
Definition at line 106 of file masterdof.C.
References oofem::Dof::dofID, oofem::Dof::dofManager, oofem::DofManager_null, equationNumber, oofem::FEMComponent::giveDomain(), oofem::Domain::giveEngngModel(), oofem::EngngModel::giveNewEquationNumber(), oofem::EngngModel::giveNewPrescribedEquationNumber(), oofem::Domain::giveNumber(), oofem::DofManager::giveParallelMode(), and hasBc().

protectedvirtual 
Returns boundary condition of dof if it is prescribed.
Reimplemented from oofem::Dof.
Definition at line 68 of file masterdof.C.
References bc, oofem::DirichletBT, oofem::Dof::dofManager, oofem::Domain::giveBc(), oofem::FEMComponent::giveDomain(), oofem::GeneralBoundaryCondition::giveType(), and OOFEM_ERROR.

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 260 of file masterdof.C.
References bc.

inlinevirtual 
Returns class name of the receiver.
Reimplemented from oofem::Dof.
Definition at line 121 of file masterdof.h.

inlinevirtual 
Returns the type of the receiver.
Implements oofem::Dof.
Definition at line 120 of file masterdof.h.

inlinevirtual 
Gives number for equation, negative for prescribed equations.
Reimplemented from oofem::Dof.
Definition at line 155 of file masterdof.h.

protectedvirtual 
Returns initial condition of dof if it is prescribed.
Reimplemented from oofem::Dof.
Definition at line 130 of file masterdof.C.
References oofem::Dof::dofManager, oofem::FEMComponent::giveDomain(), oofem::Domain::giveIc(), ic, and OOFEM_ERROR.
Referenced by giveUnknown(), and hasIcOn().

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 265 of file masterdof.C.
References ic.

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 142 of file masterdof.C.
References oofem::Dof::dofManager, oofem::DofManager_null, oofem::InitialCondition::give(), oofem::Dof::giveBcValue(), oofem::FEMComponent::giveDomain(), oofem::Domain::giveEngngModel(), giveIc(), oofem::TimeStep::giveNumber(), oofem::EngngModel::giveNumberOfTimeStepWhenIcApply(), oofem::DofManager::giveParallelMode(), hasBc(), hasIcOn(), and oofem::EngngModel::requiresUnknownsDictionaryUpdate().

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 190 of file masterdof.C.
References oofem::Dof::dofManager, oofem::DofManager_null, oofem::InitialCondition::give(), oofem::Dof::giveBcValue(), oofem::FEMComponent::giveDomain(), oofem::Domain::giveEngngModel(), giveIc(), oofem::TimeStep::giveNumber(), oofem::EngngModel::giveNumberOfTimeStepWhenIcApply(), oofem::DofManager::giveParallelMode(), oofem::PrimaryField::giveUnknownValue(), hasBc(), and hasIcOn().

inlinevirtual 
Receives the dictionary of unknowns in receiver.
Reimplemented from oofem::Dof.
Definition at line 154 of file masterdof.h.

virtual 
Access dictionary value, if not present zero is returned.
tStep  Time step. 
mode  Mode of value. 
Reimplemented from oofem::Dof.
Definition at line 285 of file masterdof.C.
References oofem::Dictionary::at(), oofem::Dof::dofManager, oofem::FEMComponent::giveDomain(), oofem::Domain::giveEngngModel(), oofem::EngngModel::giveUnknownDictHashIndx(), and unknowns.

virtual 
Test if Dof has active boundary condition.
tStep  Time when test is evaluated. 
Implements oofem::Dof.
Definition at line 217 of file masterdof.C.
References bc, oofem::Dof::dofManager, oofem::DofManager_null, oofem::Domain::giveBc(), oofem::FEMComponent::giveDomain(), oofem::DofManager::giveParallelMode(), oofem::GeneralBoundaryCondition::isImposed(), and OOFEM_ERROR.
Referenced by askNewEquationNumber(), and giveUnknown().

virtual 
Test if Dof has initial condition.
Implements oofem::Dof.
Definition at line 237 of file masterdof.C.
References ic, and OOFEM_ERROR.
Referenced by hasIcOn().

virtual 
Test if Dof has initial condition of required ValueModeType.
u  Type of required IC. 
Implements oofem::Dof.
Definition at line 249 of file masterdof.C.
References giveIc(), oofem::InitialCondition::hasConditionOn(), and hasIc().
Referenced by giveUnknown().

inlinevirtual 
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.
Reimplemented from oofem::Dof.
Definition at line 136 of file masterdof.h.

virtual 
Prints the receiver state on stdout.
Reimplemented from oofem::Dof.
Definition at line 291 of file masterdof.C.
References bc, oofem::Dof::dofID, oofem::Dof::dofManager, equationNumber, oofem::FEMComponent::giveClassName(), and oofem::FEMComponent::giveNumber().

virtual 
Restores the receiver state previously written in stream.
Reimplemented from oofem::Dof.
Definition at line 335 of file masterdof.C.
References bc, oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, CM_UnknownDictState, oofem::Dof::dofManager, equationNumber, oofem::FEMComponent::giveDomain(), oofem::Domain::giveEngngModel(), ic, oofem::DataStream::read(), oofem::EngngModel::requiresUnknownsDictionaryUpdate(), oofem::Dictionary::restoreContext(), oofem::Dof::restoreContext(), THROW_CIOERR, and unknowns.

virtual 
Stores receiver state to output stream.
Reimplemented from oofem::Dof.
Definition at line 298 of file masterdof.C.
References bc, oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, CM_UnknownDictState, oofem::Dof::dofManager, equationNumber, oofem::FEMComponent::giveDomain(), oofem::Domain::giveEngngModel(), ic, oofem::EngngModel::requiresUnknownsDictionaryUpdate(), oofem::Dictionary::saveContext(), oofem::Dof::saveContext(), THROW_CIOERR, unknowns, and oofem::DataStream::write().

inlinevirtual 
Overwrites the boundary condition id (0inactive BC), intended for specific purposes such as coupling of bc's in multiscale simulations.
Reimplemented from oofem::Dof.
Definition at line 151 of file masterdof.h.

inlinevirtual 
Sets a specific equation number to receiver.
equationNumber  New equation number. 
Reimplemented from oofem::Dof.
Definition at line 153 of file masterdof.h.

inlinevirtual 
Overwrites the initial condition id (0inactive IC)
Reimplemented from oofem::Dof.
Definition at line 152 of file masterdof.h.

virtual 
Abstract function, allowing Dof to store its unknowns in its own private dictionary.
Dof then uses this dictionary instead of forwarding the requests to EngngModel (with equationNUmber as parameter). If EngngModel does not support changes of static system (see EngngModel::requiresUnknownsDictionaryUpdate method), the dof forwards the requests for its unknowns to EngngModel, where unknowns are naturally kept. This is possible, because dof equation number is same during whole solution. But when changes of static system are allowed, several problem arise. For example by solving simple incremental static with allowed static changes, the incremental displacement vector of structure can not be added to total displacement vector of structure, because equation numbers may have changed, and one can not simply add these vector to obtain new total displacement vector, because incompatible displacement will be added. To solve this problem, unknown dictionary at dof level has been assumed. Dof then keeps its unknowns in its own private dictionary. After computing increment of solution, engngModel updates for each dof its unknowns in its dictionary (using updateUnknownsDictionary function). For aforementioned example engngModel updates incremental values but also total value by asking dof for previous total value (dof will use its dictionary, does not asks back EngngModel) adds corresponding increment and updates total value in dictionary. In fact on EngngModel level only incremental solution is stored, but total values are always stored in dofs dictionaries. Implementation is not provided, only interface declared. Children must implement this method.
tStep  Time step when unknowns are updated. In current version it is unused parameter. It is EngngModel responsibility to update values, and values stored in dictionary are always related to timeStep when they were lastly updated. 
mode  Mode of stored unknown. 
dofValue  Value of unknown. Old value will generally be lost. 
Reimplemented from oofem::Dof.
Definition at line 276 of file masterdof.C.
References oofem::Dictionary::at(), oofem::Dof::dofManager, oofem::FEMComponent::giveDomain(), oofem::Domain::giveEngngModel(), oofem::EngngModel::giveUnknownDictHashIndx(), and unknowns.

virtual 
Updates receiver after finishing time step.
tStep  Finished time step. 
Reimplemented from oofem::Dof.
Definition at line 270 of file masterdof.C.
References oofem::Dof::updateYourself().

protected 
Boundary condition number associated to dof.
Definition at line 98 of file masterdof.h.
Referenced by giveBc(), giveBcId(), hasBc(), MasterDof(), printYourself(), restoreContext(), and saveContext().

protected 
Corresponding equation number (positive value) or prescribed equation number (negative value).
Definition at line 96 of file masterdof.h.
Referenced by __giveEquationNumber(), __givePrescribedEquationNumber(), askNewEquationNumber(), MasterDof(), printYourself(), restoreContext(), and saveContext().

protected 
Initial condition number associated to dof.
Definition at line 100 of file masterdof.h.
Referenced by giveIc(), giveIcId(), hasIc(), MasterDof(), restoreContext(), and saveContext().

protected 
Unknowns dictionary to support changes of static system.
Definition at line 102 of file masterdof.h.
Referenced by giveUnknownsDictionaryValue(), restoreContext(), saveContext(), and updateUnknownsDictionary().