OOFEM 3.0
Loading...
Searching...
No Matches
intelsurftr1.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
55FEI3dTrLin IntElSurfTr1 :: interpolation;
56
57IntElSurfTr1 :: IntElSurfTr1(int n, Domain *aDomain) :
59{
61}
62
63
64void
65IntElSurfTr1 :: 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, 18);
73 answer.zero();
74
75 answer.at(1, 10) = answer.at(2, 11) = answer.at(3, 12) = N.at(1);
76 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = -N.at(1);
77
78 answer.at(1, 13) = answer.at(2, 14) = answer.at(3, 15) = N.at(2);
79 answer.at(1, 4) = answer.at(2, 5) = answer.at(3, 6) = -N.at(2);
80
81 answer.at(1, 16) = answer.at(2, 17) = answer.at(3, 18) = N.at(3);
82 answer.at(1, 7) = answer.at(2, 8) = answer.at(3, 9) = -N.at(3);
83}
84
85
86void
87IntElSurfTr1 :: computeGaussPoints()
88{
89 // Sets up the array of Gauss Points of the receiver.
90 if ( integrationRulesArray.size() == 0 ) {
91 integrationRulesArray.resize(1);
92 //integrationRulesArray[0] = std::make_unique<LobattoIntegrationRule>(1,domain, 1, 2);
93 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this, 1, 3);
94 integrationRulesArray [ 0 ]->setUpIntegrationPoints(_Triangle, 4, _3dInterface);
95 }
96}
97
98
99void
100IntElSurfTr1 :: computeCovarBaseVectorsAt(IntegrationPoint *ip, FloatArray &G1, FloatArray &G2)
101{
102 FloatMatrix dNdxi;
103 this->interpolation.evaldNdxi( dNdxi, ip->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
104 G1.resize(3);
105 G2.resize(3);
106 G1.zero();
107 G2.zero();
108
109 FloatArray meanNode;
110 int numNodes = this->giveNumberOfNodes();
111 for ( int i = 1; i <= dNdxi.giveNumberOfRows(); i++ ) {
112 meanNode = 0.5 * ( this->giveNode(i)->giveCoordinates() + this->giveNode(i + numNodes / 2)->giveCoordinates() );
113 G1 += dNdxi.at(i, 1) * meanNode;
114 G2 += dNdxi.at(i, 2) * meanNode;
115 }
116}
117
118
119double
120IntElSurfTr1 :: computeAreaAround(IntegrationPoint *ip)
121{
122 FloatArray G1, G2, G3;
123 this->computeCovarBaseVectorsAt(ip, G1, G2);
124 double weight = ip->giveWeight();
125 G3.beVectorProductOf(G1, G2);
126 return G3.computeNorm() * weight;
127}
128
129void
130IntElSurfTr1 :: giveDofManDofIDMask(int inode, IntArray &answer) const
131{
132 answer = { D_u, D_v, D_w };
133}
134
135#if 0
136bool
137IntElSurfTr1 :: computeGtoLRotationMatrix(FloatMatrix &answer)
138{
139 FloatMatrix lcs;
140 computeTransformationMatrixAt(this->giveDefaultIntegrationRulePtr()->getIntegrationPoint(0), lcs);
141 answer.resize(18, 18);
142 for ( int i = 0; i < 6; i++ ) {
143 for ( int j = 1; j <= 3; j++ ) {
144 answer.at(i * 3 + 1, i * 3 + j) = lcs.at(3, j);
145 answer.at(i * 3 + 2, i * 3 + j) = lcs.at(1, j);
146 answer.at(i * 3 + 3, i * 3 + j) = lcs.at(2, j);
147 }
148 }
149
150
151 return 1;
152}
153#endif
154
155void
156IntElSurfTr1 :: computeTransformationMatrixAt(GaussPoint *gp, FloatMatrix &answer)
157{
158 // Transformation matrix to the local coordinate system
159 FloatArray G1, G2, Normal;
160 this->computeCovarBaseVectorsAt(gp, G1, G2);
161 Normal.beVectorProductOf(G1, G2);
162 Normal.normalize();
163 answer.beLocalCoordSys(Normal);
164}
165
166
167
168int
169IntElSurfTr1 :: computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
170{
171 FloatArray N, meanNode;
172 this->interpolation.evalN( N, lcoords, FEIElementGeometryWrapper(this) );
173 answer.resize(3);
174 answer.zero();
175 for ( int i = 1; i <= 3; i++ ) {
176 meanNode = 0.5 * ( this->giveNode(i)->giveCoordinates() + this->giveNode(i + 3)->giveCoordinates() );
177 answer += N.at(i) * meanNode;
178 }
179
180 return 1;
181}
182
183
184bool
185IntElSurfTr1 :: computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
186{
187 OOFEM_ERROR("Not implemented");
188 //return false;
189}
190
192#ifdef __OOFEG
193void IntElSurfTr1 :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
194{
195 GraphicObj *go;
196 // if (!go) { // create new one
197 WCRec p [ 3 ]; /* triangle */
198 if ( !gc.testElementGraphicActivity(this) ) {
199 return;
200 }
201
202 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
203 EASValsSetColor( gc.getElementColor() );
204 EASValsSetEdgeColor( gc.getElementEdgeColor() );
205 EASValsSetEdgeFlag(true);
206 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
207 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
208 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
209 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);
210 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
211 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
212 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);
213 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
214 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
215 p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveCoordinate(3);
216
217 go = CreateTriangle3D(p);
218 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
219 EGAttachObject(go, ( EObjectP ) this);
220 EMAddGraphicsToModel(ESIModel(), go);
221}
222
223
224void IntElSurfTr1 :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
225{ }
226
227
228void IntElSurfTr1 :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
229{ }
230
231#endif
232} // 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
virtual void computeCovarBaseVectorsAt(IntegrationPoint *ip, FloatArray &G1, FloatArray &G2)
static FEI3dTrLin interpolation
#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