OOFEM 3.0
Loading...
Searching...
No Matches
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 - 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
36#include "fei2dtrlin.h"
37#include "node.h"
38#include "gausspoint.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
55namespace oofem {
57
58FEI2dTrLinAxi Axisymm3d :: interpolation(1, 2);
59
60Axisymm3d :: Axisymm3d(int n, Domain *aDomain) :
63 // Constructor.
64{
66 area = -1;
68}
69
70Axisymm3d :: ~Axisymm3d()
71// destructor
72{ }
73
74
76Axisymm3d :: giveInterpolation() const { return & interpolation; }
77
78
80Axisymm3d :: giveInterface(InterfaceType 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
96double
97Axisymm3d :: giveArea()
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
109void
110Axisymm3d :: initializeFrom(InputRecord &ir, int priority)
111{
112 StructuralElement :: initializeFrom(ir, priority);
113
114
115}
116
117void Axisymm3d :: postInitialize()
118{
119 if ( !( ( numberOfGaussPoints == 1 ) ||
120 ( numberOfGaussPoints == 4 ) ||
121 ( numberOfGaussPoints == 7 ) ) ) {
123 }
124 StructuralElement :: postInitialize();
125}
126
127
128
129
130void
131Axisymm3d :: NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node,
132 InternalStateType type, TimeStep *tStep)
133{
134 GaussPoint *gp;
135
136 if ( numberOfGaussPoints != 1 ) {
137 answer.clear(); // for more gp's need to be refined
138 return;
139 }
140
141 gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
142 this->giveIPValue(answer, gp, type, tStep);
143}
144
145void
146Axisymm3d :: SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap)
147{
148 pap.resize(3);
149 pap.at(1) = this->giveNode(1)->giveNumber();
150 pap.at(2) = this->giveNode(2)->giveNumber();
151 pap.at(3) = this->giveNode(3)->giveNumber();
152}
153
154void
155Axisymm3d :: SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap)
156{
157 answer.resize(1);
158 if ( ( pap == this->giveNode(1)->giveNumber() ) ||
159 ( pap == this->giveNode(2)->giveNumber() ) ||
160 ( pap == this->giveNode(3)->giveNumber() ) ) {
161 answer.at(1) = pap;
162 } else {
163 OOFEM_ERROR("node unknown");
164 }
165}
166
167
168int
169Axisymm3d :: SPRNodalRecoveryMI_giveNumberOfIP()
170{
171 return this->giveDefaultIntegrationRulePtr()->giveNumberOfIntegrationPoints();
172}
173
174
176Axisymm3d :: SPRNodalRecoveryMI_givePatchType()
177{
178 return SPRPatchType_2dxy;
179}
180
181
182#ifdef __OOFEG
183 #define TR_LENGHT_REDUCT 0.3333
184
185void Axisymm3d :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
186{
187 WCRec p [ 3 ];
188 GraphicObj *go;
189
190 if ( !gc.testElementGraphicActivity(this) ) {
191 return;
192 }
193
194 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
195 EASValsSetColor( gc.getElementColor() );
196 EASValsSetEdgeColor( gc.getElementEdgeColor() );
197 EASValsSetEdgeFlag(true);
198
199 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
200 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
201 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
202 p [ 0 ].z = 0.;
203 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
204 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
205 p [ 1 ].z = 0.;
206 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
207 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
208 p [ 2 ].z = 0.;
209
210 go = CreateTriangle3D(p);
211 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
212 EGAttachObject(go, ( EObjectP ) this);
213 EMAddGraphicsToModel(ESIModel(), go);
214}
215
216
217void Axisymm3d :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
218{
219 WCRec p [ 3 ];
220 GraphicObj *go;
221 double defScale = gc.getDefScale();
222
223 if ( !gc.testElementGraphicActivity(this) ) {
224 return;
225 }
226
227 EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
228 EASValsSetColor( gc.getDeformedElementColor() );
229 EASValsSetEdgeColor( gc.getElementEdgeColor() );
230 EASValsSetEdgeFlag(true);
231 EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
232 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
233 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
234 p [ 0 ].z = 0.;
235 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
236 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
237 p [ 1 ].z = 0.;
238 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
239 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
240 p [ 2 ].z = 0.;
241
242 go = CreateTriangle3D(p);
243 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
244 EMAddGraphicsToModel(ESIModel(), go);
245}
246
247void
248Axisymm3d :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
249{
250 int i, indx, result = 0;
251 WCRec p [ 3 ];
252 GraphicObj *tr;
253 FloatArray v1, v2, v3;
254 double s [ 3 ], defScale;
255
256 if ( !gc.testElementGraphicActivity(this) ) {
257 return;
258 }
259
260 if ( gc.giveIntVarMode() == ISM_recovered ) {
261 result += this->giveInternalStateAtNode(v1, gc.giveIntVarType(), gc.giveIntVarMode(), 1, tStep);
262 result += this->giveInternalStateAtNode(v2, gc.giveIntVarType(), gc.giveIntVarMode(), 2, tStep);
263 result += this->giveInternalStateAtNode(v3, gc.giveIntVarType(), gc.giveIntVarMode(), 3, tStep);
264 } else if ( gc.giveIntVarMode() == ISM_local ) {
265 GaussPoint *gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
266 result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
267 v2 = v1;
268 v3 = v1;
269 result *= 3;
270 }
271
272 if ( result != 3 ) {
273 return;
274 }
275
276 indx = gc.giveIntVarIndx();
277
278 s [ 0 ] = v1.at(indx);
279 s [ 1 ] = v2.at(indx);
280 s [ 2 ] = v3.at(indx);
281
282 EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
283
284 if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
285 for ( i = 0; i < 3; i++ ) {
286 if ( gc.getInternalVarsDefGeoFlag() ) {
287 // use deformed geometry
288 defScale = gc.getDefScale();
289 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
290 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
291 p [ i ].z = 0.;
292 } else {
293 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
294 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
295 p [ i ].z = 0.;
296 }
297 }
298
299 //EASValsSetColor(gc.getYieldPlotColor(ratio));
300 gc.updateFringeTableMinMax(s, 3);
301 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
302 EGWithMaskChangeAttributes(LAYER_MASK, tr);
303 EMAddGraphicsToModel(ESIModel(), tr);
304 } else if ( ( gc.getScalarAlgo() == SA_ZPROFILE ) || ( gc.getScalarAlgo() == SA_COLORZPROFILE ) ) {
305 double landScale = gc.getLandScale();
306
307 for ( i = 0; i < 3; i++ ) {
308 if ( gc.getInternalVarsDefGeoFlag() ) {
309 // use deformed geometry
310 defScale = gc.getDefScale();
311 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
312 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
313 p [ i ].z = s [ i ] * landScale;
314 } else {
315 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
316 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
317 p [ i ].z = s [ i ] * landScale;
318 }
319 }
320
321 if ( gc.getScalarAlgo() == SA_ZPROFILE ) {
322 EASValsSetColor( gc.getDeformedElementColor() );
323 EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
324 EASValsSetFillStyle(FILL_SOLID);
325 tr = CreateTriangle3D(p);
326 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | FILL_MASK | LAYER_MASK, tr);
327 } else {
328 gc.updateFringeTableMinMax(s, 3);
329 EASValsSetFillStyle(FILL_SOLID);
330 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
331 EGWithMaskChangeAttributes(FILL_MASK | LAYER_MASK, tr);
332 }
333
334 EMAddGraphicsToModel(ESIModel(), tr);
335 }
336}
337
338#endif
339} // end namespace oofem
#define REGISTER_Element(class)
AxisymElement(int n, Domain *d)
static FEI2dTrLinAxi interpolation
Definition axisymm3d.h:65
Node * giveNode(int i) const
Definition element.h:629
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
int numberOfGaussPoints
Definition element.h:175
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
int giveNumber() const
Definition femcmpnn.h:104
double & at(Index i)
Definition floatarray.h:202
void resize(int n)
Definition intarray.C:73
int & at(std::size_t i)
Definition intarray.h:104
SpatialLocalizerInterface(Element *element)
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep) override
ZZNodalRecoveryModelInterface(Element *element)
Constructor.
#define OOFEM_ERROR(...)
Definition error.h:79
@ SPRNodalRecoveryModelInterfaceType
@ ZZNodalRecoveryModelInterfaceType
@ SpatialLocalizerInterfaceType
@ NodalAveragingRecoveryModelInterfaceType
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_VARPLOT_PATTERN_LAYER
#define OOFEG_DEFORMED_GEOMETRY_LAYER
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_LAYER

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