OOFEM 3.0
Loading...
Searching...
No Matches
supg.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 supg_h
36#define supg_h
37
38#include "fluidmodel.h"
39#include "sparsemtrxtype.h"
40#include "sparselinsystemnm.h"
41#include "primaryfield.h"
42#include "materialinterface.h"
43#include "assemblercallback.h"
44
45#include <memory>
46
48
49#define _IFT_SUPG_Name "supg"
50#define _IFT_SUPG_deltat "deltat"
51#define _IFT_SUPG_deltatFunction "deltatltf"
52#define _IFT_SUPG_cmflag "cmflag"
53#define _IFT_SUPG_alpha "alpha"
54#define _IFT_SUPG_scaleflag "scaleflag"
55#define _IFT_SUPG_lscale "lscale"
56#define _IFT_SUPG_uscale "uscale"
57#define _IFT_SUPG_dscale "dscale"
58#define _IFT_SUPG_miflag "miflag"
59#define _IFT_SUPG_rtolv "rtolv"
60#define _IFT_SUPG_atolv "atolv"
61#define _IFT_SUPG_maxiter "maxiter"
62#define _IFT_SUPG_stopmaxiter "stopmaxiter"
63#define _IFT_SUPG_fsflag "fsflag"
65
66namespace oofem {
67class SparseMtrx;
68class SparseNonLinearSystemNM;
69
75{
76protected:
78
79public:
80 SUPGInternalForceAssembler(double l, double d, double u);
81 void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const override;
82};
83
89{
90protected:
91 MatResponseMode rmode;
93 double alpha;
94
95public:
96 SUPGTangentAssembler(MatResponseMode m, double l, double d, double u, double a);
97 void matrixFromElement(FloatMatrix &mat, Element &element, TimeStep *tStep) const override;
98};
99
104class SUPG : public FluidModel
105{
106protected:
108 std :: unique_ptr< SparseLinearSystemNM >nMethod;
109
112
113 std :: unique_ptr< SparseMtrx > lhs;
114 std :: unique_ptr< PrimaryField > VelocityPressureField;
115 //PrimaryField VelocityField;
116 FloatArray accelerationVector; //, previousAccelerationVector;
118
121
123 double deltaT = 1.;
124 int deltaTF = 0;
126 double atolv = 1., rtolv = 1.;
128 int maxiter = 0;
133 bool stopmaxiter = true;
135 double alpha = 0.;
136
137 int initFlag = 1;
139
141 // length, velocity, and density scales
142 double lscale = 1., uscale = 1., dscale = 1.;
144 double Re = 0.;
145
146 // material interface representation for multicomponent flows
147 std :: unique_ptr< MaterialInterface > materialInterface;
148 // map of active dofmans for problems with free surface and only one fluid considered
149 // IntArray __DofManActivityMask;
150 // free surface flag -> we solve free surface problem by single reference fluid
151 // int fsflag;
152
153public:
154 SUPG(int i, EngngModel * _master = nullptr);
155
156 void solveYourselfAt(TimeStep *tStep) override;
157 void updateYourself(TimeStep *tStep) override;
158
159 double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof) override;
160 void updateComponent(TimeStep *tStep, NumericalCmpn cmpn, Domain *d) override;
161 void updateSolution(FloatArray &solutionVector, TimeStep *tStep, Domain *d) override;
162 void updateInternalRHS(FloatArray &answer, TimeStep *tStep, Domain *d, FloatArray *eNorm) override;
163 void updateMatrix(SparseMtrx &mat, TimeStep *tStep, Domain *d) override;
164 double giveReynoldsNumber() override;
165
166 void saveContext(DataStream &stream, ContextMode mode) override;
167 void restoreContext(DataStream &stream, ContextMode mode) override;
168
169 void updateDomainLinks() override;
170
171 TimeStep *giveNextStep() override;
172 TimeStep *giveSolutionStepWhenIcApply(bool force = false) override;
174
175 void initializeFrom(InputRecord &ir) override;
176
177 int checkConsistency() override;
178 // identification
179 const char *giveClassName() const override { return "SUPG"; }
180 const char *giveInputRecordName() const { return _IFT_SUPG_Name; }
181
182 fMode giveFormulation() override { return TL; }
183
184 void printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *tStep) override;
185
187
189 double giveVariableScale(VarScaleType varId) override;
190
191 void updateDofUnknownsDictionary(DofManager *dman, TimeStep *tStep) override;
192 int giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep) override;
193
195
196protected:
197 void updateInternalState(TimeStep *tStep);
198 void applyIC(TimeStep *tStep);
201
204
207
208 //void initDofManActivityMap ();
209 //void updateDofManActivityMap (TimeStep* tStep);
211 //void imposeAmbientPressureInOuterNodes(SparseMtrx* lhs, FloatArray* rhs, TimeStep* tStep);
212 //void __debug(TimeStep* tStep);
213};
214} // end namespace oofem
215#endif // supg_h
bool renumberFlag
Renumbering flag (renumbers equations after each step, necessary if Dirichlet BCs change).
Definition engngm.h:229
FluidModel(int i, EngngModel *master)
Definition fluidmodel.h:49
void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const override
Definition supg.C:68
SUPGInternalForceAssembler(double l, double d, double u)
Definition supg.C:64
void matrixFromElement(FloatMatrix &mat, Element &element, TimeStep *tStep) const override
Definition supg.C:152
SUPGTangentAssembler(MatResponseMode m, double l, double d, double u, double a)
Definition supg.C:147
MatResponseMode rmode
Definition supg.h:91
const char * giveClassName() const override
Returns class name of the receiver.
Definition supg.h:179
int maxiter
Max number of iterations.
Definition supg.h:128
void printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *tStep) override
Definition supg.C:919
MaterialInterface * giveMaterialInterface(int n) override
Definition supg.h:194
TimeStep * giveSolutionStepWhenIcApply(bool force=false) override
Definition supg.C:412
void saveContext(DataStream &stream, ContextMode mode) override
Definition supg.C:825
int deltaTF
Definition supg.h:124
bool equationScalingFlag
Definition supg.h:140
void updateInternalState(TimeStep *tStep)
Definition supg.C:808
std ::unique_ptr< SparseLinearSystemNM > nMethod
Numerical method used to solve the problem.
Definition supg.h:108
int requiresUnknownsDictionaryUpdate() override
Definition supg.h:186
double uscale
Definition supg.h:142
std ::unique_ptr< SparseMtrx > lhs
Definition supg.h:113
void updateInternalRHS(FloatArray &answer, TimeStep *tStep, Domain *d, FloatArray *eNorm) override
Definition supg.C:378
SparseMtrxType sparseMtrxType
Definition supg.h:111
double Re
Reynolds number.
Definition supg.h:144
void updateDomainLinks() override
Definition supg.C:911
int giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep) override
Definition supg.C:1127
std ::unique_ptr< MaterialInterface > materialInterface
Definition supg.h:147
fMode giveFormulation() override
Definition supg.h:182
int consistentMassFlag
Definition supg.h:138
std ::unique_ptr< PrimaryField > VelocityPressureField
Definition supg.h:114
double lscale
Definition supg.h:142
void updateSolution(FloatArray &solutionVector, TimeStep *tStep, Domain *d) override
Definition supg.C:368
void updateMatrix(SparseMtrx &mat, TimeStep *tStep, Domain *d) override
Definition supg.C:387
void initializeFrom(InputRecord &ir) override
Definition supg.C:228
FloatArray eNorm
Definition supg.h:120
void updateSolutionVectors(FloatArray &solutionVector, FloatArray &accelerationVector, FloatArray &incrementalSolutionVector, TimeStep *tStep)
Definition supg.C:1183
void updateElementsForNewInterfacePosition(TimeStep *tStep)
Definition supg.C:1030
LinSystSolverType solverType
Definition supg.h:110
void restoreContext(DataStream &stream, ContextMode mode) override
Definition supg.C:843
double alpha
Integration constant.
Definition supg.h:135
SUPG(int i, EngngModel *_master=nullptr)
Definition supg.C:210
const char * giveInputRecordName() const
Definition supg.h:180
bool stopmaxiter
Definition supg.h:133
FloatArray incrementalSolutionVector
Definition supg.h:117
FloatArray accelerationVector
Definition supg.h:116
void updateDofManVals(TimeStep *tStep)
void updateDofUnknownsDictionary(DofManager *dman, TimeStep *tStep) override
Definition supg.C:1045
double giveReynoldsNumber() override
Definition supg.C:401
double deltaT
Definition supg.h:123
double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof) override
Definition supg.C:302
NumericalMethod * giveNumericalMethod(MetaStep *mStep) override
Returns reference to receiver's numerical method.
Definition supg.C:216
TimeStep * giveNextStep() override
Returns next time step (next to current step) of receiver.
Definition supg.C:428
FloatArray internalForces
Definition supg.h:119
void solveYourselfAt(TimeStep *tStep) override
Definition supg.C:466
double atolv
Convergence tolerance.
Definition supg.h:126
void updateDofUnknownsDictionary_predictor(TimeStep *tStep)
Definition supg.C:1059
int initFlag
Definition supg.h:137
void updateYourself(TimeStep *tStep) override
Definition supg.C:795
void evaluateElementStabilizationCoeffs(TimeStep *tStep)
Definition supg.C:1019
double giveVariableScale(VarScaleType varId) override
Returns the scale factor for given variable type.
Definition supg.C:995
bool giveEquationScalingFlag() override
Returns the Equation scaling flag, which is used to indicate that governing equation(s) are scaled,...
Definition supg.h:188
void updateComponent(TimeStep *tStep, NumericalCmpn cmpn, Domain *d) override
Definition supg.C:340
double dscale
Definition supg.h:142
double rtolv
Definition supg.h:126
void updateSolutionVectors_predictor(FloatArray &solutionVector, FloatArray &accelerationVector, TimeStep *tStep)
Definition supg.C:1137
void updateDofUnknownsDictionary_corrector(TimeStep *tStep)
Definition supg.C:1095
int checkConsistency() override
Definition supg.C:861
void applyIC(TimeStep *tStep)
Definition supg.C:934
long ContextMode
Definition contextmode.h:43
VarScaleType
Type determining the scale corresponding to particular variable.
fMode
Definition fmode.h:42
@ TL
Total Lagrange.
Definition fmode.h:44
@ SMT_Skyline
Symmetric skyline.
#define _IFT_SUPG_Name
Definition supg.h:49

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