OOFEM 3.0
Loading...
Searching...
No Matches
interfaceelem3dtrlin.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
35
37#include "fei2dtrlin.h"
38#include "node.h"
39#include "gausspoint.h"
41#include "floatmatrix.h"
42#include "floatmatrixf.h"
43#include "floatarray.h"
44#include "floatarrayf.h"
45#include "intarray.h"
46#include "mathfem.h"
48#include "classfactory.h"
49
50#ifdef __OOFEG
51 #include "oofeggraphiccontext.h"
52
53 #include <Emarkwd3d.h>
54#endif
55
56namespace oofem {
58
59FEI2dTrLin InterfaceElement3dTrLin :: interpolation(1, 2);
60
61InterfaceElement3dTrLin :: InterfaceElement3dTrLin(int n, Domain *aDomain) :
62 StructuralElement(n, aDomain)
63{
65}
66
67
68void
69InterfaceElement3dTrLin :: computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int li, int ui)
70//
71// Returns linear part of geometrical equations of the receiver at gp.
72// Returns the linear part of the B matrix
73//
74{
75 FloatArray n;
77
78 answer.resize(3, 18);
79 answer.zero();
80
81 answer.at(1, 10) = answer.at(2, 11) = answer.at(3, 12) = n.at(1);
82 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = -n.at(1);
83
84 answer.at(1, 13) = answer.at(2, 14) = answer.at(3, 15) = n.at(2);
85 answer.at(1, 4) = answer.at(2, 5) = answer.at(3, 6) = -n.at(2);
86
87 answer.at(1, 16) = answer.at(2, 17) = answer.at(3, 18) = n.at(3);
88 answer.at(1, 7) = answer.at(2, 8) = answer.at(3, 9) = -n.at(3);
89}
90
91
92void
93InterfaceElement3dTrLin :: computeGaussPoints()
94// Sets up the array of Gauss Points of the receiver.
95{
96 if ( integrationRulesArray.size() == 0 ) {
97 integrationRulesArray.resize( 1 );
98 //integrationRulesArray[0] = std::make_unique<LobattoIntegrationRule>(1,domain, 1, 2);
99 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this, 1, 3);
100 integrationRulesArray [ 0 ]->SetUpPointsOnTriangle(4, _3dInterface);
101 }
102}
103
104
105int
106InterfaceElement3dTrLin :: computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
107{
108 FloatArray n;
109
110 this->interpolation.evalN( n, lcoords, FEIElementGeometryWrapper(this) );
111
112 answer.resize(3);
113 answer.zero();
114 for ( int i = 1; i <= 3; i++ ) {
115 answer.at(1) += n.at(i) * this->giveNode(i)->giveCoordinate(1);
116 answer.at(2) += n.at(i) * this->giveNode(i)->giveCoordinate(2);
117 answer.at(3) += n.at(i) * this->giveNode(i)->giveCoordinate(3);
118 }
119
120 return 1;
121}
122
123
124bool
125InterfaceElement3dTrLin :: computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
126{
127 OOFEM_ERROR("Not implemented");
128 //return false;
129}
130
131
132double
133InterfaceElement3dTrLin :: computeVolumeAround(GaussPoint *gp)
134// Returns the length of the receiver. This method is valid only if 1
135// Gauss point is used.
136{
137 double determinant, weight, thickness, volume;
138 // first compute local nodal coordinates in element plane
139 std::vector< FloatArray > lncp(3);
140 FloatMatrix lcs(3, 3);
141 this->computeLCS(lcs);
142 for ( int i = 1; i <= 3; i++ ) {
143 lncp[ i - 1 ].beProductOf(lcs, this->giveNode(i)->giveCoordinates());
144 }
145
146 determinant = fabs( this->interpolation.giveTransformationJacobian( gp->giveNaturalCoordinates(), FEIVertexListGeometryWrapper(lncp, this->giveGeometryType()) ) );
147 weight = gp->giveWeight();
148 thickness = this->giveCrossSection()->give(CS_Thickness, gp);
149 volume = determinant * weight * thickness;
150
151 return volume;
152}
153
154
155void
156InterfaceElement3dTrLin :: computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
157{
158 answer = static_cast< StructuralInterfaceCrossSection* >(this->giveCrossSection())->giveEngTraction_3d(strain, gp, tStep);
159}
160
161
162void
163InterfaceElement3dTrLin :: computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
164{
165 answer = static_cast< StructuralInterfaceCrossSection* >(this->giveCrossSection())->give3dStiffnessMatrix_Eng(rMode, gp, tStep);
166}
167
168
169void
170InterfaceElement3dTrLin :: giveDofManDofIDMask(int inode, IntArray &answer) const
171{
172 answer = {D_u, D_v, D_w};
173}
174
175
176void
177InterfaceElement3dTrLin :: computeLCS(FloatMatrix &answer)
178{
179 // computes local coordinate system unit vectors (expressed in global cs)
180 // unit vectors are stored rowwise
181 FloatArray xl(3), yl(3), zl(3), t2(3);
182
183 // compute local x-axis xl (node(2)-node(1))
184 xl.at(1) = this->giveNode(2)->giveCoordinate(1) - this->giveNode(1)->giveCoordinate(1);
185 xl.at(2) = this->giveNode(2)->giveCoordinate(2) - this->giveNode(1)->giveCoordinate(2);
186 xl.at(3) = this->giveNode(2)->giveCoordinate(3) - this->giveNode(1)->giveCoordinate(3);
187
188 xl.normalize();
189
190 // compute another in-plane tangent vector t2 (node(3)-node(1))
191 t2.at(1) = this->giveNode(3)->giveCoordinate(1) - this->giveNode(1)->giveCoordinate(1);
192 t2.at(2) = this->giveNode(3)->giveCoordinate(2) - this->giveNode(1)->giveCoordinate(2);
193 t2.at(3) = this->giveNode(3)->giveCoordinate(3) - this->giveNode(1)->giveCoordinate(3);
194
195 // compute local z axis as product of xl and t2
196 zl.beVectorProductOf(xl, t2);
197 zl.normalize();
198
199 // compute local y axis as product of zl x xl
200 yl.beVectorProductOf(zl, xl);
201
202 answer.resize(3, 3);
203 for ( int i = 1; i <= 3; i++ ) {
204 answer.at(1, i) = xl.at(i);
205 answer.at(2, i) = yl.at(i);
206 answer.at(3, i) = zl.at(i);
207 }
208}
209
210
211bool
212InterfaceElement3dTrLin :: computeGtoLRotationMatrix(FloatMatrix &answer)
213{
214 // planar geometry is assumed
215 FloatMatrix lcs(3, 3);
216 this->computeLCS(lcs);
217
218 answer.resize(18, 18);
219 for ( int i = 0; i < 6; i++ ) {
220 for ( int j = 1; j <= 3; j++ ) {
221 answer.at(i * 3 + 1, i * 3 + j) = lcs.at(3, j);
222 answer.at(i * 3 + 2, i * 3 + j) = lcs.at(1, j);
223 answer.at(i * 3 + 3, i * 3 + j) = lcs.at(2, j);
224 }
225 }
226
227 return 1;
228}
229
230
231#ifdef __OOFEG
232void InterfaceElement3dTrLin :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
233{
234 GraphicObj *go;
235 // if (!go) { // create new one
236 WCRec p [ 3 ]; /* triangle */
237 if ( !gc.testElementGraphicActivity(this) ) {
238 return;
239 }
240
241 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
242 EASValsSetColor( gc.getElementColor() );
243 EASValsSetEdgeColor( gc.getElementEdgeColor() );
244 EASValsSetEdgeFlag(true);
245 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
246 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
247 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
248 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);
249 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
250 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
251 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);
252 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
253 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
254 p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveCoordinate(3);
255
256 go = CreateTriangle3D(p);
257 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
258 EGAttachObject(go, ( EObjectP ) this);
259 EMAddGraphicsToModel(ESIModel(), go);
260}
261
262
263void InterfaceElement3dTrLin :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
264{ }
265
266
267void InterfaceElement3dTrLin :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
268{ }
269
270#endif
271} // end namespace oofem
#define REGISTER_Element(class)
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
CrossSection * giveCrossSection()
Definition element.C:534
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
void zero()
Zeroes all coefficient 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
Element_Geometry_Type giveGeometryType() const override
void computeLCS(FloatMatrix &answer)
StructuralElement(int n, Domain *d)
#define OOFEM_ERROR(...)
Definition error.h:79
@ CS_Thickness
Thickness.
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