OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::SimpleSlaveDof Class Reference

Class representing "slave" degree of freedom. More...

#include <simpleslavedof.h>

+ Inheritance diagram for oofem::SimpleSlaveDof:
+ Collaboration diagram for oofem::SimpleSlaveDof:

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
 
DofManagergiveDofManager () 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 DictionarygiveUnknowns ()
 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

BoundaryConditiongiveBc ()
 Returns boundary condition of dof if it is prescribed. More...
 
InitialConditiongiveIc ()
 Returns initial condition of dof if it is prescribed. More...
 

Private Member Functions

DofgiveMasterDof () 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
DofManagerdofManager
 Link to related DofManager. More...
 
DofIDItem dofID
 Physical meaning of DOF. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
aNodereceiver will belong to aNode dof manager
masternumber of dofManager which contain master dof
idDofID 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.

virtual oofem::SimpleSlaveDof::~SimpleSlaveDof ( )
inlinevirtual

Destructor.

Definition at line 90 of file simpleslavedof.h.

Member Function Documentation

int oofem::SimpleSlaveDof::__giveEquationNumber ( ) const
virtual

Returns equation number corresponding to receiver.

Slave simply forwards this message to master.

Returns
Equation number, if active BC exists, returns zero

Implements oofem::Dof.

Definition at line 72 of file simpleslavedof.C.

References oofem::Dof::__giveEquationNumber(), and giveMasterDof().

int oofem::SimpleSlaveDof::__givePrescribedEquationNumber ( )
virtual

Returns prescribed equation number corresponding to receiver.

Slave simply forwards this message to master.

Returns
Prescribed equation number, if active BC exists, returns zero

Implements oofem::Dof.

Definition at line 81 of file simpleslavedof.C.

References oofem::Dof::__givePrescribedEquationNumber(), and giveMasterDof().

virtual int oofem::SimpleSlaveDof::askNewEquationNumber ( TimeStep tStep)
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.

BoundaryCondition * oofem::SimpleSlaveDof::giveBc ( )
protectedvirtual

Returns boundary condition of dof if it is prescribed.

Returns
NULL if no BC applied, otherwise pointer to corresponding BC.

Reimplemented from oofem::Dof.

Definition at line 65 of file simpleslavedof.C.

References oofem::Dof::giveBc(), and giveMasterDof().

int oofem::SimpleSlaveDof::giveBcId ( )
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.

Returns
Id of associated Boundary condition, zero otherwise

Implements oofem::Dof.

Definition at line 131 of file simpleslavedof.C.

References oofem::Dof::giveBcId(), and giveMasterDof().

double oofem::SimpleSlaveDof::giveBcValue ( ValueModeType  mode,
TimeStep tStep 
)
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.

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 143 of file simpleslavedof.C.

References oofem::Dof::giveBcValue(), and giveMasterDof().

virtual const char* oofem::SimpleSlaveDof::giveClassName ( ) const
inlinevirtual

Returns class name of the receiver.

Reimplemented from oofem::Dof.

Definition at line 93 of file simpleslavedof.h.

virtual dofType oofem::SimpleSlaveDof::giveDofType ( )
inlinevirtual

Returns the type of the receiver.

Implements oofem::Dof.

Definition at line 92 of file simpleslavedof.h.

InitialCondition * oofem::SimpleSlaveDof::giveIc ( )
protectedvirtual

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 90 of file simpleslavedof.C.

References oofem::Dof::giveIc(), and giveMasterDof().

int oofem::SimpleSlaveDof::giveIcId ( )
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.

Returns
Id of associated initial condition, zero otherwise

Implements oofem::Dof.

Definition at line 136 of file simpleslavedof.C.

References oofem::Dof::giveIcId(), and giveMasterDof().

int oofem::SimpleSlaveDof::giveMasterDofIndx ( ) const
inline

Returns number of master dof in master dofManager.

Definition at line 131 of file simpleslavedof.h.

int oofem::SimpleSlaveDof::giveMasterDofManagerNum ( ) const
inline

Returns Master Dof Manager Number.

Definition at line 123 of file simpleslavedof.h.

Referenced by oofem::Node::checkConsistency(), and oofem::Subdivision::createMesh().

virtual void oofem::SimpleSlaveDof::giveMasterDofManArray ( IntArray answer)
inlinevirtual
Returns
Array of master DofManagers to which the receiver is linked.

Reimplemented from oofem::Dof.

Definition at line 124 of file simpleslavedof.h.

References oofem::IntArray::at(), and oofem::IntArray::resize().

double oofem::SimpleSlaveDof::giveUnknown ( ValueModeType  mode,
TimeStep tStep 
)
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.

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 97 of file simpleslavedof.C.

References giveMasterDof(), and oofem::Dof::giveUnknown().

double oofem::SimpleSlaveDof::giveUnknown ( PrimaryField field,
ValueModeType  mode,
TimeStep tStep 
)
virtual

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 102 of file simpleslavedof.C.

References giveMasterDof(), and oofem::Dof::giveUnknown().

bool oofem::SimpleSlaveDof::hasBc ( TimeStep tStep)
virtual

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 108 of file simpleslavedof.C.

References giveMasterDof(), and oofem::Dof::hasBc().

bool oofem::SimpleSlaveDof::hasIc ( )
virtual

Test if Dof has initial condition.

Returns
True if IC exists, false otherwise.

Implements oofem::Dof.

Definition at line 116 of file simpleslavedof.C.

References giveMasterDof(), and oofem::Dof::hasIc().

bool oofem::SimpleSlaveDof::hasIcOn ( ValueModeType  u)
virtual

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 124 of file simpleslavedof.C.

References giveMasterDof(), and oofem::Dof::hasIcOn().

contextIOResultType oofem::SimpleSlaveDof::restoreContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
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.

contextIOResultType oofem::SimpleSlaveDof::saveContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual
void oofem::SimpleSlaveDof::setMasterDofManagerNum ( int  i)
inline

Sets master dof manager.

Definition at line 129 of file simpleslavedof.h.

void oofem::SimpleSlaveDof::updateLocalNumbering ( EntityRenumberingFunctor f)
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.

Parameters
fFunction 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.

Member Data Documentation

int oofem::SimpleSlaveDof::masterDofIndx
mutableprivate

Number of master dof in master dofManager.

Definition at line 76 of file simpleslavedof.h.

Referenced by restoreContext(), and SimpleSlaveDof().

int oofem::SimpleSlaveDof::masterDofMngr
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().


The documentation for this class was generated from the following files:

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:41 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011