OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class representing "slave" degree of freedom. More...
#include <slavedof.h>
Public Member Functions | |
SlaveDof (DofManager *aNode, DofIDItem id=Undef) | |
Constructor. More... | |
virtual | ~SlaveDof (void) |
Destructor. More... | |
virtual dofType | giveDofType () |
Returns the type of the receiver. More... | |
void | initialize (const IntArray &masterNodes, const IntArray &mstrDofID, const FloatArray &mstrContribution) |
virtual int | giveNumberOfPrimaryMasterDofs () |
virtual void | giveMasterDofManArray (IntArray &answer) |
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 &primaryMasterContribs) |
Computes dof transformation array, which describes the dependence of receiver value on values of master dofs. 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 double | giveUnknown (ValueModeType mode, TimeStep *tStep) |
Returns the value of the unknown associated with the receiver at given time step. More... | |
virtual double | giveUnknown (PrimaryField &field, ValueModeType mode, TimeStep *tStep) |
The key method of class Dof. More... | |
virtual int | __giveEquationNumber () const |
Returns equation number corresponding to receiver. More... | |
virtual int | __givePrescribedEquationNumber () |
Returns equation number corresponding to receiver. More... | |
virtual int | askNewEquationNumber (TimeStep *tStep) |
Asks new equation number. More... | |
virtual bool | hasBc (TimeStep *tStep) |
Returns boundary condition of dof if it is prescribed. More... | |
virtual bool | hasIc () |
Returns initial condition of dof if it is prescribed. More... | |
virtual bool | hasIcOn (ValueModeType) |
RigidArmSlaveDof can not be subjected to IC - it is only mapping to master. 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 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 const char * | giveClassName () const |
Returns class name of the receiver. 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 |
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... | |
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 | |
Dof * | giveMasterDof (int i) |
Protected Member Functions inherited from oofem::Dof | |
virtual BoundaryCondition * | giveBc () |
Returns boundary condition of dof if it is prescribed. More... | |
virtual InitialCondition * | giveIc () |
Returns initial condition of dof if it is prescribed. More... | |
Protected Attributes | |
int | countOfMasterDofs |
Count of master DofManagers. More... | |
int | countOfPrimaryMasterDofs |
Count of master DofManagers. More... | |
IntArray | masterDofMans |
Array of master DofManagers. More... | |
IntArray | dofIDs |
Array of master dofIDs. More... | |
FloatArray | masterContribution |
Vector of master contribution coefficients. More... | |
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.
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.
oofem::SlaveDof::SlaveDof | ( | DofManager * | aNode, |
DofIDItem | id = Undef |
||
) |
Constructor.
Creates slave dof with number n, belonging to aNode dof manager.
aNode | Node receiver will belong to. |
id | DofID of slave dof. |
Definition at line 44 of file slavedof.C.
References countOfMasterDofs, and countOfPrimaryMasterDofs.
|
inlinevirtual |
Destructor.
Definition at line 69 of file slavedof.h.
|
virtual |
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).
Implements oofem::Dof.
Definition at line 202 of file slavedof.C.
References OOFEM_ERROR.
|
virtual |
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).
Implements oofem::Dof.
Definition at line 209 of file slavedof.C.
References OOFEM_ERROR.
|
inlinevirtual |
Asks new equation number.
Empty function (master is assumed to receive same message).
Implements oofem::Dof.
Definition at line 115 of file slavedof.h.
|
virtual |
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.
masterContribs | Contributions of master dofs for receiver. |
Reimplemented from oofem::Dof.
Definition at line 135 of file slavedof.C.
References oofem::FloatArray::at(), oofem::Dof::computeDofTransformation(), oofem::FloatArray::copySubVector(), countOfMasterDofs, giveMasterDof(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), masterContribution, oofem::FloatArray::resize(), and oofem::FloatArray::times().
Referenced by giveUnknown().
|
inlinevirtual |
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 137 of file slavedof.h.
|
inlinevirtual |
Returns class name of the receiver.
Reimplemented from oofem::Dof.
Definition at line 143 of file slavedof.h.
|
virtual |
As giveEquationNumbers but for dof IDs.
[out] | masterDofIDs | Dof 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(), oofem::Dof::giveDofIDs(), giveMasterDof(), giveNumberOfPrimaryMasterDofs(), and oofem::IntArray::preallocate().
|
inlinevirtual |
|
virtual |
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.
[out] | masterEqNumbers | Equation numbers of master DOFs for receiver. |
[in] | s | Numbering 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(), oofem::Dof::giveEquationNumbers(), giveMasterDof(), giveNumberOfPrimaryMasterDofs(), and oofem::IntArray::preallocate().
|
inlinevirtual |
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 138 of file slavedof.h.
|
inlineprotected |
Definition at line 295 of file slavedof.C.
References oofem::IntArray::at(), dofIDs, oofem::Dof::dofManager, oofem::Domain::giveDofManager(), oofem::FEMComponent::giveDomain(), and masterDofMans.
Referenced by computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), giveNumberOfPrimaryMasterDofs(), and giveUnknowns().
|
virtual |
Reimplemented from oofem::Dof.
Definition at line 311 of file slavedof.C.
References oofem::IntArray::clear(), countOfMasterDofs, oofem::IntArray::followedBy(), giveMasterDof(), oofem::Dof::giveMasterDofManArray(), giveNumberOfPrimaryMasterDofs(), and oofem::IntArray::preallocate().
|
virtual |
Reimplemented from oofem::Dof.
Definition at line 84 of file slavedof.C.
References countOfMasterDofs, countOfPrimaryMasterDofs, giveMasterDof(), oofem::Dof::giveNumberOfPrimaryMasterDofs(), and OOFEM_ERROR.
Referenced by computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), and giveUnknowns().
|
virtual |
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 , 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.
Implements oofem::Dof.
Definition at line 181 of file slavedof.C.
References computeDofTransformation(), oofem::FloatArray::dotProduct(), and oofem::Dof::giveUnknowns().
|
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 191 of file slavedof.C.
References computeDofTransformation(), oofem::FloatArray::dotProduct(), and oofem::Dof::giveUnknowns().
|
virtual |
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).
masterUnknowns | Values of master unknowns for receiver. |
mode | Value mode for unknowns. |
tStep | Time 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(), oofem::Dof::giveUnknowns(), and oofem::FloatArray::resize().
|
virtual |
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).
masterUnknowns | |
field | The field to pick unknowns from. |
mode | Value mode for unknowns. |
tStep | Time 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(), oofem::Dof::giveUnknowns(), and oofem::FloatArray::resize().
|
inlinevirtual |
Returns boundary condition of dof if it is prescribed.
HangingDof can not be subjected to BC, it is only mapping to master
Implements oofem::Dof.
Definition at line 122 of file slavedof.h.
|
inlinevirtual |
Returns initial condition of dof if it is prescribed.
HangingDof can not be subjected to IC, it is only mapping to master
Implements oofem::Dof.
Definition at line 129 of file slavedof.h.
|
inlinevirtual |
RigidArmSlaveDof can not be subjected to IC - it is only mapping to master.
Implements oofem::Dof.
Definition at line 135 of file slavedof.h.
void oofem::SlaveDof::initialize | ( | const IntArray & | masterNodes, |
const IntArray & | mstrDofID, | ||
const FloatArray & | mstrContribution | ||
) |
Definition at line 52 of file slavedof.C.
References oofem::IntArray::at(), countOfMasterDofs, oofem::Dof::dofID, dofIDs, oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::IntArray::isEmpty(), masterContribution, masterDofMans, OOFEM_ERROR, and oofem::IntArray::resize().
Referenced by oofem::SlaveNode::postInitialize(), oofem::HangingNode::postInitialize(), oofem::RigidArmNode::postInitialize(), and oofem::qcNode::postInitializeAsHangingNode().
|
virtual |
Restores the receiver state previously written in stream.
Reimplemented from oofem::Dof.
Definition at line 256 of file slavedof.C.
References oofem::IntArray::at(), oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, countOfMasterDofs, countOfPrimaryMasterDofs, dofIDs, masterContribution, masterDofMans, oofem::DataStream::read(), oofem::IntArray::resize(), oofem::Dof::restoreContext(), oofem::IntArray::restoreYourself(), oofem::FloatArray::restoreYourself(), and THROW_CIOERR.
|
virtual |
Stores receiver state to output stream.
Reimplemented from oofem::Dof.
Definition at line 215 of file slavedof.C.
References oofem::IntArray::at(), oofem::CIO_IOERR, oofem::CIO_OK, CM_Definition, CM_DefinitionGlobal, countOfMasterDofs, countOfPrimaryMasterDofs, dofIDs, oofem::Dof::dofManager, oofem::Domain::giveDofManager(), oofem::FEMComponent::giveDomain(), masterContribution, masterDofMans, oofem::Dof::saveContext(), oofem::IntArray::storeYourself(), oofem::FloatArray::storeYourself(), THROW_CIOERR, and oofem::DataStream::write().
|
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 302 of file slavedof.C.
References oofem::IntArray::at(), countOfMasterDofs, oofem::ERS_DofManager, and masterDofMans.
|
protected |
Count of master DofManagers.
Definition at line 51 of file slavedof.h.
Referenced by computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), giveNumberOfPrimaryMasterDofs(), giveUnknowns(), initialize(), restoreContext(), saveContext(), SlaveDof(), and updateLocalNumbering().
|
protected |
Count of master DofManagers.
Definition at line 53 of file slavedof.h.
Referenced by giveNumberOfPrimaryMasterDofs(), restoreContext(), saveContext(), and SlaveDof().
|
protected |
Array of master dofIDs.
Definition at line 57 of file slavedof.h.
Referenced by giveMasterDof(), initialize(), restoreContext(), and saveContext().
|
protected |
Vector of master contribution coefficients.
Definition at line 59 of file slavedof.h.
Referenced by computeDofTransformation(), initialize(), restoreContext(), and saveContext().
|
protected |
Array of master DofManagers.
Definition at line 55 of file slavedof.h.
Referenced by giveMasterDof(), initialize(), restoreContext(), saveContext(), and updateLocalNumbering().