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

Implementation of general sequence (staggered) problem. More...

#include <staggeredproblem.h>

+ Inheritance diagram for oofem::StaggeredProblem:
+ Collaboration diagram for oofem::StaggeredProblem:

Public Member Functions

 StaggeredProblem (int i, EngngModel *_master=NULL)
 Constructor. More...
 
virtual ~StaggeredProblem ()
 Destructor. More...
 
 StaggeredProblem (const StaggeredProblem &)=delete
 
StaggeredProblemoperator= (const StaggeredProblem &)=delete
 
void setContextOutputMode (ContextOutputMode contextMode)
 
void setUDContextOutputMode (int cStep)
 
void setProblemMode (problemMode pmode)
 
virtual void setRenumberFlag ()
 Sets the renumber flag to true. More...
 
virtual void solveYourself ()
 Starts solution process. More...
 
virtual void solveYourselfAt (TimeStep *tStep)
 Solves problem for given time step. More...
 
virtual int forceEquationNumbering ()
 Forces equation renumbering on all domains associated to engng model. More...
 
virtual void updateYourself (TimeStep *tStep)
 Updates internal state after finishing time step. More...
 
virtual void initializeYourself (TimeStep *tStep)
 Provides the opportunity to initialize state variables stored in element integration points according to initial conditions using function initializeYourself() on element level. More...
 
virtual int initializeAdaptive (int tStepNumber)
 Initializes the newly generated discretization state according to previous solution. More...
 
virtual void terminate (TimeStep *tStep)
 Terminates the solution of time step. More...
 
virtual void doStepOutput (TimeStep *tStep)
 Prints the ouput of the solution step (using virtual this->printOutputAtservice) to the stream detemined using this->giveOutputStream() method and calls exportModuleManager to do output. More...
 
virtual int instanciateYourself (DataReader &dr, InputRecord *ir, const char *outFileName, const char *desc)
 Initializes whole problem according to its description stored in inputStream. More...
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description in input reader. More...
 
virtual void updateAttributes (MetaStep *mStep)
 Update receiver attributes according to step metaStep attributes. More...
 
virtual contextIOResultType saveContext (DataStream &stream, ContextMode mode)
 Stores the state of model to output stream. More...
 
virtual contextIOResultType restoreContext (DataStream &stream, ContextMode mod)
 Restores the state of model from output stream. More...
 
virtual void updateDomainLinks ()
 Updates domain links after the domains of receiver have changed. More...
 
void printYourself ()
 
virtual void printOutputAt (FILE *file, TimeStep *tStep)
 Prints output of receiver to output domain stream, for given time step. More...
 
virtual TimeStepgiveCurrentStep (bool force=false)
 Returns current time step. More...
 
virtual TimeStepgivePreviousStep (bool force=false)
 Returns previous time step. More...
 
virtual TimeStepgiveSolutionStepWhenIcApply (bool force=false)
 Returns the solution step when Initial Conditions (IC) apply. More...
 
virtual int giveNumberOfFirstStep (bool force=false)
 Returns number of first time step used by receiver. More...
 
virtual TimeStepgiveNextStep ()
 Returns next time step (next to current step) of receiver. More...
 
virtual const char * giveClassName () const
 Returns class name of the receiver. More...
 
virtual const char * giveInputRecordName () const
 
virtual int useNonlocalStiffnessOption ()
 Returns nonzero if nonlocal stiffness option activated. More...
 
virtual fMode giveFormulation ()
 Indicates type of non linear computation (total or updated formulation). More...
 
FunctiongiveDtFunction ()
 Returns time function for time step increment. More...
 
double giveDeltaT (int n)
 Returns the timestep length for given step number n, initial step is number 0. More...
 
double giveDiscreteTime (int n)
 Returns time for time step number n (array discreteTimes must be specified) More...
 
void giveCoupledModels (IntArray &answer)
 Returns list of model number that this model is coupled with. Used for staggered approach. More...
 
virtual void drawYourself (oofegGraphicContext &gc)
 
virtual void drawElements (oofegGraphicContext &gc)
 
virtual void drawNodes (oofegGraphicContext &gc)
 
virtual void showSparseMtrxStructure (int type, oofegGraphicContext &gc, TimeStep *tStep)
 Shows the sparse structure of required matrix, type == 1 stiffness. More...
 
virtual int checkProblemConsistency ()
 Allows programmer to test problem its internal data, before computation begins. More...
 
virtual EngngModelgiveSlaveProblem (int i)
 Returns i-th slave problem. More...
 
virtual int giveNumberOfSlaveProblems ()
 Returns number of slave problems. More...
 
virtual int instanciateDefaultMetaStep (InputRecord *ir)
 Instanciate default metastep, if nmsteps is zero. More...
 
- Public Member Functions inherited from oofem::EngngModel
 EngngModel (int i, EngngModel *_master=NULL)
 Constructor. More...
 
virtual ~EngngModel ()
 Destructor. More...
 
 EngngModel (const EngngModel &)=delete
 
EngngModeloperator= (const EngngModel &)=delete
 
DomaingiveDomain (int n)
 Service for accessing particular problem domain. More...
 
void setDomain (int i, Domain *ptr, bool iDeallocateOld=true)
 Sets i-th domain of receiver. More...
 
int giveNumberOfDomains ()
 Returns number of domains in problem. More...
 
const std::string & giveDescription () const
 
const time_t & giveStartTime ()
 
bool giveSuppressOutput () const
 
virtual ErrorEstimatorgiveDomainErrorEstimator (int n)
 Service for accessing ErrorEstimator corresponding to particular domain. More...
 
