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

Class representing field of primary variables, which are typically allocated on nodes. More...

#include <dofdistributedprimaryfield.h>

+ Inheritance diagram for oofem::DofDistributedPrimaryField:
+ Collaboration diagram for oofem::DofDistributedPrimaryField:

Public Member Functions

 DofDistributedPrimaryField (EngngModel *a, int idomain, FieldType ft, int nHist)
 Constructor. More...
 
virtual ~DofDistributedPrimaryField ()
 
virtual void initialize (ValueModeType mode, TimeStep *tStep, FloatArray &answer, const UnknownNumberingScheme &s)
 Copy unknowns from previous solution or DOF's dictionary to the solution vector. More...
 
virtual double giveUnknownValue (Dof *dof, ValueModeType mode, TimeStep *tStep)
 
virtual void update (ValueModeType mode, TimeStep *tStep, const FloatArray &vectorToStore, const UnknownNumberingScheme &s)
 Project vectorToStore back to DOF's dictionary. More...
 
virtual void applyDefaultInitialCondition ()
 Applies the default initial values values for all DOFs (0) in given domain. More...
 
void applyInitialCondition (InitialCondition &ic)
 
virtual void applyBoundaryCondition (TimeStep *tStep)
 Applies all boundary conditions to all prescribed DOFs. More...
 
virtual void applyBoundaryCondition (BoundaryCondition &bc, TimeStep *tStep)
 
virtual FloatArraygiveSolutionVector (TimeStep *tStep)
 
void setInitialGuess (DofManager &dman, TimeStep *tStep, TimeStep *prev)
 
virtual void advanceSolution (TimeStep *tStep)
 Brings up a new solution vector for given time step. More...
 
virtual contextIOResultType saveContext (DataStream &stream, ContextMode mode)
 Stores receiver state to output stream. More...
 
virtual contextIOResultType restoreContext (DataStream &stream, ContextMode mode)
 Restores the receiver state previously written in stream. More...
 
- Public Member Functions inherited from oofem::PrimaryField
 PrimaryField (EngngModel *a, int idomain, FieldType ft, int nHist)
 Constructor. More...
 
virtual ~PrimaryField ()
 
void storeDofManager (TimeStep *tStep, DofManager &dman)
 
void storeInDofDictionaries (TimeStep *tStep)
 
void readDofManager (TimeStep *tStep, DofManager &dman)
 
void readFromDofDictionaries (TimeStep *tStep)
 
void applyInitialCondition (InitialCondition &ic)
 Applies initial condition to all DOFs. More...
 
void applyBoundaryCondition (BoundaryCondition &bc, TimeStep *tStep)
 Applies the boundary condition to all prescribed DOFs in given domain. More...
 
virtual int evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep)
 Evaluates the field at given point. More...
 
virtual int evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep)
 Evaluates the field at given DofManager. More...
 
virtual int __evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep, IntArray *dofId)
 Evaluates the field at given DOF manager, allows to select specific dofs using mask. More...
 
virtual int __evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep, IntArray *dofId)
 Evaluates the field at given point, allows to select specific dofs using mask. More...
 
virtual const char * giveClassName () const
 
int giveActualStepNumber ()
 
- Public Member Functions inherited from oofem::Field
 Field (FieldType b)
 Constructor. More...
 
virtual ~Field ()
 
FieldType giveType ()
 Returns the type of receiver. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Additional Inherited Members

- Protected Member Functions inherited from oofem::PrimaryField
int resolveIndx (TimeStep *tStep, int shift)
 
FloatArraygiveSolutionVector (int)
 
FloatArraygivePrescribedVector (int)
 
- Protected Attributes inherited from oofem::PrimaryField
int actualStepNumber
 
int actualStepIndx
 
int nHistVectors
 
std::vector< FloatArraysolutionVectors
 
std::vector< FloatArrayprescribedVectors
 
std::vector< TimeStepsolStepList
 
EngngModelemodel
 
int domainIndx
 
- Protected Attributes inherited from oofem::Field
FieldType type
 

Detailed Description

Class representing field of primary variables, which are typically allocated on nodes.

The field is determined by DOF values stored in DOF repositories (unknown dictionary). These repositories are maintained and updated by engineering models since the algorithms are very specific to each model. The class can return several variables stored in DOF. The purpose of this class is to provide a shell that allows to access these repositories using field services. The class contains also a solution vector for temporal storage of unknowns. The vector needs to be projected back to DOFs.

Definition at line 49 of file dofdistributedprimaryfield.h.

Constructor & Destructor Documentation

oofem::DofDistributedPrimaryField::DofDistributedPrimaryField ( EngngModel a,
int  idomain,
FieldType  ft,
int  nHist 
)

Constructor.

