OOFEM 3.0
Loading...
Searching...
No Matches
timestepcontroller.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef timestepcontroller_h
36#define timestepcontroller_h
37
38
39#include "timestep.h"
40#include "metastep.h"
41
43
44#define _IFT_TimeStepController_nmsteps "nmsteps"
45#define _IFT_TimeStepController_alpha "alpha"
46
48
49namespace oofem {
50class DataReader;
51 class MetaStep;
52
58{
59protected:
63 std :: unique_ptr< TimeStep > currentStep;
65 std :: unique_ptr< TimeStep > previousStep;
69 virtual double giveEndOfTimeOfInterest() { return 0.; }
73 double initT = 0.;
75 std :: vector< MetaStep > metaStepList;
76 double alpha = 1.0;
77public:
93 const char *giveClassName() const { return "TimeStepController"; }
94
95
100 return currentStep.get();
101
102 }
103
107 return previousStep.get();
108 }
109
111 //virtual TimeStep giveNextStep();
112 virtual TimeStep* giveNextStep();
113
114
115 TimeStep* generateNextStep(){return NULL;}
116
117
118
119
120 void initializeFrom(InputRecord &ir);
126 void saveContext(DataStream &stream);
131 void restoreContext(DataStream &stream);
132 //functions copied from engng
136 MetaStep *giveMetaStep(int i);
137
138 int instanciateDefaultMetaStep(InputRecord &ir);
139 int instanciateMetaSteps(DataReader &dr);
140 void initMetaStepAttributes(MetaStep *mStep);
141 int giveMetaStepNumber(){return 1;}
142 void postInitialize();
143 void reduceTimeStep();
144 void adaptTimeStep(int nIter);
145 //@todo improve: return number of steps of the current metastep
146 int giveNumberOfSteps(){return this->giveCurrentMetaStep()->giveNumberOfSteps();}
147
148
149 int giveFinalTime(){return 0;}
150 double giveDeltaT(){return this->giveCurrentMetaStep()->giveDeltaT();}
151 double giveMinDeltaT(){return this->giveCurrentMetaStep()->giveMinDeltaT();}
152 void setDeltaT(double dT){return this->giveCurrentMetaStep()->setDeltaT(dT);}
155
156protected:
157// double finalTime = 0;
158
159
160};
161} // end namespace oofem
162#endif // timestepcontroller_h
163
virtual TimeStep * giveCurrentStep()
int giveNumberOfMetaSteps()
Return number of meta steps.
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
virtual double giveEndOfTimeOfInterest()
Returns end of time interest (time corresponding to end of time integration).
virtual TimeStep * givePreviousStep()
void setCurrentMetaStepNumber(int smstep)
const char * giveClassName() const
std ::vector< MetaStep > metaStepList
List of problem metasteps.
std ::unique_ptr< TimeStep > previousStep
Previous time step.
double initT
Initial time from which the computation runs. Default is zero.
std ::unique_ptr< TimeStep > currentStep
Current time step.
#define OOFEM_EXPORT
Definition oofemcfg.h:7

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