virtual MaterialInterfacegiveMaterialInterface (int n)
 Returns material interface representation for given domain. More...
 
void setNumberOfEquations (int id, int neq)
 
FILE * giveOutputStream ()
 Returns file descriptor of output file. More...
 
std::string giveOutputBaseFileName ()
 Returns base output file name to which extensions, like .out .vtu .osf should be added. More...
 
std::string giveReferenceFileName ()
 Returns reference file name. More...
 
void letOutputBaseFileNameBe (const std::string &src)
 Sets the base output file name. More...
 
ContextOutputMode giveContextOutputMode ()
 Returns domain context output mode. More...
 
int giveContextOutputStep ()
 Returns domain context output step. More...
 
void setContextOutputMode (ContextOutputMode contextMode)
 Sets context output mode of receiver. More...
 
void setUDContextOutputMode (int cStep)
 Sets user defined context output mode (it sets contextOutputMode to contextOutputMode), setting contextOutputStep to given value. More...
 
void setProblemMode (problemMode pmode)
 Sets domain mode to given mode. More...
 
void setParallelMode (bool newParallelFlag)
 Sets the problem to run in parallel (or not). More...
 
problemMode giveProblemMode ()
 Returns domain mode. More...
 
void setProblemScale (problemScale pscale)
 Sets scale in multiscale simulation. More...
 
problemScale giveProblemScale ()
 Returns scale in multiscale simulation. More...
 
virtual void resetRenumberFlag ()
 Sets the renumber flag to false. More...
 
double giveSolutionStepTime ()
 Returns the user time of the current simulation step in seconds. More...
 
void giveAnalysisTime (int &rhrs, int &rmin, int &rsec, int &uhrs, int &umin, int &usec)
 Returns the real and user time for the analysis. More...
 
void terminateAnalysis ()
 Performs analysis termination after finishing analysis. More...
 
void saveStepContext (TimeStep *tStep, ContextMode mode)
 Saves context of given solution step, if required (determined using this->giveContextOutputMode() method). More...
 
virtual int giveNumberOfDomainEquations (int di, const UnknownNumberingScheme &num)
 Returns number of equations for given domain in active (current time step) time step. More...
 
virtual double giveUnknownComponent (ValueModeType, TimeStep *, Domain *, Dof *)
 Returns requested unknown. More...
 
virtual FieldPtr giveField (FieldType key, TimeStep *)
 Returns the smart pointer to requested field, Null otherwise. More...
 
EngngModelgiveMasterEngngModel ()
 Returns the master engnmodel. More...
 
virtual double giveLoadLevel ()
 Returns the current load level. More...
 
virtual double giveEigenValue (int eigNum)
 Only relevant for eigen value analysis. Otherwise returns zero. More...
 
virtual void setActiveVector (int i)
 Only relevant for eigen value analysis. Otherwise does noting. More...
 
