OOFEM 3.0
Loading...
Searching...
No Matches
timestep.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 * The original idea for this class comes from
36 * Dubois-Pelerin, Y.: "Object-Oriented Finite Elements: Programming concepts and Implementation",
37 * PhD Thesis, EPFL, Lausanne, 1992.
38 */
39
40#ifndef timestep_h
41#define timestep_h
42
43#include "oofemenv.h"
44#include "contextioresulttype.h"
45#include "contextmode.h"
46#include "statecountertype.h"
48#include "inputrecord.h"
49#include "convergedreason.h"
50
51namespace oofem {
52class EngngModel;
53class DataStream;
54
82{
83protected:
87 double targetTime;
91 double deltaT;
95 int number;
110 public:
115
124
125public:
136 TimeStep(int n, EngngModel * e, int mn, double tt, double dt, StateCounterType counter, TimeDiscretizationType td = TD_Unspecified);
137 TimeStep(const TimeStep &);
139 TimeStep(const TimeStep &previous, double dt);
140 TimeStep(EngngModel * e);
141 TimeStep &operator = ( const TimeStep & );
142
144 int giveNumber() { return number; }
146 void setNumber(int i) { number = i; }
148 int giveVersion() { return version; }
152 void setMetaStepNumber(int msn) { mStepNumber = msn; }
153
160 const char *giveClassName() const { return "TimeStep"; }
162 TimeStep *givePreviousStep();
164 double giveTargetTime() { return targetTime; }
166 double giveIntrinsicTime() { return intrinsicTime; }
168 double giveTimeIncrement() { return deltaT; }
170 void setTimeIncrement(double newDt) { deltaT = newDt; }
172 void setTime(double newt) {
173 targetTime = newt;
174 intrinsicTime = newt;
175 }
176
177 void setTargetTime(double newt) { targetTime = newt; }
179 void setIntrinsicTime(double newt) { intrinsicTime = newt; }
182
187 bool isNotTheLastStep();
192 bool isTheFirstStep();
197 bool isTheCurrentTimeStep();
201 void setTimeStepReductionFactor(double tsrf);
202
207 bool isIcApply();
220
227 void saveContext(DataStream &stream);
232 void restoreContext(DataStream &stream);
233
234 std :: string errorInfo(const char *func) { return std :: string("TimeStep::") + func; }
235};
236} // end namespace oofem
237#endif // timestep_h
int giveVersion()
Returns receiver's version.
Definition timestep.h:148
double intrinsicTime
Current intrinsic time, which may represents imposing time of boundary condition or time entering con...
Definition timestep.h:89
int numberOfAttempts
Number of attempts (reduction ot time incerement, etc) needed to reach convergence.
Definition timestep.h:118
void setIntrinsicTime(double newt)
Sets only intrinsic time.
Definition timestep.h:179
void incrementVersion()
Increments receiver's version.
Definition timestep.h:215
double deltaT
Current intrinsic time increment.
Definition timestep.h:91
void incrementSubStepNumber()
Increments receiver's substep number.
Definition timestep.h:217
int giveMetaStepNumber()
Returns receiver's meta step number.
Definition timestep.h:150
int mStepNumber
Corresponding meta step number.
Definition timestep.h:107
double targetTime
Current target time, which represents time at the end of a time step.
Definition timestep.h:87
void setTargetTime(double newt)
Sets only target time.
Definition timestep.h:177
void incrementStateCounter()
Updates solution state counter.
Definition timestep.h:213
ConvergedReason convergedReason
Status of solution step (Converged,.
Definition timestep.h:120
double giveTimeIncrement()
Returns solution step associated time increment.
Definition timestep.h:168
void setTimeDiscretization(TimeDiscretizationType td)
Sets time discretization.
Definition timestep.h:181
void setNumber(int i)
Set receiver's number.
Definition timestep.h:146
double giveTargetTime()
Returns target time.
Definition timestep.h:164
int numberOfIterations
Number of itarations needed to achieve convergence.
Definition timestep.h:116
TimeDiscretizationType giveTimeDiscretization()
Returns time discretization.
Definition timestep.h:219
void setTimeIncrement(double newDt)
Sets solution step time increment.
Definition timestep.h:170
int giveNumber()
Returns receiver's number.
Definition timestep.h:144
StateCounterType solutionStateCounter
Solution state counter.
Definition timestep.h:93
int number
Receiver's number.
Definition timestep.h:95
void setMetaStepNumber(int msn)
Set meta step number.
Definition timestep.h:152
EngngModel * eModel
Engineering model reference.
Definition timestep.h:85
const char * giveClassName() const
Definition timestep.h:160
void initializeFrom(InputRecord &ir)
Definition timestep.h:221
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition timestep.h:166
double solutionTime
time step solution time in seconds
Definition timestep.h:122
std::string errorInfo(const char *func)
Definition timestep.h:234
StateCounterType giveSolutionStateCounter()
Definition timestep.h:211
TimeDiscretizationType timeDiscretization
Time discretization.
Definition timestep.h:109
void setTime(double newt)
Sets target and intrinsic time to be equal.
Definition timestep.h:172
int giveSubStepNumber()
Returns receiver's substep number.
Definition timestep.h:155
TimeStep(int n, EngngModel *e, int mn, double tt, double dt, StateCounterType counter, TimeDiscretizationType td=TD_Unspecified)
Definition timestep.C:49
long StateCounterType
StateCounterType type used to indicate solution state.
TimeDiscretizationType
Time discretization used by transient solvers.
@ TD_Unspecified
Unspecified.
#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