58 adaptiveStepLength(false),
62 adaptiveStepSince(0.),
63 endOfTimeOfInterest(0.),
210 printf(
"Suppressing output.\n");
221 #ifdef __PARALLEL_MODE 245 emodel->updateAttributes(mStep);
293 double adjustedDeltaT =
deltaT;
300 return adjustedDeltaT;
326 return adjustedDeltaT;
398 double totalTime = 0;
409 counter =
currentStep->giveSolutionStateCounter() + 1;
415 OOFEM_LOG_INFO(
"\n==================================================================\n");
421 OOFEM_LOG_INFO(
"\n==================================================================\n");
442 int smstep = 1, sjstep = 1;
456 for (
int jstep = sjstep; jstep <= nTimeSteps; jstep++ ) {
474 OOFEM_LOG_INFO(
"EngngModel info: user time consumed by solution step %d: %.2fs\n",
478 fprintf(this->
giveOutputStream(),
"\nUser time consumed by solution step %d: %.3f [s]\n\n",
482 #ifdef __PARALLEL_MODE 503 emodel->solveYourselfAt(tStep);
515 if ( emodel->requiresEquationRenumbering( emodel->giveCurrentStep() ) ) {
516 neqs += emodel->forceEquationNumbering();
531 emodel->updateYourself(tStep);
541 emodel->terminate(tStep);
549 emodel->giveExportModuleManager()->doOutput(tStep);
566 emodel->saveContext(stream, mode);
578 emodel->restoreContext(stream, mode);
605 result &= emodel->checkProblemConsistency();
625 emodel->updateDomainLinks();
633 emodel->setRenumberFlag();
EngngModelTimer timer
E-model timer.
virtual void updateAttributes(MetaStep *mStep)
Update receiver attributes according to step metaStep attributes.
#define _IFT_StaggeredProblem_maxsteplength
FILE * outputStream
Output stream.
virtual void doStepOutput(TimeStep *tStep)
Prints the ouput of the solution step (using virtual this->printOutputAtservice) to the stream detemi...
std::unique_ptr< TimeStep > currentStep
Current time step.
virtual ~StaggeredProblem()
Destructor.
std::string simulationDescription
virtual EngngModel * giveSlaveProblem(int i)
Returns i-th slave problem.
void initMetaStepAttributes(MetaStep *mStep)
Update e-model attributes attributes according to step metaStep attributes.
char processor_name[PROCESSOR_NAME_LENGTH]
Processor name.
virtual bool requiresEquationRenumbering(TimeStep *tStep)
Returns true if equation renumbering is required for given solution step.
StaggeredProblem(int i, EngngModel *_master=NULL)
Constructor.
std::string dataOutputFileName
Path to output stream.
#define _IFT_StaggeredProblem_deltat
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
void startTimer(EngngModelTimerType t)
int timeDefinedByProb
Optional parameter which specify problems to define load time functions.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
std::vector< std::unique_ptr< Domain > > domainList
List of problem domains.
virtual void solveYourself()
Starts solution process.
#define _IFT_StaggeredProblem_adaptivestepsince
std::unique_ptr< TimeStep > previousStep
Previous time step.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
long StateCounterType
StateCounterType type used to indicate solution state.
#define _IFT_StaggeredProblem_adaptiveStepLength
double giveDiscreteTime(int n)
Returns time for time step number n (array discreteTimes must be specified)
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
std::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
Function * giveDtFunction()
Returns time function for time step increment.
time_t startTime
Solution start time.
int numProcs
Total number of collaborating processes.
double minStepLength
adaptive time step length - minimum
void initTimer(EngngModelTimerType t)
double giveTargetTime()
Returns target time.
bool isParallel() const
Returns true if receiver in parallel mode.
void incrementStateCounter()
Updates solution state counter.
virtual void initializeYourself(TimeStep *tStep)
Provides the opportunity to initialize state variables stored in element integration points according...
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
void stopTimer(EngngModelTimerType t)
#define _IFT_StaggeredProblem_timeDefinedByProb
Class representing the abstraction for input data source.
#define _IFT_StaggeredProblem_dtf
REGISTER_EngngModel(ProblemSequence)
#define OOFEM_LOG_DEBUG(...)
int instanciateSlaveProblems()
#define _IFT_StaggeredProblem_prescribedtimes
double stepMultiplier
Constant multiplier, optional input parameter.
#define OOFEM_LOG_RELEVANT(...)
double giveDeltaT(int n)
Returns the timestep length for given step number n, initial step is number 0.
#define _IFT_StaggeredProblem_reqiterations
problemMode pMode
Domain mode.
virtual void drawYourself(oofegGraphicContext &gc)
EngngModel * InstanciateProblem(DataReader &dr, problemMode mode, int contextFlag, EngngModel *_master, bool parallelFlag)
Instanciates the new problem.
#define VERBOSE_PRINTS(str, str1)
bool loadBalancingFlag
If set to true, load balancing is active.
virtual TimeStep * givePreviousStep(bool force=false)
Returns previous time step.
double endOfTimeOfInterest
alternative overriding the number of steps "nsteps" - necessary for time-driven analyses when the app...
virtual void preInitializeNextStep()
Does a pre-initialization of the next time step (implement if necessarry)
IntArray coupledModels
List of slave models to which this model is coupled.
int giveNumber()
Returns receiver's number.
#define OOFEM_LOG_INFO(...)
FILE * giveOutputStream()
Returns file descriptor of output file.
virtual int giveNumberOfSlaveProblems()
Returns number of slave problems.
IntArray domainPrescribedNeqs
Number of prescribed equations per domain.
double adaptiveStepSince
adaptive time step length applies after prescribed time
virtual void drawNodes(oofegGraphicContext &gc)
virtual void drawElements(oofegGraphicContext &gc)
void clear()
Clears the array (zero size).
int numberOfSteps
Total number of time steps.
int ndomains
Number of receiver domains.
int rank
Domain rank in a group of collaborating processes (0..groupSize-1).
virtual void updateAttributes(MetaStep *mStep)
Update receiver attributes according to step metaStep attributes.
virtual void balanceLoad(TimeStep *tStep)
Recovers the load balance between processors, if needed.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
double reqIterations
adaptive time step length - required (=optimum) number of iterations
virtual int instanciateYourself(DataReader &dr, InputRecord *ir, const char *outFileName, const char *desc)
Initializes whole problem according to its description stored in inputStream.
#define _IFT_EngngModel_suppressOutput
virtual void drawYourself(oofegGraphicContext &gc)
#define _IFT_StaggeredProblem_prob1
virtual int giveNumberOfFirstStep(bool force=false)
Returns number of first time step used by receiver.
#define _IFT_EngngModel_nsteps
virtual int giveNumberOfFirstStep(bool force=false)
Returns number of first time step used by receiver.
void resize(int n)
Checks size of receiver towards requested bounds.
#define _IFT_StaggeredProblem_endoftimeofinterest
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
virtual int giveCurrentNumberOfIterations()
Returns number of iterations that was required to reach equilibrium - used for adaptive step length i...
#define _IFT_StaggeredProblem_prob3
#define _IFT_StaggeredProblem_prob2
Function * giveFunction(int n)
Service for accessing particular domain load time function.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
int giveNumberOfMetaSteps()
Return number of meta steps.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
FloatArray discreteTimes
Time lag specifying how much is the second sub-problem delayed after the first one during this period...
IntArray domainNeqs
Number of equations per domain.
std::vector< std::string > inputStreamNames
Abstract base class representing a function with vector input and output.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual int instanciateDefaultMetaStep(InputRecord *ir)
Instanciate default metastep, if nmsteps is zero.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
virtual int checkProblemConsistency()
Allows programmer to test problem its internal data, before computation begins.
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
int giveMetaStepNumber()
Returns receiver's meta step number.
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
virtual int instanciateDefaultMetaStep(InputRecord *ir)
Instanciate default metastep, if nmsteps is zero.
virtual int instanciateYourself(DataReader &dr, InputRecord *ir, const char *outFileName, const char *desc)
Initializes whole problem according to its description stored in inputStream.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
bool renumberFlag
Renumbering flag (renumbers equations after each step, necessary if Dirichlet BCs change)...
virtual TimeStep * givePreviousStep(bool force=false)
Returns previous time step.
bool suppressOutput
Flag for suppressing output to file.
double maxStepLength
adaptive time step length - maximum
#define _IFT_StaggeredProblem_stepmultiplier
#define _IFT_StaggeredProblem_minsteplength
int getActiveProblemIndx()
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to output domain stream, for given time step.
Abstract base class representing the "problem" under consideration.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
virtual void drawElements(oofegGraphicContext &gc)
int giveSize() const
Returns the size of receiver.
Class representing the implementation of plain text date reader.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void setRenumberFlag()
Sets the renumber flag to true.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
virtual void terminate(TimeStep *tStep)
Terminates the solution of time step.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
ContextOutputMode contextOutputMode
Domain context output mode.
#define _IFT_StaggeredProblem_coupling
std::vector< std::unique_ptr< EngngModel > > emodelList
List of engineering models to solve sequentially.
double getUtime(EngngModelTimerType t)
Returns total user time elapsed.
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
#define OOFEM_WARNING(...)
Class representing solution step.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mod)
Restores the state of model from output stream.
virtual void drawNodes(oofegGraphicContext &gc)
int dtFunction
Associated time function for time step increment.