int updateSharedDofManagers (FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
 Exchanges necessary remote DofManagers data. More...
 
int exchangeRemoteElementData (int ExchangeTag)
 Exchanges necessary remote element data with remote partitions. More...
 
virtual int giveCurrentNumberOfIterations ()
 Returns number of iterations that was required to reach equilibrium - used for adaptive step length in staggered problem. More...
 
MPI_Comm giveParallelComm ()
 Returns the communication object of reciever. More...
 
int packRemoteElementData (ProcessCommunicator &processComm)
 Packs data of local element to be received by their remote counterpart on remote partitions. More...
 
int unpackRemoteElementData (ProcessCommunicator &processComm)
 Unpacks data for remote elements (which are mirrors of remote partition's local elements). More...
 
int packDofManagers (ArrayWithNumbering *src, ProcessCommunicator &processComm)
 Packing function for vector values of DofManagers. More...
 
int unpackDofManagers (ArrayWithNumbering *dest, ProcessCommunicator &processComm)
 Unpacking function for vector values of DofManagers . More...
 
ProblemCommunicatorgiveProblemCommunicator (EngngModelCommType t)
 
void initializeCommMaps (bool forceInit=false)
 
void Instanciate_init ()
 Initialization of the receiver state (opening the default output stream, empty domain creation, initialization of parallel context, etc) before Initialization form DataReader. More...
 
int instanciateDomains (DataReader &dr)
 Instanciate problem domains by calling their instanciateYourself() service. More...
 
int instanciateMetaSteps (DataReader &dr)
 Instanciate problem meta steps by calling their instanciateYourself() service. More...
 
void initMetaStepAttributes (MetaStep *mStep)
 Update e-model attributes attributes according to step metaStep attributes. More...
 
MetaStepgiveCurrentMetaStep ()
 Returns current meta step. More...
 
TimeStepgenerateNextStep ()
 Generate new time step (and associate metastep). More...
 
virtual void preInitializeNextStep ()
 Does a pre-initialization of the next time step (implement if necessarry) More...
 
int giveNumberOfMetaSteps ()
 Return number of meta steps. More...
 
MetaStepgiveMetaStep (int i)
 Returns the i-th meta step. More...
 
int giveNumberOfSteps (bool force=false)
 Returns total number of steps. More...
 
virtual double giveEndOfTimeOfInterest ()
 Returns end of time interest (time corresponding to end of time integration). More...
 
int giveNumberOfTimeStepWhenIcApply ()
 Returns the time step number, when initial conditions should apply. More...
 
virtual NumericalMethodgiveNumericalMethod (MetaStep *mStep)
 Returns reference to receiver's numerical method. More...
 
ExportModuleManagergiveExportModuleManager ()
 Returns receiver's export module manager. More...
 
EngngModelTimergiveTimer ()
 Returns reference to receiver timer (EngngModelTimer). More...
 
virtual int giveNewEquationNumber (int domain, DofIDItem)
 Increases number of equations of receiver's domain and returns newly created equation number. More...
 
virtual int giveNewPrescribedEquationNumber (int domain, DofIDItem)
 Increases number of prescribed equations of receiver's domain and returns newly created equation number. More...
 
std::string giveContextFileName (int tStepNumber, int stepVersion) const
 Returns the filename for the context file for the given step and version. More...
 
std::string giveDomainFileName (int domainNum, int domainSerNum) const
 Returns the filename for the given domain (used by adaptivity and restore) More...
 
virtual void updateComponent (TimeStep *tStep, NumericalCmpn cmpn, Domain *d)
 Updates components mapped to numerical method if necessary during solution process. More...
 
virtual void initStepIncrements ()
 Initializes solution of new time step. More...
 
virtual int forceEquationNumbering (int i)
 Forces equation renumbering on given domain. More...
 
virtual int requiresUnknownsDictionaryUpdate ()
 Indicates if EngngModel requires Dofs dictionaries to be updated. More...
 
virtual bool requiresEquationRenumbering (TimeStep *tStep)
 Returns true if equation renumbering is required for given solution step. More...
 
virtual void updateDofUnknownsDictionary (DofManager *, TimeStep *)
 Updates necessary values in Dofs unknown dictionaries. More...
 
virtual int giveUnknownDictHashIndx (ValueModeType mode, TimeStep *tStep)
 This method is responsible for computing unique dictionary id (ie hash value) from given valueModeType and time step. More...
 
virtual ParallelContextgiveParallelContext (int n)
 Returns the parallel context corresponding to given domain (n) and unknown type Default implementation returns i-th context from parallelContextList. More...
 
virtual void initParallelContexts ()
 Creates parallel contexts. More...
 
virtual void assemble (SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &s, Domain *domain)
 Assembles characteristic matrix of required type into given sparse matrix. More...
 
virtual void assemble (SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, Domain *domain)
 Assembles characteristic matrix of required type into given sparse matrix. More...
 
void assembleVector (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
 Assembles characteristic vector of required type from dofManagers, element, and active boundary conditions, into given vector. More...
 
void assembleVectorFromDofManagers (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
 Assembles characteristic vector of required type from dofManagers into given vector. More...
 
void assembleVectorFromElements (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
 Assembles characteristic vector of required type from elements into given vector. More...
 
void assembleVectorFromBC (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
 Assembles characteristic vector of required type from boundary conditions. More...
 
void assembleExtrapolatedForces (FloatArray &answer, TimeStep *tStep, CharType type, Domain *domain)
 Assembles the extrapolated internal forces vector, useful for obtaining a good initial guess in nonlinear analysis with Dirichlet boundary conditions. More...
 
void assemblePrescribedExtrapolatedForces (FloatArray &answer, TimeStep *tStep, CharType type, Domain *domain)
 
void assembleVectorFromContacts (FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
 
virtual int checkConsistency ()
 Allows programmer to test some receiver's internal data, before computation begins. More...
 
virtual void init ()
 Initializes the receiver state. More...
 
virtual void postInitialize ()
 Performs post-initialization for all the problem contents (which is called after initializeFrom). More...
 
virtual void printOutputAt (FILE *file, TimeStep *tStep, const IntArray &nodeSets, const IntArray &elementSets)
 
void outputNodes (FILE *file, Domain &domain, TimeStep *tStep, int setNum)
 Outputs all nodes in the given set. More...
 
void outputElements (FILE *file, Domain &domain, TimeStep *tStep, int setNum)
 Outputs all elements in the given set. More...
 
void printYourself ()
 Prints state of receiver. Useful for debugging. More...
 
virtual void printDofOutputAt (FILE *stream, Dof *iDof, TimeStep *tStep)
 DOF printing routine. More...
 
bool isParallel () const
 Returns true if receiver in parallel mode. More...
 
int giveRank () const
 Returns domain rank in a group of collaborating processes (0..groupSize-1) More...
 
int giveNumberOfProcesses () const
 Returns the number of collaborating processes. More...
 
EngngModelContextgiveContext ()
 Context requesting service. More...
 
virtual bool giveEquationScalingFlag ()
 Returns the Equation scaling flag, which is used to indicate that governing equation(s) are scaled, or non-dimensionalized. More...
 
virtual double giveVariableScale (VarScaleType varId)
 Returns the scale factor for given variable type. More...
 
virtual int estimateMaxPackSize (IntArray &commMap, DataStream &buff, int packUnpackType)
 Determines the space necessary for send/receive buffer. More...
 
virtual void balanceLoad (TimeStep *tStep)
 Recovers the load balance between processors, if needed. More...
 
virtual LoadBalancergiveLoadBalancer ()
 Returns reference to receiver's load balancer. More...
 
virtual LoadBalancerMonitorgiveLoadBalancerMonitor ()
 Returns reference to receiver's load balancer monitor. More...
 
void initParallel ()
 Request domain rank and problem size. More...
 
EngngModelgiveEngngModel ()
 Returns reference to itself -> required by communicator.h. More...
 
virtual bool isElementActivated (int elemNum)
 
virtual bool isElementActivated (Element *e)
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Protected Member Functions

int instanciateSlaveProblems ()
 
- Protected Member Functions inherited from oofem::EngngModel
virtual void packMigratingData (TimeStep *tStep)
 Packs receiver data when rebalancing load. More...
 
virtual void unpackMigratingData (TimeStep *tStep)
 Unpacks receiver data when rebalancing load. More...
 

Protected Attributes

std::vector< std::unique_ptr< EngngModel > > emodelList
 List of engineering models to solve sequentially. More...
 
double deltaT
 
std::vector< std::string > inputStreamNames
 
int dtFunction
 Associated time function for time step increment. More...
 
double stepMultiplier
 Constant multiplier, optional input parameter. More...
 
FloatArray discreteTimes
 Time lag specifying how much is the second sub-problem delayed after the first one during this period the second subproblem isn't solved at all. More...
 
int timeDefinedByProb
 Optional parameter which specify problems to define load time functions. More...
 
IntArray coupledModels
 List of slave models to which this model is coupled. More...
 
bool adaptiveStepLength
 
double minStepLength
 adaptive time step length - minimum More...
 
double maxStepLength
 adaptive time step length - maximum More...
 
double reqIterations
 adaptive time step length - required (=optimum) number of iterations More...
 
double adaptiveStepSince
 adaptive time step length applies after prescribed time More...
 
double endOfTimeOfInterest
 alternative overriding the number of steps "nsteps" - necessary for time-driven analyses when the appropriate number of steps is apriori unknow. More...
 
double prevStepLength
 
double currentStepLength
 
- Protected Attributes inherited from oofem::EngngModel
int ndomains
 Number of receiver domains. More...
 
std::vector< std::unique_ptr< Domain > > domainList
 List of problem domains. More...
 
int numberOfSteps
 Total number of time steps. More...
 
int numberOfEquations
 Total number of equation in current time step. More...
 
int numberOfPrescribedEquations
 Total number or prescribed equations in current time step. More...
 
IntArray domainNeqs
 Number of equations per domain. More...
 
IntArray domainPrescribedNeqs
 Number of prescribed equations per domain. More...
 
bool renumberFlag
 Renumbering flag (renumbers equations after each step, necessary if Dirichlet BCs change). More...
 
bool profileOpt
 Profile optimized numbering flag (using Sloan's algorithm). More...
 
int equationNumberingCompleted
 Equation numbering completed flag. More...
 
int nMetaSteps
 Number of meta steps. More...
 
std::vector< MetaStepmetaStepList
 List of problem metasteps. More...
 
std::unique_ptr< TimeStepstepWhenIcApply
 Solution step when IC (initial conditions) apply. More...
 
std::unique_ptr< TimeStepcurrentStep
 Current time step. More...
 
std::unique_ptr< TimeSteppreviousStep
 Previous time step. More...
 
int number
 Receivers id. More...
 
std::string dataOutputFileName
 Path to output stream. More...
 
std::string coreOutputFileName
 String with core output file name. More...
 
FILE * outputStream
 Output stream. More...
 
std::string referenceFileName
 String with reference file name. More...
 
ContextOutputMode contextOutputMode
 Domain context output mode. More...
 
int contextOutputStep
 
ExportModuleManagerexportModuleManager
 Export module manager. More...
 
InitModuleManagerinitModuleManager
 Initialization module manager. More...
 
problemMode pMode
 Domain mode. More...
 
problemScale pScale
 Multiscale mode. More...
 
time_t startTime
 Solution start time. More...
 
EngngModelmaster
 Master e-model; if defined receiver is in maintained (slave) mode. More...
 
EngngModelContextcontext
 Context. More...
 
EngngModelTimer timer
 E-model timer. More...
 
int parallelFlag
 Flag indicating that the receiver runs in parallel. More...
 
enum fMode nonLinFormulation
 Type of non linear formulation (total or updated formulation). More...
 
ErrorEstimatordefaultErrEstimator
 Error estimator. Useful for adaptivity, or simply printing errors output. More...
 
int rank
 Domain rank in a group of collaborating processes (0..groupSize-1). More...
 
int numProcs
 Total number of collaborating processes. More...
 
int nonlocalExt
 Flag indicating if nonlocal extension active, which will cause data to be sent between shared elements before computing the internal forces. More...
 
char processor_name [PROCESSOR_NAME_LENGTH]
 Processor name. More...
 
MPI_Comm comm
 Communication object for this engineering model. More...
 
CommunicatorBuffcommBuff
 Common Communicator buffer. More...
 
ProblemCommunicatorcommunicator
 Communicator. More...
 
ProblemCommunicatornonlocCommunicator
 NonLocal Communicator. Necessary when nonlocal constitutive models are used. More...
 
std::vector< ParallelContextparallelContextList
 List where parallel contexts are stored. More...
 
bool suppressOutput
 Flag for suppressing output to file. More...
 
std::string simulationDescription
 
LoadBalancerlb
 Load Balancer. More...
 
LoadBalancerMonitorlbm
 
bool loadBalancingFlag
 If set to true, load balancing is active. More...
 
bool force_load_rebalance_in_first_step
 Debug flag forcing load balancing after first step. More...
 

Additional Inherited Members

- Public Types inherited from oofem::EngngModel
enum  EngngModel_UpdateMode { EngngModel_Unknown_Mode, EngngModel_SUMM_Mode, EngngModel_SET_Mode }
 
enum  EngngModelCommType { PC_default, PC_nonlocal }
 
enum  InitialGuess { IG_None = 0, IG_Tangent = 1 }
 Means to choose methods for finding a good initial guess. More...
 
- Protected Types inherited from oofem::EngngModel
enum  {
  InternalForcesExchangeTag, MassExchangeTag, LoadExchangeTag, ReactionExchangeTag,
  RemoteElementExchangeTag
}
 Message tags. More...
 

Detailed Description

Implementation of general sequence (staggered) problem.

The problem consists in sequence of low level problems (slaves) which are executed sequentially and where the results of particular slave depends on the results of previous slaves in sequence. Typical example is heat&mass transfer analysis followed by mechanical one, which takes into account the temperature field from the first analysis.

The sequence problem is represented by this class. It maintains list of subsequent (slave) problems and it is executes the slave problems. It is responsible for solution step generation and synchronization between slave problems. The transfer of required state variables is done by mapping of corresponding variables between problem domains. This allows to to transfer primary (nodal) values of one problem to integration points of subsequent problem or to use completely different discretizations for slave problems.

Since the master problem is responsible for synchronization, it is responsible for generation the solution steps. Therefore, the solution step specification, as well as relevant meta step attributes are specified at master level.

Note
To avoid confusion, the slaves are treated in so-called maintained mode. In this mode, the attributes and meta step attributes are taken from the master. The local attributes, even if specified, are ignored.

Definition at line 90 of file staggeredproblem.h.

Constructor & Destructor Documentation

oofem::StaggeredProblem::StaggeredProblem ( int  i,
EngngModel _master = NULL 
)

Constructor.

Creates an engineering model with number i belonging to domain d.

Definition at line 57 of file staggeredproblem.C.

References dtFunction, oofem::EngngModel::ndomains, stepMultiplier, and timeDefinedByProb.

oofem::StaggeredProblem::~StaggeredProblem ( )
virtual

Destructor.

Definition at line 74 of file staggeredproblem.C.

oofem::StaggeredProblem::StaggeredProblem ( const StaggeredProblem )
delete

Member Function Documentation

int oofem::StaggeredProblem::checkProblemConsistency ( )
virtual

Allows programmer to test problem its internal data, before computation begins.

Returns
Nonzero if receiver check is o.k.

Reimplemented from oofem::EngngModel.

Definition at line 599 of file staggeredproblem.C.

References emodelList, OOFEM_LOG_DEBUG, and VERBOSE_PRINTS.

void oofem::StaggeredProblem::doStepOutput ( TimeStep tStep)
virtual

Prints the ouput of the solution step (using virtual this->printOutputAtservice) to the stream detemined using this->giveOutputStream() method and calls exportModuleManager to do output.

Reimplemented from oofem::EngngModel.

Definition at line 546 of file staggeredproblem.C.

References emodelList.

void oofem::StaggeredProblem::drawElements ( oofegGraphicContext gc)
virtual
void oofem::StaggeredProblem::drawNodes ( oofegGraphicContext gc)
virtual
void oofem::StaggeredProblem::drawYourself ( oofegGraphicContext gc)
virtual
int oofem::StaggeredProblem::forceEquationNumbering ( )
virtual

Forces equation renumbering on all domains associated to engng model.

All equation numbers in all domains for all dofManagers are invalidated, and new equation numbers are generated starting from 1 on each domain. It will update numberOfEquations variable accordingly. Should be used at startup to force equation numbering and therefore sets numberOfEquations. Must be used if model supports changes of static system to assign new valid equation numbers to dofManagers.

Reimplemented from oofem::EngngModel.

Definition at line 510 of file staggeredproblem.C.

References emodelList.

Referenced by solveYourself().

virtual const char* oofem::StaggeredProblem::giveClassName ( ) const
inlinevirtual

Returns class name of the receiver.

Implements oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 181 of file staggeredproblem.h.

void oofem::StaggeredProblem::giveCoupledModels ( IntArray answer)
inline

Returns list of model number that this model is coupled with. Used for staggered approach.

Definition at line 204 of file staggeredproblem.h.

References gc.

TimeStep * oofem::StaggeredProblem::giveCurrentStep ( bool  force = false)
virtual

Returns current time step.

Parameters
forcewhen set to true then current step of receiver is returned instead of master (default)

Reimplemented from oofem::EngngModel.

Definition at line 348 of file staggeredproblem.C.

References emodelList, oofem::EngngModel::giveCurrentStep(), and timeDefinedByProb.

Referenced by oofem::FluidStructureProblem::initializeYourself(), and oofem::FluidStructureProblem::preInitializeNextStep().

double oofem::StaggeredProblem::giveDiscreteTime ( int  n)

Returns time for time step number n (array discreteTimes must be specified)

Definition at line 333 of file staggeredproblem.C.

References oofem::FloatArray::at(), discreteTimes, oofem::FloatArray::giveSize(), and OOFEM_ERROR.

Referenced by giveDeltaT().

Function * oofem::StaggeredProblem::giveDtFunction ( )

Returns time function for time step increment.

Used time function should provide step lengths as function of step number. Initial step with number 0 is considered as [ -dt(0), 0 ], first step is [ 0, dt(1) ], ...

Definition at line 262 of file staggeredproblem.C.

References dtFunction, oofem::EngngModel::giveDomain(), and oofem::Domain::giveFunction().

Referenced by giveDeltaT().

virtual fMode oofem::StaggeredProblem::giveFormulation ( )
inlinevirtual

Indicates type of non linear computation (total or updated formulation).

This is used for example on Nodal level to update coordinates if updated formulation is done, or on element level, when non linear contributions are computed.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 185 of file staggeredproblem.h.

References oofem::UNKNOWN.

virtual const char* oofem::StaggeredProblem::giveInputRecordName ( ) const
inlinevirtual

Reimplemented in oofem::FluidStructureProblem.

Definition at line 182 of file staggeredproblem.h.

References _IFT_StaggeredProblem_Name.

TimeStep * oofem::StaggeredProblem::giveNextStep ( )
virtual
int oofem::StaggeredProblem::giveNumberOfFirstStep ( bool  force = false)
virtual

Returns number of first time step used by receiver.

Parameters
forcewhen set to true then receiver reply is returned instead of master (default)

Reimplemented from oofem::EngngModel.

Definition at line 384 of file staggeredproblem.C.

References emodelList, oofem::EngngModel::giveNumberOfFirstStep(), and timeDefinedByProb.

Referenced by giveNextStep(), and giveSolutionStepWhenIcApply().

virtual int oofem::StaggeredProblem::giveNumberOfSlaveProblems ( )
inlinevirtual

Returns number of slave problems.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 216 of file staggeredproblem.h.

Referenced by drawElements(), drawNodes(), drawYourself(), giveDeltaT(), and giveSlaveProblem().

TimeStep * oofem::StaggeredProblem::givePreviousStep ( bool  force = false)
virtual

Returns previous time step.

Parameters
forcewhen set to true then previous step of receiver is returned instead of master (default)

Reimplemented from oofem::EngngModel.

Definition at line 358 of file staggeredproblem.C.

References emodelList, oofem::EngngModel::givePreviousStep(), and timeDefinedByProb.

TimeStep * oofem::StaggeredProblem::giveSolutionStepWhenIcApply ( bool  force = false)
virtual

Returns the solution step when Initial Conditions (IC) apply.

Parameters
forcewhen set to true then receiver reply is returned instead of master (default)

Reimplemented from oofem::EngngModel.

Definition at line 368 of file staggeredproblem.C.

References emodelList, giveDeltaT(), giveNumberOfFirstStep(), oofem::EngngModel::giveNumberOfTimeStepWhenIcApply(), oofem::EngngModel::stepWhenIcApply, and timeDefinedByProb.

Referenced by giveNextStep().

virtual int oofem::StaggeredProblem::initializeAdaptive ( int  tStepNumber)
inlinevirtual

Initializes the newly generated discretization state according to previous solution.

This process should typically include restoring old solution, instanciating newly generated domain(s) and by mapping procedure.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 158 of file staggeredproblem.h.

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

Initializes receiver according to object description in input reader.

InitString 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.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 132 of file staggeredproblem.C.

References _IFT_EngngModel_nsteps, _IFT_EngngModel_suppressOutput, _IFT_StaggeredProblem_adaptiveStepLength, _IFT_StaggeredProblem_adaptivestepsince, _IFT_StaggeredProblem_coupling, _IFT_StaggeredProblem_deltat, _IFT_StaggeredProblem_dtf, _IFT_StaggeredProblem_endoftimeofinterest, _IFT_StaggeredProblem_maxsteplength, _IFT_StaggeredProblem_minsteplength, _IFT_StaggeredProblem_prescribedtimes, _IFT_StaggeredProblem_prob1, _IFT_StaggeredProblem_prob2, _IFT_StaggeredProblem_prob3, _IFT_StaggeredProblem_reqiterations, _IFT_StaggeredProblem_stepmultiplier, _IFT_StaggeredProblem_timeDefinedByProb, adaptiveStepLength, adaptiveStepSince, oofem::IntArray::clear(), coupledModels, oofem::EngngModel::dataOutputFileName, deltaT, discreteTimes, oofem::EngngModel::domainList, oofem::EngngModel::domainNeqs, oofem::EngngModel::domainPrescribedNeqs, dtFunction, endOfTimeOfInterest, oofem::InputRecord::hasField(), oofem::EngngModel::initializeFrom(), inputStreamNames, IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, oofem::IRRT_BAD_FORMAT, oofem::IRRT_OK, oofem::EngngModel::isParallel(), maxStepLength, minStepLength, oofem::EngngModel::ndomains, oofem::EngngModel::numberOfSteps, oofem::EngngModel::numProcs, OOFEM_ERROR, OOFEM_WARNING, oofem::EngngModel::outputStream, oofem::EngngModel::processor_name, oofem::EngngModel::rank, oofem::EngngModel::renumberFlag, reqIterations, oofem::IntArray::resize(), oofem::EngngModel::simulationDescription, oofem::EngngModel::startTime, stepMultiplier, oofem::EngngModel::suppressOutput, and timeDefinedByProb.

Referenced by oofem::FluidStructureProblem::initializeFrom().

virtual void oofem::StaggeredProblem::initializeYourself ( TimeStep tStep)
inlinevirtual

Provides the opportunity to initialize state variables stored in element integration points according to initial conditions using function initializeYourself() on element level.

Should be called when current time step is time step when IC will apply (see EngngModel::giveNumberOfTimeStepWhenIcApply) somewhere from solveYourselfAt function). Implementation must be provided. Default implementation is empty.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 157 of file staggeredproblem.h.

Referenced by solveYourself().

int oofem::StaggeredProblem::instanciateDefaultMetaStep ( InputRecord ir)
virtual

Instanciate default metastep, if nmsteps is zero.

Reimplemented from oofem::EngngModel.

Definition at line 90 of file staggeredproblem.C.

References oofem::EngngModel::instanciateDefaultMetaStep(), oofem::EngngModel::numberOfSteps, and timeDefinedByProb.

int oofem::StaggeredProblem::instanciateSlaveProblems ( )
protected
int oofem::StaggeredProblem::instanciateYourself ( DataReader dr,
InputRecord ir,
const char *  outFileName,
const char *  desc 
)
virtual

Initializes whole problem according to its description stored in inputStream.

Prints header, opens the outFileName, instanciate itself the receiver using using virtual initializeFrom service and instanciates all problem domains.

Reimplemented from oofem::EngngModel.

Definition at line 79 of file staggeredproblem.C.

References oofem::InputRecord::finish(), instanciateSlaveProblems(), and oofem::EngngModel::instanciateYourself().

StaggeredProblem& oofem::StaggeredProblem::operator= ( const StaggeredProblem )
delete
void oofem::StaggeredProblem::printOutputAt ( FILE *  file,
TimeStep tStep 
)
virtual

Prints output of receiver to output domain stream, for given time step.

Corresponding function for element gauss points is invoked (gaussPoint::printOutputAt).

Reimplemented from oofem::EngngModel.

Definition at line 555 of file staggeredproblem.C.

void oofem::StaggeredProblem::printYourself ( )
contextIOResultType oofem::StaggeredProblem::restoreContext ( DataStream stream,
ContextMode  mode 
)
virtual

Restores the state of model from output stream.

Restores not only the receiver state, but also same function is invoked for all DofManagers and Elements in associated domain. Note that by restoring element context also contexts of all associated integration points (and material statuses) are restored. Each context is associated with unique time step. Only one context per time step is allowed. Restore context function will restore such context, which is related (through its step number) to time step number and version given in obj parameter. Restoring context will change current time step in order to correspond to newly restored context.

Parameters
streamContext file.
modeDetermines amount of info in stream.
Returns
contextIOResultType.
Exceptions
ContextIOERRexception if error encountered.

Reimplemented from oofem::EngngModel.

Definition at line 574 of file staggeredproblem.C.

References oofem::CIO_OK, emodelList, and oofem::EngngModel::restoreContext().

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

Stores the state of model to output stream.

Stores not only the receiver state, but also same function is invoked for all DofManagers and Elements in associated domain. Note that by storing element context also contexts of all associated integration points (and material statuses) are stored.

Parameters
streamContext stream.
modeDetermines amount of info in stream.
Returns
contextIOResultType.
Exceptions
ContextIOERRIf error encountered.

Reimplemented from oofem::EngngModel.

Definition at line 562 of file staggeredproblem.C.

References oofem::CIO_OK, emodelList, and oofem::EngngModel::saveContext().

void oofem::StaggeredProblem::setContextOutputMode ( ContextOutputMode  contextMode)
void oofem::StaggeredProblem::setProblemMode ( problemMode  pmode)
void oofem::StaggeredProblem::setRenumberFlag ( )
virtual

Sets the renumber flag to true.

Reimplemented from oofem::EngngModel.

Definition at line 630 of file staggeredproblem.C.

References emodelList.

Referenced by oofem::FluidStructureProblem::FluidStructureProblem().

void oofem::StaggeredProblem::setUDContextOutputMode ( int  cStep)
virtual void oofem::StaggeredProblem::showSparseMtrxStructure ( int  type,
oofegGraphicContext gc,
TimeStep tStep 
)
inlinevirtual

Shows the sparse structure of required matrix, type == 1 stiffness.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 210 of file staggeredproblem.h.

void oofem::StaggeredProblem::solveYourself ( )
virtual

Starts solution process.

Implementation should invoke for each time step solveYourselfAt function with time step as parameter. Time steps are created using giveNextStep function (this will set current time step to newly created, and updates previous step).

Reimplemented from oofem::EngngModel.

Definition at line 433 of file staggeredproblem.C.

References adaptiveStepLength, oofem::EngngModel::balanceLoad(), oofem::EngngModelTimer::EMTT_AnalysisTimer, oofem::EngngModelTimer::EMTT_NetComputationalStepTimer, oofem::EngngModelTimer::EMTT_SolutionStepTimer, endOfTimeOfInterest, forceEquationNumbering(), oofem::EngngModelTimer::getUtime(), oofem::EngngModel::giveCurrentStep(), oofem::EngngModel::giveMetaStep(), oofem::TimeStep::giveMetaStepNumber(), oofem::EngngModel::giveNextStep(), oofem::TimeStep::giveNumber(), oofem::EngngModel::giveNumberOfMetaSteps(), oofem::MetaStep::giveNumberOfSteps(), oofem::EngngModel::giveOutputStream(), giveSlaveProblem(), oofem::MetaStep::giveStepRelativeNumber(), oofem::TimeStep::giveTargetTime(), initializeYourself(), oofem::EngngModel::initMetaStepAttributes(), oofem::EngngModelTimer::initTimer(), oofem::EngngModel::loadBalancingFlag, OOFEM_LOG_INFO, oofem::EngngModel::preInitializeNextStep(), oofem::EngngModel::requiresEquationRenumbering(), solveYourselfAt(), oofem::EngngModelTimer::startTimer(), oofem::EngngModelTimer::stopTimer(), oofem::EngngModel::suppressOutput, terminate(), timeDefinedByProb, oofem::EngngModel::timer, and updateYourself().

void oofem::StaggeredProblem::solveYourselfAt ( TimeStep tStep)
virtual

Solves problem for given time step.

Should assemble characteristic matrices and vectors if necessary and solve problem using appropriate numerical method. After finishing solution, this->updateYourself function for updating solution state and then this->terminate function (for updating nodal and element values) should be called.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 497 of file staggeredproblem.C.

References emodelList, oofem::TimeStep::giveNumber(), oofem::TimeStep::giveTargetTime(), oofem::TimeStep::incrementStateCounter(), and OOFEM_LOG_RELEVANT.

Referenced by solveYourself().

void oofem::StaggeredProblem::terminate ( TimeStep tStep)
virtual

Terminates the solution of time step.

Default implementation calls prinOutput() service and if specified, context of whole domain is stored and output for given time step is printed.

Reimplemented from oofem::EngngModel.

Definition at line 538 of file staggeredproblem.C.

References emodelList.

Referenced by solveYourself().

void oofem::StaggeredProblem::updateAttributes ( MetaStep mStep)
virtual

Update receiver attributes according to step metaStep attributes.

Allows the certain parameters or attributes to be updated for particular metastep. The metastep provides the attributes record, from which the corresponding attributes can be read. The service takes a MetaStep parameter. It is recommended, to implement this service in such way, that multiple calls for steps belonging to same MetaStep does not change response. The default implementation updates the numerical method attributes.

Parameters
mStepMeta step.

Reimplemented from oofem::EngngModel.

Definition at line 235 of file staggeredproblem.C.

References _IFT_StaggeredProblem_deltat, _IFT_StaggeredProblem_dtf, _IFT_StaggeredProblem_prescribedtimes, _IFT_StaggeredProblem_stepmultiplier, deltaT, discreteTimes, dtFunction, emodelList, oofem::MetaStep::giveAttributesRecord(), oofem::InputRecord::hasField(), IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, OOFEM_ERROR, stepMultiplier, timeDefinedByProb, and oofem::EngngModel::updateAttributes().

void oofem::StaggeredProblem::updateDomainLinks ( )
virtual

Updates domain links after the domains of receiver have changed.

Used mainly after restoring context - the domains may change and this service is then used to update domain variables in all components belonging to receiver like error estimators, solvers, etc, having domains as attributes.

Reimplemented from oofem::EngngModel.

Definition at line 622 of file staggeredproblem.C.

References emodelList.

void oofem::StaggeredProblem::updateYourself ( TimeStep tStep)
virtual

Updates internal state after finishing time step.

(for example total values may be updated according to previously solved increments). Then element values are also updated (together with related integration points and material statuses).

Reimplemented from oofem::EngngModel.

Definition at line 524 of file staggeredproblem.C.

References adaptiveStepLength, currentStepLength, emodelList, prevStepLength, and oofem::EngngModel::updateYourself().

Referenced by solveYourself().

virtual int oofem::StaggeredProblem::useNonlocalStiffnessOption ( )
inlinevirtual

Returns nonzero if nonlocal stiffness option activated.

Reimplemented from oofem::EngngModel.

Reimplemented in oofem::FluidStructureProblem.

Definition at line 183 of file staggeredproblem.h.

Member Data Documentation

bool oofem::StaggeredProblem::adaptiveStepLength
protected
double oofem::StaggeredProblem::adaptiveStepSince
protected

adaptive time step length applies after prescribed time

Definition at line 128 of file staggeredproblem.h.

Referenced by giveDeltaT(), and initializeFrom().

IntArray oofem::StaggeredProblem::coupledModels
protected

List of slave models to which this model is coupled.

Definition at line 119 of file staggeredproblem.h.

Referenced by initializeFrom().

double oofem::StaggeredProblem::currentStepLength
protected

Definition at line 136 of file staggeredproblem.h.

Referenced by giveDeltaT(), and updateYourself().

double oofem::StaggeredProblem::deltaT
protected

Definition at line 95 of file staggeredproblem.h.

Referenced by giveDeltaT(), initializeFrom(), and updateAttributes().

FloatArray oofem::StaggeredProblem::discreteTimes
protected

Time lag specifying how much is the second sub-problem delayed after the first one during this period the second subproblem isn't solved at all.

Efficient tool for coupling structural problem with hydration.Specified times where the problem is solved

Definition at line 113 of file staggeredproblem.h.

Referenced by giveDeltaT(), giveDiscreteTime(), initializeFrom(), and updateAttributes().

int oofem::StaggeredProblem::dtFunction
protected

Associated time function for time step increment.

Definition at line 98 of file staggeredproblem.h.

Referenced by giveDtFunction(), initializeFrom(), StaggeredProblem(), and updateAttributes().

double oofem::StaggeredProblem::endOfTimeOfInterest
protected

alternative overriding the number of steps "nsteps" - necessary for time-driven analyses when the appropriate number of steps is apriori unknow.

If used, set "nsteps" to a high number e.g. 100000000

Definition at line 133 of file staggeredproblem.h.

Referenced by giveNextStep(), initializeFrom(), and solveYourself().

std :: vector< std :: string > oofem::StaggeredProblem::inputStreamNames
protected

Definition at line 96 of file staggeredproblem.h.

Referenced by initializeFrom(), and instanciateSlaveProblems().

double oofem::StaggeredProblem::maxStepLength
protected

adaptive time step length - maximum

Definition at line 124 of file staggeredproblem.h.

Referenced by giveDeltaT(), and initializeFrom().

double oofem::StaggeredProblem::minStepLength
protected

adaptive time step length - minimum

Definition at line 122 of file staggeredproblem.h.

Referenced by giveDeltaT(), and initializeFrom().

double oofem::StaggeredProblem::prevStepLength
protected

Definition at line 135 of file staggeredproblem.h.

Referenced by giveDeltaT(), and updateYourself().

double oofem::StaggeredProblem::reqIterations
protected

adaptive time step length - required (=optimum) number of iterations

Definition at line 126 of file staggeredproblem.h.

Referenced by giveDeltaT(), and initializeFrom().

double oofem::StaggeredProblem::stepMultiplier
protected

Constant multiplier, optional input parameter.

This parameter determines the ratio of two consecutive time steps. Efficient for creep and relaxation analyses.

Definition at line 103 of file staggeredproblem.h.

Referenced by giveDeltaT(), initializeFrom(), StaggeredProblem(), and updateAttributes().

int oofem::StaggeredProblem::timeDefinedByProb
protected

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