OOFEM 3.0
Loading...
Searching...
No Matches
cct.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
38#include "fei2dtrlin.h"
39#include "node.h"
40#include "material.h"
41#include "crosssection.h"
42#include "gausspoint.h"
44#include "floatmatrix.h"
45#include "floatarray.h"
46#include "intarray.h"
47#include "load.h"
48#include "mathfem.h"
49#include "classfactory.h"
50
51#ifdef __OOFEG
52 #include "oofeggraphiccontext.h"
53#endif
54
55namespace oofem {
57
59//FEI2dTrRot CCTPlate :: interp_rot(1, 2);
60
70
71
74
75
78{
79 if ( id == D_w ) {
80 return & interp_lin;
81 } else {
82 return NULL; //&interp_rot;
83 }
84}
85
86
87void
89// Sets up the array containing the four Gauss points of the receiver.
90{
91 if ( integrationRulesArray.size() == 0 ) {
92 integrationRulesArray.resize(1);
93 integrationRulesArray [ 0 ] = std::make_unique< GaussIntegrationRule >(1, this, 1, 5);
95 }
96}
97
98
99void
100CCTPlate::computeBodyLoadVectorAt(FloatArray &answer, Load *forLoad, TimeStep *tStep, ValueModeType mode)
101// Computes numerically the load vector of the receiver due to the body loads, at tStep.
102// load is assumed to be in global cs.
103// load vector is then transformed to coordinate system in each node.
104// (should be global coordinate system, but there may be defined
105// different coordinate system in each node)
106{
107 FloatArray force;
108 FloatMatrix T;
109
110 if ( ( forLoad->giveBCGeoType() != BodyLoadBGT ) || ( forLoad->giveBCValType() != ForceLoadBVT ) ) {
111 OOFEM_ERROR("unknown load type");
112 }
113
114 GaussIntegrationRule irule(1, this, 1, 5);
115 irule.SetUpPointsOnTriangle(1, _2dPlate);
116
117 // note: force is assumed to be in global coordinate system.
118 forLoad->computeComponentArrayAt(force, tStep, mode);
119
120 if ( force.giveSize() ) {
121 GaussPoint *gp = irule.getIntegrationPoint(0);
122 // constant density and thickness assumed
123 double dens = this->giveStructuralCrossSection()->give('d', gp);
124 double dV = this->computeVolumeAround(gp) * this->giveCrossSection()->give(CS_Thickness, gp);
125
126 answer.resize(9);
127 answer.zero();
128
129 double load = force.at(1) * dens * dV / 3.0;
130 answer.at(1) = load;
131 answer.at(4) = load;
132 answer.at(7) = load;
133
134 // transform result from global cs to local element cs.
135 if ( this->computeGtoLRotationMatrix(T) ) {
136 answer.rotatedWith(T, 'n');
137 }
138 } else {
139 answer.clear(); // nil resultant
140 }
141}
142
143
144void
146// Returns the [5x9] strain-displacement matrix {B} of the receiver,
147// evaluated at gp.
148{
149 // get node coordinates
150 double x1, x2, x3, y1, y2, y3, z1, z2, z3;
151 this->giveNodeCoordinates(x1, x2, x3, y1, y2, y3, z1, z2, z3);
152
153 //
154 double area, b1, b2, b3, c1, c2, c3, l1, l2, l3;
155
156 b1 = y2 - y3;
157 b2 = y3 - y1;
158 b3 = y1 - y2;
159
160 c1 = x3 - x2;
161 c2 = x1 - x3;
162 c3 = x2 - x1;
163
164 l1 = 1. / 3.;
165 l2 = 1. / 3.;
166 l3 = 1. / 3.;
167
168 area = this->computeArea();
169
170 answer.resize(5, 9);
171 answer.zero();
172
173 answer.at(1, 3) = b1;
174 answer.at(1, 6) = b2;
175 answer.at(1, 9) = b3;
176
177 answer.at(2, 2) = -c1;
178 answer.at(2, 5) = -c2;
179 answer.at(2, 8) = -c3;
180
181 answer.at(3, 2) = -b1;
182 answer.at(3, 3) = c1;
183 answer.at(3, 5) = -b2;
184 answer.at(3, 6) = c2;
185 answer.at(3, 8) = -b3;
186 answer.at(3, 9) = c3;
187
188 answer.at(4, 1) = b1;
189 answer.at(4, 2) = ( -b1 * b3 * l2 + b1 * b2 * l3 ) * 0.5;
190 answer.at(4, 3) = ( -b1 * c3 * l2 - b2 * c3 * l1 + b3 * c2 * l1 + b1 * c2 * l3 ) * 0.5 + l1 * 2. * area;
191 answer.at(4, 4) = b2;
192 answer.at(4, 5) = ( -b2 * b1 * l3 + b2 * b3 * l1 ) * 0.5;
193 answer.at(4, 6) = ( -b2 * c1 * l3 - b3 * c1 * l2 + b1 * c3 * l2 + b2 * c3 * l1 ) * 0.5 + l2 * 2. * area;
194 answer.at(4, 7) = b3;
195 answer.at(4, 8) = ( -b3 * b2 * l1 + b3 * b1 * l2 ) * 0.5;
196 answer.at(4, 9) = ( -b3 * c2 * l1 - b1 * c2 * l3 + b2 * c1 * l3 + b3 * c1 * l2 ) * 0.5 + l3 * 2. * area;
197
198 answer.at(5, 1) = c1;
199 answer.at(5, 2) = ( -b3 * c1 * l2 - b3 * c2 * l1 + b2 * c3 * l1 + b2 * c1 * l3 ) * 0.5 - l1 * 2. * area;
200 answer.at(5, 3) = ( -c1 * c3 * l2 + c1 * c2 * l3 ) * 0.5;
201 answer.at(5, 4) = c2;
202 answer.at(5, 5) = ( -b1 * c2 * l3 - b1 * c3 * l2 + b3 * c1 * l2 + b3 * c2 * l1 ) * 0.5 - l2 * 2. * area;
203 answer.at(5, 6) = ( -c2 * c1 * l3 + c2 * c3 * l1 ) * 0.5;
204 answer.at(5, 7) = c3;
205 answer.at(5, 8) = ( -b2 * c3 * l1 - b2 * c1 * l3 + b1 * c2 * l3 + b1 * c3 * l2 ) * 0.5 - l3 * 2. * area;
206 answer.at(5, 9) = ( -c3 * c2 * l1 + c3 * c1 * l2 ) * 0.5;
207
208 answer.times(1. / ( 2. * area ) );
209}
210
211
212void
214// Returns the [3x9] displacement interpolation matrix {N} of the receiver,
215// evaluated at gp.
216{
217 // get node coordinates
218 double x1, x2, x3, y1, y2, y3, z1, z2, z3;
219 this->giveNodeCoordinates(x1, x2, x3, y1, y2, y3, z1, z2, z3);
220
221 //
222 double l1, l2, l3, b1, b2, b3, c1, c2, c3;
223
224 b1 = y2 - y3;
225 b2 = y3 - y1;
226 b3 = y1 - y2;
227
228 c1 = x3 - x2;
229 c2 = x1 - x3;
230 c3 = x2 - x1;
231
232 l1 = iLocCoord.at(1);
233 l2 = iLocCoord.at(2);
234 l3 = 1.0 - l1 - l2;
235
236 //
237 answer.resize(3, 9);
238 answer.zero();
239
240 answer.at(1, 1) = l1;
241 answer.at(1, 2) = l1 * ( l2 * b3 - l3 * b2 ) * 0.5;
242 answer.at(1, 3) = l1 * ( l2 * c3 - l3 * c2 ) * 0.5;
243 answer.at(1, 4) = l2;
244 answer.at(1, 5) = l2 * ( l3 * b1 - l1 * b3 ) * 0.5;
245 answer.at(1, 6) = l2 * ( l3 * c1 - l1 * c3 ) * 0.5;
246 answer.at(1, 7) = l3;
247 answer.at(1, 8) = l3 * ( l1 * b2 - l2 * b1 ) * 0.5;
248 answer.at(1, 9) = l3 * ( l1 * c2 - l2 * c1 ) * 0.5;
249
250 answer.at(2, 2) = l1;
251 answer.at(2, 5) = l2;
252 answer.at(2, 8) = l3;
253
254 answer.at(3, 3) = l1;
255 answer.at(3, 6) = l2;
256 answer.at(3, 9) = l3;
257}
258
259
260void
262{
263 answer = this->giveStructuralCrossSection()->giveGeneralizedStress_Plate(strain, gp, tStep);
264}
265
266
267void
268CCTPlate::computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
269{
270 answer = this->giveStructuralCrossSection()->give2dPlateStiffMtrx(rMode, gp, tStep);
271}
272
273
274void
275CCTPlate::giveNodeCoordinates(double &x1, double &x2, double &x3,
276 double &y1, double &y2, double &y3,
277 double &z1, double &z2, double &z3)
278{
279 const auto &nc1 = this->giveNode(1)->giveCoordinates();
280 const auto &nc2 = this->giveNode(2)->giveCoordinates();
281 const auto &nc3 = this->giveNode(3)->giveCoordinates();
282
283 x1 = nc1.at(1);
284 x2 = nc2.at(1);
285 x3 = nc3.at(1);
286
287 y1 = nc1.at(2);
288 y2 = nc2.at(2);
289 y3 = nc3.at(2);
290
291 z1 = nc1.at(3);
292 z2 = nc2.at(3);
293 z3 = nc3.at(3);
294}
295
296double
298// returns the area occupied by the receiver
299{
300 // get node coordinates
301 double x1, x2, x3, y1, y2, y3, z1, z2, z3;
302 this->giveNodeCoordinates(x1, x2, x3, y1, y2, y3, z1, z2, z3);
303
304 if ( area > 0 ) {
305 return area; // check if previously computed
306 }
307 return ( area = 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 ) );
308}
309
310void
312{
314}
315
316
317void
319{
320 answer = { D_w, R_u, R_v };
321}
322
323
324void
326// returns normal vector to midPlane in GaussPoinr gp of receiver
327{
328 FloatArray u, v;
329 u.beDifferenceOf(this->giveNode(2)->giveCoordinates(), this->giveNode(1)->giveCoordinates() );
330 v.beDifferenceOf(this->giveNode(3)->giveCoordinates(), this->giveNode(1)->giveCoordinates() );
331
332 answer.beVectorProductOf(u, v);
333 answer.normalize();
334}
335
336
337double
339// returns receiver's characteristic length (for crack band models)
340// for a crack formed in the plane with normal normalToCrackPlane.
341{
342 return this->giveCharacteristicLengthForPlaneElements(normalToCrackPlane);
343}
344
345
346double
348// Returns the portion of the receiver which is attached to gp.
349{
350 double detJ, weight;
351
352 std::vector< FloatArray >lc = { FloatArray(3), FloatArray(3), FloatArray(3) };
353 this->giveNodeCoordinates( lc [ 0 ].at(1), lc [ 1 ].at(1), lc [ 2 ].at(1),
354 lc [ 0 ].at(2), lc [ 1 ].at(2), lc [ 2 ].at(2),
355 lc [ 0 ].at(3), lc [ 1 ].at(3), lc [ 2 ].at(3) );
356
357 weight = gp->giveWeight();
358 detJ = fabs(this->interp_lin.giveTransformationJacobian(gp->giveNaturalCoordinates(), FEIVertexListGeometryWrapper(lc, this->interp_lin.giveGeometryType()) ) );
359 return detJ * weight;
360}
361
362
363void
365// Returns the lumped mass matrix of the receiver.
366{
367 answer.resize(9, 9);
368 answer.zero();
369
370 double mass = 0.0;
372 if ( iRule ) {
373 for ( GaussPoint *gp: * iRule ) {
374 mass += this->computeVolumeAround(gp) * this->giveStructuralCrossSection()->give('d', gp) * this->giveCrossSection()->give(CS_Thickness, gp);
375 }
376 }
377 double mass3 = mass / 3.0;
378
379 answer.at(1, 1) = mass3;
380 answer.at(4, 4) = mass3;
381 answer.at(7, 7) = mass3;
382}
383
384
385Interface *
387{
388 if ( interface == LayeredCrossSectionInterfaceType ) {
389 return static_cast< LayeredCrossSectionInterface * >( this );
390 } else if ( interface == ZZNodalRecoveryModelInterfaceType ) {
391 return static_cast< ZZNodalRecoveryModelInterface * >( this );
392 } else if ( interface == NodalAveragingRecoveryModelInterfaceType ) {
393 return static_cast< NodalAveragingRecoveryModelInterface * >( this );
394 } else if ( interface == SPRNodalRecoveryModelInterfaceType ) {
395 return static_cast< SPRNodalRecoveryModelInterface * >( this );
396 } else if ( interface == ZZErrorEstimatorInterfaceType ) {
397 return static_cast< ZZErrorEstimatorInterface * >( this );
398 }
399
400
401 return NULL;
402}
403
404
405#define POINT_TOL 1.e-3
406
407bool
409//converts global coordinates to local planar area coordinates,
410//does not return a coordinate in the thickness direction, but
411//does check that the point is in the element thickness
412{
413 // get node coordinates
414 double x1, x2, x3, y1, y2, y3, z1, z2, z3;
415 this->giveNodeCoordinates(x1, x2, x3, y1, y2, y3, z1, z2, z3);
416
417 // Fetch local coordinates.
418 bool ok = this->interp_lin.global2local(answer, coords, FEIElementGeometryWrapper(this) ) > 0;
419
420 //get midplane location at this point
421 double midplZ;
422 midplZ = z1 * answer.at(1) + z2 * answer.at(2) + z3 * answer.at(3);
423
424 //check that the z is within the element
425 GaussPoint _gp(NULL, 1, answer, 1.0, _2dPlate);
427 double elthick = cs->give(CS_Thickness, & _gp);
428
429 if ( elthick / 2.0 + midplZ - fabs(coords.at(3) ) < -POINT_TOL ) {
430 answer.zero();
431 return false;
432 }
433
434 //check that the point is in the element and set flag
435 for ( int i = 1; i <= 3; i++ ) {
436 if ( answer.at(i) < ( 0. - POINT_TOL ) ) {
437 return false;
438 }
439
440 if ( answer.at(i) > ( 1. + POINT_TOL ) ) {
441 return false;
442 }
443 }
444
445 return ok;
446}
447
448
449int
451{
452 FloatArray help;
453 answer.resize(6);
454 if ( type == IST_ShellForceTensor || type == IST_ShellStrainTensor ) {
455 if ( type == IST_ShellForceTensor ) {
456 help = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveStressVector();
457 } else {
458 help = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveStrainVector();
459 }
460 answer.at(1) = 0.0; // nx
461 answer.at(2) = 0.0; // ny
462 answer.at(3) = 0.0; // nz
463 answer.at(4) = help.at(5); // vyz
464 answer.at(5) = help.at(4); // vxz
465 answer.at(6) = 0.0; // vxy
466 return 1;
467 } else if ( type == IST_ShellMomentTensor || type == IST_CurvatureTensor ) {
468 if ( type == IST_ShellMomentTensor ) {
469 help = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveStressVector();
470 } else {
471 help = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveStrainVector();
472 }
473 answer.at(1) = help.at(1); // mx
474 answer.at(2) = help.at(2); // my
475 answer.at(3) = 0.0; // mz
476 answer.at(4) = 0.0; // myz
477 answer.at(5) = 0.0; // mxz
478 answer.at(6) = help.at(3); // mxy
479 return 1;
480 } else {
481 return StructuralElement::giveIPValue(answer, gp, type, tStep);
482 }
483}
484
485void
487 InternalStateType type, TimeStep *tStep)
488{
489 GaussPoint *gp;
490 if ( ( type == IST_ShellForceTensor ) || ( type == IST_ShellMomentTensor ) ||
491 ( type == IST_ShellStrainTensor ) || ( type == IST_CurvatureTensor ) ) {
492 gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
493 this->giveIPValue(answer, gp, type, tStep);
494 } else {
495 answer.clear();
496 }
497}
498
499
500void
502{
503 pap.resize(3);
504 pap.at(1) = this->giveNode(1)->giveNumber();
505 pap.at(2) = this->giveNode(2)->giveNumber();
506 pap.at(3) = this->giveNode(3)->giveNumber();
507}
508
509
510void
512{
513 answer.resize(1);
514 if ( ( pap == this->giveNode(1)->giveNumber() ) ||
515 ( pap == this->giveNode(2)->giveNumber() ) ||
516 ( pap == this->giveNode(3)->giveNumber() ) ) {
517 answer.at(1) = pap;
518 } else {
519 OOFEM_ERROR("node unknown");
520 }
521}
522
523
529
530
531//
532// layered cross section support functions
533//
534void
536 GaussPoint *masterGp, GaussPoint *slaveGp, TimeStep *tStep)
537// returns full 3d strain vector of given layer (whose z-coordinate from center-line is
538// stored in slaveGp) for given tStep
539{
540 double layerZeta, layerZCoord, top, bottom;
541
542 top = this->giveCrossSection()->give(CS_TopZCoord, masterGp);
543 bottom = this->giveCrossSection()->give(CS_BottomZCoord, masterGp);
544 layerZeta = slaveGp->giveNaturalCoordinate(3);
545 layerZCoord = 0.5 * ( ( 1. - layerZeta ) * bottom + ( 1. + layerZeta ) * top );
546
547 answer.resize(5); // {Exx,Eyy,GMyz,GMzx,GMxy}
548
549 answer.at(1) = masterGpStrain.at(1) * layerZCoord;
550 answer.at(2) = masterGpStrain.at(2) * layerZCoord;
551 answer.at(5) = masterGpStrain.at(3) * layerZCoord;
552 answer.at(3) = masterGpStrain.at(5);
553 answer.at(4) = masterGpStrain.at(4);
554}
555
556// Edge load support
557/*
558 * void
559 * CCTPlate :: computeEgdeNMatrixAt(FloatMatrix &answer, int iedge, GaussPoint *gp)
560 * {
561 * IntArray edgeNodes;
562 * FloatArray n;
563 * double b, c, n12;
564 *
565 * this->interp_lin.edgeEvalN( n, iedge, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
566 * this->interp_lin.computeLocalEdgeMapping(edgeNodes, iedge);
567 *
568 * n12 = 0.5 * n.at(1) * n.at(2);
569 * b = this->giveNode( edgeNodes.at(1) )->giveCoordinate(2) - this->giveNode( edgeNodes.at(2) )->giveCoordinate(2);
570 * c = this->giveNode( edgeNodes.at(2) )->giveCoordinate(1) - this->giveNode( edgeNodes.at(1) )->giveCoordinate(1);
571 *
572 *
573 * answer.resize(3, 6);
574 * answer.at(1, 1) = n.at(1);
575 * answer.at(1, 2) = n12 * b;
576 * answer.at(1, 3) = n12 * c;
577 * answer.at(1, 4) = n.at(2);
578 * answer.at(1, 5) = -n12 * b;
579 * answer.at(1, 6) = -n12 * c;
580 * //
581 * answer.at(2, 2) = answer.at(3, 3) = n.at(1);
582 * answer.at(2, 5) = answer.at(3, 6) = n.at(2);
583 * }
584 */
585
586void
587CCTPlate::giveEdgeDofMapping(IntArray &answer, int iEdge) const
588{
589 /*
590 * provides dof mapping of local edge dofs (only nonzero are taken into account)
591 * to global element dofs
592 */
593
594 answer.resize(6);
595 if ( iEdge == 1 ) { // edge between nodes 1,2
596 answer.at(1) = 1;
597 answer.at(2) = 2;
598 answer.at(3) = 3;
599 answer.at(4) = 4;
600 answer.at(5) = 5;
601 answer.at(6) = 6;
602 } else if ( iEdge == 2 ) { // edge between nodes 2 3
603 answer.at(1) = 4;
604 answer.at(2) = 5;
605 answer.at(3) = 6;
606 answer.at(4) = 7;
607 answer.at(5) = 8;
608 answer.at(6) = 9;
609 } else if ( iEdge == 3 ) { // edge between nodes 3 1
610 answer.at(1) = 7;
611 answer.at(2) = 8;
612 answer.at(3) = 9;
613 answer.at(4) = 1;
614 answer.at(5) = 2;
615 answer.at(6) = 3;
616 } else {
617 OOFEM_ERROR("wrong edge number");
618 }
619}
620
621double
623{
624 double detJ = this->interp_lin.edgeGiveTransformationJacobian(iEdge, gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) );
625 return detJ * gp->giveWeight();
626}
627
628
629int
631{
632 // returns transformation matrix from
633 // edge local coordinate system
634 // to element local c.s
635 // (same as global c.s in this case)
636 //
637 // i.e. f(element local) = T * f(edge local)
638 //
639 const auto &edgeNodes = this->interp_lin.computeLocalEdgeMapping(iEdge);
640
641 auto nodeA = this->giveNode(edgeNodes.at(1) );
642 auto nodeB = this->giveNode(edgeNodes.at(2) );
643
644 double dx = nodeB->giveCoordinate(1) - nodeA->giveCoordinate(1);
645 double dy = nodeB->giveCoordinate(2) - nodeA->giveCoordinate(2);
646 double length = sqrt(dx * dx + dy * dy);
647
648 answer.resize(3, 3);
649 answer.zero();
650 answer.at(1, 1) = 1.0;
651 answer.at(2, 2) = dx / length;
652 answer.at(2, 3) = -dy / length;
653 answer.at(3, 2) = dy / length;
654 answer.at(3, 3) = dx / length;
655
656 return 1;
657}
658
659
660void
661CCTPlate::computeSurfaceNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords)
662{
663 if ( boundaryID == 1 ) {
664 this->computeNmatrixAt(lcoords, answer);
665 } else {
666 OOFEM_ERROR("computeSurfaceNMatrix: Unsupported surface id");
667 }
668}
669
670
671
672//
673// io routines
674//
675#ifdef __OOFEG
676void
678{
679 WCRec p[ 3 ];
680 GraphicObj *go;
681
682 if ( !gc.testElementGraphicActivity(this) ) {
683 return;
684 }
685
686 if ( this->isActivated(tStep) ) {
687 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
688 EASValsSetColor(gc.getElementColor() );
689 EASValsSetEdgeColor(gc.getElementEdgeColor() );
690 EASValsSetEdgeFlag(true);
691 EASValsSetFillStyle(FILL_SOLID);
692 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
693 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
694 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
695 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);
696 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
697 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
698 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);
699 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveCoordinate(1);
700 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveCoordinate(2);
701 p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveCoordinate(3);
702
703 go = CreateTriangle3D(p);
704 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
705 EGAttachObject(go, ( EObjectP ) this);
706 EMAddGraphicsToModel(ESIModel(), go);
707 }
708}
709
710
711void
713{
714 WCRec p[ 3 ];
715 GraphicObj *go;
716 double defScale = gc.getDefScale();
717
718 if ( !gc.testElementGraphicActivity(this) ) {
719 return;
720 }
721
722 if ( this->isActivated(tStep) ) {
723 EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
724 EASValsSetColor(gc.getDeformedElementColor() );
725 EASValsSetEdgeColor(gc.getElementEdgeColor() );
726 EASValsSetEdgeFlag(true);
727 EASValsSetFillStyle(FILL_SOLID);
728 EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
729 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
730 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
731 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);
732 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
733 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
734 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(3, tStep, defScale);
735 p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
736 p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
737 p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(3, tStep, defScale);
738
739 go = CreateTriangle3D(p);
740 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
741 EMAddGraphicsToModel(ESIModel(), go);
742 }
743}
744
745
746void
748{
749 int i, indx, result = 0;
750 WCRec p[ 3 ];
751 GraphicObj *tr;
752 FloatArray v1, v2, v3;
753 double s[ 3 ], defScale;
754
755 if ( !gc.testElementGraphicActivity(this) ) {
756 return;
757 }
758
759 if ( !this->isActivated(tStep) ) {
760 return;
761 }
762
763 if ( gc.giveIntVarMode() == ISM_recovered ) {
764 result += this->giveInternalStateAtNode(v1, gc.giveIntVarType(), gc.giveIntVarMode(), 1, tStep);
765 result += this->giveInternalStateAtNode(v2, gc.giveIntVarType(), gc.giveIntVarMode(), 2, tStep);
766 result += this->giveInternalStateAtNode(v3, gc.giveIntVarType(), gc.giveIntVarMode(), 3, tStep);
767 } else if ( gc.giveIntVarMode() == ISM_local ) {
768 GaussPoint *gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
769 result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
770 v2 = v1;
771 v3 = v1;
772 result *= 3;
773 }
774
775 if ( result != 3 ) {
776 return;
777 }
778
779 indx = gc.giveIntVarIndx();
780
781 s [ 0 ] = v1.at(indx);
782 s [ 1 ] = v2.at(indx);
783 s [ 2 ] = v3.at(indx);
784
785 EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
786
787 if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
788 for ( i = 0; i < 3; i++ ) {
789 if ( gc.getInternalVarsDefGeoFlag() ) {
790 // use deformed geometry
791 defScale = gc.getDefScale();
792 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
793 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
794 p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
795 } else {
796 p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
797 p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
798 p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
799 }
800 }
801
802 //EASValsSetColor(gc.getYieldPlotColor(ratio));
803 gc.updateFringeTableMinMax(s, 3);
804 tr = CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
805 EGWithMaskChangeAttributes(LAYER_MASK, tr);
806 EMAddGraphicsToModel(ESIModel(), tr);
807 }
808}
809
810#endif
811} // end namespace oofem
double length(const Vector &a)
Definition CSG.h:88
#define REGISTER_Element(class)
FEInterpolation * giveInterpolation() const override
Definition cct.C:73
void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep) override
Definition cct.C:677
void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int=1, int=ALL_STRAINS) override
Definition cct.C:145
double computeArea() override
Definition cct.C:297
void giveEdgeDofMapping(IntArray &answer, int iEdge) const override
Definition cct.C:587
bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords) override
Definition cct.C:408
void computeLumpedMassMatrix(FloatMatrix &answer, TimeStep *tStep) override
Definition cct.C:364
void giveDofManDofIDMask(int inode, IntArray &) const override
Definition cct.C:318
void computeStrainVectorInLayer(FloatArray &answer, const FloatArray &masterGpStrain, GaussPoint *masterGp, GaussPoint *slaveGp, TimeStep *tStep) override
Definition cct.C:535
void computeSurfaceNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords) override
Definition cct.C:661
Interface * giveInterface(InterfaceType it) override
Definition cct.C:386
void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type) override
Definition cct.C:712
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
Definition cct.C:450
void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) override
Definition cct.C:268
double area
Definition cct.h:67
void computeMidPlaneNormal(FloatArray &answer, const GaussPoint *gp) override
Definition cct.C:325
CCTPlate(int n, Domain *d)
Definition cct.C:61
static FEI2dTrLin interp_lin
Definition cct.h:64
void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode) override
Definition cct.C:100
void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep) override
Definition cct.C:261
double giveCharacteristicLength(const FloatArray &normalToCrackPlane) override
Definition cct.C:338
double computeEdgeVolumeAround(GaussPoint *gp, int iEdge) override
Definition cct.C:622
void initializeFrom(InputRecord &ir, int priority) override
Definition cct.C:311
int computeLoadLEToLRotationMatrix(FloatMatrix &answer, int iEdge, GaussPoint *gp) override
Definition cct.C:630
SPRPatchType SPRNodalRecoveryMI_givePatchType() override
Definition cct.C:525
void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer) override
Definition cct.C:213
virtual void giveNodeCoordinates(double &x1, double &x2, double &x3, double &y1, double &y2, double &y3, double &z1, double &z2, double &z3)
Definition cct.C:275
void NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node, InternalStateType type, TimeStep *tStep) override
Definition cct.C:486
void SPRNodalRecoveryMI_giveDofMansDeterminedByPatch(IntArray &answer, int pap) override
Definition cct.C:511
void SPRNodalRecoveryMI_giveSPRAssemblyPoints(IntArray &pap) override
Definition cct.C:501
void drawScalar(oofegGraphicContext &gc, TimeStep *tStep) override
Definition cct.C:747
void computeGaussPoints() override
Definition cct.C:88
double computeVolumeAround(GaussPoint *gp) override
Definition cct.C:347
virtual double give(CrossSectionProperty a, GaussPoint *gp) const
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
double giveCoordinate(int i) const
Definition dofmanager.h:383
const FloatArray & giveCoordinates() const
Definition dofmanager.h:390
Node * giveNode(int i) const
Definition element.h:629
virtual bool computeGtoLRotationMatrix(FloatMatrix &answer)
Definition element.C:1710
virtual bool isActivated(TimeStep *tStep)
Definition element.C:838
void initializeFrom(InputRecord &ir, int priority) override
Definition element.C:687
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
double giveCharacteristicLengthForPlaneElements(const FloatArray &normalToCrackPlane)
Definition element.C:1188
CrossSection * giveCrossSection()
Definition element.C:534
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
int giveNumber() const
Definition femcmpnn.h:104
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Definition floatarray.C:403
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void rotatedWith(FloatMatrix &r, char mode)
Definition floatarray.C:814
void beVectorProductOf(const FloatArray &v1, const FloatArray &v2)
Definition floatarray.C:476
void times(double f)
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
int SetUpPointsOnTriangle(int nPoints, MaterialMode mode) override
double giveNaturalCoordinate(int i) const
Returns i-th natural element coordinate of receiver.
Definition gausspoint.h:136
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
Definition gausspoint.h:204
double giveWeight()
Returns integration weight of receiver.
Definition gausspoint.h:180
virtual bcGeomType giveBCGeoType() const
void resize(int n)
Definition intarray.C:73
int & at(std::size_t i)
Definition intarray.h:104
GaussPoint * getIntegrationPoint(int n)
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Definition load.C:84
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Definition node.C:234
virtual FloatMatrixF< 5, 5 > give2dPlateStiffMtrx(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const =0
virtual FloatArrayF< 5 > giveGeneralizedStress_Plate(const FloatArrayF< 5 > &generalizedStrain, GaussPoint *gp, TimeStep *tStep) const =0
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
StructuralElement(int n, Domain *d)
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
int giveInternalStateAtNode(FloatArray &answer, InternalStateType type, InternalStateMode mode, int node, TimeStep *tStep) override
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver's strain vector.
const FloatArray & giveStressVector() const
Returns the const pointer to receiver's stress vector.
ZZErrorEstimatorInterface(Element *element)
Constructor.
ZZNodalRecoveryModelInterface(Element *element)
Constructor.
#define OOFEM_ERROR(...)
Definition error.h:79
#define POINT_TOL
@ CS_BottomZCoord
Bottom z coordinate.
@ CS_Thickness
Thickness.
@ CS_TopZCoord
Top z coordinate.
@ BodyLoadBGT
Distributed body load.
Definition bcgeomtype.h:43
@ ForceLoadBVT
Definition bcvaltype.h:43
@ SPRNodalRecoveryModelInterfaceType
@ ZZNodalRecoveryModelInterfaceType
@ LayeredCrossSectionInterfaceType
@ ZZErrorEstimatorInterfaceType
@ NodalAveragingRecoveryModelInterfaceType
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

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