OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
tr1_2d_pfem.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 // ***************************************************************************************
36 // *** 2D LINEAR TRIANGULAR ELEMENT FOR FLUID DYNAMIC PROBLEMS SOLVED WITH PFEM METHOD ***
37 // ***************************************************************************************
38 
39 #ifndef tr1_2d_pfem_h
40 #define tr1_2d_pfem_h
41 
42 
43 #include "pfemelement2d.h"
44 #include "femcmpnn.h"
45 #include "domain.h"
46 #include "floatmatrix.h"
47 #include "fei2dtrlin.h"
48 
50 
51 #define _IFT_TR1_2D_PFEM_Name "tr1pfem"
52 
53 
54 namespace oofem {
55 class TimeStep;
56 class Node;
57 class Material;
58 class GaussPoint;
59 class FloatMatrix;
60 class FloatArray;
61 class IntArray;
62 
68 class TR1_2D_PFEM : public PFEMElement2d
69 {
70 protected:
71  double b [ 3 ];
72  double c [ 3 ];
73  double area;
74 
79 
80  static IntArray edge_ordering [ 3 ];
81 
86 
87 public:
98  TR1_2D_PFEM(int n, Domain *aDomain, int particle1, int particle2, int particle3, int mat, int cs);
100  ~TR1_2D_PFEM();
101 
102  virtual void computeDiagonalMassMtrx(FloatArray &answer, TimeStep *tStep);
103  virtual void computeDiagonalMassMtrx(FloatMatrix &answer, TimeStep *tStep);
104 
105  virtual double computeCriticalTimeStep(TimeStep *tStep);
106 
107  virtual const char *giveClassName() const { return "TR1_2D_PFEM"; }
108  virtual const char *giveInputRecordName() const { return _IFT_TR1_2D_PFEM_Name; }
109 
110  virtual Element_Geometry_Type giveGeometryType() const { return EGT_triangle_1; }
111 
112  virtual void giveElementDofIDMask(IntArray &answer) const;
113 
114  virtual void giveDofManDofIDMask(int inode, IntArray &answer) const;
115  virtual int computeNumberOfDofs();
117  virtual int checkConsistency();
118 
119  virtual double computeVolumeAround(GaussPoint *gp);
120 
122 
123  virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj);
124  virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj);
125 
126  virtual Element *giveElement() { return this; }
127 
128 #ifdef __OOFEG
130  int node, TimeStep *atTime);
131  // Graphics output
132  //virtual void drawYourself(oofegGraphicContext&);
133  virtual void drawRawGeometry(oofegGraphicContext &);
134  virtual void drawScalar(oofegGraphicContext &context);
135  //virtual void drawDeformedGeometry(oofegGraphicContext&, UnknownType) {}
136 #endif
137 
140 
142  virtual FEInterpolation *giveInterpolation(DofIDItem id) const { return id == P_f ? & pressureInterpolation : & velocityInterpolation; }
143 
144  virtual const IntArray &giveVelocityDofMask() const
145  {
146  return this->velocityDofMask;
147  }
148  virtual const IntArray &givePressureDofMask() const
149  {
150  return this->pressureDofMask;
151  }
152 
153 protected:
154  virtual void computeGaussPoints();
155  virtual void computeDeviatoricStress(FloatArray &answer, GaussPoint *gp, TimeStep *tStep);
156 
157  virtual void computeDeviatoricStressDivergence(FloatArray &answer, TimeStep *tStep);
158 
159  virtual void computeBodyLoadVectorAt(FloatArray &answer, BodyLoad *load, TimeStep *tStep, ValueModeType mode);
160  virtual void computeEdgeBCSubVectorAt(FloatArray &answer, Load *load, int iEdge, TimeStep *tStep);
161 };
162 } // end namespace oofem
163 #endif // tr1_2d_pfem_h
virtual void drawRawGeometry(oofegGraphicContext &)
Definition: tr1_2d_pfem.C:463
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
virtual const char * giveInputRecordName() const
Definition: tr1_2d_pfem.h:108
virtual int computeNumberOfDofs()
Computes or simply returns total number of element's local DOFs.
Definition: tr1_2d_pfem.C:98
This class is the implementation of triangular PFEM element with linear (and equal order) interpolati...
Definition: tr1_2d_pfem.h:68
Class and object Domain.
Definition: domain.h:115
Element_Geometry_Type
Enumerative type used to classify element geometry Possible values are: EGT_point - point in space EG...
virtual void computeEdgeBCSubVectorAt(FloatArray &answer, Load *load, int iEdge, TimeStep *tStep)
Definition: tr1_2d_pfem.C:168
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
virtual FEInterpolation * giveVelocityInterpolation()
Returns the interpolation for velocity.
Definition: tr1_2d_pfem.h:138
TR1_2D_PFEM(int n, Domain *aDomain, int particle1, int particle2, int particle3, int mat, int cs)
Constructor of TR1_2D_PFEM Element.
Definition: tr1_2d_pfem.C:78
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
Definition: bodyload.h:49
static IntArray velocityDofMask
Mask of velocity Dofs.
Definition: tr1_2d_pfem.h:83
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Definition: tr1_2d_pfem.C:129
virtual const IntArray & givePressureDofMask() const
Returns mask of pressure Dofs.
Definition: tr1_2d_pfem.h:148
virtual void computeDiagonalMassMtrx(FloatArray &answer, TimeStep *tStep)
Calculates diagonal mass matrix as vector.
Definition: tr1_2d_pfem.C:212
virtual void computeDeviatoricStress(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Computes deviatoric stress vector in given integration point and solution step from given total strai...
Definition: tr1_2d_pfem.C:243
Abstract base class for all finite elements.
Definition: element.h:145
virtual const IntArray & giveVelocityDofMask() const
Returns mask of velocity Dofs.
Definition: tr1_2d_pfem.h:144
virtual FEInterpolation * giveInterpolation(DofIDItem id) const
Returns the interpolation for the specific dof id.
Definition: tr1_2d_pfem.h:142
Class implementing an array of integers.
Definition: intarray.h:61
virtual void giveElementDofIDMask(IntArray &answer) const
Returns element dof mask for node.
Definition: tr1_2d_pfem.C:113
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
static FEI2dTrLin velocityInterpolation
Interpolation for velocity unknowns.
Definition: tr1_2d_pfem.h:76
Class representing a 2d triangular linear interpolation based on area coordinates.
Definition: fei2dtrlin.h:44
DofIDItem
Type representing particular dof type.
Definition: dofiditem.h:86
static FEI2dTrLin pressureInterpolation
Interpolation for pressure unknowns.
Definition: tr1_2d_pfem.h:78
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
Definition: tr1_2d_pfem.h:110
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Definition: tr1_2d_pfem.C:434
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj)
Stores receiver state to output stream.
Definition: tr1_2d_pfem.C:408
~TR1_2D_PFEM()
Destructor.
Definition: tr1_2d_pfem.C:93
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual double computeCriticalTimeStep(TimeStep *tStep)
Calculates critical time step.
Definition: tr1_2d_pfem.C:307
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual void computeDeviatoricStressDivergence(FloatArray &answer, TimeStep *tStep)
Calculates the divergence of the deviatoric stress.
Definition: tr1_2d_pfem.C:260
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
Definition: tr1_2d_pfem.C:104
Class Interface.
Definition: interface.h:82
virtual const char * giveClassName() const
Definition: tr1_2d_pfem.h:107
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
InterfaceType
Enumerative type, used to identify interface type.
Definition: interfacetype.h:43
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver acording to object description stored in input record.
Definition: tr1_2d_pfem.C:120
Load is base abstract class for all loads.
Definition: load.h:61
#define _IFT_TR1_2D_PFEM_Name
Definition: tr1_2d_pfem.h:51
static IntArray pressureDofMask
Mask of pressure Dofs.
Definition: tr1_2d_pfem.h:85
virtual void computeBodyLoadVectorAt(FloatArray &answer, BodyLoad *load, TimeStep *tStep, ValueModeType mode)
Computes the load vector due to body load acting on receiver, at given time step. ...
Definition: tr1_2d_pfem.C:141
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj)
Restores the receiver state previously written in stream.
Definition: tr1_2d_pfem.C:420
virtual Element * giveElement()
Definition: tr1_2d_pfem.h:126
virtual void drawScalar(oofegGraphicContext &context)
Definition: tr1_2d_pfem.C:493
virtual FEInterpolation * givePressureInterpolation()
Returns the interpolation for the pressure.
Definition: tr1_2d_pfem.h:139
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
This class is the implementation of general 2d element with arbitrary interpolation of velocity and p...
Definition: pfemelement2d.h:68
virtual int checkConsistency()
Performs consistency check.
Definition: tr1_2d_pfem.C:276
virtual int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *atTime)
Returns internal state variable (like stress,strain) at node of element in Reduced form...
Definition: tr1_2d_pfem.C:443
InternalStateMode
Determines the mode of internal variable.
virtual Interface * giveInterface(InterfaceType)
Interface requesting service.
Definition: tr1_2d_pfem.C:237
static IntArray edge_ordering[3]
Definition: tr1_2d_pfem.h:80
virtual FEInterpolation * giveInterpolation() const
Definition: tr1_2d_pfem.h:141

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