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

Class representing "slave" degree of freedom with an active boundary condition. More...

#include <activedof.h>

+ Inheritance diagram for oofem::ActiveDof:
+ Collaboration diagram for oofem::ActiveDof:

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

Protected Attributes

int equationNumber
 Corresponding equation number (positive value) or prescribed equation number (negative value). More...
 
int bc
 Boundary condition number. More...
 
ActiveBoundaryConditionactiveBC
 Active boundary condition number. 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 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.

Constructor & Destructor Documentation

oofem::ActiveDof::ActiveDof ( DofManager aNode,
DofIDItem  id = Undef,
int  bc = 0 
)

Constructor.

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

Parameters
aNodeNode receiver will belong to.
idDofID of slave dof.
bcBoundary condition dof belongs to.

Definition at line 44 of file activedof.C.

virtual oofem::ActiveDof::~ActiveDof ( )
inlinevirtual

Destructor.

Definition at line 67 of file activedof.h.

Member Function Documentation

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

Returns
Equation number of DOF.

Implements oofem::Dof.

Definition at line 204 of file activedof.C.

References equationNumber.

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

Returns
Prescribed equation number.

Implements oofem::Dof.

Definition at line 209 of file activedof.C.

References equationNumber.

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

Parameters
tStepTime step determining the time.
See also
Dof::updateUnknownsDictionary
EngngModel::requiresUnknownsDictionaryUpdate

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

void oofem::ActiveDof::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 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().

int oofem::ActiveDof::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 241 of file activedof.C.

References bc.

double oofem::ActiveDof::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 252 of file activedof.C.

References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::giveBcValue().

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

Returns class name of the receiver.

Reimplemented from oofem::Dof.

Definition at line 87 of file activedof.h.

void oofem::ActiveDof::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 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().

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

Returns the type of the receiver.

Implements oofem::Dof.

Definition at line 86 of file activedof.h.

void oofem::ActiveDof::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 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().

InitialCondition * oofem::ActiveDof::giveIc ( )
virtual

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 263 of file activedof.C.

int oofem::ActiveDof::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 262 of file activedof.C.

void oofem::ActiveDof::giveMasterDofManArray ( IntArray answer)
virtual
int oofem::ActiveDof::giveNumberOfPrimaryMasterDofs ( )
virtual
Returns
Number of primary dofs, on which receiver value depends on (even recursively).

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

double oofem::ActiveDof::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 193 of file activedof.C.

References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::giveUnknown().

double oofem::ActiveDof::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 198 of file activedof.C.

References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::giveUnknown().

void oofem::ActiveDof::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 146 of file activedof.C.

References oofem::FloatArray::copySubVector(), giveMasterDof(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), oofem::Dof::giveUnknowns(), and oofem::FloatArray::resize().

void oofem::ActiveDof::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 159 of file activedof.C.

References oofem::FloatArray::copySubVector(), giveMasterDof(), giveNumberOfMasterDofs(), giveNumberOfPrimaryMasterDofs(), oofem::FloatArray::giveSize(), oofem::Dof::giveUnknowns(), and oofem::FloatArray::resize().

bool oofem::ActiveDof::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 236 of file activedof.C.

References giveActiveBoundaryCondition(), and oofem::ActiveBoundaryCondition::hasBc().

Referenced by askNewEquationNumber().

bool oofem::ActiveDof::hasIc ( TimeStep tStep)
virtual

Definition at line 259 of file activedof.C.

bool oofem::ActiveDof::hasIc ( )
virtual

Test if Dof has initial condition.

Returns
True if IC exists, false otherwise.

Implements oofem::Dof.

Definition at line 261 of file activedof.C.

bool oofem::ActiveDof::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 260 of file activedof.C.

void oofem::ActiveDof::initialize ( int  cntOfMstrDfMngr,
const IntArray masterNodes,
const IntArray mstrDofID,
const FloatArray mstrContribution 
)
virtual

Definition at line 48 of file activedof.C.

References OOFEM_ERROR.

bool oofem::ActiveDof::isPrimaryDof ( )
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.

Returns
True if receiver is primary DOF, false otherwise (default).

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

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

contextIOResultType oofem::ActiveDof::saveContext ( DataStream stream,
ContextMode  mode,
void *  obj = NULL 
)
virtual

Stores receiver state to output stream.

Reimplemented from oofem::Dof.

Definition at line 266 of file activedof.C.

References oofem::CIO_OK.

void oofem::ActiveDof::setBcId ( int  bcId)
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.

References activeBC, and bc.

void oofem::ActiveDof::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 282 of file activedof.C.

Member Data Documentation

ActiveBoundaryCondition* oofem::ActiveDof::activeBC
protected

Active boundary condition number.

Definition at line 56 of file activedof.h.

Referenced by giveActiveBoundaryCondition(), and setBcId().

int oofem::ActiveDof::bc
protected

Boundary condition number.

Definition at line 54 of file activedof.h.

Referenced by giveActiveBoundaryCondition(), giveBcId(), and setBcId().

int oofem::ActiveDof::equationNumber
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().


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:33 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011