OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
axisymm3d.C
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 
36 #include "fei2dtrlin.h"
37 #include "node.h"
38 #include "gausspoint.h"
39 #include "gaussintegrationrule.h"
40 #include "floatmatrix.h"
41 #include "floatarray.h"
42 #include "intarray.h"
43 #include "domain.h"
44 #include "engngm.h"
45 #include "mathfem.h"
46 #include "crosssection.h"
47 #include "classfactory.h"
48 
49 #ifdef __OOFEG
50  #include "oofeggraphiccontext.h"
51  #include "connectivitytable.h"
52 #endif
53 
54 
55 namespace oofem {
56 REGISTER_Element(Axisymm3d);
57 
58 FEI2dTrLinAxi Axisymm3d :: interpolation(1, 2);
59 
60 Axisymm3d :: Axisymm3d(int n, Domain *aDomain) :
63  // Constructor.
64 {
65  numberOfDofMans = 3;
66  area = -1;
68 }
69 
71 // destructor
72 { }
73 
74 
77 
78 
79 Interface *
81 {
82  if ( interface == ZZNodalRecoveryModelInterfaceType ) {
83  return static_cast< ZZNodalRecoveryModelInterface * >(this);
84  } else if ( interface == NodalAveragingRecoveryModelInterfaceType ) {
85  return static_cast< NodalAveragingRecoveryModelInterface * >(this);
86  } else if ( interface == SPRNodalRecoveryModelInterfaceType ) {
87  return static_cast< SPRNodalRecoveryModelInterface * >(this);
88  } else if ( interface == SpatialLocalizerInterfaceType ) {
89  return static_cast< SpatialLocalizerInterface * >(this);
90  }
91 
92  return NULL;
93 }
94 
95 
96 double
98 // returns the area occupied by the receiver
99 {
100  if ( area > 0 ) {
101  return area; // check if previously computed
102  }
103 
104  area = fabs( this->interpolation.giveArea( FEIElementGeometryWrapper(this) ) );
105  return area;
106 }
107 
108 
111 {
112  IRResultType result; // Required by IR_GIVE_FIELD macro
113 
116  if ( result != IRRT_OK ) {
117  return result;
118  }
119 
120  if ( !( ( numberOfGaussPoints == 1 ) ||
121  ( numberOfGaussPoints == 4 ) ||
122  ( numberOfGaussPoints == 7 ) ) ) {
124  }
125 
126  return IRRT_OK;
127 }
128 
129 
130 
131 
132 
133 void
135  InternalStateType type, TimeStep *tStep)
136 {
137  GaussPoint *gp;
138 
139  if ( numberOfGaussPoints != 1 ) {
140  answer.clear(); // for more gp's need to be refined
141  return;
142  }
143 
144  gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
145  this->giveIPValue(answer, gp, type, tStep);
146 }
147 
148 void
150 {
151  pap.resize(3);
152  pap.at(1) = this->giveNode(1)->giveNumber();
153  pap.at(2) = this->giveNode(2)->giveNumber();
154  pap.at(3) = this->giveNode(3)->giveNumber();
155 }
156 
157 void
159 {
160  answer.resize(1);
161  if ( ( pap == this->giveNode(1)->giveNumber() ) ||
162  ( pap == this->giveNode(2)->giveNumber() ) ||
163  ( pap == this->giveNode(3)->giveNumber() ) ) {
164  answer.at(1) = pap;
165  } else {
166  OOFEM_ERROR("node unknown");
167  }
168 }
169 
170 
171 int
173 {
175 }
176 
177 
180 {
181  return SPRPatchType_2dxy;
182 }
183 
184 
185 #ifdef __OOFEG
186  #define TR_LENGHT_REDUCT 0.3333
187 
189 {
190  WCRec p [ 3 ];
191  GraphicObj *go;
192 
193  if ( !gc.testElementGraphicActivity(this) ) {
194  return;
195  }
196 
197  EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
198  EASValsSetColor( gc.getElementColor() );
199  EASValsSetEdgeColor( gc.getElementEdgeColor() );
200  EASValsSetEdgeFlag(true);
201 
202  EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
203  p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
204  p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
205  p [ 0 ].z = 0.;
206  p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
207  p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
208  p [ 1 ].z = 0.;
209  p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
210  p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
211  p [ 2 ].z = 0.;
212 
213  go = CreateTriangle3D(p);
214  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
215  EGAttachObject(go, ( EObjectP ) this);
216  EMAddGraphicsToModel(ESIModel(), go);
217 }
218 
219 
221 {
222  WCRec p [ 3 ];
223  GraphicObj *go;
224  double defScale = gc.getDefScale();
225 
226  if ( !gc.testElementGraphicActivity(this) ) {
227  return;
228  }
229 
230  EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
231  EASValsSetColor( gc.getDeformedElementColor() );
232  EASValsSetEdgeColor( gc.getElementEdgeColor() );
233  EASValsSetEdgeFlag(true);
234  EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
235  p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
236  p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
237  p [ 0 ].z = 0.;
238  p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
239  p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
240  p [ 1 ].z = 0.;
241  p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
242  p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
243  p [ 2 ].z = 0.;
244 
245  go = CreateTriangle3D(p);
246  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
247  EMAddGraphicsToModel(ESIModel(), go);
248 }
249 
250 void
252 {
253  int i, indx, result = 0;
254  WCRec p [ 3 ];
255  GraphicObj *tr;
256  FloatArray v1, v2, v3;
257  double s [ 3 ], defScale;
258 
259  if ( !gc.testElementGraphicActivity(this) ) {
260  return;
261  }
262 
263  if ( gc.giveIntVarMode() == ISM_recovered ) {
264  result += this->giveInternalStateAtNode(v1, gc.giveIntVarType(), gc.giveIntVarMode(), 1, tStep);
265  result += this->giveInternalStateAtNode(v2, gc.giveIntVarType(), gc.giveIntVarMode(), 2, tStep);
266  result += this->giveInternalStateAtNode(v3, gc.giveIntVarType(), gc.giveIntVarMode(), 3, tStep);
267  } else if ( gc.giveIntVarMode() == ISM_local ) {
268  GaussPoint *gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
269  result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
270  v2 = v1;
271  v3 = v1;
272  result *= 3;
273  }
274 
275  if ( result != 3 ) {
276  return;
277  }
278 
279  indx = gc.giveIntVarIndx();
280 
281  s [ 0 ] = v1.at(indx);
282  s [ 1 ] = v2.at(indx);
283  s [ 2 ] = v3.at(indx);
284 
285  EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
286 
287  if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
288  for ( i = 0; i < 3; i++ ) {
289  if ( gc.getInternalVarsDefGeoFlag() ) {
290  // use deformed geometry
291  defScale = gc.getDefScale();
292  p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
293  p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
294  p [ i ].z = 0.;
295  } else {
296  p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
297  p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
298  p [ i ].z = 0.;
299  }
300  }
301 
302  //EASValsSetColor(gc.getYieldPlotColor(ratio));
303  gc.updateFringeTableMinMax(s, 3);
304  tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
305  EGWithMaskChangeAttributes(LAYER_MASK, tr);
306  EMAddGraphicsToModel(ESIModel(), tr);
307  } else if ( ( gc.getScalarAlgo() == SA_ZPROFILE ) || ( gc.getScalarAlgo() == SA_COLORZPROFILE ) ) {
308  double landScale = gc.getLandScale();
309 
310  for ( i = 0; i < 3; i++ ) {
311  if ( gc.getInternalVarsDefGeoFlag() ) {
312  // use deformed geometry
313  defScale = gc.getDefScale();
314  p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
315  p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
316  p [ i ].z = s [ i ] * landScale;
317  } else {
318  p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
319  p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
320  p [ i ].z = s [ i ] * landScale;
321  }
322  }
323 
324  if ( gc.getScalarAlgo() == SA_ZPROFILE ) {
325  EASValsSetColor( gc.getDeformedElementColor() );
326  EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
327  EASValsSetFillStyle(FILL_SOLID);
328  tr = CreateTriangle3D(p);
329  EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | FILL_MASK | LAYER_MASK, tr);
330  } else {
331  gc.updateFringeTableMinMax(s, 3);
332  EASValsSetFillStyle(FILL_SOLID);
333  tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
334  EGWithMaskChangeAttributes(FILL_MASK | LAYER_MASK, tr);
335  }
336 
337  EMAddGraphicsToModel(ESIModel(), tr);
338  }
339 }
340 
341 #endif
342 } // end namespace oofem
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
The element interface required by NodalAvergagingRecoveryModel.
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
Definition: axisymm3d.C:220
The element interface required by ZZNodalRecoveryModel.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
Class and object Domain.
Definition: domain.h:115
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
Definition: element.h:822
ScalarAlgorithmType getScalarAlgo()
The element interface required by ZZNodalRecoveryModel.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual 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...
#define OOFEG_RAW_GEOMETRY_LAYER
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
Definition: axisymm3d.C:188
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual double giveCoordinate(int i)
Definition: node.C:82
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
virtual double giveArea()
Definition: axisymm3d.C:97
#define OOFEG_DEFORMED_GEOMETRY_LAYER
virtual SPRPatchType SPRNodalRecoveryMI_givePatchType()
Definition: axisymm3d.C:179
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
InternalStateType giveIntVarType()
virtual double giveArea(const FEICellGeometry &cellgeo) const
Computes the exact area.
Definition: fei2dtrlin.C:267
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
Definition: axisymm3d.C:251
virtual ~Axisymm3d()
Definition: axisymm3d.C:70
#define OOFEM_ERROR(...)
Definition: error.h:61
REGISTER_Element(LSpace)
Axisymm3d(int n, Domain *d)
Definition: axisymm3d.C:60
#define OOFEG_RAW_GEOMETRY_WIDTH
UnknownType
Type representing particular unknown (its physical meaning).
Definition: unknowntype.h:55
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: axisymm3d.C:110
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
Definition: node.C:245
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
virtual int SPRNodalRecoveryMI_giveNumberOfIP()
Definition: axisymm3d.C:172
int numberOfGaussPoints
Number of integration points as specified by nip.
Definition: element.h:188
InternalStateMode giveIntVarMode()
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual void NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep)
Computes the element value in given node.
Definition: axisymm3d.C:134
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
Definition: axisymm3d.C:80
Class representing the general Input Record.
Definition: inputrecord.h:101
Class Interface.
Definition: interface.h:82
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
static FEI2dTrLinAxi interpolation
Definition: axisymm3d.h:65
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
The spatial localizer element interface associated to spatial localizer.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
Definition: element.h:170
InterfaceType
Enumerative type, used to identify interface type.
Definition: interfacetype.h:43
void updateFringeTableMinMax(double *s, int size)
virtual void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
Definition: axisymm3d.C:149
the oofem namespace is to define a context or scope in which all oofem names are defined.
int giveNumber() const
Definition: femcmpnn.h:107
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
#define OOFEG_VARPLOT_PATTERN_LAYER
virtual void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
Definition: axisymm3d.C:158
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
int numberOfDofMans
Number of dofmanagers.
Definition: element.h:149
virtual FEInterpolation * giveInterpolation() const
Definition: axisymm3d.C:76

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