46 #include "../sm/Elements/structuralelementevaluator.h" 58 #ifdef __PARALLEL_MODE 59 int numberOfKnotSpans = 0;
75 }
else if ( nsd == 2 ) {
78 #ifdef __PARALLEL_MODE 79 numberOfKnotSpans = numberOfKnotSpansU * numberOfKnotSpansV;
89 int numberOfIntegrationRules = numberOfKnotSpansU * numberOfKnotSpansV;
93 for (
int vi = 1; vi <= numberOfKnotSpansV; vi++ ) {
94 dv = knotValuesV->
at(vi + 1) - knotValuesV->
at(vi);
95 knotSpan.
at(2) += knotMultiplicityV->
at(vi);
98 for (
int ui = 1; ui <= numberOfKnotSpansU; ui++ ) {
99 du = knotValuesU->
at(ui + 1) - knotValuesU->
at(ui);
100 knotSpan.
at(1) += knotMultiplicityU->
at(ui);
107 const FloatArray &gpcoords = gp->giveNaturalCoordinates();
109 newgpcoords.
at(1) = knotValuesU->
at(ui) + du * ( gpcoords.
at(1) / 2.0 + 0.5 );
110 newgpcoords.
at(2) = knotValuesV->
at(vi) + dv * ( gpcoords.
at(2) / 2.0 + 0.5 );
111 gp->setNaturalCoordinates(newgpcoords);
112 gp->setWeight(gp->giveWeight() / 4.0 * du * dv);
118 }
else if ( nsd == 3 ) {
122 #ifdef __PARALLEL_MODE 123 numberOfKnotSpans = numberOfKnotSpansU * numberOfKnotSpansV * numberOfKnotSpansW;
135 int numberOfIntegrationRules = numberOfKnotSpansU * numberOfKnotSpansV * numberOfKnotSpansW;
139 for (
int wi = 1; wi <= numberOfKnotSpansW; wi++ ) {
140 dw = knotValuesW->
at(wi + 1) - knotValuesW->
at(wi);
141 knotSpan.
at(3) += knotMultiplicityW->
at(wi);
144 for (
int vi = 1; vi <= numberOfKnotSpansV; vi++ ) {
145 dv = knotValuesV->
at(vi + 1) - knotValuesV->
at(vi);
146 knotSpan.
at(2) += knotMultiplicityV->
at(vi);
149 for (
int ui = 1; ui <= numberOfKnotSpansU; ui++ ) {
150 du = knotValuesU->
at(ui + 1) - knotValuesU->
at(ui);
151 knotSpan.
at(1) += knotMultiplicityU->
at(ui);
158 const FloatArray &gpcoords = gp->giveNaturalCoordinates();
160 newgpcoords.
at(1) = knotValuesU->
at(ui) + du * ( gpcoords.
at(1) / 2.0 + 0.5 );
161 newgpcoords.
at(2) = knotValuesV->
at(vi) + dv * ( gpcoords.
at(2) / 2.0 + 0.5 );
162 newgpcoords.
at(3) = knotValuesW->
at(wi) + dw * ( gpcoords.
at(3) / 2.0 + 0.5 );
163 gp->setNaturalCoordinates(newgpcoords);
164 gp->setWeight(gp->giveWeight() / 8.0 * du * dv * dw);
172 OOFEM_WARNING(
"unsupported number of spatial dimensions (nsd = %d)", nsd);
176 #ifdef __PARALLEL_MODE 180 for (
int i = 1; i <= numberOfKnotSpans; i++ ) {
191 #ifdef __PARALLEL_MODE 201 OOFEM_ERROR(
"Cannot determine elementParallelMode");
207 #endif // __PARALLEL_MODE 248 int numberOfIntegrationRules = numberOfKnotSpansU * numberOfKnotSpansV;
252 for ( vi = 1; vi <= numberOfKnotSpansV; vi++ ) {
253 dv = knotValuesV->
at(vi + 1) - knotValuesV->
at(vi);
254 knotSpan.
at(2) += knotMultiplicityV->
at(vi);
257 for ( ui = 1; ui <= numberOfKnotSpansU; ui++ ) {
258 du = knotValuesU->
at(ui + 1) - knotValuesU->
at(ui);
259 knotSpan.
at(1) += knotMultiplicityU->
at(ui);
266 const FloatArray &gpcoords = gp->giveNaturalCoordinates();
268 newgpcoords.
at(1) = knotValuesU->
at(ui) + du * ( gpcoords.
at(1) / 2.0 + 0.5 );
269 newgpcoords.
at(2) = knotValuesV->
at(vi) + dv * ( gpcoords.
at(2) / 2.0 + 0.5 );
270 gp->setNaturalCoordinates(newgpcoords);
271 gp->setWeight(gp->giveWeight() / 4.0 * du * dv);
278 OOFEM_WARNING(
"unsupported number of spatial dimensions (nsd = %d)", nsd);
303 int i, j, k, m, nseg;
316 EASValsSetEdgeFlag(
true);
318 EASValsSetLineStyle(SOLID_STYLE);
319 EASValsSetFillStyle(FILL_SOLID);
336 for ( j = 0; j < 2; j++ ) {
343 span = iRule->giveKnotSpan();
345 du = ( knotVector [ 0 ] [ span->
at(1) + 1 ] - knotVector [ 0 ] [ span->
at(1) ] ) / nseg;
346 for ( i = 1; i <= nseg; i++ ) {
347 c [ 0 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
348 c [ 1 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
350 for ( k = 0; k < 2; k++ ) {
352 p [ k ].x = ( FPNum ) cg [ k ].at(1);
357 go = CreateLine3D(p);
358 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
359 EGAttachObject(go, ( EObjectP )
this);
360 EMAddGraphicsToModel(ESIModel(), go);
363 }
else if ( nsd == 2 ) {
367 for ( j = 0; j < 4; j++ ) {
374 span = iRule->giveKnotSpan();
376 du = ( knotVector [ 0 ] [ span->
at(1) + 1 ] - knotVector [ 0 ] [ span->
at(1) ] ) / nseg;
377 dv = ( knotVector [ 1 ] [ span->
at(2) + 1 ] - knotVector [ 1 ] [ span->
at(2) ] ) / nseg;
378 for ( i = 1; i <= nseg; i++ ) {
379 for ( j = 1; j <= nseg; j++ ) {
380 c [ 0 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
381 c [ 0 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
382 c [ 1 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
383 c [ 1 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
384 c [ 2 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
385 c [ 2 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
386 c [ 3 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
387 c [ 3 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
389 for ( k = 0; k < 4; k++ ) {
391 p [ k ].x = ( FPNum ) cg [ k ].at(1);
392 p [ k ].y = ( FPNum ) cg [ k ].at(2);
398 pp [ 0 ].x = p [ 0 ].x;
399 pp [ 0 ].y = p [ 0 ].y;
400 pp [ 0 ].z = p [ 0 ].z;
402 pp [ 1 ].x = p [ 3 ].x;
403 pp [ 1 ].y = p [ 3 ].y;
404 pp [ 1 ].z = p [ 3 ].z;
406 go = CreateLine3D(pp);
407 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
408 EGAttachObject(go, ( EObjectP )
this);
409 EMAddGraphicsToModel(ESIModel(), go);
413 pp [ 0 ].x = p [ 0 ].x;
414 pp [ 0 ].y = p [ 0 ].y;
415 pp [ 0 ].z = p [ 0 ].z;
417 pp [ 1 ].x = p [ 1 ].x;
418 pp [ 1 ].y = p [ 1 ].y;
419 pp [ 1 ].z = p [ 1 ].z;
421 go = CreateLine3D(pp);
422 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
423 EGAttachObject(go, ( EObjectP )
this);
424 EMAddGraphicsToModel(ESIModel(), go);
428 pp [ 0 ].x = p [ 1 ].x;
429 pp [ 0 ].y = p [ 1 ].y;
430 pp [ 0 ].z = p [ 1 ].z;
432 pp [ 1 ].x = p [ 2 ].x;
433 pp [ 1 ].y = p [ 2 ].y;
434 pp [ 1 ].z = p [ 2 ].z;
436 go = CreateLine3D(pp);
437 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
438 EGAttachObject(go, ( EObjectP )
this);
439 EMAddGraphicsToModel(ESIModel(), go);
443 pp [ 0 ].x = p [ 2 ].x;
444 pp [ 0 ].y = p [ 2 ].y;
445 pp [ 0 ].z = p [ 2 ].z;
447 pp [ 1 ].x = p [ 3 ].x;
448 pp [ 1 ].y = p [ 3 ].y;
449 pp [ 1 ].z = p [ 3 ].z;
451 go = CreateLine3D(pp);
452 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
453 EGAttachObject(go, ( EObjectP )
this);
454 EMAddGraphicsToModel(ESIModel(), go);
458 go = CreateQuad3D(p);
459 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
460 EGAttachObject(go, ( EObjectP )
this);
461 EMAddGraphicsToModel(ESIModel(), go);
466 }
else if ( nsd == 3 ) {
470 for ( j = 0; j < 8; j++ ) {
477 span = iRule->giveKnotSpan();
479 du = ( knotVector [ 0 ] [ span->
at(1) + 1 ] - knotVector [ 0 ] [ span->
at(1) ] ) / nseg;
480 dv = ( knotVector [ 1 ] [ span->
at(2) + 1 ] - knotVector [ 1 ] [ span->
at(2) ] ) / nseg;
481 dt = ( knotVector [ 2 ] [ span->
at(3) + 1 ] - knotVector [ 2 ] [ span->
at(3) ] ) / nseg;
482 for ( i = 1; i <= nseg; i++ ) {
483 for ( j = 1; j <= nseg; j++ ) {
484 for ( k = 1; k <= nseg; k++ ) {
485 c [ 0 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
486 c [ 0 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
487 c [ 0 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
488 c [ 1 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
489 c [ 1 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
490 c [ 1 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
491 c [ 2 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
492 c [ 2 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
493 c [ 2 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
494 c [ 3 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
495 c [ 3 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
496 c [ 3 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
497 c [ 4 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
498 c [ 4 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
499 c [ 4 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
500 c [ 5 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
501 c [ 5 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
502 c [ 5 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
503 c [ 6 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
504 c [ 6 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
505 c [ 6 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
506 c [ 7 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
507 c [ 7 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
508 c [ 7 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
510 for ( m = 0; m < 8; m++ ) {
512 p [ m ].x = ( FPNum ) cg [ m ].at(1);
513 p [ m ].y = ( FPNum ) cg [ m ].at(2);
514 p [ m ].z = ( FPNum ) cg [ m ].at(3);
518 if ( i == 1 && j == 1 ) {
519 pp [ 0 ].x = p [ 0 ].x;
520 pp [ 0 ].y = p [ 0 ].y;
521 pp [ 0 ].z = p [ 0 ].z;
523 pp [ 1 ].x = p [ 4 ].x;
524 pp [ 1 ].y = p [ 4 ].y;
525 pp [ 1 ].z = p [ 4 ].z;
527 #ifdef DRAW_VISIBLE_CONTOUR 528 #ifdef SPHERE_WITH_HOLE 529 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
530 for (
int ii = 0; ii < 2; ii++ ) {
538 rr = xx * xx + yy * yy;
541 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
542 if ( zz < 2.0001 || rr < 1.001 * 1.001 || yy < 0.0001 ) {
543 go = CreateLine3D(pp);
544 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
545 EGAttachObject(go, ( EObjectP )
this);
546 EMAddGraphicsToModel(ESIModel(), go);
551 go = CreateLine3D(pp);
552 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
553 EGAttachObject(go, ( EObjectP )
this);
554 EMAddGraphicsToModel(ESIModel(), go);
558 if ( i == 1 && j == nseg ) {
559 pp [ 0 ].x = p [ 3 ].x;
560 pp [ 0 ].y = p [ 3 ].y;
561 pp [ 0 ].z = p [ 3 ].z;
563 pp [ 1 ].x = p [ 7 ].x;
564 pp [ 1 ].y = p [ 7 ].y;
565 pp [ 1 ].z = p [ 7 ].z;
567 #ifdef DRAW_VISIBLE_CONTOUR 568 #ifdef SPHERE_WITH_HOLE 569 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
570 for (
int ii = 0; ii < 2; ii++ ) {
578 rr = xx * xx + yy * yy;
581 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
582 if ( zz < 2.0001 || rr < 1.001 * 1.001 || yy < 0.0001 ) {
583 go = CreateLine3D(pp);
584 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
585 EGAttachObject(go, ( EObjectP )
this);
586 EMAddGraphicsToModel(ESIModel(), go);
591 go = CreateLine3D(pp);
592 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
593 EGAttachObject(go, ( EObjectP )
this);
594 EMAddGraphicsToModel(ESIModel(), go);
598 if ( i == nseg && j == 1 ) {
599 pp [ 0 ].x = p [ 1 ].x;
600 pp [ 0 ].y = p [ 1 ].y;
601 pp [ 0 ].z = p [ 1 ].z;
603 pp [ 1 ].x = p [ 5 ].x;
604 pp [ 1 ].y = p [ 5 ].y;
605 pp [ 1 ].z = p [ 5 ].z;
607 #ifdef DRAW_VISIBLE_CONTOUR 608 #ifdef SPHERE_WITH_HOLE 609 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
610 for (
int ii = 0; ii < 2; ii++ ) {
618 rr = xx * xx + yy * yy;
621 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
622 if ( zz < 2.0001 || rr < 1.001 * 1.001 || yy < 0.0001 ) {
623 go = CreateLine3D(pp);
624 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
625 EGAttachObject(go, ( EObjectP )
this);
626 EMAddGraphicsToModel(ESIModel(), go);
631 go = CreateLine3D(pp);
632 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
633 EGAttachObject(go, ( EObjectP )
this);
634 EMAddGraphicsToModel(ESIModel(), go);
638 if ( i == nseg && j == nseg ) {
639 pp [ 0 ].x = p [ 2 ].x;
640 pp [ 0 ].y = p [ 2 ].y;
641 pp [ 0 ].z = p [ 2 ].z;
643 pp [ 1 ].x = p [ 6 ].x;
644 pp [ 1 ].y = p [ 6 ].y;
645 pp [ 1 ].z = p [ 6 ].z;
647 #ifdef DRAW_VISIBLE_CONTOUR 648 #ifdef SPHERE_WITH_HOLE 649 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
650 for (
int ii = 0; ii < 2; ii++ ) {
658 rr = xx * xx + yy * yy;
661 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
662 if ( zz < 2.0001 || rr < 1.001 * 1.001 || yy < 0.0001 ) {
663 go = CreateLine3D(pp);
664 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
665 EGAttachObject(go, ( EObjectP )
this);
666 EMAddGraphicsToModel(ESIModel(), go);
671 go = CreateLine3D(pp);
672 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
673 EGAttachObject(go, ( EObjectP )
this);
674 EMAddGraphicsToModel(ESIModel(), go);
678 if ( j == 1 && k == 1 ) {
679 pp [ 0 ].x = p [ 0 ].x;
680 pp [ 0 ].y = p [ 0 ].y;
681 pp [ 0 ].z = p [ 0 ].z;
683 pp [ 1 ].x = p [ 1 ].x;
684 pp [ 1 ].y = p [ 1 ].y;
685 pp [ 1 ].z = p [ 1 ].z;
687 #ifdef DRAW_VISIBLE_CONTOUR 688 #ifdef SPHERE_WITH_HOLE 689 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
690 for (
int ii = 0; ii < 2; ii++ ) {
698 rr = xx * xx + yy * yy;
701 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
702 go = CreateLine3D(pp);
703 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
704 EGAttachObject(go, ( EObjectP )
this);
705 EMAddGraphicsToModel(ESIModel(), go);
709 go = CreateLine3D(pp);
710 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
711 EGAttachObject(go, ( EObjectP )
this);
712 EMAddGraphicsToModel(ESIModel(), go);
716 if ( j == 1 && k == nseg ) {
717 pp [ 0 ].x = p [ 4 ].x;
718 pp [ 0 ].y = p [ 4 ].y;
719 pp [ 0 ].z = p [ 4 ].z;
721 pp [ 1 ].x = p [ 5 ].x;
722 pp [ 1 ].y = p [ 5 ].y;
723 pp [ 1 ].z = p [ 5 ].z;
725 #ifdef DRAW_VISIBLE_CONTOUR 726 #ifdef SPHERE_WITH_HOLE 727 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
728 for (
int ii = 0; ii < 2; ii++ ) {
736 rr = xx * xx + yy * yy;
739 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
740 if ( yy < 1.5 || zz < 2.0001 ) {
741 go = CreateLine3D(pp);
742 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
743 EGAttachObject(go, ( EObjectP )
this);
744 EMAddGraphicsToModel(ESIModel(), go);
749 go = CreateLine3D(pp);
750 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
751 EGAttachObject(go, ( EObjectP )
this);
752 EMAddGraphicsToModel(ESIModel(), go);
756 if ( j == nseg && k == 1 ) {
757 pp [ 0 ].x = p [ 3 ].x;
758 pp [ 0 ].y = p [ 3 ].y;
759 pp [ 0 ].z = p [ 3 ].z;
761 pp [ 1 ].x = p [ 2 ].x;
762 pp [ 1 ].y = p [ 2 ].y;
763 pp [ 1 ].z = p [ 2 ].z;
765 #ifdef DRAW_VISIBLE_CONTOUR 766 #ifdef SPHERE_WITH_HOLE 767 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
768 for (
int ii = 0; ii < 2; ii++ ) {
776 rr = xx * xx + yy * yy;
779 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
780 go = CreateLine3D(pp);
781 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
782 EGAttachObject(go, ( EObjectP )
this);
783 EMAddGraphicsToModel(ESIModel(), go);
787 go = CreateLine3D(pp);
788 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
789 EGAttachObject(go, ( EObjectP )
this);
790 EMAddGraphicsToModel(ESIModel(), go);
794 if ( j == nseg && k == nseg ) {
795 pp [ 0 ].x = p [ 7 ].x;
796 pp [ 0 ].y = p [ 7 ].y;
797 pp [ 0 ].z = p [ 7 ].z;
799 pp [ 1 ].x = p [ 6 ].x;
800 pp [ 1 ].y = p [ 6 ].y;
801 pp [ 1 ].z = p [ 6 ].z;
803 #ifdef DRAW_VISIBLE_CONTOUR 804 #ifdef SPHERE_WITH_HOLE 805 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
806 for (
int ii = 0; ii < 2; ii++ ) {
814 rr = xx * xx + yy * yy;
817 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
818 if ( yy < 1.5 || zz < 2.0001 ) {
819 go = CreateLine3D(pp);
820 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
821 EGAttachObject(go, ( EObjectP )
this);
822 EMAddGraphicsToModel(ESIModel(), go);
827 go = CreateLine3D(pp);
828 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
829 EGAttachObject(go, ( EObjectP )
this);
830 EMAddGraphicsToModel(ESIModel(), go);
834 if ( k == 1 && i == 1 ) {
835 pp [ 0 ].x = p [ 0 ].x;
836 pp [ 0 ].y = p [ 0 ].y;
837 pp [ 0 ].z = p [ 0 ].z;
839 pp [ 1 ].x = p [ 3 ].x;
840 pp [ 1 ].y = p [ 3 ].y;
841 pp [ 1 ].z = p [ 3 ].z;
843 #ifdef DRAW_VISIBLE_CONTOUR 844 #ifdef SPHERE_WITH_HOLE 845 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
846 for (
int ii = 0; ii < 2; ii++ ) {
854 rr = xx * xx + yy * yy;
857 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
858 go = CreateLine3D(pp);
859 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
860 EGAttachObject(go, ( EObjectP )
this);
861 EMAddGraphicsToModel(ESIModel(), go);
865 go = CreateLine3D(pp);
866 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
867 EGAttachObject(go, ( EObjectP )
this);
868 EMAddGraphicsToModel(ESIModel(), go);
872 if ( k == 1 && i == nseg ) {
873 pp [ 0 ].x = p [ 1 ].x;
874 pp [ 0 ].y = p [ 1 ].y;
875 pp [ 0 ].z = p [ 1 ].z;
877 pp [ 1 ].x = p [ 2 ].x;
878 pp [ 1 ].y = p [ 2 ].y;
879 pp [ 1 ].z = p [ 2 ].z;
881 #ifdef DRAW_VISIBLE_CONTOUR 882 #ifdef SPHERE_WITH_HOLE 883 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
884 for (
int ii = 0; ii < 2; ii++ ) {
892 rr = xx * xx + yy * yy;
895 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
896 go = CreateLine3D(pp);
897 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
898 EGAttachObject(go, ( EObjectP )
this);
899 EMAddGraphicsToModel(ESIModel(), go);
903 go = CreateLine3D(pp);
904 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
905 EGAttachObject(go, ( EObjectP )
this);
906 EMAddGraphicsToModel(ESIModel(), go);
910 if ( k == nseg && i == 1 ) {
911 pp [ 0 ].x = p [ 4 ].x;
912 pp [ 0 ].y = p [ 4 ].y;
913 pp [ 0 ].z = p [ 4 ].z;
915 pp [ 1 ].x = p [ 7 ].x;
916 pp [ 1 ].y = p [ 7 ].y;
917 pp [ 1 ].z = p [ 7 ].z;
919 #ifdef DRAW_VISIBLE_CONTOUR 920 #ifdef SPHERE_WITH_HOLE 921 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
922 for (
int ii = 0; ii < 2; ii++ ) {
930 rr = xx * xx + yy * yy;
933 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
935 go = CreateLine3D(pp);
936 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
937 EGAttachObject(go, ( EObjectP )
this);
938 EMAddGraphicsToModel(ESIModel(), go);
943 go = CreateLine3D(pp);
944 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
945 EGAttachObject(go, ( EObjectP )
this);
946 EMAddGraphicsToModel(ESIModel(), go);
950 if ( k == nseg && i == nseg ) {
951 pp [ 0 ].x = p [ 5 ].x;
952 pp [ 0 ].y = p [ 5 ].y;
953 pp [ 0 ].z = p [ 5 ].z;
955 pp [ 1 ].x = p [ 6 ].x;
956 pp [ 1 ].y = p [ 6 ].y;
957 pp [ 1 ].z = p [ 6 ].z;
959 #ifdef DRAW_VISIBLE_CONTOUR 960 #ifdef SPHERE_WITH_HOLE 961 double xx = 0.0, yy = 0.0, zz = 0.0, rr, r;
962 for (
int ii = 0; ii < 2; ii++ ) {
970 rr = xx * xx + yy * yy;
973 if ( zz < 2.0001 || yy < 0.0001 || rr < 1.001 * 1.001 || r < 25.0 || r > 5.98 * 5.98 ) {
975 go = CreateLine3D(pp);
976 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
977 EGAttachObject(go, ( EObjectP )
this);
978 EMAddGraphicsToModel(ESIModel(), go);
983 go = CreateLine3D(pp);
984 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
985 EGAttachObject(go, ( EObjectP )
this);
986 EMAddGraphicsToModel(ESIModel(), go);
991 go = CreateHexahedron(p);
992 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
993 EGAttachObject(go, ( EObjectP )
this);
994 EMAddGraphicsToModel(ESIModel(), go);
1010 int i, j, k, m, n, nseg;
1025 EASValsSetEdgeFlag(
true);
1027 EASValsSetLineStyle(SOLID_STYLE);
1028 EASValsSetFillStyle(FILL_SOLID);
1029 EASValsSetLineWidth(0);
1048 for ( j = 0; j < 2; j++ ) {
1058 du = ( knotVector [ 0 ] [ span->
at(1) + 1 ] - knotVector [ 0 ] [ span->
at(1) ] ) / nseg;
1059 for ( i = 1; i <= nseg; i++ ) {
1060 c [ 0 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
1061 c [ 1 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
1063 for ( k = 0; k < 2; k++ ) {
1065 GaussPoint gp(iRule, 999, c [ k ], 1.0, _PlaneStress);
1073 for ( n = 1; n <= lc.
giveSize(); n++ ) {
1074 ur.
at(n) = u.
at( lc.
at(n) );
1081 p [ k ].x = ( FPNum ) ( cg [ k ].at(1) + d.
at(1) * defScale );
1086 go = CreateLine3D(p);
1087 EGWithMaskChangeAttributes(WIDTH_MASK | STYLE_MASK | COLOR_MASK | LAYER_MASK, go);
1088 EGAttachObject(go, ( EObjectP ) elem);
1089 EMAddGraphicsToModel(ESIModel(), go);
1092 }
else if ( nsd == 2 ) {
1096 for ( j = 0; j < 4; j++ ) {
1106 du = ( knotVector [ 0 ] [ span->
at(1) + 1 ] - knotVector [ 0 ] [ span->
at(1) ] ) / nseg;
1107 dv = ( knotVector [ 1 ] [ span->
at(2) + 1 ] - knotVector [ 1 ] [ span->
at(2) ] ) / nseg;
1108 for ( i = 1; i <= nseg; i++ ) {
1109 for ( j = 1; j <= nseg; j++ ) {
1110 c [ 0 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
1111 c [ 0 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
1112 c [ 1 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
1113 c [ 1 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
1114 c [ 2 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
1115 c [ 2 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
1116 c [ 3 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
1117 c [ 3 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
1119 for ( k = 0; k < 4; k++ ) {
1121 GaussPoint gp(iRule, 999, c [ k ], 1.0, _PlaneStress);
1129 for ( n = 1; n <= lc.
giveSize(); n++ ) {
1130 ur.
at(n) = u.
at( lc.
at(n) );
1137 p [ k ].x = ( FPNum ) ( cg [ k ].at(1) + d.
at(1) * defScale );
1138 p [ k ].y = ( FPNum ) ( cg [ k ].at(2) + d.
at(2) * defScale );
1142 go = CreateQuad3D(p);
1143 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
1144 EGAttachObject(go, ( EObjectP ) elem);
1145 EMAddGraphicsToModel(ESIModel(), go);
1149 }
else if ( nsd == 3 ) {
1153 for ( j = 0; j < 8; j++ ) {
1163 du = ( knotVector [ 0 ] [ span->
at(1) + 1 ] - knotVector [ 0 ] [ span->
at(1) ] ) / nseg;
1164 dv = ( knotVector [ 1 ] [ span->
at(2) + 1 ] - knotVector [ 1 ] [ span->
at(2) ] ) / nseg;
1165 dt = ( knotVector [ 2 ] [ span->
at(3) + 1 ] - knotVector [ 2 ] [ span->
at(3) ] ) / nseg;
1166 for ( i = 1; i <= nseg; i++ ) {
1167 for ( j = 1; j <= nseg; j++ ) {
1168 for ( k = 1; k <= nseg; k++ ) {
1169 c [ 0 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
1170 c [ 0 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
1171 c [ 0 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
1172 c [ 1 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
1173 c [ 1 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
1174 c [ 1 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
1175 c [ 2 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
1176 c [ 2 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
1177 c [ 2 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
1178 c [ 3 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
1179 c [ 3 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
1180 c [ 3 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * ( k - 1 );
1181 c [ 4 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
1182 c [ 4 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
1183 c [ 4 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
1184 c [ 5 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
1185 c [ 5 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * ( j - 1 );
1186 c [ 5 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
1187 c [ 6 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * i;
1188 c [ 6 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
1189 c [ 6 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
1190 c [ 7 ].
at(1) = knotVector [ 0 ] [ span->
at(1) ] + du * ( i - 1 );
1191 c [ 7 ].
at(2) = knotVector [ 1 ] [ span->
at(2) ] + dv * j;
1192 c [ 7 ].
at(3) = knotVector [ 2 ] [ span->
at(3) ] + dt * k;
1194 for ( m = 0; m < 8; m++ ) {
1196 GaussPoint gp(iRule, 999, c [ m ], 1.0, _3dMat);
1204 for ( n = 1; n <= lc.
giveSize(); n++ ) {
1205 ur.
at(n) = u.
at( lc.
at(n) );
1212 p [ m ].x = ( FPNum ) ( cg [ m ].at(1) + d.
at(1) * defScale );
1213 p [ m ].y = ( FPNum ) ( cg [ m ].at(2) + d.
at(2) * defScale );
1214 p [ m ].z = ( FPNum ) ( cg [ m ].at(3) + d.
at(3) * defScale );
1217 go = CreateHexahedron(p);
1218 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
1219 EGAttachObject(go, ( EObjectP ) elem);
1220 EMAddGraphicsToModel(ESIModel(), go);
This class represent a new concept on how to define elements.
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
int giveNumberOfColumns() const
Returns number of columns of receiver.
virtual const FloatArray * giveKnotValues(int dim)
Returns the knot values of the receiver.
IntArray dofManArray
Array containing dofmanager numbers.
void setNumberOfControlPoints(int num)
IntArray knotSpanParallelMode
virtual IntegrationRule * giveIntegrationRule(int i)
virtual void computeNMatrixAt(FloatMatrix &answer, GaussPoint *gp)=0
Computes the matrix for which the unknown field is obtained, typically [N1, 0, N2, 0, ...; 0, N1, 0, N2, ...].
virtual const IntArray * giveKnotMultiplicity(int dim)
Returns the knot multiplicity of the receiver.
double & at(int i)
Coefficient access function.
#define OOFEG_RAW_GEOMETRY_LAYER
virtual int giveNumberOfKnotSpans(int dim)
Returns the number of knot spans of the receiver.
EPixel getElementEdgeColor()
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
Abstract base class for all finite elements.
virtual int giveIntegrationElementLocalCodeNumbers(IntArray &answer, Element *elem, IntegrationRule *ie)
Assembles the local element code numbers of given integration element (sub-patch) This is done by obt...
virtual const IntArray * giveKnotSpan()
Returns receiver sub patch indices (if apply).
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual FEInterpolation * giveInterpolation() const
#define OOFEG_DEFORMED_GEOMETRY_LAYER
Abstract base class representing integration rule.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
int giveNumberOfIntegrationRules()
EPixel getDeformedElementColor()
Class representing a general abstraction for finite element interpolation class.
void drawIGAPatchDeformedGeometry(Element *elem, StructuralElementEvaluator *se, oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define _IFT_IGAElement_KnotSpanParallelMode
#define OOFEG_RAW_GEOMETRY_WIDTH
UnknownType
Type representing particular unknown (its physical meaning).
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
elementParallelMode
In parallel mode, this type indicates the mode of element.
void resize(int n)
Checks size of receiver towards requested bounds.
IntegrationRule * giveIntegrationRule()
Returns corresponding integration rule to receiver.
IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
int numberOfGaussPoints
Number of integration points as specified by nip.
Class representing vector of real numbers.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Element is local, there are no contributions from other domains to this element.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
virtual const double *const * giveKnotVector()
Returns the subdivision of patch parametric space.
#define OOFEG_DEFORMED_GEOMETRY_WIDTH
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
Element in active domain is only mirror of some remote element.
IntegrationElement represent nonzero knot span, derived from Integration Rule.
Geometry wrapper for IGA elements.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Interpolation for T-splines.
Class representing integration point in finite element program.
#define OOFEM_WARNING(...)
Class representing solution step.
virtual int giveNsd()=0
Returns number of spatial dimensions.
int numberOfDofMans
Number of dofmanagers.
elementParallelMode giveKnotSpanParallelMode(int) const
Returns the parallel mode for particular knot span of the receiver.
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates global coordinates from given local ones.
void resize(int s)
Resizes receiver towards requested size.