OOFEM 3.0
Loading...
Searching...
No Matches
timestepreductionstrategy.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 timestepreductionstrategy_h
36#define timestepreductionstrategy_h
37
39#include "timestep.h"
40#include "classfactory.h"
41#include <limits>
42
43#define _IFT_NoReductionStrategy_Name "noreduction"
44
45//
46#define _IFT_SimpleReductionStrategy_Name "simplereduction"
47#define _IFT_SimpleReductionStrategy_nMaxRestarts "nmaxrestarts"
48#define _IFT_SimpleReductionStrategy_deltaTmax "dtmax"
49#define _IFT_SimpleReductionStrategy_deltaTmin "dtmin"
50#define _IFT_SimpleReductionStrategy_minRequiredIter "minrequirediter"
51#define _IFT_SimpleReductionStrategy_maxRequiredIter "maxrequirediter"
52#define _IFT_SimpleReductionStrategy_noConvergenceReductionFactor "ncrf"
53
54namespace oofem {
55
60{
61protected:
63double deltaTmax = 1;
64double deltaTmin = 1;
72public:
73 TimeStepReductionStrategy(int n){this->number = n;}
74 virtual ~TimeStepReductionStrategy() = default;
75 virtual void initializeFrom(InputRecord &ir) = 0;
77 //virtual double giveMaxMaterialTimeIncrementAdaptationFactor(std::unique_ptr<TimeStep> &ts) = 0;
80 virtual double giveReqIterTimeIncrementAdaptationFactor(int nIter) = 0;
83 virtual void setTimeStepIncrementAdaptationFactor(double tsrf) = 0;
84 virtual double giveMinDeltaT(){return deltaTmin;}
85
88 virtual double give_dTmin(){return deltaTmin;}
89 virtual double give_dTmax(){return deltaTmax;}
90
91 virtual void updateYourself(TimeStep *tStep) {;}
92 virtual bool giveReductionFlag() {return reductionFlag;};
93};
94
95
96
98{
99public:
100 NoReductionStrategy(int n);
101 void initializeFrom(InputRecord &ir) override {};
103 double giveMaterialTimeIncrementAdaptationFactorMax() override {return 1.;}
104 double giveMaterialTimeIncrementAdaptationFactorMin() override {return 1.;}
105 double giveReqIterTimeIncrementAdaptationFactor(int nIter) override {return 1.;}
107 //do nothing
108 void setTimeStepIncrementAdaptationFactor(double tsrf) override {;}
109
110 int giveNumberOfMaxTimeStepReductions() override {return 0;}
111 double give_dTmin() override {return 0.;}
112 double give_dTmax() override {return std::numeric_limits<double>::infinity();}
113};
114
115
116
118{
119private:
121public:
123 void initializeFrom(InputRecord &ir) override;
127 double giveReqIterTimeIncrementAdaptationFactor(int nIter) override;
129 int giveNumberOfMaxTimeStepReductions() override {return this->numberOfMaxTimeStepReductions;}
130 //do nothing
131 void setTimeStepIncrementAdaptationFactor(double tsrf) override {
132 if(tsrf < 1){
134 } else {
136 }
137 }
142
143};
144
145
146} // end namespace oofem
147#endif // timestepreductionstrategy_h
148
double giveMaterialTimeIncrementAdaptationFactorMax() override
double giveNoConvergenceTimeIncrementReductionFactor() override
void initializeFrom(InputRecord &ir) override
double giveReqIterTimeIncrementAdaptationFactor(int nIter) override
void setTimeStepIncrementAdaptationFactor(double tsrf) override
TimeStepReductionStrategyType giveTimeStepReductionStrategyType() override
double giveMaterialTimeIncrementAdaptationFactorMin() override
virtual void updateYourself(TimeStep *tStep) override
double giveReqIterTimeIncrementAdaptationFactor(int nIter) override
void initializeFrom(InputRecord &ir) override
void setTimeStepIncrementAdaptationFactor(double tsrf) override
double giveMaterialTimeIncrementAdaptationFactorMax() override
TimeStepReductionStrategyType giveTimeStepReductionStrategyType() override
double giveMaterialTimeIncrementAdaptationFactorMin() override
double giveNoConvergenceTimeIncrementReductionFactor() override
virtual void initializeFrom(InputRecord &ir)=0
virtual double giveMaterialTimeIncrementAdaptationFactorMin()=0
virtual TimeStepReductionStrategyType giveTimeStepReductionStrategyType()=0
virtual int giveNumberOfMaxTimeStepReductions()=0
virtual void setTimeStepIncrementAdaptationFactor(double tsrf)=0
virtual double giveMaterialTimeIncrementAdaptationFactorMax()=0
virtual double giveReqIterTimeIncrementAdaptationFactor(int nIter)=0
virtual ~TimeStepReductionStrategy()=default
virtual void updateYourself(TimeStep *tStep)
virtual double giveNoConvergenceTimeIncrementReductionFactor()=0
@ TSRST_NoReduction
no reduction is used. Used for backward compatibility
#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