OOFEM 3.0
Loading...
Searching...
No Matches
oofem::InitialCondition Class Reference

#include <initialcondition.h>

Inheritance diagram for oofem::InitialCondition:
Collaboration diagram for oofem::InitialCondition:

Public Member Functions

 InitialCondition (int i, Domain *d)
virtual ~InitialCondition ()
 Destructor.
double give (ValueModeType mode, const FloatArray &coords)
bcValType giveICValType () const
int hasConditionOn (int u)
int hasConditionOn (ValueModeType type)
virtual void scale (ValueModeType type, double s)
int giveSetNumber ()
const IntArraygiveDofIDs ()
void printYourself () override
 Prints receiver state on stdout. Useful for debugging.
void initializeFrom (InputRecord &ir) override
const char * giveClassName () const override
const char * giveInputRecordName () const override
Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
virtual ~FEMComponent ()=default
 Virtual destructor.
DomaingiveDomain () const
virtual void setDomain (Domain *d)
int giveNumber () const
void setNumber (int num)
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
virtual void initializeFrom (InputRecord &ir, int priority)
virtual void initializeFinish ()
virtual void postInitialize ()
 Performs post initialization steps. Called after all components are created and initialized.
virtual void giveInputRecord (DynamicInputRecord &input)
virtual void saveContext (DataStream &stream, ContextMode mode)
virtual void restoreContext (DataStream &stream, ContextMode mode)
virtual int checkConsistency ()
virtual void printOutputAt (FILE *file, TimeStep *tStep)
virtual InterfacegiveInterface (InterfaceType t)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Private Attributes

int mode = 0
 flag indicating compatibility (initialValueDictionary) mode (0 uses initialValueDictionary, 1 uses expressions, 2 uses external field)
Dictionary initialValueDictionary
 Dictionary of initial (constant) values (deprecated).
ScalarFunction valueExpr
ScalarFunction velocityExpr
ScalarFunction accelerationExpr
FieldPtr externalFField
FieldType fFieldType =FieldType::FT_Unknown
bcValType valType
 Physical meaning of bc value.
int set
 Set number.
IntArray dofIDs
 List of dof ids that IC is applied to.

Additional Inherited Members

Protected Attributes inherited from oofem::FEMComponent
int number
 Component number.
Domaindomain
 Link to domain object, useful for communicating with other FEM components.

Detailed Description

Class implementing general initial condition. Initial condition is usually attribute of one or more degrees of freedom (DOFs).

The inherited attribute 'componentArray' is not used. It is replaced with the more adequate dictionary 'initialValueDictionary', which entries are referenced by names rather than by indices.

One particular DOF (with its physical meaning - for example displacement) can have associated only single initial condition. Initial condition therefore must represent several initial conditions for particular DOF (for example velocity and acceleration of unknown can be prescribed using single initial condition instance). These multiple entries are distinguished by their ValueModeType value. The ValueModeType value is also used as key in initialValueDictionary.

Initial conditions apply and should be taken into account only in one particular time step, which number is determined from engineering model giveNumberOfTimeStepWhenIcApply service. If in this time step both boundary condition on unknown and also initial condition on value of this unknown (TotalMode ValueModeType) are prescribed, then always value reported by boundary condition is taken into account.

See also
EngngModel::giveNumberOfTimeStepWhenIcApply

Definition at line 86 of file initialcondition.h.

Constructor & Destructor Documentation

◆ InitialCondition()

oofem::InitialCondition::InitialCondition ( int i,
Domain * d )
inline

Creates initial condition with given number, belonging to given domain.

Parameters
iInitial condition number.
dDomain to which new object will belongs.

Definition at line 119 of file initialcondition.h.

References dofIDs, oofem::FEMComponent::FEMComponent(), initialValueDictionary, set, oofem::UnknownBVT, and valType.

◆ ~InitialCondition()

virtual oofem::InitialCondition::~InitialCondition ( )
inlinevirtual

Destructor.

Definition at line 121 of file initialcondition.h.

Member Function Documentation

◆ give()

double oofem::InitialCondition::give ( ValueModeType mode,
const FloatArray & coords )

Returns value of initial condition for given unknown mode (determines whether total or velocity or acceleration mode of unknown is requested).

Parameters
modeCharacteristic mode of unknown, characteristic type depends on DOF (represent physical meaning).
Returns
Value of initial condition for given mode.

Definition at line 43 of file initialcondition.C.

References accelerationExpr, oofem::FloatArray::at(), oofem::cltypesGiveUnknownTypeModeKey(), oofem::FEMComponent::domain, externalFField, fFieldType, oofem::FEMComponent::giveDomain(), oofem::FloatArray::giveSize(), hasConditionOn(), initialValueDictionary, mode, OOFEM_ERROR, valueExpr, and velocityExpr.

Referenced by oofem::PrimaryField::applyDefaultInitialCondition(), and oofem::PrimaryField::applyInitialCondition().

◆ giveClassName()

const char * oofem::InitialCondition::giveClassName ( ) const
inlineoverridevirtual
Returns
Class name of the receiver.

Implements oofem::FEMComponent.

Definition at line 171 of file initialcondition.h.

◆ giveDofIDs()

const IntArray & oofem::InitialCondition::giveDofIDs ( )
inline

Gives the set number which initial condition is applied to.

Definition at line 166 of file initialcondition.h.

References dofIDs.

Referenced by oofem::Domain::createDofs().

◆ giveICValType()

bcValType oofem::InitialCondition::giveICValType ( ) const
inline

Returns receiver load type. It distinguish particular boundary conditions according to their "physical" meaning (like StructuralTemperatureLoadLT, StructuralLoadLT). Derived classes should always overload, default implementation returns UnknownLT value. See cltypes.h file for details.

