61 if ( mode == VM_Total ) {
66 if ( mode == VM_Velocity ) {
68 }
else if ( mode == VM_Incremental ) {
97 if ( !dof->isPrimaryDof() )
continue;
98 int eqNum = dof->giveEquationNumber(s);
100 answer.
at(eqNum) = dof->giveUnknownsDictionaryValue(tStep, mode);
106 int ndman = elem->giveNumberOfInternalDofManagers();
107 for (
int i = 1; i <= ndman; i++ ) {
108 for (
auto &dof : *elem->giveInternalDofManager(i) ) {
109 if ( !dof->isPrimaryDof() )
continue;
110 int eqNum = dof->giveEquationNumber(s);
112 answer.
at(eqNum) = dof->giveUnknownsDictionaryValue(tStep, mode);
118 for (
auto &bc : d->
giveBcs() ) {
119 int ndman = bc->giveNumberOfInternalDofManagers();
120 for (
int i = 1; i <= ndman; i++ ) {
121 for (
auto &dof : *bc->giveInternalDofManager(i) ) {
122 if ( !dof->isPrimaryDof() )
continue;
123 int eqNum = dof->giveEquationNumber(s);
125 answer.
at(eqNum) = dof->giveUnknownsDictionaryValue(tStep, mode);
140 if ( !dof->isPrimaryDof() )
continue;
141 int eqNum = dof->giveEquationNumber(s);
143 dof->updateUnknownsDictionary(tStep, mode, vectorToStore.
at(eqNum));
146 if ( mode == VM_Total ) {
147 if ( dof->hasBc(tStep) ) {
148 dof->updateUnknownsDictionary(tStep, mode, dof->giveBcValue(VM_Total, tStep));
155 int ndman = elem->giveNumberOfInternalDofManagers();
156 for (
int i = 1; i <= ndman; i++ ) {
157 for (
auto &dof : *elem->giveInternalDofManager(i) ) {
158 if ( !dof->isPrimaryDof() )
continue;
159 int eqNum = dof->giveEquationNumber(s);
161 dof->updateUnknownsDictionary(tStep, mode, vectorToStore.
at(eqNum));
167 for (
auto &bc : d->
giveBcs() ) {
168 int ndman = bc->giveNumberOfInternalDofManagers();
169 for (
int i = 1; i <= ndman; i++ ) {
170 for (
auto &dof : *bc->giveInternalDofManager(i) ) {
171 if ( !dof->isPrimaryDof() )
continue;
172 int eqNum = dof->giveEquationNumber(s);
174 dof->updateUnknownsDictionary(tStep, mode, vectorToStore.
at(eqNum));
189 if ( dman->isNull() )
continue;
190 for (
auto &dof : *dman ) {
191 dof->updateUnknownsDictionary(tStep, VM_Total, 0.);
192 int icid = dof->giveIcId();
193 if ( icid > 0 && dof->isPrimaryDof() ) {
196 double val = ic->
give(VM_Total);
197 dof->updateUnknownsDictionary(tStep, VM_Total, val);
205 int ndman = elem->giveNumberOfInternalDofManagers();
206 for (
int i = 1; i <= ndman; i++ ) {
207 for (
auto &dof : *elem->giveInternalDofManager(i) ) {
208 dof->updateUnknownsDictionary(tStep, VM_Total, 0.);
213 for (
auto &bc : d->
giveBcs() ) {
214 int ndman = bc->giveNumberOfInternalDofManagers();
215 for (
int i = 1; i <= ndman; i++ ) {
216 if ( bc->giveInternalDofManager(i)->isNull() )
continue;
217 for (
auto &dof : *bc->giveInternalDofManager(i) ) {
218 dof->updateUnknownsDictionary(tStep, VM_Total, 0.);
224 for (
auto &ic : d->
giveIcs() ) {
242 for (
int inode : set->giveNodeList() ) {
244 if ( dman->
isNull() )
continue;
247 tot0 = ic.
give(VM_Total);
250 Not relevant
for this time discretization
253 tot1 = tot0 - ic.
give(VM_Incremental);
276 if ( dman->isNull() )
continue;
277 for (
auto &dof : *dman ) {
278 if ( dof->hasBc(tStep) && dof->isPrimaryDof() ) {
279 int bcid = dof->giveBcId();
281 dof->updateUnknownsDictionary(tStep, VM_Total, val);
286 for (
auto &bc : d->
giveBcs() ) {
287 if ( bc->isImposed(tStep) ) {
295 if ( dof->isPrimaryDof() && abc->
hasBc(dof, tStep) ) {
296 dof->updateUnknownsDictionary( tStep, VM_Total, abc->
giveBcValue(dof, VM_Total, tStep) );
314 for (
int inode : set->giveNodeList() ) {
316 if ( dman->
isNull() )
continue;
333 for (
auto &dof : dman ) {
334 double val = dof->giveUnknownsDictionaryValue( prev, VM_Total );
335 dof->updateUnknownsDictionary( tStep, VM_Total, val );
348 if ( dman->isNull() )
continue;
354 int ndman = elem->giveNumberOfInternalDofManagers();
355 for (
int i = 1; i <= ndman; i++ ) {
360 for (
auto &bc : d->
giveBcs() ) {
361 int ndman = bc->giveNumberOfInternalDofManagers();
362 for (
int i = 1; i <= ndman; i++ ) {
363 if ( abc->giveInternalDofManager(i)->isNull() )
continue;
virtual FloatArray * giveSolutionVector(TimeStep *tStep)
virtual bool isImposed(TimeStep *tStep)
Returns nonzero if receiver representing BC is imposed at given time, otherwise returns zero...
const IntArray & giveDofIDs()
Gives the set number which initial condition is applied to.
void applyInitialCondition(InitialCondition &ic)
virtual void advanceSolution(TimeStep *tStep)
Brings up a new solution vector for given time step.
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
void setInitialGuess(DofManager &dman, TimeStep *tStep, TimeStep *prev)
FieldType
Physical type of field.
Class implementing general initial condition.
InitialCondition * giveIc(int n)
Service for accessing particular domain ic.
virtual double give(Dof *dof, ValueModeType mode, TimeStep *tStep)
Returns the value of a prescribed unknown, respecting requested mode for given time.
Abstract class representing field of primary variables (those, which are unknown and are typically as...
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual const IntArray & giveDofIDs() const
Array with default dofs which b.c.
virtual double giveBcValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
virtual void advanceSolution(TimeStep *tStep)
Brings up a new solution vector for given time step.
virtual DofManager * giveInternalDofManager(int i)
Gives an internal dof manager from receiver.
double giveTargetTime()
Returns target time.
Base class for dof managers.
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
virtual FloatArray * giveSolutionVector(TimeStep *tStep)
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
double giveTimeIncrement()
Returns solution step associated time increment.
std::vector< std::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
int giveSetNumber()
Gives the set number which boundary condition is applied to.
Class implementing Dirichlet boundary condition on DOF (primary boundary condition).
virtual bool hasBc(Dof *dof, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
DofIDItem
Type representing particular dof type.
int hasConditionOn(int u)
Tests if receiver has initial condition for specific unknown-mode.
virtual void updateUnknownsDictionary(TimeStep *tStep, ValueModeType mode, double dofValue)
Abstract function, allowing Dof to store its unknowns in its own private dictionary.
Set of elements, boundaries, edges and/or nodes.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual ~DofDistributedPrimaryField()
virtual bool isPrimaryDof()
Tests if receiver is primary DOF.
Set * giveSet(int n)
Service for accessing particular domain set.
std::vector< std::unique_ptr< InitialCondition > > & giveIcs()
Abstract base class for all active boundary conditions.
virtual double giveUnknownValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
double give(ValueModeType mode)
Returns value of initial condition for given unknown mode (determines whether total or velocity or ac...
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores receiver state to output stream.
Class representing vector of real numbers.
bool isNull()
Returns true if receiver is shared.
bool hasDofID(DofIDItem id) const
Checks if receiver contains dof with given ID.
virtual double giveUnknownsDictionaryValue(TimeStep *tStep, ValueModeType mode)
Access dictionary value, if not present zero is returned.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the receiver state previously written in stream.
virtual void applyBoundaryCondition(TimeStep *tStep)
Applies all boundary conditions to all prescribed DOFs.
std::vector< Dof * >::const_iterator findDofWithDofId(DofIDItem dofID) const
Finds index of DOF with required physical meaning of receiver.
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
virtual void applyDefaultInitialCondition()
Applies the default initial values values for all DOFs (0) in given domain.
void zero()
Zeroes all coefficients of receiver.
virtual void update(ValueModeType mode, TimeStep *tStep, const FloatArray &vectorToStore, const UnknownNumberingScheme &s)
Project vectorToStore back to DOF's dictionary.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
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.
Element in active domain is only mirror of some remote element.
int giveSetNumber()
Gives the set number which initial condition is applied to.
Domain * giveDomain() const
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
std::vector< std::unique_ptr< Element > > & giveElements()
Abstract base class representing the "problem" under consideration.
the oofem namespace is to define a context or scope in which all oofem names are defined.
std::vector< Dof * >::iterator end()
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
DofDistributedPrimaryField(EngngModel *a, int idomain, FieldType ft, int nHist)
Constructor.
Class representing solution step.
void resize(int s)
Resizes receiver towards requested size.