Creates a field of given type associated to given domain. Not using pointer to domain, because this will prevent the use of PrimaryField as an EngngModel attribute. This is because the domain does not exists when PrimaryField is created (this is when EngngModel is created).

Parameters
aEngineering model which field belongs to.
idomainIndex of domain for field.
ftType of stored field.
nHistNumber of old time steps to store.

Definition at line 50 of file dofdistributedprimaryfield.C.

oofem::DofDistributedPrimaryField::~DofDistributedPrimaryField ( )
virtual

Definition at line 55 of file dofdistributedprimaryfield.C.

Member Function Documentation

void oofem::DofDistributedPrimaryField::advanceSolution ( TimeStep tStep)
virtual
FloatArray * oofem::DofDistributedPrimaryField::giveSolutionVector ( TimeStep tStep)
virtual
Parameters
tStepTime step to take solution for.
Returns
Solution vector for requested time step.

Reimplemented from oofem::PrimaryField.

Definition at line 80 of file dofdistributedprimaryfield.C.

References oofem::PrimaryField::giveSolutionVector().

double oofem::DofDistributedPrimaryField::giveUnknownValue ( Dof dof,
ValueModeType  mode,
TimeStep tStep 
)
virtual
Parameters
dofPointer to DOF.
modeWhat the unknown describes (increment, total value etc.).
tStepTime step of interest.
Returns
Value of interest at given DOF.
Todo:
Clean this up, this is a hack for when we ask for the increment in the first step.

Reimplemented from oofem::PrimaryField.

Definition at line 59 of file dofdistributedprimaryfield.C.

References oofem::TimeStep::givePreviousStep(), oofem::TimeStep::giveTimeIncrement(), oofem::Dof::giveUnknownsDictionaryValue(), and OOFEM_ERROR.

void oofem::DofDistributedPrimaryField::initialize ( ValueModeType  mode,
TimeStep tStep,
FloatArray answer,
const UnknownNumberingScheme s 
)
virtual

Copy unknowns from previous solution or DOF's dictionary to the solution vector.

Parameters
modewhat the unknown describes (increment, total value etc.).
tStepTime of interest.
answerResulting vector.

Reimplemented from oofem::PrimaryField.

Definition at line 87 of file dofdistributedprimaryfield.C.

References oofem::FloatArray::at(), oofem::PrimaryField::domainIndx, oofem::PrimaryField::emodel, oofem::Domain::giveBcs(), oofem::Domain::giveDofManagers(), oofem::EngngModel::giveDomain(), oofem::Domain::giveElements(), oofem::EngngModel::giveNumberOfDomainEquations(), oofem::FloatArray::resize(), and oofem::FloatArray::zero().

contextIOResultType oofem::DofDistributedPrimaryField::restoreContext ( DataStream stream,
ContextMode  mode 
)
virtual

Restores the receiver state previously written in stream.

Reads the FEMComponent class-id in order to allow test consistency.

Parameters
streamInput stream.
modeDetermines amount of info in stream (state, definition,...).
Returns
contextIOResultType.
Exceptions
Throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::PrimaryField.

Definition at line 382 of file dofdistributedprimaryfield.C.

References oofem::CIO_OK.

contextIOResultType oofem::DofDistributedPrimaryField::saveContext ( DataStream stream,
ContextMode  mode 
)
virtual

Stores receiver state to output stream.

Writes the FEMComponent class-id in order to allow test whether correct data are then restored.

Parameters
streamOutput stream.
modeDetermines amount of info in stream (state, definition,...).
Returns
contextIOResultType.
Exceptions
Throwsan ContextIOERR exception if error encountered.

Reimplemented from oofem::PrimaryField.

Definition at line 375 of file dofdistributedprimaryfield.C.

References oofem::CIO_OK.

void oofem::DofDistributedPrimaryField::setInitialGuess ( DofManager dman,
TimeStep tStep,
TimeStep prev 
)

Definition at line 331 of file dofdistributedprimaryfield.C.

Referenced by advanceSolution().

void oofem::DofDistributedPrimaryField::update ( ValueModeType  mode,
TimeStep tStep,
const FloatArray vectorToStore,
const UnknownNumberingScheme s 
)
virtual

Project vectorToStore back to DOF's dictionary.

Parameters
vectorToStoreVector with the size of number of equations.
modeMode of the unknown (increment, total value etc.)
tStepTime step unknowns belong to.
Todo:
This should not be here / Mikael

Reimplemented from oofem::PrimaryField.

Definition at line 134 of file dofdistributedprimaryfield.C.

References oofem::FloatArray::at(), oofem::PrimaryField::domainIndx, oofem::PrimaryField::emodel, oofem::Domain::giveBcs(), oofem::Domain::giveDofManagers(), oofem::EngngModel::giveDomain(), and oofem::Domain::giveElements().


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