OOFEM 3.0
Loading...
Searching...
No Matches
intelsurfquad1.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 "node.h"
37#include "crosssection.h"
38#include "gausspoint.h"
40#include "floatmatrix.h"
41#include "floatarray.h"
42#include "intarray.h"
43#include "mathfem.h"
44#include "classfactory.h"
45
46#ifdef __OOFEG
47 #include "oofeggraphiccontext.h"
48
49 #include <Emarkwd3d.h>
50#endif
51
52namespace oofem {
54
55FEI3dQuadLin IntElSurfQuad1 :: interpolation;
56
57IntElSurfQuad1 :: IntElSurfQuad1(int n, Domain *aDomain) :
59{
61}
62
63
64void
65IntElSurfQuad1 :: computeNmatrixAt(GaussPoint *ip, FloatMatrix &answer)
66{
67 // Returns the modified N-matrix which multiplied with u give the spatial jump.
68
71
72 answer.resize(3, 24);
73 answer.zero();
74
75 answer.at(1, 13) = answer.at(2, 14) = answer.at(3, 15) = N.at(1);
76 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = -N.at(1);
77
78 answer.at(1, 16) = answer.at(2, 17) = answer.at(3, 18) = N.at(2);
79 answer.at(1, 4) = answer.at(2, 5) = answer.at(3, 6) = -N.at(2);
80
81 answer.at(1, 19) = answer.at(2, 20) = answer.at(3, 21) = N.at(3);
82 answer.at(1, 7) = answer.at(2, 8) = answer.at(3, 9) = -N.at(3);
83
84 answer.at(1, 22) = answer.at(2, 23) = answer.at(3, 24) = N.at(4);
85 answer.at(1, 10) = answer.at(2, 11) = answer.at(3, 12) = -N.at(4);
86}
87
88
89void
90IntElSurfQuad1 :: computeGaussPoints()
91{
92 // Sets up the array of Gauss Points of the receiver.
93 if ( integrationRulesArray.size() == 0 ) {
94 integrationRulesArray.resize(1);
95 //integrationRulesArray[0] = std::make_unique<LobattoIntegrationRule>(1,domain, 1, 2);
96 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this, 1, 3);
97 integrationRulesArray [ 0 ]->setUpIntegrationPoints(_Square, 4, _3dInterface);
98 }
99}
100
101
102void
103IntElSurfQuad1 :: computeCovarBaseVectorsAt(IntegrationPoint *ip, FloatArray &G1, FloatArray &G2)
104{
105 FloatMatrix dNdxi;
106 this->interpolation.evaldNdxi( dNdxi, ip->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
107 G1.resize(3);
108 G2.resize(3);
109 G1.zero();
110 G2.zero();
111
112 FloatArray meanNode;
113 int numNodes = this->giveNumberOfNodes();
114 for ( int i = 1; i <= dNdxi.giveNumberOfRows(); i++ ) {
115 meanNode = 0.5 * ( this->giveNode(i)->giveCoordinates() + this->giveNode(i + numNodes / 2)->giveCoordinates() );
116 G1 += dNdxi.at(i, 1) * meanNode;
117 G2 += dNdxi.at(i, 2) * meanNode;
118 }
119}
120
121
122double
123IntElSurfQuad1 :: computeAreaAround(IntegrationPoint *ip)
124{
125 FloatArray G1, G2, G3;
126 this->computeCovarBaseVectorsAt(ip, G1, G2);
127 double weight = ip->giveWeight();
128 G3.beVectorProductOf(G1, G2);
129 return G3.computeNorm() * weight;
130}
131
132void
133IntElSurfQuad1 :: giveDofManDofIDMask(int inode, IntArray &answer) const
134{
135 answer = { D_u, D_v, D_w };
136}
137
138#if 0
139bool
140IntElSurfQuad1 :: computeGtoLRotationMatrix(FloatMatrix &answer)
141{
142 FloatMatrix lcs;
143 computeTransformationMatrixAt(this->giveDefaultIntegrationRulePtr()->getIntegrationPoint(0), lcs);
144 answer.resize(18, 18);
145 for ( int i = 0; i < 6; i++ ) {
146 for ( int j = 1; j <= 3; j++ ) {
147 answer.at(i * 3 + 1, i * 3 + j) = lcs.at(3, j);
148 answer.at(i * 3 + 2, i * 3 + j) = lcs.at(1, j);
149 answer.at(i * 3 + 3, i * 3 + j) = lcs.at(2, j);
150 }
151 }
152
153
154 return 1;
155}
156#endif
157
158void
159IntElSurfQuad1 :: computeTransformationMatrixAt(GaussPoint *gp, FloatMatrix &answer)
160{
161 // Transformation matrix to the local coordinate system
162 FloatArray G1, G2, Normal;
163 this->computeCovarBaseVectorsAt(gp, G1, G2);
164 Normal.beVectorProductOf(G1, G2);
165 Normal.normalize();
166 answer.beLocalCoordSys(Normal);
167}
168
169
170
171int
172IntElSurfQuad1 :: computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
173{
174 FloatArray N, meanNode;
175 this->interpolation.evalN( N, lcoords, FEIElementGeometryWrapper(this) );
176 answer.resize(3);
177 answer.zero();
178 for ( int i = 1; i <= 4; i++ ) {
179 meanNode = 0.5 * ( this->giveNode(i)->giveCoordinates() + this->giveNode(i + 3)->giveCoordinates() );
180 answer += N.at(i) * meanNode;
181 }
182
183 return 1;
184}
185
186
187bool
188IntElSurfQuad1 :: computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
189{
190 OOFEM_ERROR("Not implemented");
191 //return false;
192}
193
195#ifdef __OOFEG
196void IntElSurfQuad1 :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
197{
198 GraphicObj *go;
199 // if (!go) { // create new one
200 WCRec p [ 3 ]; /* triangle */
201 if ( !gc.testElementGraphicActivity(this) ) {
202 return;
203 }
204
205 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
206 EASValsSetColor( gc.getElementColor() );
207 EASValsSetEdgeColor( gc.getElementEdgeColor() );
208 EASValsSetEdgeFlag(true);
209 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
210 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
211 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
212 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);
213 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
214 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
215 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);
216 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
217 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
218 p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveCoordinate(3);
219
220 go = CreateTriangle3D(p);
221 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
222 EGAttachObject(go, ( EObjectP ) this);
223 EMAddGraphicsToModel(ESIModel(), go);
224}
225
226
227void IntElSurfQuad1 :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
228{ }
229
230
231void IntElSurfQuad1 :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
232{ }
233
234#endif
235} // end namespace oofem
#define N(a, b)
#define REGISTER_Element(class)
Node * giveNode(int i) const
Definition element.h:629
virtual int giveNumberOfNodes() const
Definition element.h:703
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
double computeNorm() const
Definition floatarray.C:861
void resize(Index s)
Definition floatarray.C:94
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Definition floatarray.C:476
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void zero()
Zeroes all coefficient of receiver.
void beLocalCoordSys(const FloatArray &normal)
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
double giveWeight()
Returns integration weight of receiver.
Definition gausspoint.h:180
static FEI3dQuadLin interpolation
virtual void computeCovarBaseVectorsAt(IntegrationPoint *ip, FloatArray &G1, FloatArray &G2)
#define OOFEM_ERROR(...)
Definition error.h:79
GaussPoint IntegrationPoint
Definition gausspoint.h:272
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#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