OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class representing "slave" degree of freedom with an active boundary condition. More...
#include <activedof.h>
Public Member Functions | |
ActiveDof (DofManager *aNode, DofIDItem id=Undef, int bc=0) | |
Constructor. More... | |
virtual | ~ActiveDof () |
Destructor. More... | |
virtual void | initialize (int cntOfMstrDfMngr, const IntArray &masterNodes, const IntArray *mstrDofID, const FloatArray &mstrContribution) |
virtual int | giveNumberOfPrimaryMasterDofs () |
virtual bool | isPrimaryDof () |
Tests if receiver is primary DOF. More... | |
int | giveNumberOfMasterDofs () |
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) |
The key method of class Dof. More... | |
virtual double | giveUnknown (PrimaryField &field, ValueModeType mode, TimeStep *tStep) |
The key method of class Dof. 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 dofType | giveDofType () |
Returns the type of the receiver. More... | |
virtual const char * | giveClassName () const |
Returns class name of the receiver. More... | |
virtual void | updateLocalNumbering (EntityRenumberingFunctor &f) |
Local renumbering support. 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 bool | hasBc (TimeStep *tStep) |
Test if Dof has active boundary condition. More... | |
virtual int | giveBcId () |
Returns the id of associated boundary condition, if there is any. 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 double | giveBcValue (ValueModeType mode, TimeStep *tStep) |
Returns value of boundary condition of dof if it is prescribed. More... | |
virtual bool | hasIc (TimeStep *tStep) |
virtual bool | hasIcOn (ValueModeType type) |
Test if Dof has initial condition of required ValueModeType. More... | |
virtual InitialCondition * | giveIc () |
Returns initial condition of dof if it is prescribed. More... | |
virtual bool | hasIc () |
Test if Dof has initial condition. More... | |
virtual int | giveIcId () |
Returns the id of associated initial condition, if there is any. More... | |
ActiveBoundaryCondition * | giveActiveBoundaryCondition () |
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... | |
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 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 | 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... | |
Protected Attributes | |
int | equationNumber |
Corresponding equation number (positive value) or prescribed equation number (negative value). More... | |
int | bc |
Boundary condition number. More... | |
ActiveBoundaryCondition * | activeBC |
Active boundary condition number. 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 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.
oofem::ActiveDof::ActiveDof | ( | DofManager * | aNode, |
DofIDItem | id = Undef , |
||
int | bc = 0 |
||
) |
Constructor.
Creates slave dof with number n, belonging to aNode dof manager.
aNode | Node receiver will belong to. |
id | DofID of slave dof. |
bc | Boundary condition dof belongs to. |
Definition at line 44 of file activedof.C.
|
inlinevirtual |
Destructor.
Definition at line 67 of file activedof.h.
|
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 204 of file activedof.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 209 of file activedof.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 214 of file activedof.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(), hasBc(), and isPrimaryDof().
|
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 172 of file activedof.C.
References oofem::FloatArray::at(), oofem::ActiveBoundaryCondition::computeDofTransformation(), oofem::Dof::computeDofTransformation(), oofem::FloatArray::copySubVector(), giveActiveBoundaryCondition(), giveMasterDof(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), isPrimaryDof(), oofem::FloatArray::resize(), and oofem::FloatArray::times().
ActiveBoundaryCondition * oofem::ActiveDof::giveActiveBoundaryCondition | ( | ) |
Definition at line 53 of file activedof.C.
References activeBC, bc, oofem::Dof::dofManager, oofem::Domain::giveBc(), oofem::FEMComponent::giveDomain(), and OOFEM_ERROR.
Referenced by computeDofTransformation(), giveBcValue(), giveMasterDof(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), giveUnknown(), hasBc(), and isPrimaryDof().
|
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 241 of file activedof.C.
References bc.
|
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 252 of file activedof.C.
References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::giveBcValue().
|
inlinevirtual |
Returns class name of the receiver.
Reimplemented from oofem::Dof.
Definition at line 87 of file activedof.h.
|
virtual |
As giveEquationNumbers but for dof IDs.
[out] | masterDofIDs | Dof 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(), oofem::Dof::giveDofIDs(), giveMasterDof(), giveNumberOfMasterDofs(), isPrimaryDof(), oofem::IntArray::preallocate(), and oofem::IntArray::resize().
|
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 89 of file activedof.C.
References oofem::IntArray::at(), oofem::IntArray::clear(), oofem::IntArray::followedBy(), oofem::Dof::giveEquationNumber(), oofem::Dof::giveEquationNumbers(), giveMasterDof(), giveNumberOfMasterDofs(), isPrimaryDof(), oofem::IntArray::preallocate(), and oofem::IntArray::resize().
|
virtual |
Returns initial condition of dof if it is prescribed.
Reimplemented from oofem::Dof.
Definition at line 263 of file activedof.C.
|
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 262 of file activedof.C.
|
inlineprotected |
Definition at line 277 of file activedof.C.
References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::giveMasterDof().
Referenced by computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), giveNumberOfPrimaryMasterDofs(), and giveUnknowns().
|
virtual |
Reimplemented from oofem::Dof.
Definition at line 127 of file activedof.C.
References oofem::IntArray::at(), oofem::IntArray::followedBy(), oofem::Dof::giveDofManNumber(), giveMasterDof(), oofem::Dof::giveMasterDofManArray(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), isPrimaryDof(), and oofem::IntArray::resize().
int oofem::ActiveDof::giveNumberOfMasterDofs | ( | ) |
Definition at line 83 of file activedof.C.
References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::giveNumberOfMasterDofs().
Referenced by computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), and giveUnknowns().
|
virtual |
Reimplemented from oofem::Dof.
Definition at line 64 of file activedof.C.
References giveActiveBoundaryCondition(), giveMasterDof(), oofem::ActiveBoundaryCondition::giveNumberOfMasterDofs(), oofem::Dof::giveNumberOfPrimaryMasterDofs(), and isPrimaryDof().
Referenced by computeDofTransformation(), giveMasterDofManArray(), and giveUnknowns().
|
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 193 of file activedof.C.
References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::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 198 of file activedof.C.
References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::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. 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 146 of file activedof.C.
References oofem::FloatArray::copySubVector(), giveMasterDof(), giveNumberOfMasterDofs(), 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 159 of file activedof.C.
References oofem::FloatArray::copySubVector(), giveMasterDof(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), oofem::Dof::giveUnknowns(), and oofem::FloatArray::resize().
|
virtual |
Test if Dof has active boundary condition.
tStep | Time when test is evaluated. |
Implements oofem::Dof.
Definition at line 236 of file activedof.C.
References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::hasBc().
Referenced by askNewEquationNumber().
|
virtual |
Definition at line 259 of file activedof.C.
|
virtual |
Test if Dof has initial condition.
Implements oofem::Dof.
Definition at line 261 of file activedof.C.
|
virtual |
Test if Dof has initial condition of required ValueModeType.
u | Type of required IC. |
Implements oofem::Dof.
Definition at line 260 of file activedof.C.
|
virtual |
Definition at line 48 of file activedof.C.
References OOFEM_ERROR.
|
virtual |
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 78 of file activedof.C.
References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::isPrimaryDof().
Referenced by askNewEquationNumber(), computeDofTransformation(), giveDofIDs(), giveEquationNumbers(), giveMasterDofManArray(), and giveNumberOfPrimaryMasterDofs().
|
virtual |
Restores the receiver state previously written in stream.
Reimplemented from oofem::Dof.
Definition at line 272 of file activedof.C.
References oofem::CIO_OK.
|
virtual |
Stores receiver state to output stream.
Reimplemented from oofem::Dof.
Definition at line 266 of file activedof.C.
References oofem::CIO_OK.
|
virtual |
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.
|
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 282 of file activedof.C.
|
protected |
Active boundary condition number.
Definition at line 56 of file activedof.h.
Referenced by giveActiveBoundaryCondition(), and setBcId().
|
protected |
Boundary condition number.
Definition at line 54 of file activedof.h.
Referenced by giveActiveBoundaryCondition(), giveBcId(), and setBcId().
|
protected |
Corresponding equation number (positive value) or prescribed equation number (negative value).
Definition at line 52 of file activedof.h.
Referenced by __giveEquationNumber(), __givePrescribedEquationNumber(), and askNewEquationNumber().