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

Class implementing general initial condition. More...

#include <initialcondition.h>

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

Public Member Functions

 InitialCondition (int i, Domain *d)
 Creates initial condition with given number, belonging to given domain. More...
 
virtual ~InitialCondition ()
 Destructor. More...
 
double give (ValueModeType mode)
 Returns value of initial condition for given unknown mode (determines whether total or velocity or acceleration mode of unknown is requested). More...
 
bcValType giveICValType () const
 Returns receiver load type. More...
 
int hasConditionOn (int u)
 Tests if receiver has initial condition for specific unknown-mode. More...
 
int hasConditionOn (ValueModeType type)
 Tests if receiver has initial condition for specific unknown-mode. More...
 
virtual void scale (ValueModeType type, double s)
 Scales the receiver value (determined by ValueModeType) by given value. More...
 
int giveSetNumber ()
 Gives the set number which initial condition is applied to. More...
 
const IntArraygiveDofIDs ()
 Gives the set number which initial condition is applied to. More...
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
virtual void printYourself ()
 Prints receiver state on stdout. Useful for debugging. More...
 
virtual const char * giveClassName () const
 
virtual const char * giveInputRecordName () const
 
- Public Member Functions inherited from oofem::FEMComponent
 FEMComponent (int n, Domain *d)
 Regular constructor, creates component with given number and belonging to given domain. More...
 
virtual ~FEMComponent ()
 Virtual destructor. More...
 
DomaingiveDomain () const
 
virtual void setDomain (Domain *d)
 Sets associated Domain. More...
 
int giveNumber () const
 
void setNumber (int num)
 Sets number of receiver. More...
 
virtual void updateLocalNumbering (EntityRenumberingFunctor &f)
 Local renumbering support. More...
 
virtual void giveInputRecord (DynamicInputRecord &input)
 Setups the input record string of receiver. 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 int checkConsistency ()
 Allows programmer to test some internal data, before computation begins. More...
 
virtual void printOutputAt (FILE *file, TimeStep *tStep)
 Prints output of receiver to stream, for given time step. More...
 
virtual InterfacegiveInterface (InterfaceType t)
 Interface requesting service. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Private Attributes

Dictionary initialValueDictionary
 Dictionary of initial values. More...
 
bcValType valType
 Physical meaning of bc value. More...
 
int set
 Set number. More...
 
IntArray dofIDs
 List of dof ids that IC is applied to. More...
 

Additional Inherited Members

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

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 78 of file initialcondition.h.

Constructor & Destructor Documentation

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 96 of file initialcondition.h.

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

Destructor.

Definition at line 98 of file initialcondition.h.

Member Function Documentation

double oofem::InitialCondition::give ( ValueModeType  mode)

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 40 of file initialcondition.C.

References oofem::Dictionary::at(), oofem::cltypesGiveUnknownTypeModeKey(), hasConditionOn(), and initialValueDictionary.

Referenced by oofem::DofDistributedPrimaryField::applyDefaultInitialCondition(), oofem::PrimaryField::applyDefaultInitialCondition(), oofem::DofDistributedPrimaryField::applyInitialCondition(), oofem::PrimaryField::applyInitialCondition(), oofem::Dof::giveBcValue(), and oofem::MasterDof::giveUnknown().

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

Implements oofem::FEMComponent.

Definition at line 148 of file initialcondition.h.

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

Gives the set number which initial condition is applied to.

Definition at line 143 of file initialcondition.h.

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

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 114 of file initialcondition.h.

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

Implements oofem::FEMComponent.

Definition at line 149 of file initialcondition.h.

References _IFT_InitialCondition_Name.

int oofem::InitialCondition::giveSetNumber ( )
inline

Gives the set number which initial condition is applied to.

Definition at line 138 of file initialcondition.h.

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

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 53 of file initialcondition.C.

References oofem::Dictionary::includes(), and initialValueDictionary.

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

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 61 of file initialcondition.C.

References oofem::cltypesGiveUnknownTypeModeKey(), oofem::Dictionary::includes(), and initialValueDictionary.

IRResultType oofem::InitialCondition::initializeFrom ( InputRecord ir)
virtual

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.

See also
IR_GIVE_FIELD
IR_GIVE_OPTIONAL_FIELD
Parameters
irInput record to initialize from.
Returns
IRResultType
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 78 of file initialcondition.C.

References _IFT_InitialCondition_conditions, _IFT_InitialCondition_dofs, _IFT_InitialCondition_set, _IFT_InitialCondition_valType, oofem::IntArray::clear(), dofIDs, initialValueDictionary, IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, oofem::IRRT_OK, and valType.

Referenced by oofem::T3DInterface::t3d_2_OOFEM().

void oofem::InitialCondition::printYourself ( )
virtual

Prints receiver state on stdout. Useful for debugging.

Reimplemented from oofem::FEMComponent.

Definition at line 69 of file initialcondition.C.

References initialValueDictionary, oofem::FEMComponent::number, and oofem::Dictionary::printYourself().

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 101 of file initialcondition.C.

References oofem::Dictionary::at(), hasConditionOn(), and initialValueDictionary.

Member Data Documentation

IntArray oofem::InitialCondition::dofIDs
private

List of dof ids that IC is applied to.

Definition at line 88 of file initialcondition.h.

Referenced by initializeFrom().

Dictionary oofem::InitialCondition::initialValueDictionary
private

Dictionary of initial values.

Definition at line 82 of file initialcondition.h.

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

int oofem::InitialCondition::set
private

Set number.

Definition at line 86 of file initialcondition.h.

bcValType oofem::InitialCondition::valType
private

Physical meaning of bc value.

Definition at line 84 of file initialcondition.h.

Referenced by initializeFrom().


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