|
OOFEM 3.0
|
#include <primaryfield.h>
Public Member Functions | |
| PrimaryField (EngngModel *a, int idomain, FieldType ft, int nHist) | |
| virtual | ~PrimaryField () |
| virtual void | initialize (ValueModeType mode, TimeStep *tStep, FloatArray &answer, const UnknownNumberingScheme &s) |
| void | storeDofManager (TimeStep *tStep, DofManager &dman) |
| void | storeInDofDictionaries (TimeStep *tStep) |
| void | readDofManager (TimeStep *tStep, DofManager &dman) |
| void | readFromDofDictionaries (TimeStep *tStep) |
| virtual void | applyDefaultInitialCondition () |
| void | applyInitialCondition (InitialCondition &ic) |
| virtual void | applyBoundaryCondition (TimeStep *tStep) |
| void | applyBoundaryCondition (BoundaryCondition &bc, TimeStep *tStep) |
| virtual double | giveUnknownValue (Dof *dof, ValueModeType mode, TimeStep *tStep) |
| int | evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep) override |
| int | evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep) override |
| virtual int | __evaluateAt (FloatArray &answer, DofManager *dman, ValueModeType mode, TimeStep *tStep, IntArray *dofId) |
| virtual int | __evaluateAt (FloatArray &answer, const FloatArray &coords, ValueModeType mode, TimeStep *tStep, IntArray *dofId) |
| virtual FloatArray * | giveSolutionVector (TimeStep *tStep) |
| virtual void | update (ValueModeType mode, TimeStep *tStep, const FloatArray &vectorToStore, const UnknownNumberingScheme &s) |
| virtual void | advanceSolution (TimeStep *tStep) |
| void | saveContext (DataStream &stream) override |
| void | restoreContext (DataStream &stream) override |
| const char * | giveClassName () const override |
| int | giveActualStepNumber () |
| Public Member Functions inherited from oofem::Field | |
| Field (FieldType b=FieldType::FT_Unknown) | |
| virtual | ~Field () |
| virtual int | evaluateAt (FloatArray &answer, Element *elem, ValueModeType mode, TimeStep *tStep) |
| FieldType | giveType () |
| Returns the type of receiver. | |
| void | setType (FieldType b) |
| Sets the type of receiver. | |
| void | setSetsNumbers (const IntArray sets) |
| Defines a list of sets used to impose a field on specific elements. | |
| virtual bool | hasElementInSets (int nElem, Domain *d) |
| Searches if element number exist in IntArray regionSets for given domain. | |
| std::string | errorInfo (const char *func) const |
| Returns string for prepending output (used by error reporting macros). | |
| virtual void | initializeFrom (InputRecord &ir) |
Protected Member Functions | |
| int | resolveIndx (TimeStep *tStep, int shift) |
| FloatArray * | giveSolutionVector (int) |
| FloatArray * | givePrescribedVector (int) |
Protected Attributes | |
| int | actualStepNumber |
| int | actualStepIndx |
| int | nHistVectors |
| std ::vector< FloatArray > | solutionVectors |
| std ::vector< FloatArray > | prescribedVectors |
| std ::vector< TimeStep > | solStepList |
| EngngModel * | emodel |
| int | domainIndx |
| Protected Attributes inherited from oofem::Field | |
| FieldType | type |
| IntArray | regionSets |
Abstract class representing field of primary variables (those, which are unknown and are typically associated to nodes). In the current design the primary field is understood as simple database, that allows to keep track of the history of a solution vector representing primary field. The history is kept as sequence of solution vectors. The history depth kept can be selected. PrimaryField class basically provides access to time-dependent vectors of the field of unknowns. It adds the possibility to further interpolate the field values using element interpolation functions. The prescribed values of the field are not maintained, since they can be obtained directly from corresponding DOFs of associated domain.
As the PrimaryField stores the state directly in solution vectors that are usually directly updated by EngngModel, it may contain a mix of different fields (this is especially true for strongly coupled problems). Then masked primary field can be used to select only certain DOFs (based on DofID) from its master PrimaryField.
Definition at line 104 of file primaryfield.h.
| oofem::PrimaryField::PrimaryField | ( | 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).
| a | Engineering model which field belongs to. |
| idomain | Index of domain for field. |
| ft | Type of stored field. |
| nHist | Number of old time steps to store. |
Definition at line 49 of file primaryfield.C.
References actualStepIndx, actualStepNumber, domainIndx, emodel, oofem::Field::Field(), nHistVectors, prescribedVectors, solStepList, and solutionVectors.
|
virtual |
Definition at line 60 of file primaryfield.C.
|
virtual |
Evaluates the field at given point, allows to select specific dofs using mask.
| answer | Evaluated field at coords. |
| coords | Coordinates of the point of interest. |
| mode | Mode of evaluated unknowns. |
| tStep | Time step of interest. |
| dofId | Dof mask, id set to NULL, all Dofs evaluated. |
Definition at line 372 of file primaryfield.C.
References oofem::FloatArray::at(), oofem::IntArray::at(), oofem::Element::computeField(), domainIndx, oofem::EIPrimaryFieldInterfaceType, emodel, oofem::IntArray::findFirstIndexOf(), oofem::SpatialLocalizer::giveElementClosestToPoint(), oofem::SpatialLocalizer::giveElementContainingPoint(), oofem::Element::giveElementDofIDMask(), oofem::FEMComponent::giveInterface(), oofem::IntArray::giveSize(), oofem::Domain::giveSpatialLocalizer(), OOFEM_ERROR, oofem::FloatArray::resize(), and oofem::FloatArray::zero().
|
virtual |
Evaluates the field at given DOF manager, allows to select specific dofs using mask
| answer | Evaluated field at dman. |
| dman | DOF manager of interest. |
| mode | Mode of evaluated unknowns. |
| tStep | Time step of interest. |
| dofId | Dof mask, id set to NULL, all Dofs evaluated. |
Definition at line 352 of file primaryfield.C.
References __evaluateAt(), domainIndx, oofem::DofManager::giveCompleteUnknownVector(), oofem::DofManager::giveCoordinates(), oofem::FEMComponent::giveDomain(), and oofem::DofManager::giveUnknownVector().
Referenced by __evaluateAt(), evaluateAt(), and evaluateAt().
|
virtual |
Brings up a new solution vector for given time step.
| tStep | Time step for new solution vector. |
Definition at line 485 of file primaryfield.C.
References actualStepIndx, actualStepNumber, oofem::TimeStep::giveNumber(), givePrescribedVector(), giveSolutionVector(), nHistVectors, OOFEM_ERROR, resolveIndx(), and solStepList.
| void oofem::PrimaryField::applyBoundaryCondition | ( | BoundaryCondition & | bc, |
| TimeStep * | tStep ) |
Applies the boundary condition to all prescribed DOFs in given domain.
| bc | Boundary condition. |
| domain | tStep Time step for when bc applies. |
Definition at line 289 of file primaryfield.C.
References oofem::FloatArray::at(), oofem::BoundaryCondition::give(), oofem::GeneralBoundaryCondition::giveDofIDs(), oofem::Domain::giveDofManager(), oofem::DofManager::giveDofWithID(), oofem::FEMComponent::giveDomain(), oofem::Dof::giveEqn(), oofem::Set::giveNodeList(), givePrescribedVector(), oofem::Domain::giveSet(), oofem::GeneralBoundaryCondition::giveSetNumber(), oofem::TimeStep::giveTargetTime(), and resolveIndx().
|
virtual |
Applies all boundary conditions to all prescribed DOFs.
| tStep | Current time step. |
Definition at line 265 of file primaryfield.C.
References applyBoundaryCondition(), oofem::FloatArray::at(), domainIndx, emodel, oofem::BoundaryCondition::give(), oofem::Domain::giveBc(), oofem::Domain::giveBcs(), oofem::Domain::giveDofManagers(), givePrescribedVector(), oofem::TimeStep::giveTargetTime(), and resolveIndx().
Referenced by applyBoundaryCondition().
|
virtual |
Applies the default initial values values for all DOFs (0) in given domain.
| domain | Domain number |
Definition at line 168 of file primaryfield.C.
References applyInitialCondition(), oofem::FloatArray::at(), domainIndx, emodel, oofem::InitialCondition::give(), oofem::Domain::giveDofManagers(), oofem::Domain::giveIc(), givePrescribedVector(), giveSolutionVector(), oofem::InitialCondition::hasConditionOn(), prescribedVectors, resolveIndx(), and solutionVectors.
| void oofem::PrimaryField::applyInitialCondition | ( | InitialCondition & | ic | ) |
Applies initial condition to all DOFs.
| ic | Initial condition for DOFs |
Definition at line 218 of file primaryfield.C.
References oofem::FloatArray::at(), emodel, oofem::InitialCondition::give(), oofem::DofManager::giveCoordinates(), oofem::Domain::giveDofManager(), oofem::FEMComponent::giveDomain(), oofem::Set::giveNodeList(), givePrescribedVector(), oofem::Domain::giveSet(), oofem::InitialCondition::giveSetNumber(), giveSolutionVector(), oofem::TimeStep::giveTimeIncrement(), oofem::InitialCondition::hasConditionOn(), and resolveIndx().
Referenced by applyDefaultInitialCondition().
|
overridevirtual |
Evaluates the field at given point.
| coords | Coordinates of the point of interest |
| answer | Field evaluated at coordinate. |
| tStep | Time step to evaluate for. |
| mode | Mode of value (total, velocity,...). |
Implements oofem::Field.
Definition at line 429 of file primaryfield.C.
References __evaluateAt().
|
overridevirtual |
Evaluates the field at given DofManager. This potentially can be resolved quickly, as receiver data may be described using values at dofManagers. Here an additional issue exists: one needs to make sure, that passed dman is from the same domain, so that its number can be used to perform suggested quick evaluation.
If this is not the case (the field is described differently), the response can be evaluated using dofman coordinates in a standard way.
| [out] | answer | Evaluated field for dman. |
| dman | Reference to dofManager. | |
| mode | Mode of value (total, velocity,...). | |
| tStep | Time step to evaluate for. |
Implements oofem::Field.
Definition at line 437 of file primaryfield.C.
References __evaluateAt().
|
inline |
Definition at line 226 of file primaryfield.h.
References actualStepNumber.
|
inlineoverridevirtual |
Implements oofem::Field.
Definition at line 224 of file primaryfield.h.
|
protected |
Definition at line 460 of file primaryfield.C.
References nHistVectors, OOFEM_ERROR, and prescribedVectors.
Referenced by advanceSolution(), applyBoundaryCondition(), applyBoundaryCondition(), applyDefaultInitialCondition(), applyInitialCondition(), giveUnknownValue(), readDofManager(), and storeDofManager().
|
protected |
Definition at line 451 of file primaryfield.C.
References nHistVectors, OOFEM_ERROR, and solutionVectors.
|
virtual |
| tStep | Time step to take solution for. |
Definition at line 445 of file primaryfield.C.
References giveSolutionVector(), and resolveIndx().
Referenced by advanceSolution(), applyDefaultInitialCondition(), applyInitialCondition(), giveSolutionVector(), giveUnknownValue(), initialize(), readDofManager(), storeDofManager(), and update().
|
virtual |
| dof | Pointer to DOF. |
| mode | What the unknown describes (increment, total value etc.). |
| tStep | Time step of interest. |
Definition at line 322 of file primaryfield.C.
References oofem::Dof::giveEqn(), givePrescribedVector(), giveSolutionVector(), OOFEM_ERROR, and resolveIndx().
Referenced by oofem::MasterDof::giveUnknown().
|
virtual |
Copy unknowns from previous solution or DOF's dictionary to the solution vector
| mode | what the unknown describes (increment, total value etc.). |
| tStep | Time of interest. |
| answer | Resulting vector. |
Definition at line 154 of file primaryfield.C.
References giveSolutionVector(), OOFEM_ERROR, resolveIndx(), and oofem::FloatArray::subtract().
| void oofem::PrimaryField::readDofManager | ( | TimeStep * | tStep, |
| DofManager & | dman ) |
Definition at line 108 of file primaryfield.C.
References oofem::FloatArray::at(), givePrescribedVector(), oofem::TimeStep::givePreviousStep(), giveSolutionVector(), nHistVectors, and resolveIndx().
Referenced by readFromDofDictionaries().
| void oofem::PrimaryField::readFromDofDictionaries | ( | TimeStep * | tStep | ) |
Definition at line 128 of file primaryfield.C.
References domainIndx, emodel, oofem::Domain::giveBcs(), oofem::Domain::giveDofManagers(), oofem::Domain::giveElements(), and readDofManager().
|
protected |
Definition at line 470 of file primaryfield.C.
References actualStepIndx, actualStepNumber, oofem::TimeStep::giveNumber(), nHistVectors, and OOFEM_ERROR.
Referenced by advanceSolution(), applyBoundaryCondition(), applyBoundaryCondition(), applyDefaultInitialCondition(), applyInitialCondition(), giveSolutionVector(), giveUnknownValue(), initialize(), readDofManager(), and storeDofManager().
|
overridevirtual |
Restores the receiver state previously written in stream.
| stream | Input stream. |
| Throws | an ContextIOERR exception if error encountered. |
Implements oofem::Field.
Definition at line 539 of file primaryfield.C.
References actualStepIndx, actualStepNumber, oofem::CIO_IOERR, oofem::CIO_OK, emodel, nHistVectors, prescribedVectors, oofem::DataStream::read(), solStepList, solutionVectors, and THROW_CIOERR.
|
overridevirtual |
Stores receiver state to output stream.
| stream | Output stream. |
| Throws | an ContextIOERR exception if error encountered. |
Implements oofem::Field.
Definition at line 509 of file primaryfield.C.
References actualStepIndx, actualStepNumber, oofem::CIO_IOERR, oofem::CIO_OK, prescribedVectors, solStepList, solutionVectors, THROW_CIOERR, and oofem::DataStream::write().
| void oofem::PrimaryField::storeDofManager | ( | TimeStep * | tStep, |
| DofManager & | dman ) |
Definition at line 65 of file primaryfield.C.
References oofem::FloatArray::at(), givePrescribedVector(), oofem::TimeStep::givePreviousStep(), giveSolutionVector(), nHistVectors, and resolveIndx().
Referenced by storeInDofDictionaries().
| void oofem::PrimaryField::storeInDofDictionaries | ( | TimeStep * | tStep | ) |
Definition at line 84 of file primaryfield.C.
References domainIndx, emodel, oofem::Domain::giveBcs(), oofem::Domain::giveDofManagers(), oofem::Domain::giveElements(), and storeDofManager().
|
virtual |
Project vectorToStore back to DOF's dictionary
| vectorToStore | Vector with the size of number of equations. |
| mode | Mode of the unknown (increment, total value etc.) |
| tStep | Time step unknowns belong to. |
Definition at line 312 of file primaryfield.C.
References giveSolutionVector(), and OOFEM_ERROR.
|
protected |
Definition at line 108 of file primaryfield.h.
Referenced by advanceSolution(), PrimaryField(), resolveIndx(), restoreContext(), and saveContext().
|
protected |
Definition at line 107 of file primaryfield.h.
Referenced by advanceSolution(), giveActualStepNumber(), PrimaryField(), resolveIndx(), restoreContext(), and saveContext().
|
protected |
Definition at line 114 of file primaryfield.h.
Referenced by __evaluateAt(), __evaluateAt(), applyBoundaryCondition(), applyDefaultInitialCondition(), PrimaryField(), readFromDofDictionaries(), and storeInDofDictionaries().
|
protected |
Definition at line 113 of file primaryfield.h.
Referenced by __evaluateAt(), applyBoundaryCondition(), applyDefaultInitialCondition(), applyInitialCondition(), PrimaryField(), readFromDofDictionaries(), restoreContext(), and storeInDofDictionaries().
|
protected |
Definition at line 109 of file primaryfield.h.
Referenced by advanceSolution(), givePrescribedVector(), giveSolutionVector(), PrimaryField(), readDofManager(), resolveIndx(), restoreContext(), and storeDofManager().
|
protected |
Definition at line 111 of file primaryfield.h.
Referenced by applyDefaultInitialCondition(), givePrescribedVector(), PrimaryField(), restoreContext(), and saveContext().
|
protected |
Definition at line 112 of file primaryfield.h.
Referenced by advanceSolution(), PrimaryField(), restoreContext(), and saveContext().
|
protected |
Definition at line 110 of file primaryfield.h.
Referenced by applyDefaultInitialCondition(), giveSolutionVector(), PrimaryField(), restoreContext(), and saveContext().