OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 2013 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 "oofemcfg.h"
44 #include "contextioresulttype.h"
45 #include "contextmode.h"
46 #include "statecountertype.h"
47 #include "timediscretizationtype.h"
48 #include "inputrecord.h"
49 
50 namespace oofem {
51 class EngngModel;
52 class DataStream;
53 
80 class OOFEM_EXPORT TimeStep
81 {
82 protected:
86  double targetTime;
88  double intrinsicTime;
90  double deltaT;
94  int number;
100  int version;
109 
110 public:
121  TimeStep(int n, EngngModel * e, int mn, double tt, double dt, StateCounterType counter, TimeDiscretizationType td = TD_Unspecified);
122  TimeStep(const TimeStep &);
124  TimeStep(const TimeStep &previous, double dt);
125  TimeStep(EngngModel * e);
126  TimeStep &operator = ( const TimeStep & );
127 
129  int giveNumber() { return number; }
131  void setNumber(int i) { number = i; }
133  int giveVersion() { return version; }
135  int giveMetaStepNumber() { return mStepNumber; }
137  int giveSubStepNumber() { return subStepNumber; }
142  const char *giveClassName() const { return "TimeStep"; }
144  TimeStep *givePreviousStep();
146  double giveTargetTime() { return targetTime; }
148  double giveIntrinsicTime() { return intrinsicTime; }
150  double giveTimeIncrement() { return deltaT; }
152  void setTimeIncrement(double newDt) { deltaT = newDt; }
154  void setTime(double newt) {
155  targetTime = newt;
156  intrinsicTime = newt;
157  }
159  void setTargetTime(double newt) { targetTime = newt; }
161  void setIntrinsicTime(double newt) { intrinsicTime = newt; }
163  void setTimeDiscretization(TimeDiscretizationType td) { timeDiscretization = td; }
164 
169  bool isNotTheLastStep();
174  bool isTheFirstStep();
179  bool isTheCurrentTimeStep();
184  bool isIcApply();
188  StateCounterType giveSolutionStateCounter() { return solutionStateCounter; }
190  void incrementStateCounter() { solutionStateCounter++; }
192  void incrementVersion() { version++; }
194  void incrementSubStepNumber() { subStepNumber++; }
196  TimeDiscretizationType giveTimeDiscretization() { return timeDiscretization; }
197 
210  contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj = NULL);
215  contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj = NULL);
216 
217  std :: string errorInfo(const char *func) { return std :: string("TimeStep::") + func; }
218 };
219 } // end namespace oofem
220 #endif // timestep_h
const char * giveClassName() const
Returns class name of receiver.
Definition: timestep.h:142
double intrinsicTime
Current intrinsic time, which may represents imposing time of boundary condition or time entering con...
Definition: timestep.h:88
TimeDiscretizationType timeDiscretization
Time discretization.
Definition: timestep.h:108
void setIntrinsicTime(double newt)
Sets only intrinsic time.
Definition: timestep.h:161
void incrementVersion()
Increments receiver's version.
Definition: timestep.h:192
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
EngngModel * eModel
Engineering model reference.
Definition: timestep.h:84
long StateCounterType
StateCounterType type used to indicate solution state.
int version
Receiver's version, used for special applications; default set to 0.
Definition: timestep.h:100
StateCounterType solutionStateCounter
Solution state counter.
Definition: timestep.h:92
double giveTargetTime()
Returns target time.
Definition: timestep.h:146
void setTime(double newt)
Sets target and intrinsic time to be equal.
Definition: timestep.h:154
void incrementStateCounter()
Updates solution state counter.
Definition: timestep.h:190
void setTimeIncrement(double newDt)
Sets solution step time increment.
Definition: timestep.h:152
double giveTimeIncrement()
Returns solution step associated time increment.
Definition: timestep.h:150
void incrementSubStepNumber()
Increments receiver's substep number.
Definition: timestep.h:194
int giveSubStepNumber()
Returns receiver's substep number.
Definition: timestep.h:137
TimeDiscretizationType
Time discretization used by transient solvers.
int giveNumber()
Returns receiver's number.
Definition: timestep.h:129
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
Definition: timestep.h:188
std::string errorInfo(const char *func)
Definition: timestep.h:217
int mStepNumber
Corresponding meta step number.
Definition: timestep.h:106
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition: timestep.h:148
TimeDiscretizationType giveTimeDiscretization()
Returns time discretization.
Definition: timestep.h:196
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
int giveMetaStepNumber()
Returns receiver's meta step number.
Definition: timestep.h:135
Class representing the general Input Record.
Definition: inputrecord.h:101
void setTimeDiscretization(TimeDiscretizationType td)
Sets time discretization.
Definition: timestep.h:163
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
int giveVersion()
Returns receiver's version.
Definition: timestep.h:133
int number
Receiver's number.
Definition: timestep.h:94
void setTargetTime(double newt)
Sets only target time.
Definition: timestep.h:159
double deltaT
Current intrinsic time increment.
Definition: timestep.h:90
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
double targetTime
Current target time, which represents time at the end of a time step.
Definition: timestep.h:86
the oofem namespace is to define a context or scope in which all oofem names are defined.
IRResultType initializeFrom(InputRecord *ir)
Definition: timestep.h:198
Class representing solution step.
Definition: timestep.h:80
void setNumber(int i)
Set receiver's number.
Definition: timestep.h:131
int subStepNumber
Receiver's substep (iteration) number.
Definition: timestep.h:104

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