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

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

#include <slavedof.h>

+ Inheritance diagram for oofem::SlaveDof:
+ Collaboration diagram for oofem::SlaveDof:

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

DofgiveMasterDof (int i)
 
- Protected Member Functions inherited from oofem::Dof
virtual BoundaryConditiongiveBc ()
 Returns boundary condition of dof if it is prescribed. More...
 
virtual InitialConditiongiveIc ()
 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
DofManagerdofManager
 Link to related DofManager. More...
 
DofIDItem dofID
 Physical meaning of DOF. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

oofem::SlaveDof::SlaveDof ( DofManager aNode,
DofIDItem  id = Undef 
)

Constructor.

Creates slave dof with number n, belonging to aNode dof manager.

Parameters
aNodeNode receiver will belong to.
idDofID of slave dof.

Definition at line 44 of file slavedof.C.

References countOfMasterDofs, and countOfPrimaryMasterDofs.

virtual oofem::SlaveDof::~SlaveDof ( void  )
inlinevirtual

Destructor.

Definition at line 69 of file slavedof.h.

Member Function Documentation

int oofem::SlaveDof::__giveEquationNumber ( ) const
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).

Returns
Prints error message and exits.

Implements oofem::Dof.

Definition at line 202 of file slavedof.C.

References OOFEM_ERROR.

int oofem::SlaveDof::__givePrescribedEquationNumber ( )
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).

Returns
Prints error message and exits.

Implements oofem::Dof.

Definition at line 209 of file slavedof.C.

References OOFEM_ERROR.

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

void oofem::SlaveDof::computeDofTransformation ( FloatArray masterContribs)
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.

Parameters
masterContribsContributions 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().

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

Returns
Id of associated Boundary condition, zero otherwise

Implements oofem::Dof.

Definition at line 137 of file slavedof.h.

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

Returns class name of the receiver.

Reimplemented from oofem::Dof.

Definition at line 143 of file slavedof.h.

void oofem::SlaveDof::giveDofIDs ( IntArray masterDofIDs)
virtual

As giveEquationNumbers but for dof IDs.

Parameters
[out]masterDofIDsDof 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().

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

Returns the type of the receiver.

Implements oofem::Dof.

Definition at line 71 of file slavedof.h.

void oofem::SlaveDof::giveEquationNumbers ( IntArray masterEqNumbers,
const UnknownNumberingScheme s 
)
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.

Parameters
[out]masterEqNumbersEquation numbers of master DOFs for receiver.
[in]sNumbering 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().

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

Returns
Id of associated initial condition, zero otherwise

Implements oofem::Dof.

Definition at line 138 of file slavedof.h.

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

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().

int oofem::SlaveDof::giveNumberOfPrimaryMasterDofs ( )
virtual
Returns
Number of primary dofs, on which receiver value depends on (even recursively).

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().

double oofem::SlaveDof::giveUnknown ( ValueModeType  mode,
TimeStep tStep 
)
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 $\epsilon = B\cdot r $, 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.

See also
MasterDof::giveUnknown

Implements oofem::Dof.

Definition at line 181 of file slavedof.C.

References computeDofTransformation(), oofem::FloatArray::dotProduct(), and oofem::Dof::giveUnknowns().

double oofem::SlaveDof::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 191 of file slavedof.C.

References computeDofTransformation(), oofem::FloatArray::dotProduct(), and oofem::Dof::giveUnknowns().

void oofem::SlaveDof::giveUnknowns ( FloatArray masterUnknowns,
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. For primary dof it returns is associated unknown value, for slave dofs it returns an array of master values (in recursive way).

Parameters
masterUnknownsValues of master unknowns for receiver.
modeValue mode for unknowns.
tStepTime 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().

void oofem::SlaveDof::giveUnknowns ( FloatArray masterUnknowns,
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. For primary dof it returns is associated unknown value, for slave dofs it returns an array of master values (in recursive way).

Parameters
masterUnknowns
fieldThe field to pick unknowns from.
modeValue mode for unknowns.
tStepTime 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().

virtual bool oofem::SlaveDof::hasBc ( TimeStep tStep)
inlinevirtual

Returns boundary condition of dof if it is prescribed.

HangingDof can not be subjected to BC, it is only mapping to master

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

Implements oofem::Dof.

Definition at line 122 of file slavedof.h.

virtual bool oofem::SlaveDof::hasIc ( )
inlinevirtual

Returns initial condition of dof if it is prescribed.

HangingDof can not be subjected to IC, it is only mapping to master

See also
MasterDof::hasIc

Implements oofem::Dof.

Definition at line 129 of file slavedof.h.

virtual bool oofem::SlaveDof::hasIcOn ( ValueModeType  )
inlinevirtual

RigidArmSlaveDof can not be subjected to IC - it is only mapping to master.

See also
MasterDof::hasIc

Implements oofem::Dof.

Definition at line 135 of file slavedof.h.

contextIOResultType oofem::SlaveDof::restoreContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual
void oofem::SlaveDof::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 302 of file slavedof.C.

References oofem::IntArray::at(), countOfMasterDofs, oofem::ERS_DofManager, and masterDofMans.

Member Data Documentation

int oofem::SlaveDof::countOfMasterDofs
protected
int oofem::SlaveDof::countOfPrimaryMasterDofs
protected

Count of master DofManagers.

Definition at line 53 of file slavedof.h.

Referenced by giveNumberOfPrimaryMasterDofs(), restoreContext(), saveContext(), and SlaveDof().

IntArray oofem::SlaveDof::dofIDs
protected

Array of master dofIDs.

Definition at line 57 of file slavedof.h.

Referenced by giveMasterDof(), initialize(), restoreContext(), and saveContext().

FloatArray oofem::SlaveDof::masterContribution
protected

Vector of master contribution coefficients.

Definition at line 59 of file slavedof.h.

Referenced by computeDofTransformation(), initialize(), restoreContext(), and saveContext().

IntArray oofem::SlaveDof::masterDofMans
protected

Array of master DofManagers.

Definition at line 55 of file slavedof.h.

Referenced by giveMasterDof(), initialize(), restoreContext(), saveContext(), 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