OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
tr21_2d_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 - 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 tr21_2d_supg_h
36 #define tr21_2d_supg_h
37 
38 #include "supgelement2.h"
39 #include "intarray.h"
40 #include "zznodalrecoverymodel.h"
42 #include "sprnodalrecoverymodel.h"
43 #include "leplic.h"
44 #include "levelsetpcs.h"
45 
46 #define _IFT_TR21_2D_SUPG_Name "tr21supg"
47 
48 namespace oofem {
49 class FEI2dTrQuad;
50 class FEI2dTrLin;
51 
58 {
59 protected:
62 
63 public:
64  TR21_2D_SUPG(int n, Domain * aDomain);
65  virtual ~TR21_2D_SUPG();
66 
67  virtual FEInterpolation *giveInterpolation() const;
68  virtual FEInterpolation *giveInterpolation(DofIDItem id) const;
69 
70  // definition
71  virtual const char *giveClassName() const { return "TR21_2D_SUPG"; }
72  virtual const char *giveInputRecordName() const { return _IFT_TR21_2D_SUPG_Name; }
73  virtual MaterialMode giveMaterialMode() { return _2dFlow; }
74 
75  virtual void giveDofManDofIDMask(int inode, IntArray &answer) const;
76  virtual int computeNumberOfDofs();
77  virtual void updateYourself(TimeStep *tStep);
79  virtual int checkConsistency();
80 
81  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj = NULL);
82  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj = NULL);
83 
84  virtual double LS_PCS_computeF(LevelSetPCS *ls, TimeStep *tStep);
85  virtual void LS_PCS_computedN(FloatMatrix &answer);
86  virtual double LS_PCS_computeVolume();
87  virtual void LS_PCS_computeVolume(double &answer, const FloatArray **coordinates);
88  virtual double LS_PCS_computeS(LevelSetPCS *ls, TimeStep *tStep);
89  virtual void LS_PCS_computeVOFFractions(FloatArray &answer, FloatArray &fi);
90 
91 
93  InternalStateType type, TimeStep *tStep);
94 
96 
97  void computeIntersection(int iedge, FloatArray &intcoords, FloatArray &fi);
98  void computeMiddlePointOnParabolicArc(FloatArray &answer, int iedge, FloatArray borderpoints);
99  void computeCenterOf(FloatArray &C, FloatArray c, int dim);
100  void computeQuadraticRoots(FloatArray Coeff, double &r1, double &r2);
101  void computeCoordsOfEdge(FloatArray &answer, int iedge);
102  void computeQuadraticFunct(FloatArray &answer, int iedge);
103  void computeQuadraticFunct(FloatArray &answer, FloatArray line);
105 
106  virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep);
107 
108 #ifdef __OOFEG
110  int node, TimeStep *tStep);
111  // Graphics output
112  virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep);
113  virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep);
114  //virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType) {}
115 #endif
116 
117  virtual double computeCriticalTimeStep(TimeStep *tStep);
118 
119  // three terms for computing their norms due to computing t_supg
120  virtual void computeAdvectionTerm(FloatMatrix &answer, TimeStep *tStep);
121  virtual void computeAdvectionDeltaTerm(FloatMatrix &answer, TimeStep *tStep);
122  virtual void computeMassDeltaTerm(FloatMatrix &answer, TimeStep *tStep);
123  virtual void computeLSICTerm(FloatMatrix &answer, TimeStep *tStep);
124 
126 
127 protected:
128  virtual void giveLocalVelocityDofMap(IntArray &map);
129  virtual void giveLocalPressureDofMap(IntArray &map);
130 
131  virtual void computeGaussPoints();
132  virtual void computeNuMatrix(FloatMatrix &answer, GaussPoint *gp);
133  virtual void computeUDotGradUMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep);
134  virtual void computeBMatrix(FloatMatrix &anwer, GaussPoint *gp);
135  virtual void computeDivUMatrix(FloatMatrix &answer, GaussPoint *gp);
136  virtual void computeNpMatrix(FloatMatrix &answer, GaussPoint *gp);
137  virtual void computeGradPMatrix(FloatMatrix &answer, GaussPoint *gp);
138  virtual void computeDivTauMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep);
139  virtual void computeGradUMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep);
140  virtual int giveNumberOfSpatialDimensions();
141  virtual double computeVolumeAround(GaussPoint *gp);
142  virtual void initGeometry();
143 
144  virtual void updateStabilizationCoeffs(TimeStep *tStep);
145 };
146 } // end namespace oofem
147 #endif // tr21_2d_supg_h
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
The element interface required by NodalAvergagingRecoveryModel.
virtual int checkConsistency()
Used to check consistency and initialize some element geometry data (area,b,c).
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
virtual void giveLocalVelocityDofMap(IntArray &map)
virtual FEInterpolation * giveInterpolation() const
Definition: tr21_2d_supg.C:78
Class and object Domain.
Definition: domain.h:115
virtual void computeDivTauMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Definition: tr21_2d_supg.C:237
The element interface required by ZZNodalRecoveryModel.
virtual void computeAdvectionTerm(FloatMatrix &answer, TimeStep *tStep)
Definition: tr21_2d_supg.C:306
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
Element interface for LevelSetPCS class representing level-set like material interface.
Definition: levelsetpcs.h:68
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
void computeCenterOf(FloatArray &C, FloatArray c, int dim)
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual void LS_PCS_computeVOFFractions(FloatArray &answer, FloatArray &fi)
Returns VOF fractions for each material on element according to nodal values of level set function (p...
Definition: tr21_2d_supg.C:494
static FEI2dTrLin pressureInterpolation
Definition: tr21_2d_supg.h:61
virtual void computeDivUMatrix(FloatMatrix &answer, GaussPoint *gp)
Definition: tr21_2d_supg.C:180
virtual void computeAdvectionDeltaTerm(FloatMatrix &answer, TimeStep *tStep)
Definition: tr21_2d_supg.C:324
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
Class implementing an array of integers.
Definition: intarray.h:61
void computeQuadraticFunct(FloatArray &answer, int iedge)
virtual void initGeometry()
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
virtual int computeNumberOfDofs()
Computes or simply returns total number of element's local DOFs.
Definition: tr21_2d_supg.C:94
virtual MaterialMode giveMaterialMode()
Returns material mode for receiver integration points.
Definition: tr21_2d_supg.h:73
virtual void NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep)
Computes the element value in given node.
This abstract class represent a general base element class for fluid dynamic problems.
Definition: supgelement2.h:57
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
virtual void giveLocalPressureDofMap(IntArray &map)
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
Class representing a 2d triangular linear interpolation based on area coordinates.
Definition: fei2dtrlin.h:44
virtual void computeGradUMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Definition: tr21_2d_supg.C:210
void computeQuadraticRoots(FloatArray Coeff, double &r1, double &r2)
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual void computeNpMatrix(FloatMatrix &answer, GaussPoint *gp)
Definition: tr21_2d_supg.C:195
DofIDItem
Type representing particular dof type.
Definition: dofiditem.h:86
static FEI2dTrQuad velocityInterpolation
Definition: tr21_2d_supg.h:60
#define _IFT_TR21_2D_SUPG_Name
Definition: tr21_2d_supg.h:46
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
void computeMiddlePointOnParabolicArc(FloatArray &answer, int iedge, FloatArray borderpoints)
void computeCoordsOfEdge(FloatArray &answer, int iedge)
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
virtual const char * giveClassName() const
Definition: tr21_2d_supg.h:71
virtual void computeNuMatrix(FloatMatrix &answer, GaussPoint *gp)
Definition: tr21_2d_supg.C:134
TR21_2D_SUPG(int n, Domain *aDomain)
Definition: tr21_2d_supg.C:66
Class representing 2d triangular element with quadratic velocity and linear pressure approximation fo...
Definition: tr21_2d_supg.h:57
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual Interface * giveInterface(InterfaceType)
Interface requesting service.
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
Abstract base class representing Level Set representation of material interfaces. ...
Definition: levelsetpcs.h:114
virtual void LS_PCS_computedN(FloatMatrix &answer)
Returns gradient of shape functions.
Definition: tr21_2d_supg.C:422
virtual void computeMassDeltaTerm(FloatMatrix &answer, TimeStep *tStep)
Definition: tr21_2d_supg.C:344
virtual const char * giveInputRecordName() const
Definition: tr21_2d_supg.h:72
Class Interface.
Definition: interface.h:82
virtual void computeUDotGradUMatrix(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
Definition: tr21_2d_supg.C:144
virtual double computeCriticalTimeStep(TimeStep *tStep)
Computes the critical time increment.
Definition: tr21_2d_supg.C:388
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
virtual double LS_PCS_computeVolume()
Returns receiver's volume.
Definition: tr21_2d_supg.C:458
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
InterfaceType
Enumerative type, used to identify interface type.
Definition: interfacetype.h:43
virtual void updateStabilizationCoeffs(TimeStep *tStep)
Updates the stabilization coefficients used for CBS and SUPG algorithms.
Definition: tr21_2d_supg.C:259
virtual int giveNumberOfSpatialDimensions()
Definition: tr21_2d_supg.C:381
Second order triangular interpolation in 2D (6 nodes).
Definition: fei2dtrquad.h:44
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual ~TR21_2D_SUPG()
Definition: tr21_2d_supg.C:73
virtual double LS_PCS_computeS(LevelSetPCS *ls, TimeStep *tStep)
Evaluates S in level set equation of the form where .
Definition: tr21_2d_supg.C:470
virtual void computeLSICTerm(FloatMatrix &answer, TimeStep *tStep)
Definition: tr21_2d_supg.C:362
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
Definition: tr21_2d_supg.C:100
Class representing integration point in finite element program.
Definition: gausspoint.h:93
void computeIntersection(int iedge, FloatArray &intcoords, FloatArray &fi)
Class representing solution step.
Definition: timestep.h:80
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: tr21_2d_supg.C:110
virtual void computeGradPMatrix(FloatMatrix &answer, GaussPoint *gp)
Definition: tr21_2d_supg.C:226
InternalStateMode
Determines the mode of internal variable.
virtual void computeBMatrix(FloatMatrix &anwer, GaussPoint *gp)
Definition: tr21_2d_supg.C:163
virtual double LS_PCS_computeF(LevelSetPCS *ls, TimeStep *tStep)
Evaluates F in level set equation of the form where for interface position driven by flow with speed...
Definition: tr21_2d_supg.C:395

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