OOFEM 3.0
Loading...
Searching...
No Matches
libeam3dnl.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 "node.h"
39#include "material.h"
40#include "gausspoint.h"
42#include "floatmatrix.h"
43#include "intarray.h"
44#include "floatarray.h"
45#include "mathfem.h"
46#include "timestep.h"
47#include "classfactory.h"
48#include "parametermanager.h"
49#include "paramkey.h"
50
51#ifdef __OOFEG
52 #include "oofeggraphiccontext.h"
53#endif
54
55namespace oofem {
58
59LIBeam3dNL::LIBeam3dNL(int n, Domain *aDomain) : NLStructuralElement(n, aDomain), tc(3, 3), tempTc(3, 3) //, kappa (3)
60{
62 l0 = 0.;
63 tempTcCounter = 0;
64 referenceNode = 0;
65 // init kappa vector at centre
66 // kappa.zero();
67}
68
69
70void
72{
73 if ( vec.giveSize() != 3 ) {
74 OOFEM_ERROR("vec param size mismatch");
75 }
76
77 answer.resize(3, 3);
78
79 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = 0.;
80 answer.at(1, 2) = -vec.at(3);
81 answer.at(1, 3) = vec.at(2);
82 answer.at(2, 1) = vec.at(3);
83 answer.at(2, 3) = -vec.at(1);
84 answer.at(3, 1) = -vec.at(2);
85 answer.at(3, 2) = vec.at(1);
86}
87
88
89void
91{
92 FloatMatrix S(3, 3), SS(3, 3);
93 double psiSize;
94
95 if ( psi.giveSize() != 3 ) {
96 OOFEM_ERROR("psi param size mismatch");
97 }
98
99 answer.resize(3, 3);
100 answer.zero();
101
102 psiSize = psi.computeNorm();
103 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = 1.;
104
105 if ( psiSize <= 1.e-40 ) {
106 return;
107 }
108
109 this->computeSMtrx(S, psi);
110 SS.beProductOf(S, S);
111 S.times(sin(psiSize) / psiSize);
112 SS.times( ( 1. - cos(psiSize) ) / ( psiSize * psiSize ) );
113
114 answer.add(S);
115 answer.add(SS);
116}
117
118
119void
121{
122 // test if not previously done
123 if ( tStep->giveSolutionStateCounter() == tempTcCounter ) {
124 return;
125 }
126
127 FloatArray u, centreSpin(3);
128 FloatMatrix dR(3, 3);
129
130 // ask element's displacement increments
131 this->computeVectorOf(VM_Incremental, tStep, u);
132
133 // interpolate spin at the centre
134 centreSpin.at(1) = 0.5 * ( u.at(4) + u.at(10) );
135 centreSpin.at(2) = 0.5 * ( u.at(5) + u.at(11) );
136 centreSpin.at(3) = 0.5 * ( u.at(6) + u.at(12) );
137
138 // compute rotation matrix from centreSpin pseudovector
139 this->computeRotMtrx(dR, centreSpin);
140
141 // update triad
142 tempTc.beProductOf(dR, tc);
143 // remember timestamp
145}
146
147
148void
150{
151 FloatArray xd(3), eps(3), curv(3);
152
153 // update temp triad
154 this->updateTempTriad(tStep);
155
156 this->computeXdVector(xd, tStep);
157
158 // compute eps_xl, gamma_l2, gamma_l3
159 eps.beTProductOf(tempTc, xd);
160 eps.times(1. / this->l0);
161 eps.at(1) -= 1.0;
162
163 // update curvature at midpoint
164 this->computeTempCurv(curv, tStep);
165
166 answer.resize(6);
167 answer.at(1) = eps.at(1); // eps_xl
168 answer.at(2) = eps.at(2); // gamma_l2
169 answer.at(3) = eps.at(3); // gamma_l3
170 answer.at(4) = curv.at(1); // kappa_1
171 answer.at(5) = curv.at(2); // kappa_2
172 answer.at(6) = curv.at(3); // kappa_3
173}
174
175
176void
178{
179 FloatArray xd(3);
180 FloatMatrix s(3, 3);
181
182 this->computeXdVector(xd, tStep);
183 this->computeSMtrx(s, xd);
184
185 answer.resize(12, 6);
186 answer.zero();
187
188 for ( int i = 1; i < 4; i++ ) {
189 answer.at(i, i) = -1.0;
190 answer.at(i + 6, i) = 1.0;
191 answer.at(i + 3, i + 3) = -1.0;
192 answer.at(i + 9, i + 3) = 1.0;
193
194 for ( int j = 1; j < 4; j++ ) {
195 answer.at(i + 3, j) = answer.at(i + 9, j) = 0.5 * s.at(j, i);
196 }
197 }
198}
199
200
201void
202LIBeam3dNL::giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
203{
205 FloatArray nm(6), stress, strain;
206 FloatMatrix x;
207 double s1, s2;
208
209 // update temp triad
210 this->updateTempTriad(tStep);
211
212 if ( useUpdatedGpRecord == 1 ) {
213 stress = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveStressVector();
214 } else {
215 this->computeStrainVector(strain, gp, tStep);
216 this->computeStressVector(stress, strain, gp, tStep);
217 }
218
219 for ( int i = 1; i <= 3; i++ ) {
220 s1 = s2 = 0.0;
221 for ( int j = 1; j <= 3; j++ ) {
222 s1 += tempTc.at(i, j) * stress.at(j);
223 s2 += tempTc.at(i, j) * stress.at(j + 3);
224 }
225
226 nm.at(i) = s1;
227 nm.at(i + 3) = s2;
228 }
229
230 this->computeXMtrx(x, tStep);
231 answer.beProductOf(x, nm);
232}
233
234
235void
237{
238 FloatArray u(3);
239
240 answer.resize(3);
241 // ask element's displacements
242 this->computeVectorOf(VM_Total, tStep, u);
243
244 answer.at(1) = ( this->giveNode(2)->giveCoordinate(1) + u.at(7) ) -
245 ( this->giveNode(1)->giveCoordinate(1) + u.at(1) );
246 answer.at(2) = ( this->giveNode(2)->giveCoordinate(2) + u.at(8) ) -
247 ( this->giveNode(1)->giveCoordinate(2) + u.at(2) );
248 answer.at(3) = ( this->giveNode(2)->giveCoordinate(3) + u.at(9) ) -
249 ( this->giveNode(1)->giveCoordinate(3) + u.at(3) );
250}
251
252
253void
254LIBeam3dNL::computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
255{
256 double s1, s2;
257 FloatMatrix d, x, xt(12, 6), dxt, sn, sm, sxd, y;
258 FloatArray n(3), m(3), xd(3), stress, strain;
260
261 answer.clear();
262
263 // linear part
264
265 this->updateTempTriad(tStep); // update temp triad
266 this->computeXMtrx(x, tStep);
267 xt.zero();
268 for ( int i = 1; i <= 12; i++ ) {
269 for ( int j = 1; j <= 3; j++ ) {
270 for ( int k = 1; k <= 3; k++ ) {
271 // compute x*Tbar, taking into account sparsity of Tbar
272 xt.at(i, j) += x.at(i, k) * tempTc.at(k, j);
273 xt.at(i, j + 3) += x.at(i, k + 3) * tempTc.at(k, j);
274 }
275 }
276 }
277
278 this->computeConstitutiveMatrixAt(d, rMode, gp, tStep);
279 dxt.beProductTOf(d, xt);
280 answer.beProductOf(xt, dxt);
281 answer.times(1. / this->l0);
282
283 // geometric stiffness ks = ks1+ks2
284 // ks1
285 this->computeStrainVector(strain, gp, tStep);
286 this->computeStressVector(stress, strain, gp, tStep);
287
288 for ( int i = 1; i <= 3; i++ ) {
289 s1 = s2 = 0.0;
290 for ( int j = 1; j <= 3; j++ ) {
291 s1 += tempTc.at(i, j) * stress.at(j);
292 s2 += tempTc.at(i, j) * stress.at(j + 3);
293 }
294
295 n.at(i) = s1;
296 m.at(i) = s2;
297 }
298
299 this->computeSMtrx(sn, n);
300 this->computeSMtrx(sm, m);
301
302 for ( int i = 1; i <= 3; i++ ) {
303 for ( int j = 1; j <= 3; j++ ) {
304 answer.at(i, j + 3) += sn.at(i, j);
305 answer.at(i, j + 9) += sn.at(i, j);
306 answer.at(i + 3, j + 3) += sm.at(i, j);
307 answer.at(i + 3, j + 9) += sm.at(i, j);
308
309 answer.at(i + 6, j + 3) -= sn.at(i, j);
310 answer.at(i + 6, j + 9) -= sn.at(i, j);
311 answer.at(i + 9, j + 3) -= sm.at(i, j);
312 answer.at(i + 9, j + 9) -= sm.at(i, j);
313 }
314 }
315
316 // ks2
317 this->computeXdVector(xd, tStep);
318 this->computeSMtrx(sxd, xd);
319
320 y.beProductOf(sxd, sn);
321 y.times(0.5);
322
323 for ( int i = 1; i <= 3; i++ ) {
324 for ( int j = 1; j <= 3; j++ ) {
325 answer.at(i + 3, j) -= sn.at(i, j);
326 answer.at(i + 3, j + 3) += y.at(i, j);
327 answer.at(i + 3, j + 6) += sn.at(i, j);
328 answer.at(i + 3, j + 9) += y.at(i, j);
329
330 answer.at(i + 9, j) -= sn.at(i, j);
331 answer.at(i + 9, j + 3) += y.at(i, j);
332 answer.at(i + 9, j + 6) += sn.at(i, j);
333 answer.at(i + 9, j + 9) += y.at(i, j);
334 }
335 }
336}
337
338
339void
341// Sets up the array of Gauss Points of the receiver.
342{
343 if ( integrationRulesArray.size() == 0 ) {
344 integrationRulesArray.resize(1);
345 integrationRulesArray [ 0 ] = std::make_unique< GaussIntegrationRule >(1, this, 1, 2);
347 }
348}
349
350
351void
353{
354 // first call parent
356 ParameterManager &ppm = this->giveDomain()->elementPPM;
358}
359
360void
362{
364 ParameterManager &ppm = this->giveDomain()->elementPPM;
366 if ( referenceNode == 0 ) {
367 OOFEM_ERROR("wrong reference node specified");
368 }
369 // compute initial triad at centre - requires nodal coordinates
370 FloatMatrix lcs;
371 this->giveLocalCoordinateSystem(lcs);
372 this->tc.beTranspositionOf(lcs);
373 this->nlGeometry = 0; // element always nonlinear, this is to force ouput in strains and stresses in GP (see structuralms.C)
374
375}
376
377double
379// Returns the original length (l0) of the receiver.
380{
381 double dx, dy, dz;
382 Node *nodeA, *nodeB;
383
384 if ( l0 == 0. ) {
385 nodeA = this->giveNode(1);
386 nodeB = this->giveNode(2);
387 dx = nodeB->giveCoordinate(1) - nodeA->giveCoordinate(1);
388 dy = nodeB->giveCoordinate(2) - nodeA->giveCoordinate(2);
389 dz = nodeB->giveCoordinate(3) - nodeA->giveCoordinate(3);
390 l0 = sqrt(dx * dx + dy * dy + dz * dz);
391 }
392
393 return l0;
394}
395
396
397void
399// Returns the lumped mass matrix of the receiver. This expression is
400// valid in both local and global axes.
401{
402 GaussPoint *gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
403 double density = this->giveStructuralCrossSection()->give('d', gp);
404 double halfMass = density * this->giveCrossSection()->give(CS_Area, gp) * this->computeLength() / 2.;
405 answer.resize(12, 12);
406 answer.zero();
407 answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = halfMass;
408 answer.at(7, 7) = answer.at(8, 8) = answer.at(9, 9) = halfMass;
409
410 double Irr, Iy, Iz;
411 Iy = this->giveCrossSection()->give(CS_InertiaMomentY, gp);
412 Iz = this->giveCrossSection()->give(CS_InertiaMomentZ, gp);
413 Irr = Iy + Iz;
414
415 halfMass = density * this->computeLength() / 2.;
416 answer.at(4, 4) = answer.at(10, 10) = Irr * halfMass;
417 answer.at(5, 5) = answer.at(11, 11) = Iy * halfMass;
418 answer.at(6, 6) = answer.at(12, 12) = Iz * halfMass;
419}
420
421
422void
424// Returns the displacement interpolation matrix {N} of the receiver, eva-
425// luated at gp.
426{
427 double ksi, n1, n2;
428
429 ksi = iLocCoord.at(1);
430 n1 = ( 1. - ksi ) * 0.5;
431 n2 = ( 1. + ksi ) * 0.5;
432
433 answer.resize(6, 12);
434 answer.zero();
435
436 // u
437 answer.at(1, 1) = n1;
438 answer.at(1, 7) = n2;
439 // v
440 answer.at(2, 2) = n1;
441 answer.at(2, 8) = n2;
442 // w
443 answer.at(3, 3) = n1;
444 answer.at(3, 9) = n2;
445 // fi_x
446 answer.at(4, 4) = n1;
447 answer.at(4, 10) = n2;
448 // fi_y
449 answer.at(5, 5) = n1;
450 answer.at(5, 11) = n2;
451 // fi_z
452 answer.at(6, 6) = n1;
453 answer.at(6, 12) = n2;
454}
455
456
457double
459// Returns the length of the receiver. This method is valid only if 1
460// Gauss point is used.
461{
462 double weight = gp->giveWeight();
463 return weight * 0.5 * this->computeLength();
464}
465
466
467int
469{
472 if ( type == IST_BeamForceMomentTensor ) {
473 answer = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveStressVector();
474 return 1;
475 } else if ( type == IST_BeamStrainCurvatureTensor ) {
476 answer = static_cast< StructuralMaterialStatus * >( gp->giveMaterialStatus() )->giveStrainVector();
477 return 1;
478 } else {
479 return StructuralElement::giveIPValue(answer, gp, type, tStep);
480 }
481}
482
483
484void
486{
487 answer = { D_u, D_v, D_w, R_u, R_v, R_w };
488}
489
490
491int
493{
494 double ksi, n1, n2;
495
496 ksi = lcoords.at(1);
497 n1 = ( 1. - ksi ) * 0.5;
498 n2 = ( 1. + ksi ) * 0.5;
499
500 answer.resize(3);
501 answer.at(1) = n1 * this->giveNode(1)->giveCoordinate(1) + n2 * this->giveNode(2)->giveCoordinate(1);
502 answer.at(2) = n1 * this->giveNode(1)->giveCoordinate(2) + n2 * this->giveNode(2)->giveCoordinate(2);
503 answer.at(3) = n1 * this->giveNode(1)->giveCoordinate(3) + n2 * this->giveNode(2)->giveCoordinate(3);
504
505 return 1;
506}
507
508
509void
510LIBeam3dNL::computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
511{
512 answer = this->giveStructuralCrossSection()->give3dBeamStiffMtrx(rMode, gp, tStep);
513}
514
515void
517{
518 OOFEM_ERROR("computeConstitutiveMatrix_dPdF_At Not implemented for libeam2dnl");
519}
520
521
522void
524{
525 answer = this->giveStructuralCrossSection()->giveGeneralizedStress_Beam3d(strain, gp, tStep);
526}
527
528
529void
531{
532 /*
533 * provides dof mapping of local edge dofs (only nonzero are taken into account)
534 * to global element dofs
535 */
536 if ( iEdge != 1 ) {
537 OOFEM_ERROR("wrong edge number");
538 }
539
540 answer.resize(12);
541 for ( int i = 1; i <= 12; i++ ) {
542 answer.at(i) = i;
543 }
544}
545
546
547double
549{
550 if ( iEdge != 1 ) { // edge between nodes 1 2
551 OOFEM_ERROR("wrong egde number");
552 }
553
554 double weight = gp->giveWeight();
555 return 0.5 * this->computeLength() * weight;
556}
557
558
559int
561//
562// returns a unit vectors of local coordinate system at element
563// stored rowwise (mainly used by some materials with ortho and anisotrophy)
564//
565{
566 FloatArray lx(3), ly(3), lz(3), help(3);
567 double length = this->computeLength();
568 Node *nodeA, *nodeB, *refNode;
569
570 answer.resize(3, 3);
571 answer.zero();
572 nodeA = this->giveNode(1);
573 nodeB = this->giveNode(2);
574 refNode = this->giveDomain()->giveNode(this->referenceNode);
575
576 for ( int i = 1; i <= 3; i++ ) {
577 lx.at(i) = ( nodeB->giveCoordinate(i) - nodeA->giveCoordinate(i) ) / length;
578 help.at(i) = ( refNode->giveCoordinate(i) - nodeA->giveCoordinate(i) );
579 }
580
581 lz.beVectorProductOf(lx, help);
582 lz.normalize();
583 ly.beVectorProductOf(lz, lx);
584 ly.normalize();
585
586 for ( int i = 1; i <= 3; i++ ) {
587 answer.at(1, i) = lx.at(i);
588 answer.at(2, i) = ly.at(i);
589 answer.at(3, i) = lz.at(i);
590 }
591
592 return 1;
593}
594
595
596/*
597 * int
598 * LIBeam3dNL :: computeGtoLRotationMatrix (FloatMatrix& answer)
599 * // Returns the rotation matrix of the receiver.
600 * // rotation matrix is computed for original configuration only
601 * {
602 * FloatMatrix lcs;
603 * int i,j;
604 *
605 * answer.resize(12,12);
606 * answer.zero();
607 *
608 * this->giveLocalCoordinateSystem (lcs);
609 *
610 * for (i=1; i <= 3; i++)
611 * for (j=1; j <= 3; j++) {
612 * answer.at(i,j) = lcs.at(i,j);
613 * answer.at(i+3, j+3) = lcs.at(i,j);
614 * answer.at(i+6, j+6) = lcs.at(i,j);
615 * answer.at(i+9, j+9) = lcs.at(i,j);
616 * }
617 *
618 * return 1 ;
619 * }
620 */
621
622int
624{
625 /*
626 * Returns transformation matrix from global coordinate system to local
627 * element coordinate system for element load vector components.
628 * If no transformation is necessary, answer is empty matrix (default);
629 *
630 * Does not support follower load
631 */
632
633 FloatMatrix lcs;
634
635 answer.resize(6, 6);
636 answer.zero();
637
638 this->giveLocalCoordinateSystem(lcs);
639
640 for ( int i = 1; i <= 3; i++ ) {
641 for ( int j = 1; j <= 3; j++ ) {
642 answer.at(i, j) = lcs.at(i, j);
643 answer.at(3 + i, 3 + j) = lcs.at(i, j);
644 }
645 }
646
647 return 1;
648}
649
650
651int
653{
654 // returns transformation matrix from
655 // edge local coordinate system
656 // to element local c.s
657 // (same as global c.s in this case)
658 //
659 // i.e. f(element local) = T * f(edge local)
660 //
661 answer.clear();
662 return 0;
663}
664
665
666void
667LIBeam3dNL::computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
668{
669 FloatArray lc(1);
670 NLStructuralElement::computeBodyLoadVectorAt(answer, load, tStep, mode);
671 answer.times(this->giveCrossSection()->give(CS_Area, lc, this) );
672}
673
674
675
677// Updates the receiver at end of step.
678{
680
681 // update triad
682 this->updateTempTriad(tStep);
683 tc = tempTc;
684
685 // update curvature
686 //FloatArray curv;
687 //this->computeTempCurv (curv, tStep);
688 //kappa = curv;
689}
690
691void
693// initializes receiver to new time step or can be used
694// if current time step must be restarted
695{
697 tempTc = tc;
698}
699
700
701void
703{
705 GaussPoint *gp = iRule->getIntegrationPoint(0);
706
707 FloatArray ui(3), ac(3), PrevEpsilon;
708 FloatMatrix sc(3, 3), tmid(3, 3);
709
710 // update curvature at midpoint
711 // first, compute Tmid
712 // ask increments
713 this->computeVectorOf(VM_Incremental, tStep, ui);
714
715 ac.at(1) = 0.5 * ( ui.at(10) - ui.at(4) );
716 ac.at(2) = 0.5 * ( ui.at(11) - ui.at(5) );
717 ac.at(3) = 0.5 * ( ui.at(12) - ui.at(6) );
718 this->computeSMtrx(sc, ac);
719 sc.times(1. / 2.);
720 // compute I+sc
721 sc.at(1, 1) += 1.0;
722 sc.at(2, 2) += 1.0;
723 sc.at(3, 3) += 1.0;
724 tmid.beProductOf(sc, this->tc);
725
726 // update curvature at centre
727 ac.at(1) = ( ui.at(10) - ui.at(4) );
728 ac.at(2) = ( ui.at(11) - ui.at(5) );
729 ac.at(3) = ( ui.at(12) - ui.at(6) );
730
731 answer.beTProductOf(tmid, ac);
732 answer.times(1 / this->l0);
733
734 // ask for previous kappa
735 StructuralMaterialStatus *matStat = static_cast< StructuralMaterialStatus * >( this->giveCrossSection()->giveMaterial(gp)->giveStatus(gp) );
736 if ( matStat ) {
737 PrevEpsilon = matStat->giveStrainVector();
738 }
739 if ( PrevEpsilon.giveSize() ) {
740 answer.at(1) += PrevEpsilon.at(4);
741 answer.at(2) += PrevEpsilon.at(5);
742 answer.at(3) += PrevEpsilon.at(6);
743 }
744}
745
746void
747LIBeam3dNL :: NodalAveragingRecoveryMI_computeNodalValue(FloatArray &answer, int node,
748 InternalStateType type, TimeStep *tStep)
749{
750 GaussPoint* gp = integrationRulesArray[0]->getIntegrationPoint(0);
751 this->giveIPValue(answer, gp, type, tStep);
752}
753
754Interface *
755LIBeam3dNL :: giveInterface(InterfaceType interface)
756{
757 if ( interface == NodalAveragingRecoveryModelInterfaceType ) {
758 return static_cast< NodalAveragingRecoveryModelInterface * >(this);
759 }
760
761 return NULL;
762}
763
764
765
766#ifdef __OOFEG
768{
769 GraphicObj *go;
770
771 if ( !gc.testElementGraphicActivity(this) ) {
772 return;
773 }
774
775 // if (!go) { // create new one
776 WCRec p[ 2 ]; /* poin */
777 EASValsSetLineWidth(OOFEG_RAW_GEOMETRY_WIDTH);
778 EASValsSetColor(gc.getElementColor() );
779 EASValsSetLayer(OOFEG_RAW_GEOMETRY_LAYER);
780 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveCoordinate(1);
781 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveCoordinate(2);
782 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveCoordinate(3);
783 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveCoordinate(1);
784 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveCoordinate(2);
785 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveCoordinate(3);
786 go = CreateLine3D(p);
787 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
788 EGAttachObject(go, ( EObjectP ) this);
789 EMAddGraphicsToModel(ESIModel(), go);
790}
791
792
794{
795 GraphicObj *go;
796
797 if ( !gc.testElementGraphicActivity(this) ) {
798 return;
799 }
800
801 double defScale = gc.getDefScale();
802 // if (!go) { // create new one
803 WCRec p[ 2 ]; /* poin */
804 EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
805 EASValsSetColor(gc.getDeformedElementColor() );
806 EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
807 p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
808 p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
809 p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);
810
811 p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
812 p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
813 p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(3, tStep, defScale);
814 go = CreateLine3D(p);
815 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
816 EMAddGraphicsToModel(ESIModel(), go);
817}
818#endif
819} // end namespace oofem
double length(const Vector &a)
Definition CSG.h:88
#define REGISTER_Element(class)
virtual Material * giveMaterial(IntegrationPoint *ip) const =0
hidden by virtual oofem::Material* TransportCrossSection::giveMaterial() const
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
Node * giveNode(int n)
Definition domain.h:398
ParameterManager elementPPM
Definition domain.h:133
Node * giveNode(int i) const
Definition element.h:629
virtual void updateYourself(TimeStep *tStep)
Definition element.C:824
int numberOfDofMans
Number of dofmanagers.
Definition element.h:136
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Definition element.C:103
void postInitialize() override
Performs post initialization steps.
Definition element.C:797
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Definition element.h:157
virtual void initForNewStep()
Definition element.C:879
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 computeNorm() const
Definition floatarray.C:861
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 beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:689
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Definition floatarray.C:721
void times(double s)
Definition floatarray.C:834
void times(double f)
void add(const FloatMatrix &a)
void resize(Index rows, Index cols)
Definition floatmatrix.C:79
*Sets size of receiver to be an empty matrix It will have zero rows and zero columns size void clear()
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void zero()
Zeroes all coefficient of receiver.
double at(std::size_t i, std::size_t j) const
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
Definition gausspoint.h:204
double giveWeight()
Returns integration weight of receiver.
Definition gausspoint.h:180
void resize(int n)
Definition intarray.C:73
int & at(std::size_t i)
Definition intarray.h:104
GaussPoint * getIntegrationPoint(int n)
void computeSMtrx(FloatMatrix &answer, FloatArray &vec)
Definition libeam3dnl.C:71
int computeLoadLEToLRotationMatrix(FloatMatrix &answer, int iEdge, GaussPoint *gp) override
Definition libeam3dnl.C:652
void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode) override
Definition libeam3dnl.C:667
FloatMatrix tempTc
Temporary triad at the centre.
Definition libeam3dnl.h:67
void computeLumpedMassMatrix(FloatMatrix &answer, TimeStep *tStep) override
Definition libeam3dnl.C:398
void computeXdVector(FloatArray &answer, TimeStep *tStep)
Definition libeam3dnl.C:236
void initForNewStep() override
Definition libeam3dnl.C:692
void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep) override
Definition libeam3dnl.C:767
void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer) override
Definition libeam3dnl.C:423
void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType) override
Definition libeam3dnl.C:793
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
Definition libeam3dnl.C:468
void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep) override
Definition libeam3dnl.C:523
void postInitialize() override
Performs post initialization steps.
Definition libeam3dnl.C:361
void computeXMtrx(FloatMatrix &answer, TimeStep *tStep)
Definition libeam3dnl.C:177
StateCounterType tempTcCounter
Time stamp of temporary centre triad.
Definition libeam3dnl.h:69
void giveDofManDofIDMask(int inode, IntArray &) const override
Definition libeam3dnl.C:485
void computeConstitutiveMatrix_dPdF_At(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) override
Definition libeam3dnl.C:516
void initializeFrom(InputRecord &ir, int priority) override
Definition libeam3dnl.C:352
void updateYourself(TimeStep *tStep) override
Definition libeam3dnl.C:676
FloatMatrix tc
Last equilibrium triad at the centre.
Definition libeam3dnl.h:63
int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords) override
Definition libeam3dnl.C:492
int referenceNode
Reference node.
Definition libeam3dnl.h:71
double l0
Initial length.
Definition libeam3dnl.h:61
void giveEdgeDofMapping(IntArray &answer, int iEdge) const override
Definition libeam3dnl.C:530
LIBeam3dNL(int n, Domain *d)
Definition libeam3dnl.C:59
double computeEdgeVolumeAround(GaussPoint *gp, int iEdge) override
Definition libeam3dnl.C:548
void updateTempTriad(TimeStep *tStep)
Definition libeam3dnl.C:120
static ParamKey IPK_LIBeam3dNL_refnode
Definition libeam3dnl.h:73
void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep) override
Definition libeam3dnl.C:254
void computeRotMtrx(FloatMatrix &answer, FloatArray &psi)
Definition libeam3dnl.C:90
void computeStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep) override
Definition libeam3dnl.C:149
void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) override
Definition libeam3dnl.C:510
int giveLocalCoordinateSystem(FloatMatrix &answer) override
Definition libeam3dnl.C:560
double computeLength() override
Definition libeam3dnl.C:378
void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0) override
Definition libeam3dnl.C:202
void computeTempCurv(FloatArray &answer, TimeStep *tStep)
Definition libeam3dnl.C:702
void computeGaussPoints() override
Definition libeam3dnl.C:340
double computeVolumeAround(GaussPoint *gp) override
Definition libeam3dnl.C:458
int computeLoadGToLRotationMtrx(FloatMatrix &answer) override
Definition libeam3dnl.C:623
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
void initializeFrom(InputRecord &ir, int priority) override
NLStructuralElement(int n, Domain *d)
int nlGeometry
Flag indicating if geometrical nonlinearities apply.
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Definition node.C:234
virtual FloatMatrixF< 6, 6 > give3dBeamStiffMtrx(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const =0
virtual FloatArrayF< 6 > giveGeneralizedStress_Beam3d(const FloatArrayF< 6 > &generalizedStrain, GaussPoint *gp, TimeStep *tStep) const =0
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep) override
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
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.
StateCounterType giveSolutionStateCounter()
Definition timestep.h:211
#define OOFEM_ERROR(...)
Definition error.h:79
#define S(p)
Definition mdm.C:469
@ CS_InertiaMomentZ
Moment of inertia around z-axis.
@ CS_InertiaMomentY
Moment of inertia around y-axis.
@ CS_Area
Area.
@ NodalAveragingRecoveryModelInterfaceType
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_DEFORMED_GEOMETRY_LAYER
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_WIDTH
#define OOFEG_RAW_GEOMETRY_LAYER
#define PM_ELEMENT_ERROR_IFNOTSET(_pm, _componentnum, _paramkey)
#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