OOFEM 3.0
Loading...
Searching...
No Matches
interfaceelem2dlin.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#include "interfaceelem2dlin.h"
36#include "node.h"
37#include "gausspoint.h"
39#include "floatmatrix.h"
40#include "floatmatrixf.h"
41#include "floatarray.h"
42#include "floatarrayf.h"
43#include "intarray.h"
44#include "mathfem.h"
45#include "fei2dlinelin.h"
47#include "classfactory.h"
48#include "parametermanager.h"
49#include "paramkey.h"
50
51#ifdef __OOFEG
52 #include "oofeggraphiccontext.h"
53 #include <Emarkwd3d.h>
54#endif
55
56namespace oofem {
59
60FEI2dLineLin InterfaceElem2dLin :: interp(1, 2);
61
62
63InterfaceElem2dLin :: InterfaceElem2dLin(int n, Domain *aDomain) :
64 StructuralElement(n, aDomain)
65{
67 axisymmode = false;
68}
69
70
71void
72InterfaceElem2dLin :: computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int li, int ui)
73//
74// Returns linear part of geometrical equations of the receiver at gp.
75// Returns the linear part of the B matrix
76//
77{
78 FloatArray n;
79 this->interp.evalN (n, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this));
80
81 answer.resize(2, 8);
82 answer.zero();
83
84 answer.at(1, 2) = answer.at(2, 1) = -n.at(1);
85 answer.at(1, 4) = answer.at(2, 3) = -n.at(2);
86
87 answer.at(1, 6) = answer.at(2, 5) = n.at(1);
88 answer.at(1, 8) = answer.at(2, 7) = n.at(2);
89}
90
91
92void
93InterfaceElem2dLin :: 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<GaussIntegrationRule>(1, this, 1, 2);
99 integrationRulesArray [ 0 ]->SetUpPointsOnLine(2, _2dInterface);
100 }
101}
102
103
104double
105InterfaceElem2dLin :: computeVolumeAround(GaussPoint *gp)
106// Returns the length of the receiver. This method is valid only if 1
107// Gauss point is used.
108{
109 double r = 1.0;
110 if (this->axisymmode) {
111 FloatArray n(2);
112 this->interp.evalN( n, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
113 r = n.at(1)*this->giveNode(1)->giveCoordinate(1) + n.at(2)*this->giveNode(2)->giveCoordinate(1);
114 }
115
116
117 double result = this->interp.giveTransformationJacobian(gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this));
118 return result * gp->giveWeight() * r;
119}
120
121
122void
123InterfaceElem2dLin :: computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
124{
125 answer = static_cast< StructuralInterfaceCrossSection* >(this->giveCrossSection())->giveEngTraction_2d(strain, gp, tStep);
126}
127
128
129void
130InterfaceElem2dLin :: computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
131{
132 answer = static_cast< StructuralInterfaceCrossSection* >(this->giveCrossSection())->give2dStiffnessMatrix_Eng(rMode, gp, tStep);
133}
134
135
136void
137InterfaceElem2dLin :: initializeFrom(InputRecord &ir, int priority)
138{
139 ParameterManager &ppm = this->giveDomain()->elementPPM;
141 StructuralElement :: initializeFrom(ir, priority);
142}
143
144
145void
146InterfaceElem2dLin :: giveDofManDofIDMask(int inode, IntArray &answer) const
147{
148 answer = {D_u, D_v};
149}
150
151
152bool
153InterfaceElem2dLin :: computeGtoLRotationMatrix(FloatMatrix &answer)
154{
155 FloatArray grad(2);
156
157 // tangent
158 grad.at(1) = this->giveNode(2)->giveCoordinate(1) - this->giveNode(1)->giveCoordinate(1);
159 grad.at(2) = this->giveNode(2)->giveCoordinate(2) - this->giveNode(1)->giveCoordinate(2);
160 grad.normalize();
161
162 answer.resize(8, 8);
163 for ( int i = 0; i < 4; i++ ) {
164 answer.at(i * 2 + 1, i * 2 + 1) = grad.at(1);
165 answer.at(i * 2 + 1, i * 2 + 2) = grad.at(2);
166 answer.at(i * 2 + 2, i * 2 + 1) = -grad.at(2);
167 answer.at(i * 2 + 2, i * 2 + 2) = grad.at(1);
168 }
169
170 return 1;
171}
172
173
175InterfaceElem2dLin :: giveInterpolation() const
176{
177 return & interp;
178}
179
180#ifdef __OOFEG
181void InterfaceElem2dLin :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
182{
183 GraphicObj *go;
184 // if (!go) { // create new one
185 WCRec p [ 2 ]; /* poin */
186 if ( !gc.testElementGraphicActivity(this) ) {
187 return;
188 }
189
190 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
191 EASValsSetColor( gc.getElementColor() );
192 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
193 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
194 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
195 p [ 0 ].z = 0.0;
196 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
197 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
198 p [ 1 ].z = 0.0;
199 go = CreateLine3D(p);
200 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
201 EGAttachObject(go, ( EObjectP ) this);
202 EMAddGraphicsToModel(ESIModel(), go);
203}
204
205
206void InterfaceElem2dLin :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
207{
208 GraphicObj *go;
209 // if (!go) { // create new one
210 WCRec p [ 2 ]; /* poin */
211 if ( !gc.testElementGraphicActivity(this) ) {
212 return;
213 }
214
215 double defScale = gc.getDefScale();
216
217 EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
218 EASValsSetColor( gc.getDeformedElementColor() );
219 EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER + 1);
220 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
221 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
222 p [ 0 ].z = 0.0;
223 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
224 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
225 p [ 1 ].z = 0.0;
226 go = CreateLine3D(p);
227 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
228 EMAddGraphicsToModel(ESIModel(), go);
229
230 p [ 0 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
231 p [ 0 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
232 p [ 0 ].z = 0.0;
233 p [ 1 ].x = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(1, tStep, defScale);
234 p [ 1 ].y = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(2, tStep, defScale);
235 p [ 1 ].z = 0.0;
236 go = CreateLine3D(p);
237 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
238 EMAddGraphicsToModel(ESIModel(), go);
239}
240
241
242void InterfaceElem2dLin :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
243{
244 int indx, result = 0;
245 FloatArray gcoord(3), v1;
246 WCRec p [ 1 ];
247 GraphicObj *go;
248 double val [ 1 ];
249
250 if ( !gc.testElementGraphicActivity(this) ) {
251 return;
252 }
253
254 if ( gc.giveIntVarMode() == ISM_recovered ) {
255 return;
256 }
257
258 for ( GaussPoint *gp: *this->giveDefaultIntegrationRulePtr() ) {
259 result = 0;
260 result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
261 if ( result != 1 ) {
262 continue;
263 }
264
265 indx = gc.giveIntVarIndx();
266
267 result += this->computeGlobalCoordinates( gcoord, gp->giveNaturalCoordinates() );
268
269 p [ 0 ].x = ( FPNum ) gcoord.at(1);
270 p [ 0 ].y = ( FPNum ) gcoord.at(2);
271 p [ 0 ].z = 0.;
272
273 val [ 0 ] = v1.at(indx);
274 gc.updateFringeTableMinMax(val, 1);
275 //if (val[0] > 0.) {
276
277 EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
278 EASValsSetMType(FILLED_CIRCLE_MARKER);
279 go = CreateMarkerWD3D(p, val [ 0 ]);
280 EGWithMaskChangeAttributes(LAYER_MASK | FILL_MASK | MTYPE_MASK, go);
281 EMAddGraphicsToModel(ESIModel(), go);
282 //}
283 }
284}
285
286#endif
287} // end namespace oofem
#define REGISTER_Element(class)
Node * giveNode(int i) const
Definition element.h:629
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Definition element.C:1225
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
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
Domain * giveDomain() const
Definition femcmpnn.h:97
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.
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 ParamKey IPK_InterfaceElem2dLin_axisymmode
bool axisymmode
Flag controlling axisymmetric mode (integration over unit circumferential angle).
StructuralElement(int n, Domain *d)
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
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
#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