Returns
Value type.

Definition at line 137 of file initialcondition.h.

◆ giveInputRecordName()

const char * oofem::InitialCondition::giveInputRecordName ( ) const
inlineoverridevirtual
Returns
Input record name of the receiver.

Implements oofem::FEMComponent.

Definition at line 172 of file initialcondition.h.

References _IFT_InitialCondition_Name.

◆ giveSetNumber()

int oofem::InitialCondition::giveSetNumber ( )
inline

Gives the set number which initial condition is applied to.

Definition at line 161 of file initialcondition.h.

References set.

Referenced by oofem::PrimaryField::applyInitialCondition(), and oofem::Domain::createDofs().

◆ hasConditionOn() [1/2]

int oofem::InitialCondition::hasConditionOn ( int u)

Tests if receiver has initial condition for specific unknown-mode.

Parameters
uValueModeType value of unknown.
Returns
Nonzero if given mode has initial condition, zero otherwise.

Definition at line 87 of file initialcondition.C.

References initialValueDictionary, and mode.

Referenced by oofem::PrimaryField::applyDefaultInitialCondition(), oofem::PrimaryField::applyInitialCondition(), give(), and scale().

◆ hasConditionOn() [2/2]

int oofem::InitialCondition::hasConditionOn ( ValueModeType type)

Tests if receiver has initial condition for specific unknown-mode.

Parameters
typeValueModeType of unknown.
Returns
Nonzero if given mode has initial condition, zero otherwise.

Definition at line 99 of file initialcondition.C.

References oofem::cltypesGiveUnknownTypeModeKey(), initialValueDictionary, and mode.

◆ initializeFrom()

void oofem::InitialCondition::initializeFrom ( InputRecord & ir)
overridevirtual

Initializes receiver according to object description stored in input record. This function is called immediately after creating object using constructor. Input record can be imagined as data record in component database belonging to receiver. Receiver may use value-name extracting functions to extract particular field from record. Note that initializeFrom may be called mutiple times.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
priorityPriority of the input record. This is used to determine the order of initialization
Todo
Make these both not optional (and remove the old approach). Not done right now because it breaks backwards compatibility with input files.

Reimplemented from oofem::FEMComponent.

Definition at line 120 of file initialcondition.C.

References _IFT_InitialCondition_conditions, _IFT_InitialCondition_d2fdt2, _IFT_InitialCondition_dfdt, _IFT_InitialCondition_dofs, _IFT_InitialCondition_f, _IFT_InitialCondition_field, _IFT_InitialCondition_set, _IFT_InitialCondition_valType, accelerationExpr, dofIDs, fFieldType, oofem::InputRecord::hasField(), initialValueDictionary, IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, mode, OOFEM_ERROR, set, valType, valueExpr, and velocityExpr.

◆ printYourself()

void oofem::InitialCondition::printYourself ( )
overridevirtual

Prints receiver state on stdout. Useful for debugging.

Reimplemented from oofem::FEMComponent.

Definition at line 111 of file initialcondition.C.

References initialValueDictionary, and oofem::FEMComponent::number.

◆ scale()

void oofem::InitialCondition::scale ( ValueModeType type,
double s )
virtual

Scales the receiver value (determined by ValueModeType) by given value. Typically used in nondimensional analysis to scale down BCs and ICs.

Parameters
typeValueModeType of unknown.
sScaling factor.

Definition at line 163 of file initialcondition.C.

References hasConditionOn(), initialValueDictionary, mode, and OOFEM_ERROR.

Member Data Documentation

◆ accelerationExpr

ScalarFunction oofem::InitialCondition::accelerationExpr
private

Definition at line 99 of file initialcondition.h.

Referenced by give(), and initializeFrom().

◆ dofIDs

IntArray oofem::InitialCondition::dofIDs
private

List of dof ids that IC is applied to.

Definition at line 111 of file initialcondition.h.

Referenced by giveDofIDs(), InitialCondition(), and initializeFrom().

◆ externalFField

FieldPtr oofem::InitialCondition::externalFField
private

Definition at line 102 of file initialcondition.h.

Referenced by give().

◆ fFieldType

FieldType oofem::InitialCondition::fFieldType =FieldType::FT_Unknown
private

Definition at line 103 of file initialcondition.h.

Referenced by give(), and initializeFrom().

◆ initialValueDictionary

Dictionary oofem::InitialCondition::initialValueDictionary
private

Dictionary of initial (constant) values (deprecated).

Definition at line 92 of file initialcondition.h.

Referenced by give(), hasConditionOn(), hasConditionOn(), InitialCondition(), initializeFrom(), printYourself(), and scale().

◆ mode

int oofem::InitialCondition::mode = 0
private

flag indicating compatibility (initialValueDictionary) mode (0 uses initialValueDictionary, 1 uses expressions, 2 uses external field)

Definition at line 90 of file initialcondition.h.

Referenced by give(), hasConditionOn(), hasConditionOn(), initializeFrom(), and scale().

◆ set

int oofem::InitialCondition::set
private

Set number.

Definition at line 109 of file initialcondition.h.

Referenced by giveSetNumber(), InitialCondition(), and initializeFrom().

◆ valType

bcValType oofem::InitialCondition::valType
private

Physical meaning of bc value.

Definition at line 107 of file initialcondition.h.

Referenced by InitialCondition(), and initializeFrom().

◆ valueExpr

ScalarFunction oofem::InitialCondition::valueExpr
private

Definition at line 95 of file initialcondition.h.

Referenced by give(), and initializeFrom().

◆ velocityExpr

ScalarFunction oofem::InitialCondition::velocityExpr
private

Definition at line 97 of file initialcondition.h.

Referenced by give(), and initializeFrom().


The documentation for this class was generated from the following files:

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011