OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
staggeredproblem.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 #ifndef staggeredproblem_h
36 #define staggeredproblem_h
37 
38 #include "engngm.h"
39 #include "inputrecord.h"
40 #include "floatarray.h"
41 
43 
44 #define _IFT_StaggeredProblem_Name "staggeredproblem"
45 #define _IFT_StaggeredProblem_deltat "deltat"
46 #define _IFT_StaggeredProblem_dtf "dtf"
47 #define _IFT_StaggeredProblem_timeDefinedByProb "timedefinedbyprob"
48 #define _IFT_StaggeredProblem_stepmultiplier "stepmultiplier"
49 //#define _IFT_StaggeredProblem_timeLag "timelag"
50 #define _IFT_StaggeredProblem_prescribedtimes "prescribedtimes"
51 #define _IFT_StaggeredProblem_prob1 "prob1"
52 #define _IFT_StaggeredProblem_prob2 "prob2"
53 #define _IFT_StaggeredProblem_prob3 "prob3"
54 #define _IFT_StaggeredProblem_coupling "coupling"
55 #define _IFT_StaggeredProblem_adaptiveStepLength "adaptivesteplength"
56 #define _IFT_StaggeredProblem_minsteplength "minsteplength"
57 #define _IFT_StaggeredProblem_maxsteplength "maxsteplength"
58 #define _IFT_StaggeredProblem_reqiterations "reqiterations"
59 #define _IFT_StaggeredProblem_endoftimeofinterest "endoftimeofinterest"
60 #define _IFT_StaggeredProblem_adaptivestepsince "adaptivestepsince"
61 
62 
63 namespace oofem {
64 class Function;
65 
90 class OOFEM_EXPORT StaggeredProblem : public EngngModel
91 {
92 protected:
94  std :: vector< std :: unique_ptr< EngngModel > >emodelList;
95  double deltaT;
96  std :: vector< std :: string >inputStreamNames;
104 
110  // double timeLag;
111 
114 
117 
134 
137 
138 
139 public:
143  StaggeredProblem(int i, EngngModel * _master = NULL);
145  virtual ~StaggeredProblem();
146  StaggeredProblem(const StaggeredProblem &) = delete;
147  StaggeredProblem & operator=(const StaggeredProblem &) = delete;
148  void setContextOutputMode(ContextOutputMode contextMode);
149  void setUDContextOutputMode(int cStep);
150  void setProblemMode(problemMode pmode);
151  virtual void setRenumberFlag();
152 
153  virtual void solveYourself();
154  virtual void solveYourselfAt(TimeStep *tStep);
155  virtual int forceEquationNumbering();
156  virtual void updateYourself(TimeStep *tStep);
157  virtual void initializeYourself(TimeStep *tStep) { }
158  virtual int initializeAdaptive(int tStepNumber) { return 0; }
159  virtual void terminate(TimeStep *tStep);
160  virtual void doStepOutput(TimeStep *tStep);
161 
162  virtual int instanciateYourself(DataReader &dr, InputRecord *ir, const char *outFileName, const char *desc);
163  virtual IRResultType initializeFrom(InputRecord *ir);
164  virtual void updateAttributes(MetaStep *mStep);
165 
166  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode);
167  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mod);
168  virtual void updateDomainLinks();
169 
170  void printYourself();
171  virtual void printOutputAt(FILE *file, TimeStep *tStep);
172 
173  virtual TimeStep *giveCurrentStep(bool force = false);
174  virtual TimeStep *givePreviousStep(bool force = false);
175  virtual TimeStep *giveSolutionStepWhenIcApply(bool force = false);
176  virtual int giveNumberOfFirstStep(bool force = false);
177 
178  virtual TimeStep *giveNextStep();
179 
180  // identification
181  virtual const char *giveClassName() const { return "StaggeredProblem"; }
182  virtual const char *giveInputRecordName() const { return _IFT_StaggeredProblem_Name; }
183  virtual int useNonlocalStiffnessOption() { return 0; }
184 
185  virtual fMode giveFormulation() { return UNKNOWN; }
191  Function *giveDtFunction();
192 
196  double giveDeltaT(int n);
197 
201  double giveDiscreteTime(int n);
202 
204  void giveCoupledModels(IntArray &answer) { answer = coupledModels; }
205 
206 #ifdef __OOFEG
207  virtual void drawYourself(oofegGraphicContext &gc);
208  virtual void drawElements(oofegGraphicContext &gc);
209  virtual void drawNodes(oofegGraphicContext &gc);
210  virtual void showSparseMtrxStructure(int type, oofegGraphicContext &gc, TimeStep *tStep) { }
211 #endif
212 
213  virtual int checkProblemConsistency();
214 
215  virtual EngngModel *giveSlaveProblem(int i);
216  virtual int giveNumberOfSlaveProblems() { return (int)inputStreamNames.size(); }
217  virtual int instanciateDefaultMetaStep(InputRecord *ir);
218 
219 protected:
220  int instanciateSlaveProblems();
221 };
222 } // end namespace oofem
223 #endif // staggeredproblem_h
Class representing meta step.
Definition: metastep.h:62
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...
Definition: datastream.h:54
virtual const char * giveClassName() const
Returns class name of the receiver.
#define _IFT_StaggeredProblem_Name
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
double minStepLength
adaptive time step length - minimum
virtual void initializeYourself(TimeStep *tStep)
Provides the opportunity to initialize state variables stored in element integration points according...
Unknown.
Definition: fmode.h:43
Class representing the abstraction for input data source.
Definition: datareader.h:50
Class implementing an array of integers.
Definition: intarray.h:61
double stepMultiplier
Constant multiplier, optional input parameter.
double endOfTimeOfInterest
alternative overriding the number of steps "nsteps" - necessary for time-driven analyses when the app...
IntArray coupledModels
List of slave models to which this model is coupled.
virtual int giveNumberOfSlaveProblems()
Returns number of slave problems.
void giveCoupledModels(IntArray &answer)
Returns list of model number that this model is coupled with. Used for staggered approach.
double adaptiveStepSince
adaptive time step length applies after prescribed time
virtual int useNonlocalStiffnessOption()
Returns nonzero if nonlocal stiffness option activated.
double reqIterations
adaptive time step length - required (=optimum) number of iterations
virtual fMode giveFormulation()
Indicates type of non linear computation (total or updated formulation).
Implementation of general sequence (staggered) problem.
virtual void showSparseMtrxStructure(int type, oofegGraphicContext &gc, TimeStep *tStep)
Shows the sparse structure of required matrix, type == 1 stiffness.
FloatArray discreteTimes
Time lag specifying how much is the second sub-problem delayed after the first one during this period...
Class representing vector of real numbers.
Definition: floatarray.h:82
std::vector< std::string > inputStreamNames
virtual int initializeAdaptive(int tStepNumber)
Initializes the newly generated discretization state according to previous solution.
Abstract base class representing a function with vector input and output.
Definition: function.h:88
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
fMode
Type representing the type of formulation (total or updated) of non-linear computation.
Definition: fmode.h:42
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
double maxStepLength
adaptive time step length - maximum
virtual const char * giveInputRecordName() const
problemMode
Definition: problemmode.h:39
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
the oofem namespace is to define a context or scope in which all oofem names are defined.
std::vector< std::unique_ptr< EngngModel > > emodelList
List of engineering models to solve sequentially.
Class representing solution step.
Definition: timestep.h:80
int dtFunction
Associated time function for time step increment.

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