OOFEM 3.0
Loading...
Searching...
No Matches
intelline2.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
37#include "gausspoint.h"
39#include "floatmatrix.h"
40#include "floatarray.h"
41#include "intarray.h"
42#include "fei2dlinequad.h"
43#include "fei2dlinelin.h"
44#include "classfactory.h"
45#include "parametermanager.h"
46#include "paramkey.h"
47
48#ifdef __OOFEG
49 #include "oofeggraphiccontext.h"
50 #include <Emarkwd3d.h>
51#endif
52
53namespace oofem {
55
56FEI2dLineQuad IntElLine2 :: interp(2, 2);
57FEI2dLineLin IntElLine2 :: interpLin(1, 1);
58
60
61
62IntElLine2 :: IntElLine2(int n, Domain *aDomain) : IntElLine1(n, aDomain)
63{
66 linear = false;
67}
68
69
70void
71IntElLine2 :: computeNmatrixAt(GaussPoint *ip, FloatMatrix &answer)
72{
73 // Returns the modified N-matrix which multiplied with u give the spatial jump.
75 answer.resize(2, 12);
76 answer.zero();
77
78 if ( linear ) {
80
81 answer.at(1, 1) = answer.at(2, 2) = -N.at(1);
82 answer.at(1, 3) = answer.at(2, 4) = -N.at(2);
83 //answer.at(1, 5) = answer.at(2, 6) = -N.at(3);
84
85 answer.at(1, 7) = answer.at(2, 8) = N.at(1);
86 answer.at(1, 9) = answer.at(2, 10) = N.at(2);
87 //answer.at(1, 11) = answer.at(2, 12) = N.at(3);
88 } else {
90
91 answer.at(1, 1) = answer.at(2, 2) = -N.at(1);
92 answer.at(1, 3) = answer.at(2, 4) = -N.at(2);
93 answer.at(1, 5) = answer.at(2, 6) = -N.at(3);
94
95 answer.at(1, 7) = answer.at(2, 8) = N.at(1);
96 answer.at(1, 9) = answer.at(2, 10) = N.at(2);
97 answer.at(1, 11) = answer.at(2, 12) = N.at(3);
98 }
99}
100
101
102void
103IntElLine2 :: computeGaussPoints()
104{
105 if ( integrationRulesArray.size() == 0 ) {
106 integrationRulesArray.resize( 1 );
107 //integrationRulesArray[ 0 ] = std::make_unique<LobattoIntegrationRule>(1,domain, 1, 2); ///@todo - should be able to decide
108 integrationRulesArray [ 0 ] = std::make_unique<GaussIntegrationRule>(1, this, 1, 2);
109 integrationRulesArray [ 0 ]->SetUpPointsOnLine(numberOfGaussPoints, _2dInterface);
110 }
111}
112
114IntElLine2 :: giveInterpolation() const
115{
116 return & interp;
117}
118
119
120void
121IntElLine2 :: initializeFrom(InputRecord &ir, int priority)
122{
123 IntElLine1 :: initializeFrom(ir, priority);
124 ParameterManager &ppm = domain->elementPPM;
126}
127
128
129
130#ifdef __OOFEG
131void IntElLine2 :: drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
132{
133 GraphicObj *go;
134 // if (!go) { // create new one
135 WCRec p [ 2 ]; /* poin */
136 if ( !gc.testElementGraphicActivity(this) ) {
137 return;
138 }
139
140 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
141 EASValsSetColor( gc.getElementColor() );
142 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
143 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
144 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
145 p [ 0 ].z = 0.0;
146 p [ 1 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
147 p [ 1 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
148 p [ 1 ].z = 0.0;
149 go = CreateLine3D(p);
150 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
151 EGAttachObject(go, ( EObjectP ) this);
152 EMAddGraphicsToModel(ESIModel(), go);
153 p [ 0 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
154 p [ 0 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
155 p [ 0 ].z = 0.0;
156 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
157 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
158 p [ 1 ].z = 0.0;
159 go = CreateLine3D(p);
160 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
161 EGAttachObject(go, ( EObjectP ) this);
162 EMAddGraphicsToModel(ESIModel(), go);
163}
164
165
166void IntElLine2 :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
167{
168 GraphicObj *go;
169 // if (!go) { // create new one
170 WCRec p [ 2 ]; /* poin */
171 if ( !gc.testElementGraphicActivity(this) ) {
172 return;
173 }
174
175 double defScale = gc.getDefScale();
176
177 EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
178 EASValsSetColor( gc.getDeformedElementColor() );
179 EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER + 1);
180 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
181 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
182 p [ 0 ].z = 0.0;
183 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
184 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
185 p [ 1 ].z = 0.0;
186 go = CreateLine3D(p);
187 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
188 EMAddGraphicsToModel(ESIModel(), go);
189
190 p [ 0 ].x = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(1, tStep, defScale);
191 p [ 0 ].y = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(2, tStep, defScale);
192 p [ 0 ].z = 0.0;
193 p [ 1 ].x = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(1, tStep, defScale);
194 p [ 1 ].y = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(2, tStep, defScale);
195 p [ 1 ].z = 0.0;
196 go = CreateLine3D(p);
197 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
198 EMAddGraphicsToModel(ESIModel(), go);
199}
200
201
202void IntElLine2 :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
203{
204 int indx, result = 0;
206 FloatArray gcoord(3), v1;
207 WCRec p [ 1 ];
208 GraphicObj *go;
209 double val [ 1 ];
210
211 if ( !gc.testElementGraphicActivity(this) ) {
212 return;
213 }
214
215 if ( gc.giveIntVarMode() == ISM_recovered ) {
216 return;
217 }
218
219 for ( GaussPoint *gp: *iRule ) {
220 result = 0;
221 result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
222 if ( result != 1 ) {
223 continue;
224 }
225
226 indx = gc.giveIntVarIndx();
227
228 result += this->computeGlobalCoordinates( gcoord, gp->giveNaturalCoordinates() );
229
230 p [ 0 ].x = ( FPNum ) gcoord.at(1);
231 p [ 0 ].y = ( FPNum ) gcoord.at(2);
232 p [ 0 ].z = 0.;
233
234 val [ 0 ] = v1.at(indx);
235 gc.updateFringeTableMinMax(val, 1);
236 //if (val[0] > 0.) {
237
238 EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
239 EASValsSetMType(FILLED_CIRCLE_MARKER);
240 go = CreateMarkerWD3D(p, val [ 0 ]);
241 EGWithMaskChangeAttributes(LAYER_MASK | FILL_MASK | MTYPE_MASK, go);
242 EMAddGraphicsToModel(ESIModel(), go);
243 //}
244 }
245}
246
247#endif
248
249
250} // end namespace oofem
#define N(a, b)
#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
int numberOfGaussPoints
Definition element.h:175
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
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.
double at(std::size_t i, std::size_t j) const
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
IntElLine1(int n, Domain *d)
Definition intelline1.C:63
static FEI2dLineQuad interp
Definition intelline2.h:56
static ParamKey IPK_IntElLine2_LinearTraction
Definition intelline2.h:59
bool linear
If linear interpolation should be used.
Definition intelline2.h:85
static FEI2dLineLin interpLin
Definition intelline2.h:57
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords) 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