OOFEM 3.0
Loading...
Searching...
No Matches
q4axisymm.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 "fei2dquadquad.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#include "parametermanager.h"
49#include "paramkey.h"
50
51#ifdef __OOFEG
52 #include "oofeggraphiccontext.h"
53 #include "connectivitytable.h"
54#endif
55
56namespace oofem {
59
60FEI2dQuadQuadAxi Q4Axisymm :: interp(1, 2);
61
62Q4Axisymm :: Q4Axisymm(int n, Domain *aDomain) :
64{
68}
69
70
71Q4Axisymm :: ~Q4Axisymm()
72{ }
73
74
76Q4Axisymm :: giveInterpolation() const
77{
78 return & interp;
79}
80
81
82
83void
84Q4Axisymm :: initializeFrom(InputRecord &ir, int priority)
85 // Initialize the receiver from the input record ir.
86 // The priority is used to resolve conflicts in the input record
87 // (e.g. when two elements are defined in the same input record).
88 // The higher the priority, the more important the field is.
89 // The default value of priority is 0.
90{
91 ParameterManager &ppm = domain->elementPPM;
92 StructuralElement :: initializeFrom(ir, priority);
94}
95
96
97void
98Q4Axisymm :: computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int li, int ui)
99{
100 // Returns the [ 6 x (nno*2) ] strain-displacement matrix {B} of the receiver,
101 // evaluated at gp. Uses reduced integration
102 // (epsilon_x,epsilon_y,...,Gamma_xy) = B . r
103 // r = ( u1,v1,u2,v2,u3,v3,u4,v4)
104
105 if ( numberOfFiAndShGaussPoints == 1 ) { // Reduced integration
107
108 FloatArray N, NRed, redCoord = {0.0, 0.0}; // eval in centroid
110 interp->evalN( NRed, redCoord, FEIElementGeometryWrapper(this) );
111
112 // Evaluate radius at center
113 double r = 0.0;
114 for ( int i = 1; i <= this->giveNumberOfDofManagers(); i++ ) {
115 double x = this->giveNode(i)->giveCoordinate(1);
116 r += x * NRed.at(i);
117 }
118
119 FloatMatrix dNdx, dNdxRed;
120 interp->evaldNdx( dNdx, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
121 interp->evaldNdx( dNdxRed, redCoord, FEIElementGeometryWrapper(this) );
122 answer.resize(6, dNdx.giveNumberOfRows() * 2);
123 answer.zero();
124
125 for ( int i = 1; i <= dNdx.giveNumberOfRows(); i++ ) {
126 answer.at(1, i * 2 - 1) = dNdx.at(i, 1);
127 answer.at(2, i * 2 - 0) = dNdx.at(i, 2);
128 answer.at(3, i * 2 - 1) = NRed.at(i) / r;
129 answer.at(6, 2 * i - 1) = dNdxRed.at(i, 2);
130 answer.at(6, 2 * i - 0) = dNdxRed.at(i, 1);
131 }
132 }
133}
134
135
136
137
138
139Interface *
140Q4Axisymm :: giveInterface(InterfaceType interface)
141{
142 if ( interface == ZZNodalRecoveryModelInterfaceType ) {
143 return static_cast< ZZNodalRecoveryModelInterface * >(this);
144 }
145
146 return NULL;
147}
148
149
150#ifdef __OOFEG
151
152void Q4Axisymm :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
153{
154 WCRec p [ 4 ];
155 GraphicObj *go;
156
157 if ( !gc.testElementGraphicActivity(this) ) {
158 return;
159 }
160
161 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
162 EASValsSetColor( gc.getElementColor() );
163 EASValsSetEdgeColor( gc.getElementEdgeColor() );
164 EASValsSetEdgeFlag(true);
165
166 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
167 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
168 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
169 p [ 0 ].z = 0.;
170 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
171 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
172 p [ 1 ].z = 0.;
173 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
174 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
175 p [ 2 ].z = 0.;
176 p [ 3 ].x = ( FPNum ) this->giveNode(4)->giveCoordinate(1);
177 p [ 3 ].y = ( FPNum ) this->giveNode(4)->giveCoordinate(2);
178 p [ 3 ].z = 0.;
179
180 go = CreateQuad3D(p);
181 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
182 EGAttachObject(go, ( EObjectP ) this);
183 EMAddGraphicsToModel(ESIModel(), go);
184}
185
186
187void Q4Axisymm :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
188{
189 WCRec p [ 4 ];
190 GraphicObj *go;
191 double defScale = gc.getDefScale();
192
193 if ( !gc.testElementGraphicActivity(this) ) {
194 return;
195 }
196
197 EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
198 EASValsSetColor( gc.getDeformedElementColor() );
199 EASValsSetEdgeColor( gc.getElementEdgeColor() );
200 EASValsSetEdgeFlag(true);
201 EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
202 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
203 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
204 p [ 0 ].z = 0.;
205 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
206 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
207 p [ 1 ].z = 0.;
208 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
209 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
210 p [ 2 ].z = 0.;
211 p [ 3 ].x = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(1, tStep, defScale);
212 p [ 3 ].y = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(2, tStep, defScale);
213 p [ 3 ].z = 0.;
214
215 go = CreateQuad3D(p);
216 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
217 EMAddGraphicsToModel(ESIModel(), go);
218}
219
220#endif
221} // end namespace oofem
#define N(a, b)
#define REGISTER_Element(class)
AxisymElement(int n, Domain *d)
Node * giveNode(int i) const
Definition element.h:629
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
int numberOfGaussPoints
Definition element.h:175
virtual int giveNumberOfDofManagers() const
Definition element.h:695
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
int number
Component number.
Definition femcmpnn.h:77
double & at(Index i)
Definition floatarray.h:202
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void zero()
Zeroes all coefficient of receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
double at(std::size_t i, std::size_t j) const
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
static FEI2dQuadQuadAxi interp
Definition q4axisymm.h:59
static ParamKey IPK_Q4Axisymm_nipfish
Definition q4axisymm.h:61
int numberOfFiAndShGaussPoints
Definition q4axisymm.h:60
FEInterpolation * giveInterpolation() const override
Definition q4axisymm.C:76
ZZNodalRecoveryModelInterface(Element *element)
Constructor.
@ ZZNodalRecoveryModelInterfaceType
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_DEFORMED_GEOMETRY_LAYER
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_LAYER
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)

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