62 #ifdef __PARALLEL_MODE 92 #define DRAW_IRREGULAR_NODES 93 #define DRAW_REMOTE_ELEMENTS 95 #define DRAW_MESH_AFTER_BISECTION 104 #define HEADEDSTUD // headed stud 119 for ( i = 1; i <= connElems.
giveSize(); i++ ) {
120 el = connElems.
at(i);
122 #ifdef __PARALLEL_MODE 141 if ( this->isTerminal() ) {
146 for ( el = 1; el <= this->giveChildren()->giveSize(); el++ ) {
158 #ifdef __PARALLEL_MODE 170 for ( i = 1; i <= connElems.
giveSize(); i++ ) {
171 el = connElems.
at(i);
193 for ( ie = 1; ie <= connElems->
giveSize(); ie++ ) {
205 for ( jnode = 1; jnode <= 3; jnode++ ) {
206 jNode = nodes.at(jnode);
207 if ( jNode == iNode ) {
223 eIndex = giveEdgeIndex(iNode, jNode);
225 if ( shared_edges.giveSize() ) {
226 if ( shared_edges.at(eIndex) ) {
245 if ( !shared_edges.giveSize() ) {
249 shared_edges.at(eIndex) = eNum;
262 for ( jnode = 1; jnode <= 4; jnode++ ) {
263 jNode = nodes.at(jnode);
264 if ( jNode == iNode ) {
280 eIndex = giveEdgeIndex(iNode, jNode);
282 if ( shared_edges.giveSize() ) {
283 if ( shared_edges.at(eIndex) ) {
300 if ( !this->giveSharedEdges()->giveSize() ) {
301 this->makeSharedEdges();
304 shared_edges.at(eIndex) = eNum;
324 OOFEM_ERROR(
"potentionally shared edge %d is not shared by common elements", eNum);
328 for ( ie = 1; ie <= elems; ie++ ) {
330 if ( elem ==
this ) {
361 int ipsize = iPartitions->
giveSize();
362 for (
int i = 1; i <= ipsize; i++ ) {
363 if ( jPartitions->
contains( iPartitions->
at(i) ) && ( iPartitions->
at(i) != myrank ) ) {
379 for (
int n: nodes ) {
383 answer = answer / nodes.giveSize();
440 double elength1, elength2, elength3;
447 if ( elength2 > elength1 ) {
449 if ( elength3 > elength2 ) {
452 }
else if ( elength3 > elength1 ) {
482 double elength [ 6 ], maxlength, maxlen [ 4 ];
483 int i, j, side, l_nd [ 4 ], ind [ 6 ];
487 }, ed_side [ 6 ] [ 2 ] = { { 0, 1 }, { 0, 2 }, { 0, 3 }, { 3, 1 }, { 1, 2 }, { 2, 3 } };
490 int ed [ 4 ] [ 4 ] = { { 0, 1, 3, 4 }, { 1, 0, 2, 5 }, { 3, 2, 0, 6 }, { 4, 5, 6, 0 } };
491 #ifdef __PARALLEL_MODE 497 for ( i = 0; i < 4; i++ ) {
499 #ifdef __PARALLEL_MODE 507 for ( i = 0; i < 3; i++ ) {
508 #ifdef __PARALLEL_MODE 509 if ( g_nd [ i ] > g_nd [ i + 1 ] ) {
511 if ( l_nd [ i ] > l_nd [ i + 1 ] ) {
514 #ifdef __PARALLEL_MODE 516 g_nd [ i ] = g_nd [ i + 1 ];
517 g_nd [ i + 1 ] = tmp;
520 l_nd [ i ] = l_nd [ i + 1 ];
521 l_nd [ i + 1 ] = tmp;
523 nd [ i ] = nd [ i + 1 ];
531 ind [ 0 ] = ed [ nd [ 0 ] ] [ nd [ 1 ] ];
532 ind [ 1 ] = ed [ nd [ 0 ] ] [ nd [ 2 ] ];
533 ind [ 2 ] = ed [ nd [ 0 ] ] [ nd [ 3 ] ];
534 ind [ 3 ] = ed [ nd [ 1 ] ] [ nd [ 2 ] ];
535 ind [ 4 ] = ed [ nd [ 1 ] ] [ nd [ 3 ] ];
536 ind [ 5 ] = ed [ nd [ 2 ] ] [ nd [ 3 ] ];
548 maxlength = maxlen [ 0 ] = maxlen [ 1 ] = maxlen [ 2 ] = maxlen [ 3 ] = 0.0;
549 for ( i = 0; i < 6; i++ ) {
550 if ( elength [ i ] > maxlength ) {
551 maxlength = elength [ i ];
553 for ( j = 0; j < 2; j++ ) {
554 side = ed_side [ ind [ i ] - 1 ] [ j ];
555 maxlen [ side ] = elength [ i ];
559 for ( j = 0; j < 2; j++ ) {
560 side = ed_side [ ind [ i ] - 1 ] [ j ];
561 if ( elength [ i ] > maxlen [ side ] ) {
562 maxlen [ side ] = elength [ i ];
581 for ( k = 1; k <= 3; k++ ) {
591 if ( in == 0 || jn == 0 ) {
592 OOFEM_ERROR(
"there is no edge connecting %d and %d on element %d",
598 if ( jn == in + 1 ) {
604 if ( in == jn + 1 ) {
620 for ( k = 1; k <= 4; k++ ) {
630 if ( in == 0 || jn == 0 ) {
631 OOFEM_ERROR(
"there is no edge connecting %d and %d on element %d",
641 if ( jn == in + 1 ) {
651 if ( in == jn + 1 ) {
664 int inode, jnode, iNode, jNode, iNum, eInd;
666 bool boundary =
false;
669 #ifdef __PARALLEL_MODE 678 jnode = ( inode < 3 ) ? inode + 1 : 1;
697 #ifdef DRAW_IRREGULAR_NODES 702 #ifdef __PARALLEL_MODE 703 #ifdef __VERBOSE_PARALLEL 752 #ifdef __PARALLEL_MODE 762 OOFEM_ERROR(
"unshared edge %d of element %d is marked as shared",
774 sharedIrregularsQueue.push_back(iNum);
775 #ifdef __VERBOSE_PARALLEL 792 int i, j, inode, jnode, iNode, jNode, ngb, eIndex, eInd, reg, iNum, side, cnt = 0, elems;
794 int ed_side [ 6 ] [ 2 ] = { { 3, 4 }, { 4, 2 }, { 2, 3 }, { 1, 3 }, { 1, 4 }, { 1, 2 } }, ed [ 4 ] = {
800 int side_ed [ 4 ] [ 3 ] = { { 1, 2, 3 }, { 1, 5, 4 }, { 2, 6, 5 }, { 3, 4, 6 } };
802 bool shared, boundary, iboundary, jboundary, opposite =
false;
808 #ifdef __PARALLEL_MODE 819 for ( i = 0; i < 2; i++ ) {
821 side = ed_side [
leIndex - 1 ] [ i ];
827 for ( j = 0; j < 3; j++ ) {
847 for ( i = 0; i < 2; i++ ) {
849 side = ed_side [
leIndex - 1 ] [ i ];
850 for ( j = 0; j < 3; j++ ) {
867 if ( ed [ 1 ] == ed [ 2 ] ) {
870 if ( ed [ 1 ] != opp_ed [
leIndex - 1 ] ) {
887 for ( i = 0; i < cnt; i++ ) {
896 jnode = ( eIndex < 3 ) ? inode + 1 : 1;
911 double dist, rad, rate;
915 dist = c->
at(1) * c->
at(1) + c->
at(3) * c->
at(3);
916 if ( c->
at(2) > 69.9999999 ) {
918 }
else if ( c->
at(2) < 64.5000001 ) {
921 rad = 18.0 - 11.0 / 5.5 * ( c->
at(2) - 64.5 );
924 if ( fabs(dist - rad * rad) < 0.01 ) {
926 dist = c->
at(1) * c->
at(1) + c->
at(3) * c->
at(3);
927 if ( c->
at(2) > 69.9999999 ) {
929 }
else if ( c->
at(2) < 64.5000001 ) {
932 rad = 18.0 - 11.0 / 5.5 * ( c->
at(2) - 64.5 );
935 if ( fabs(dist - rad * rad) < 0.01 ) {
936 dist = coords.
at(1) * coords.
at(1) + coords.
at(3) * coords.
at(3);
937 if ( coords.
at(2) > 69.9999999 ) {
939 }
else if ( coords.
at(2) < 64.5000001 ) {
942 rad = 18.0 - 11.0 / 5.5 * ( coords.
at(2) - 64.5 );
945 rate = rad / sqrt(dist);
946 coords.
at(1) *= rate;
947 coords.
at(3) *= rate;
963 #ifdef DRAW_IRREGULAR_NODES 969 #ifdef __PARALLEL_MODE 972 OOFEM_LOG_INFO(
"[%d] Irregular %d added on %d [%d] (edge %d, nodes %d %d [%d %d], nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
983 OOFEM_LOG_INFO(
"Irregular %d added on %d (edge %d, nodes %d %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
984 iNum, this->number, eIndex, iNode, jNode,
993 shared = boundary =
false;
995 #ifdef __PARALLEL_MODE 1004 OOFEM_ERROR(
"unshared edge %d of element %d is marked as shared",
1010 shared = boundary =
true;
1016 sharedIrregularsQueue.push_back(iNum);
1017 #ifdef __VERBOSE_PARALLEL 1025 if ( iElems->giveSize() <= jElems->
giveSize() ) {
1033 elems = iElems->findCommonValuesSorted(* jElems, common, 0);
1036 OOFEM_ERROR(
"shared edge %d is not shared by common elements",
1044 for ( j = 1; j <= elems; j++ ) {
1046 if ( elem ==
this ) {
1052 OOFEM_ERROR(
"element %d incident to shared edge %d does not have shared edges",
1068 #ifdef __PARALLEL_MODE 1071 OOFEM_LOG_INFO(
"[%d] Irregular %d added on %d [%d] (edge %d, nodes %d %d [%d %d], nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
1084 OOFEM_LOG_INFO(
"Irregular %d added on %d (edge %d, nodes %d %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
1085 iNum, elem->
giveNumber(), eInd, iNode, jNode,
1102 if ( iboundary ==
true && jboundary ==
true ) {
1113 if ( elem2 ==
this ) {
1131 if ( iboundary ==
true || jboundary ==
true ) {
1141 #ifdef __PARALLEL_MODE 1144 OOFEM_LOG_INFO(
"[%d] Irregular %d added on %d [%d] (edge %d, nodes %d %d [%d %d], nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
1157 OOFEM_LOG_INFO(
"Irregular %d added on %d (edge %d, nodes %d %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
1158 iNum, elem2->
giveNumber(), eInd, iNode, jNode,
1174 ngb = ( eInd > 4 ) ? eInd - 3 : 4;
1183 if ( elem2 !=
this ) {
1186 if ( coords.
at(1) > 0.000001 && coords.
at(1) < 1999.99999 &&
1187 coords.
at(2) > 0.000001 && coords.
at(2) < 249.99999 &&
1188 coords.
at(3) > 0.000001 && coords.
at(3) < 499.99999 ) {
1189 if ( 987.5 - coords.
at(1) > 0.000001 || coords.
at(1) - 1012.5 > 0.000001 || 300.0 - coords.
at(3) > 0.000001 ) {
1190 OOFEM_ERROR(
"Irregular %d [%d %d] not on boundary", iNum, iNode, jNode);
1225 OOFEM_ERROR(
"local outer edge %d %d is not shared by common elements",
1235 for ( j = 1; j <= elems; j++ ) {
1237 if ( elem ==
this ) {
1246 #ifdef __PARALLEL_MODE 1249 OOFEM_LOG_INFO(
"[%d] Irregular %d added on %d [%d] (edge %d, nodes %d %d [%d %d], nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
1262 OOFEM_LOG_INFO(
"Irregular %d added on %d (edge %d, nodes %d %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
1263 iNum, elem->
giveNumber(), eInd, iNode, jNode,
1308 int i, ind, nIrregulars = 0;
1309 int childNum, iedge, jedge, kedge, inode, jnode, knode;
1313 #ifdef __PARALLEL_MODE 1314 bool ishared =
false, jshared =
false, kshared =
false;
1339 jedge = ( iedge < 3 ) ? iedge + 1 : 1;
1340 kedge = ( jedge < 3 ) ? jedge + 1 : 1;
1342 inode = ( iedge > 1 ) ? iedge - 1 : 3;
1343 jnode = ( inode < 3 ) ? inode + 1 : 1;
1344 knode = ( jnode < 3 ) ? jnode + 1 : 1;
1346 #ifdef __PARALLEL_MODE 1375 #ifdef __PARALLEL_MODE 1395 #ifdef __PARALLEL_MODE 1415 #ifdef __PARALLEL_MODE 1417 if ( ishared || kshared ) {
1442 #ifdef __PARALLEL_MODE 1444 if ( ishared || jshared ) {
1457 #ifdef __PARALLEL_MODE 1505 #ifdef __PARALLEL_MODE 1507 if ( ishared || kshared ) {
1531 #ifdef __PARALLEL_MODE 1551 #ifdef __PARALLEL_MODE 1553 if ( ishared || jshared ) {
1566 #ifdef __PARALLEL_MODE 1608 #ifdef __PARALLEL_MODE 1628 #ifdef __PARALLEL_MODE 1630 if ( ishared || kshared ) {
1654 #ifdef __PARALLEL_MODE 1656 if ( ishared || jshared ) {
1669 #ifdef __PARALLEL_MODE 1711 #ifdef __PARALLEL_MODE 1713 if ( ishared || kshared ) {
1737 #ifdef __PARALLEL_MODE 1739 if ( ishared || jshared ) {
1752 #ifdef __PARALLEL_MODE 1782 for ( i = 1; i <= 3; i++ ) {
1822 int irregulars1 = 0, irregulars2 = 0;
1823 int childNum, iedge, jedge, kedge, iiedge, jjedge, kkedge, inode, jnode, knode, nnode, iside, jside, kside, nside;
1824 int i, ind, leIndex1 = 0, leIndex2 = 0;
1828 #ifdef __PARALLEL_MODE 1831 bool ishared =
false, jshared =
false, kshared =
false;
1832 bool iishared =
false, jjshared =
false, kkshared =
false;
1862 jedge = ( iedge < 3 ) ? iedge + 1 : 1;
1863 kedge = ( jedge < 3 ) ? jedge + 1 : 1;
1865 inode = ( iedge > 1 ) ? iedge - 1 : 3;
1866 jnode = ( inode < 3 ) ? inode + 1 : 1;
1867 knode = ( jnode < 3 ) ? jnode + 1 : 1;
1881 #ifdef __PARALLEL_MODE 1917 leIndex1 = leIndex2 = 4;
1940 if ( irregulars1 > 1 ) {
1944 if ( leIndex1 == jjedge ) {
1946 }
else if ( leIndex1 == kedge ) {
1950 if ( leIndex1 != iiedge ) {
1959 if ( irregulars2 > 1 ) {
1963 if ( leIndex2 == kkedge ) {
1965 }
else if ( leIndex2 == jedge ) {
1969 if ( leIndex2 != iiedge ) {
1978 #ifdef __PARALLEL_MODE 1979 int i_shared_id = 0, n_shared_id = 0;
1998 sharedEdgesQueue.push_back(eNum);
2018 sharedEdgesQueue.push_back(eNum);
2036 if ( irregulars1 ) {
2053 #ifdef __PARALLEL_MODE 2055 if ( ishared || kshared || iishared || jjshared ) {
2080 #ifdef __PARALLEL_MODE 2081 OOFEM_LOG_INFO(
"[%d] Child %d generated on parent %d [%d] (leIndex %d, nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d [%d %d %d %d %d %d])\n",
2084 _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2099 OOFEM_LOG_INFO(
"Child %d generated on parent %d (leIndex %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
2100 childNum, this->number, this->leIndex, _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2117 if ( irregulars2 ) {
2133 #ifdef __PARALLEL_MODE 2135 if ( ishared || jshared || iishared || kkshared ) {
2159 #ifdef __PARALLEL_MODE 2191 #ifdef __PARALLEL_MODE 2192 OOFEM_LOG_INFO(
"[%d] Child %d generated on parent %d [%d] (leIndex %d, nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d [%d %d %d %d %d %d])\n",
2195 _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2210 OOFEM_LOG_INFO(
"Child %d generated on parent %d (leIndex %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
2211 childNum, this->number, this->leIndex, _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2219 #ifdef __PARALLEL_MODE 2231 #ifdef __PARALLEL_MODE 2239 #ifdef __PARALLEL_MODE 2243 #ifdef __PARALLEL_MODE 2251 #ifdef __PARALLEL_MODE 2254 #ifdef __PARALLEL_MODE 2257 #ifdef __PARALLEL_MODE 2262 #ifdef __PARALLEL_MODE 2271 #ifdef __PARALLEL_MODE 2274 #ifdef __PARALLEL_MODE 2283 #ifdef __PARALLEL_MODE 2286 #ifdef __PARALLEL_MODE 2296 leIndex1 = leIndex2 = 2;
2319 if ( irregulars1 > 1 ) {
2323 if ( leIndex1 == jedge ) {
2325 }
else if ( leIndex1 == kedge ) {
2329 if ( leIndex1 != iedge ) {
2338 if ( irregulars2 > 1 ) {
2342 if ( leIndex2 == kkedge ) {
2344 }
else if ( leIndex2 == jjedge ) {
2348 if ( leIndex2 != iedge ) {
2357 #ifdef __PARALLEL_MODE 2358 int j_shared_id = 0, k_shared_id = 0;
2377 sharedEdgesQueue.push_back(eNum);
2397 sharedEdgesQueue.push_back(eNum);
2414 if ( irregulars1 ) {
2430 #ifdef __PARALLEL_MODE 2432 if ( ishared || jshared || kshared || iishared ) {
2457 #ifdef __PARALLEL_MODE 2458 OOFEM_LOG_INFO(
"[%d] Child %d generated on parent %d [%d] (leIndex %d, nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d [%d %d %d %d %d %d])\n",
2461 _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2476 OOFEM_LOG_INFO(
"Child %d generated on parent %d (leIndex %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
2477 childNum, this->number, this->leIndex, _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2494 if ( irregulars2 ) {
2510 #ifdef __PARALLEL_MODE 2512 if ( ishared || jjshared || kkshared || iishared ) {
2536 #ifdef __PARALLEL_MODE 2568 #ifdef __PARALLEL_MODE 2569 OOFEM_LOG_INFO(
"[%d] Child %d generated on parent %d [%d] (leIndex %d, nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d [%d %d %d %d %d %d])\n",
2572 _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2587 OOFEM_LOG_INFO(
"Child %d generated on parent %d (leIndex %d, nds %d %d %d %d, ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
2588 childNum, this->number, this->leIndex, _nodes.
at(1), _nodes.
at(2), _nodes.
at(3), _nodes.
at(4),
2596 #ifdef __PARALLEL_MODE 2608 #ifdef __PARALLEL_MODE 2616 #ifdef __PARALLEL_MODE 2619 #ifdef __PARALLEL_MODE 2627 #ifdef __PARALLEL_MODE 2630 #ifdef __PARALLEL_MODE 2633 #ifdef __PARALLEL_MODE 2638 #ifdef __PARALLEL_MODE 2647 #ifdef __PARALLEL_MODE 2650 #ifdef __PARALLEL_MODE 2659 #ifdef __PARALLEL_MODE 2662 #ifdef __PARALLEL_MODE 2667 if ( irregulars1 ) {
2678 if ( irregulars2 ) {
2691 for ( i = 1; i <= 4; i++ ) {
2718 int i, iside, parentNeighbor;
2729 for ( iside = 1; iside <= 3; iside++ ) {
2737 for ( i = 1; i <= ca->
giveSize(); i++ ) {
2763 int i, j, k, iside, parentNeighbor;
2774 for ( iside = 1; iside <= 4; iside++ ) {
2783 for ( i = 1; i <= ca1->
giveSize(); i++ ) {
2792 for ( j = 1; j <= ca2->
giveSize(); j++ ) {
2801 for ( k = 1; k <= ca3->
giveSize(); k++ ) {
2830 OOFEM_ERROR(
"failed for element %d (side %d, elem %d)",
2831 this->
number, iside, parentNeighbor);
2846 for ( i = 1; i <= 4; i++ ) {
2866 for ( k = 1; k <= 3; k++ ) {
2871 OOFEM_ERROR(
"element %d is not neighbor (%d) of element %d",
2875 OOFEM_ERROR(
"element %d is not neighbor (%d) of element %d",
2880 for ( k = 1; k <= 3; k++ ) {
2885 OOFEM_ERROR(
"element %d is not neighbor of element %d",
2890 OOFEM_ERROR(
"negative neighbour %d of %d not expected",
2905 for ( i = 1; i <= 3; i++ ) {
2918 for ( i = 1; i <= 4; i++ ) {
2932 jnode = ( iside < 3 ) ? iside + 1 : 1;
2943 int inode, jnode, knode;
2951 jnode = ( iside < 4 ) ? iside : 1;
2966 double x1, x2, x3, y1, y2, y3;
2975 return sqrt( fabs( 0.5 * ( x2 * y3 + x1 * y2 + y1 * x3 - x2 * y1 - x3 * y2 - x1 * y3 ) ) );
2982 double x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4;
2983 double dx1, dx2, dx3, dy1, dy2, dy3, dz1, dz2, dz3;
3010 vol = ( dx3 * ( dy1 * dz2 - dz1 * dy2 ) + dy3 * ( dz1 * dx2 - dx1 * dz2 ) + dz3 * ( dx1 * dy2 - dy1 * dx2 ) ) / 6.0;
3011 d = exp(log(vol) / 3.0);
3021 int iNode, jNode, el, i;
3026 #if 0 // old version 3031 for ( iside = 1; iside <= 3; iside++ ) {
3033 jNode =
nodes.
at( ( iside == 3 ) ? 1 : iside + 1 );
3036 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3038 if ( el == this->
number ) {
3042 #ifdef __PARALLEL_MODE 3064 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3066 if ( el == this->
number ) {
3070 #ifdef __PARALLEL_MODE 3083 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3085 if ( el == this->
number ) {
3089 #ifdef __PARALLEL_MODE 3106 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3108 if ( el == this->
number ) {
3112 #ifdef __PARALLEL_MODE 3131 int iNode, jNode, kNode, el, i;
3136 #if 0 // old version 3145 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3147 if ( el == this->
number ) {
3151 #ifdef __PARALLEL_MODE 3167 for ( iside = 1; iside <= 3; iside++ ) {
3169 jNode =
nodes.
at( ( iside == 3 ) ? 1 : iside + 1 );
3172 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3174 if ( el == this->
number ) {
3178 #ifdef __PARALLEL_MODE 3195 bool has_i, has_j, has_k;
3204 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3206 if ( el == this->
number ) {
3210 #ifdef __PARALLEL_MODE 3221 if ( has_i && has_j ) {
3225 if ( has_j && has_k ) {
3229 if ( has_k && has_i ) {
3238 for ( i = 1; i <= conn.
giveSize(); i++ ) {
3240 if ( el == this->
number ) {
3244 #ifdef __PARALLEL_MODE 3279 const char *colors[] = {
3284 p [ 0 ].x = ( FPNum ) this->giveCoordinate(1);
3285 p [ 0 ].y = ( FPNum ) this->giveCoordinate(2);
3286 p [ 0 ].z = ( FPNum ) this->giveCoordinate(3);
3288 EASValsSetMType(FILLED_CIRCLE_MARKER);
3289 color = ColorGetPixelFromString(const_cast< char * >(colors [ 0 ]), & suc);
3290 EASValsSetColor(color);
3294 go = CreateMarker3D(p);
3295 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go);
3296 EMAddGraphicsToModel(ESIModel(), go);
3299 color = ColorGetPixelFromString(const_cast< char * >(colors [ 1 ]), & suc);
3300 EASValsSetColor(color);
3303 p [ 0 ].x = ( FPNum ) this->giveCoordinate(1);
3304 p [ 0 ].y = ( FPNum ) this->giveCoordinate(2);
3305 p [ 0 ].z = ( FPNum ) this->giveCoordinate(3);
3306 sprintf(num,
"%d", this->
number);
3307 go = CreateAnnText3D(p, num);
3308 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK, go);
3309 EMAddGraphicsToModel(ESIModel(), go);
3320 const char *colors[] = {
3321 "DodgerBlue",
"black" 3325 color = ColorGetPixelFromString(const_cast< char * >(colors [ 0 ]), & suc);
3326 EASValsSetColor(color);
3327 color = ColorGetPixelFromString(const_cast< char * >(colors [ 1 ]), & suc);
3328 EASValsSetEdgeColor(color);
3331 EASValsSetEdgeFlag(
true);
3344 go = CreateTriangle3D(p);
3346 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
3347 EGAttachObject(go, ( EObjectP )
this);
3348 EMAddGraphicsToModel(ESIModel(), go);
3359 const char *colors[] = {
3360 "DodgerBlue",
"black" 3364 color = ColorGetPixelFromString(const_cast< char * >(colors [ 0 ]), & suc);
3365 EASValsSetColor(color);
3366 color = ColorGetPixelFromString(const_cast< char * >(colors [ 1 ]), & suc);
3367 EASValsSetEdgeColor(color);
3370 EASValsSetEdgeFlag(
true);
3372 EASValsSetFillStyle(FILL_SOLID);
3387 go = CreateTetra(p);
3389 EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK | FILL_MASK, go);
3390 EGAttachObject(go, ( EObjectP )
this);
3391 EMAddGraphicsToModel(ESIModel(), go);
3417 for (
int i = 1; i <= nnodes; i++ ) {
3422 #ifdef __PARALLEL_MODE 3432 for (
int i = 1; i <= nelems; i++ ) {
3435 for (
int j = 1; j <= 3; j++ ) {
3442 for (
int j = 1; j <= 4; j++ ) {
3448 OOFEM_ERROR(
"Unsupported element geometry (element %d)", i);
3452 #ifdef __PARALLEL_MODE 3460 for (
int i = 1; i <= nelems; i++ ) {
3461 #ifdef __PARALLEL_MODE 3470 #ifdef __PARALLEL_MODE 3474 for (
int i = 1; i <= nnodes; i++ ) {
3486 for (
int i = 1; i <= nnodes; i++ ) {
3507 #ifdef DRAW_MESH_BEFORE_BISECTION 3509 for (
int i = 1; i <= nelems; i++ ) {
3510 #ifdef __PARALLEL_MODE 3519 ESIEventLoop(YES,
"Before bisection; Press Ctrl-p to continue");
3535 #ifdef DRAW_MESH_AFTER_BISECTION 3537 for (
int i = 1; i <= nelems; i++ ) {
3542 #ifdef __PARALLEL_MODE 3551 ESIEventLoop(YES,
"After bisection; Press Ctrl-p to continue");
3573 ( * dNew )->resizeDofManagers(nnodes);
3575 for (
int inode = 1; inode <= nnodes; inode++ ) {
3584 for (
Dof *idofPtr: *parentNodePtr ) {
3585 if ( idofPtr->isPrimaryDof() ) {
3586 dof =
new MasterDof( node, idofPtr->giveBcId(), idofPtr->giveIcId(), idofPtr->giveDofID() );
3589 if ( simpleSlaveDofPtr ) {
3600 #ifdef __PARALLEL_MODE 3606 node =
new Node(inode, *dNew);
3608 int ndofs = dofIDArrayPtr.
giveSize();
3612 for (
int idof = 1; idof <= ndofs; idof++ ) {
3617 if ( fabs(coords->
at(1) - 200.0) < 0.000001 ) {
3618 if ( coords->
at(2) > -0.000001 && coords->
at(2) < 97.500001 ) {
3619 dof =
new MasterDof( node, 1, 0, dofIDArrayPtr.
at ( idof ) );
3625 if ( fabs( coords->
at(2) ) < 0.000001 ) {
3626 dof =
new MasterDof( node, 1, 0, dofIDArrayPtr.
at ( idof ) );
3631 if ( fabs( coords->
at(1) ) < 0.000001 ) {
3632 if ( coords->
at(2) > 102.4999999 && coords->
at(2) < 199.9999999 ) {
3639 if ( fabs(coords->
at(2) - 200.0) < 0.000001 ) {
3640 if ( coords->
at(1) > 0.000001 && coords->
at(1) < 200.000001 ) {
3647 dof =
new MasterDof( node, 0, 0, dofIDArrayPtr.
at ( idof ) );
3655 if ( fabs( coords->
at(1) ) < 0.000001 ) {
3656 if ( coords->
at(2) > 0.000001 ) {
3658 dof =
new MasterDof( node, 1, 0, dofIDArrayPtr.
at ( idof ) );
3665 if ( fabs( coords->
at(2) ) < 0.000001 ) {
3666 if ( coords->
at(1) > 0.000001 ) {
3668 dof =
new MasterDof( node, 1, 0, dofIDArrayPtr.
at ( idof ) );
3675 dof =
new MasterDof( node, 0, 0, dofIDArrayPtr.
at ( idof ) );
3683 if ( fabs( coords->
at(1) ) < 0.000001 ) {
3684 if ( coords->
at(2) > 0.000001 ) {
3685 if ( coords->
at(3) > 499.999999 ) {
3686 if ( idof == 1 || idof == 3 ) {
3687 dof =
new MasterDof( node, 1, 0, dofIDArrayPtr.
at ( idof ) );
3695 if ( coords->
at(1) > 1999.999999 ) {
3696 if ( coords->
at(2) > 0.000001 ) {
3697 if ( coords->
at(3) > 499.999999 ) {
3699 dof =
new MasterDof( node, 1, 0, dofIDArrayPtr.
at ( idof ) );
3707 dof =
new MasterDof( node, 0, 0, dofIDArrayPtr.
at ( idof ) );
3717 dist = coords->
at(1) * coords->
at(1) + coords->
at(3) * coords->
at(3);
3718 if ( coords->
at(2) < 88.000001 ) {
3719 if ( coords->
at(2) > 70.000001 ) {
3720 if ( fabs(dist - 7.0 * 7.0) < 0.01 ) {
3721 if ( idof == 1 || idof == 3 ) {
3725 }
else if ( coords->
at(2) > 67.9999999 ) {
3726 rad = 18.0 - 11.0 / 5.5 * ( coords->
at(2) - 64.5 );
3727 if ( fabs(dist - rad * rad) < 0.01 ) {
3728 if ( idof == 1 || idof == 3 ) {
3742 if ( coords->
at(1) > 299.999999 || coords->
at(3) > 299.999999 ) {
3748 if ( coords->
at(1) < 0.00000001 ) {
3760 dof =
new MasterDof( node, 0, 0, dofIDArrayPtr.
at ( idof ) );
3769 #ifdef __PARALLEL_MODE 3778 ( * dNew )->setDofManager(inode, node);
3785 for (
int ielem = 1; ielem <= nelems; ielem++ ) {
3786 #ifdef __PARALLEL_MODE 3797 #ifdef __PARALLEL_MODE 3798 IntArray parentElemMap(nterminals);
3800 ( * dNew )->resizeElements(nterminals);
3802 for (
int ielem = 1; ielem <= nelems; ielem++ ) {
3803 #ifdef __PARALLEL_MODE 3815 #ifdef __PARALLEL_MODE 3822 ir.giveRecordKeywordField(name);
3826 #ifdef __PARALLEL_MODE 3831 ( * dNew )->setElement(eNum, elem);
3840 ( * dNew )->resizeCrossSectionModels(ncrosssect);
3841 for (
int i = 1; i <= ncrosssect; i++ ) {
3847 ( * dNew )->setCrossSection(i, crossSection);
3852 ( * dNew )->resizeMaterials(nmat);
3853 for (
int i = 1; i <= nmat; i++ ) {
3859 ( * dNew )->setMaterial(i, mat);
3864 ( * dNew )->resizeNonlocalBarriers(nbarriers);
3865 for (
int i = 1; i <= nbarriers; i++ ) {
3871 ( * dNew )->setNonlocalBarrier(i, barrier);
3876 ( * dNew )->resizeBoundaryConditions(nbc);
3877 for (
int i = 1; i <= nbc; i++ ) {
3884 ( * dNew )->setBoundaryCondition(i, bc);
3889 ( * dNew )->resizeInitialConditions(nic);
3890 for (
int i = 1; i <= nic; i++ ) {
3894 ic->initializeFrom(& ir);
3895 ( * dNew )->setInitialCondition(i, ic);
3900 ( * dNew )->resizeFunctions(nfunc);
3901 for (
int i = 1; i <= nfunc; i++ ) {
3907 ( * dNew )->setFunction(i, func);
3912 ( * dNew )->resizeSets(nset);
3913 for (
int i = 1; i <= nset; i++ ) {
3917 set =
new Set(i, * dNew);
3918 set->initializeFrom(& ir);
3919 ( * dNew )->setSet(i,
set);
3924 ( * dNew )->postInitialize();
3930 #ifdef __PARALLEL_MODE 3931 OOFEM_LOG_INFO(
"[%d] Subdivision: created new mesh (%d nodes and %d elements) in %.2fs\n",
3932 ( * dNew )->giveEngngModel()->giveRank(), nnodes, eNum, timer.
getUtime() );
3934 OOFEM_LOG_INFO(
"Subdivision: created new mesh (%d nodes and %d elements) in %.2fs\n",
3941 #ifdef __PARALLEL_MODE 3942 #ifdef __VERBOSE_PARALLEL 3943 nnodes = ( * dNew )->giveNumberOfDofManagers();
3944 for (
int inode = 1; inode <= nnodes; inode++ ) {
3945 if ( ( * dNew )->giveDofManager(inode)->giveParallelMode() ==
DofManager_shared ) {
3955 bool nonloc =
false;
3956 nmat = ( * dNew )->giveNumberOfMaterialModels();
3957 for (
int im = 1; im <= nmat; im++ ) {
3967 ( * dNew )->commitTransactions( ( * dNew )->giveTransactionManager() );
3971 for (
int in=1; in<=(*dNew)->giveNumberOfDofManagers(); in++) {
3973 (*dNew)->giveDofManager(in)->giveInputRecord(ir);
3977 for (
int in=1; in<=(*dNew)->giveNumberOfElements(); in++) {
3979 (*dNew)->giveElement(in)->giveInputRecord(ir);
3980 nodes = (*dNew)->giveElement(in)->giveDofManArray();
3982 for (
int ii=1; ii<=nodes.giveSize(); ii++)
3988 nelems = ( * dNew )->giveNumberOfElements();
3989 int localVals [ 2 ], globalVals [ 2 ];
3990 localVals [ 0 ] = 0;
3991 for (
int ielem = 1; ielem <= nelems; ielem++ ) {
3992 if ( ( * dNew )->giveElement(ielem)->giveParallelMode() ==
Element_local ) {
3997 nnodes = ( * dNew )->giveNumberOfDofManagers();
3998 localVals [ 1 ] = 0;
3999 for (
int inode = 1; inode <= nnodes; inode++ ) {
4000 if ( ( * dNew )->giveDofManager(inode)->isLocal() ) {
4005 MPI_Reduce(localVals, globalVals, 2, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
4007 OOFEM_LOG_INFO(
"Subdivision: new mesh info: %d nodes, %d elements in total\n", globalVals [ 1 ], globalVals [ 0 ]);
4023 double iedensity, rdensity;
4024 int repeat = 1, loop = 0, max_loop = 0;
4028 #ifdef __PARALLEL_MODE 4029 int remote_elems = 0;
4033 int *partitionsIrregulars =
new int[ problem_size ];
4038 int maxlocalglobal = 0, maxglobalnumber;
4039 for (
int in = 1; in <= nnodes; in++ ) {
4042 #ifdef __PARALLEL_MODE 4044 MPI_Allreduce(& maxlocalglobal, & maxglobalnumber, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
4046 maxglobalnumber=maxlocalglobal;
4051 while ( repeat && ( loop < max_loop || max_loop == 0 ) ) {
4054 nnodes_old = nnodes;
4055 #ifdef __PARALLEL_MODE 4056 OOFEM_LOG_INFO(
"[%d] Subdivision::bisectMesh: entering bisection loop %d\n", myrank, ++loop);
4058 OOFEM_LOG_INFO(
"Subdivision::bisectMesh: entering bisection loop %d\n", ++loop);
4062 for ( ie = nelems_old + 1; ie <= nelems; ie++ ) {
4064 #ifdef __PARALLEL_MODE 4068 if ( nelems_old == 0 ) {
4071 terminal_local_elems--;
4081 #ifdef __PARALLEL_MODE 4101 if ( rdensity < iedensity ) {
4107 #ifndef __PARALLEL_MODE 4121 #ifdef __PARALLEL_MODE 4122 OOFEM_LOG_INFO(
"[%d] (with %d nodes and %d elems)\n", myrank, nnodes_old, terminal_local_elems + remote_elems);
4124 OOFEM_LOG_INFO(
"(with %d nodes and %d elems)\n", nnodes_old, terminal_local_elems);
4128 #ifdef __PARALLEL_MODE 4135 #ifdef __PARALLEL_MODE 4147 #ifdef __PARALLEL_MODE 4156 #ifndef __PARALLEL_MODE 4171 int localIrregulars = 0;
4172 for ( in = nnodes_old+1; in <= nnodes; in++ ) {
4178 #ifdef __PARALLEL_MODE 4179 #ifdef __VERBOSE_PARALLEL 4180 OOFEM_LOG_INFO(
"[%d] Subdivision::bisectMesh: number of new local irregulars is %d\n", myrank, localIrregulars);
4182 int localOffset = 0;
4183 int irank, gnum, globalIrregulars = 0;
4185 MPI_Allgather(& localIrregulars, 1, MPI_INT, partitionsIrregulars, 1, MPI_INT, MPI_COMM_WORLD);
4187 for ( irank = 0; irank < myrank; irank++ ) {
4188 localOffset += partitionsIrregulars [ irank ];
4191 int availGlobNum = maxglobalnumber + localOffset;
4192 for ( in = nnodes_old+1; in <= nnodes; in++ ) {
4197 #ifdef __VERBOSE_PARALLEL 4205 int availGlobNum = maxglobalnumber+localOffset;
4206 for ( in = nnodes_old+1; in <= nnodes; in++ ) {
4213 #ifdef __PARALLEL_MODE 4216 for ( in = nnodes_old+1; in <= nnodes; in++ ) {
4225 }
else if ( gnum == 0 ) {
4226 OOFEM_ERROR(
"rank [%d] zero globnum identified on node %d", myrank, in);
4231 for ( irank = 0; irank < problem_size; irank++ ) {
4232 globalIrregulars += partitionsIrregulars [ irank ];
4235 if ( globalIrregulars ) {
4236 maxglobalnumber += globalIrregulars;
4246 maxglobalnumber+=localIrregulars;
4252 for ( ie = 1; ie <= nelems; ie++ ) {
4258 #ifdef __PARALLEL_MODE 4267 #ifdef __PARALLEL_MODE 4268 if ( globalIrregulars ) {
4277 for ( in = nnodes_old+1; in <= nnodes; in++ ) {
4283 nelems_old = nelems;
4285 terminal_local_elems = 0;
4286 for ( ie = 1; ie <= nelems; ie++ ) {
4292 #ifdef __PARALLEL_MODE 4299 terminal_local_elems++;
4303 #ifdef __PARALLEL_MODE 4304 int global_repeat = 0;
4307 MPI_Allreduce(& repeat, & global_repeat, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
4308 repeat = global_repeat;
4313 #ifdef DRAW_MESH_AFTER_EACH_BISECTION_LEVEL 4314 for ( ie = 1; ie <= nelems; ie++ ) {
4322 ESIEventLoop( YES, const_cast< char * >(
"Subdivision Bisection; Press Ctrl-p to continue") );
4326 #ifdef __PARALLEL_MODE 4327 if (partitionsIrregulars) {
4328 delete[] partitionsIrregulars;
4337 int nnodes, nelems, i, j, in, ie;
4338 int pos,
number, reg, nd, cycles = 6;
4343 IntArray node_num_elems, node_con_elems;
4344 IntArray node_num_nodes, node_con_nodes;
4346 #ifdef DEBUG_SMOOTHING 4347 char buffer [ 1024 ];
4350 #ifdef __PARALLEL_MODE 4359 node_num_elems.
resize(nnodes + 1);
4360 node_num_elems.
zero();
4362 for ( ie = 1; ie <= nelems; ie++ ) {
4368 #ifdef __PARALLEL_MODE 4382 for ( in = 1; in <= nnodes; in++ ) {
4383 number = node_num_elems.
at(in);
4384 node_num_elems.
at(in) = pos;
4388 node_num_elems.
at(nnodes + 1) = pos;
4389 node_con_elems.
resize(pos);
4392 for ( ie = 1; ie <= nelems; ie++ ) {
4398 #ifdef __PARALLEL_MODE 4406 node_con_elems.
at(node_num_elems.
at( elem->
giveNode(i) )++) = ie;
4412 for ( in = 1; in <= nnodes; in++ ) {
4413 number = node_num_elems.
at(in) - pos;
4414 node_num_elems.
at(in) = pos;
4418 #ifdef DEBUG_SMOOTHING 4419 #ifdef __PARALLEL_MODE 4422 OOFEM_LOG_INFO(
"Subdivision::smoothMesh: connectivity node_id: elem_ids\n");
4424 for ( in = 1; in <= nnodes; in++ ) {
4426 for ( i = node_num_elems.
at(in); i < node_num_elems.
at(in + 1); i++ ) {
4427 sprintf( buffer + len,
" %d", node_con_elems.
at(i) );
4428 len = strlen(buffer);
4429 if ( len >= 1024 ) {
4440 node_num_nodes.
resize(nnodes + 1);
4441 node_num_nodes.
zero();
4443 for ( in = 1; in <= nnodes; in++ ) {
4444 for ( i = node_num_elems.
at(in); i < node_num_elems.
at(in + 1); i++ ) {
4450 node_num_nodes.
at(in)++;
4456 for ( i = node_num_elems.
at(in); i < node_num_elems.
at(in + 1); i++ ) {
4467 for ( in = 1; in <= nnodes; in++ ) {
4468 number = node_num_nodes.
at(in);
4469 node_num_nodes.
at(in) = pos;
4473 node_num_nodes.
at(nnodes + 1) = pos;
4474 node_con_nodes.
resize(pos);
4477 for ( in = 1; in <= nnodes; in++ ) {
4478 for ( i = node_num_elems.
at(in); i < node_num_elems.
at(in + 1); i++ ) {
4484 node_con_nodes.
at(node_num_nodes.
at(in)++) = nd;
4490 for ( i = node_num_elems.
at(in); i < node_num_elems.
at(in + 1); i++ ) {
4501 for ( in = 1; in <= nnodes; in++ ) {
4502 number = node_num_nodes.
at(in) - pos;
4503 node_num_nodes.
at(in) = pos;
4507 #ifdef DEBUG_SMOOTHING 4508 #ifdef __PARALLEL_MODE 4511 OOFEM_LOG_INFO(
"Subdivision::smoothMesh: connectivity node_id: node_ids\n");
4513 for ( in = 1; in <= nnodes; in++ ) {
4515 for ( i = node_num_nodes.
at(in); i < node_num_nodes.
at(in + 1); i++ ) {
4516 sprintf( buffer + len,
" %d", node_con_nodes.
at(i) );
4517 len = strlen(buffer);
4518 if ( len >= 1024 ) {
4534 for ( in = 1; in <= nnodes; in++ ) {
4539 if ( node_num_elems.
at(in) == node_num_elems.
at(in + 1) ) {
4559 for ( i = node_num_elems.
at(in) + 1; i < node_num_elems.
at(in + 1); i++ ) {
4591 orderedNodes.
resize(nnodes);
4592 for ( jn = 1; jn <= nnodes; jn++ ) {
4593 orderedNodes.
at(jn) = jn;
4596 sort(orderedNodes, cmp);
4599 while ( cycles-- ) {
4601 for ( jn = 1; jn <= nnodes; jn++ ) {
4602 in = orderedNodes.
at(jn);
4604 for ( in = 1; in <= nnodes; in++ ) {
4606 #ifdef __PARALLEL_MODE 4627 for ( i = node_num_nodes.
at(in); i < node_num_nodes.
at(in + 1); i++ ) {
4629 if (
mesh->
giveNode( node_con_nodes.
at(i) )->giveCoordinates() ) {
4644 coords->
times( 1.0 / ( node_num_nodes.
at(in + 1) - node_num_nodes.
at(in) ) );
4651 for ( i = node_num_nodes.
at(in); i < node_num_nodes.
at(in + 1); i++ ) {
4655 coords->
times( 1.0 / ( node_num_nodes.
at(in + 1) - node_num_nodes.
at(in) ) );
4661 for ( in = 1; in <= nnodes; in++ ) {
4678 #ifdef __PARALLEL_MODE 4683 int i, minpart, npart;
4687 for ( i = 1; i <= npart; i++ ) {
4688 minpart =
min( minpart, partitions->
at(i) );
4691 if ( minpart == myrank ) {
4711 #ifdef __PARALLEL_MODE 4715 int i, nelems, numberOfLocalElementsToNumber = 0;
4716 int *partitionNumberOfElements =
new int[ problem_size ];
4717 int localMaxGlobnum = 0, globalMaxGlobnum;
4722 for ( i = 1; i <= nelems; i++ ) {
4731 numberOfLocalElementsToNumber++;
4736 MPI_Allgather(& numberOfLocalElementsToNumber, 1, MPI_INT,
4737 partitionNumberOfElements, 1, MPI_INT, MPI_COMM_WORLD);
4738 MPI_Allreduce(& localMaxGlobnum, & globalMaxGlobnum, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD);
4739 #ifdef __VERBOSE_PARALLEL 4740 OOFEM_LOG_INFO(
"[%d] Subdivision::assignGlobalNumbersToElements: max globnum %d, new elements %d\n", myrank, globalMaxGlobnum, numberOfLocalElementsToNumber);
4744 int startOffset = globalMaxGlobnum, availGlobNum;
4745 for ( i = 0; i < myrank; i++ ) {
4746 startOffset += partitionNumberOfElements [ i ];
4750 availGlobNum = startOffset;
4751 for ( i = 1; i <= nelems; i++ ) {
4757 #ifdef __VERBOSE_PARALLEL 4765 if (partitionNumberOfElements) {
4766 delete[] partitionNumberOfElements;
4771 int i, nelems, numberOfLocalElementsToNumber = 0;
4772 int localMaxGlobnum = 0;
4777 for ( i = 1; i <= nelems; i++ ) {
4780 numberOfLocalElementsToNumber++;
4785 int startOffset = localMaxGlobnum, availGlobNum;
4788 availGlobNum = startOffset;
4789 for ( i = 1; i <= nelems; i++ ) {
4801 #ifdef __PARALLEL_MODE 4806 int globalSharedIrregularsQueueEmpty, localSharedIrregularsQueueEmpty = this->
sharedIrregularsQueue.empty();
4807 #ifdef __VERBOSE_PARALLEL 4808 OOFEM_LOG_INFO(
"[%d] Subdivision :: exchangeSharedIrregulars: localSharedIrregularsQueueEmpty %d\n",
4809 this->
giveRank(), localSharedIrregularsQueueEmpty);
4811 MPI_Allreduce(& localSharedIrregularsQueueEmpty, & globalSharedIrregularsQueueEmpty, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);
4812 #ifdef __VERBOSE_PARALLEL 4813 OOFEM_LOG_INFO(
"[%d] Subdivision :: exchangeSharedIrregulars: globalSharedIrregularsQueueEmpty %d\n",
4814 this->
giveRank(), globalSharedIrregularsQueueEmpty);
4816 if ( globalSharedIrregularsQueueEmpty ) {
4819 #ifdef __VERBOSE_PARALLEL 4830 com.finishExchange();
4841 int pi, iNode, jNode, rproc = pc.
giveRank();
4844 std :: list< int > :: const_iterator sharedIrregQueueIter;
4847 if ( rproc == myrank ) {
4855 sharedIrregQueueIter++ ) {
4856 pi = ( * sharedIrregQueueIter );
4858 if ( sharedPartitions->
contains(rproc) ) {
4867 #ifdef __VERBOSE_PARALLEL 4868 OOFEM_LOG_INFO(
"[%d] Subdivision::packSharedIrregulars: packing shared node %d [%d %d] for %d\n",
4869 myrank, pi, edgeInfo.
at(1), edgeInfo.
at(2), rproc);
4883 int ie, _type, iNum, iproc = pc.
giveRank();
4884 int iNode, jNode, elems;
4894 if ( iproc == myrank ) {
4901 pcbuff->
read(_type);
4906 #ifdef __VERBOSE_PARALLEL 4907 OOFEM_LOG_INFO(
"[%d] Subdivision::unpackSharedIrregulars: received shared node record [%d %d] from %d ...\n",
4908 myrank, edgeInfo.
at(1), edgeInfo.
at(2), iproc);
4931 pcbuff->
read(_type);
4936 OOFEM_ERROR(
"[%d] no element found sharing nodes %d[%d] and %d[%d]",
4937 myrank, iNode, edgeInfo.
at(1), jNode, edgeInfo.
at(2));
4944 if ( !elem->giveSharedEdges()->giveSize() ) {
4945 OOFEM_ERROR(
"element %d sharing nodes %d %d has no shared edges",
4946 elem->giveNumber(), iNode, jNode);
4949 if ( !elem->giveSharedEdge(eIndex) ) {
4950 OOFEM_ERROR(
"element %d sharing nodes %d and %d has no shared edge %d",
4951 elem->giveNumber(), iNode, jNode, eIndex);
4955 if ( elem->giveIrregular(eIndex) ) {
4957 #ifdef __VERBOSE_PARALLEL 4958 OOFEM_LOG_INFO(
"...already exists as %d on element %d\n", elem->giveIrregular(eIndex), elem->giveNumber() );
4967 double dist, rad, rate;
4971 dist = c->
at(1) * c->
at(1) + c->
at(3) * c->
at(3);
4972 if ( c->
at(2) > 69.9999999 ) {
4974 }
else if ( c->
at(2) < 64.5000001 ) {
4977 rad = 18.0 - 11.0 / 5.5 * ( c->
at(2) - 64.5 );
4980 if ( fabs(dist - rad * rad) < 0.01 ) {
4982 dist = c->
at(1) * c->
at(1) + c->
at(3) * c->
at(3);
4983 if ( c->
at(2) > 69.9999999 ) {
4985 }
else if ( c->
at(2) < 64.5000001 ) {
4988 rad = 18.0 - 11.0 / 5.5 * ( c->
at(2) - 64.5 );
4991 if ( fabs(dist - rad * rad) < 0.01 ) {
4992 dist = coords.
at(1) * coords.
at(1) + coords.
at(3) * coords.
at(3);
4993 if ( coords.
at(2) > 69.9999999 ) {
4995 }
else if ( coords.
at(2) < 64.5000001 ) {
4998 rad = 18.0 - 11.0 / 5.5 * ( coords.
at(2) - 64.5 );
5001 rate = rad / sqrt(dist);
5002 coords.
at(1) *= rate;
5003 coords.
at(3) *= rate;
5019 #ifdef DRAW_IRREGULAR_NODES 5028 for ( ie = 1; ie <= common.
giveSize(); ie++ ) {
5032 if ( !elem->giveSharedEdges()->giveSize() ) {
5033 OOFEM_ERROR(
"element %d sharing nodes %d %d has no shared edges",
5034 elem->giveNumber(), iNode, jNode);
5037 if ( !elem->giveSharedEdge(eIndex) ) {
5038 OOFEM_ERROR(
"element %d sharing nodes %d and %d has no shared edge %d",
5039 elem->giveNumber(), iNode, jNode, eIndex);
5042 if ( elem->giveIrregular(eIndex) ) {
5043 OOFEM_ERROR(
"element %d sharing nodes %d %d already has irregular",
5044 elem->giveNumber(), iNode, jNode);
5048 elem->setIrregular(eIndex, iNum);
5049 if ( !elem->giveQueueFlag() ) {
5052 elem->setQueueFlag(
true);
5055 #ifdef __VERBOSE_PARALLEL 5056 OOFEM_LOG_INFO(
"...added as %d on element %d\n", iNum, elem->giveNumber() );
5059 if (
domain->
giveElement( elem->giveTopParent() )->giveGeometryType() == EGT_tetra_1 ) {
5062 OOFEM_LOG_INFO(
"[%d] Shared irregular %d added on %d (edge %d, nodes %d %d [%d %d], nds %d %d %d %d [%d %d %d %d], ngbs %d %d %d %d, irr %d %d %d %d %d %d)\n",
5064 elem->giveNumber(), eIndex, iNode, jNode,
5066 elem->giveNode(1), elem->giveNode(2), elem->giveNode(3), elem->giveNode(4),
5071 elem->giveNeighbor(1), elem->giveNeighbor(2), elem->giveNeighbor(3), elem->giveNeighbor(4),
5072 elem->giveIrregular(1), elem->giveIrregular(2), elem->giveIrregular(3),
5073 elem->giveIrregular(4), elem->giveIrregular(5), elem->giveIrregular(6) );
5084 pcbuff->
read(_type);
5101 com.finishExchange();
5113 if ( rproc == myrank ) {
5119 for ( in = 1; in <= nnodes; in++ ) {
5122 if ( sharedPartitions->
contains(rproc) ) {
5130 #ifdef __VERBOSE_PARALLEL 5131 OOFEM_LOG_INFO(
"[%d] packIrregularSharedGlobnums: sending %d [%d] - [%d %d] to %d\n",
5132 myrank, in, -edgeInfo.
at(3), edgeInfo.
at(1), edgeInfo.
at(2), rproc);
5151 int iNode, jNode, iNum, elems;
5158 if ( iproc == myrank ) {
5165 pcbuff->
read(_type);
5190 pcbuff->
read(_type);
5195 OOFEM_ERROR(
"no element found sharing nodes %d and %d",
5206 OOFEM_ERROR(
"element %d sharing nodes %d %d has no shared edges",
5211 OOFEM_ERROR(
"element %d sharing nodes %d and %d has no shared edge %d",
5216 OOFEM_ERROR(
"element %d sharing nodes %d %d does not have irregular",
5226 #ifdef __VERBOSE_PARALLEL 5227 OOFEM_LOG_INFO(
"[%d] Subdivision::unpackIrregularSharedGlobnums: received %d [%d] - [%d %d] from %d\n",
5228 myrank, iNum, -edgeInfo.
at(3), edgeInfo.
at(1), edgeInfo.
at(2), iproc);
5234 pcbuff->
read(_type);
5245 int i, minpart, npart;
5249 for ( i = 1; i <= npart; i++ ) {
5250 minpart =
min( minpart, partitions->
at(i) );
5253 if ( minpart == myrank ) {
5321 s.parentElemMap = & parentMap;
5329 for ( i = 1; i <= nnodes; i++ ) {
5335 for ( i = 1; i <= nelem; i++ ) {
5343 com.finishExchange();
5356 std :: queue< int >elemCandidates;
5357 std :: set< int >remoteElements, processedElements, nodesToSend;
5359 if ( rproc == myrank ) {
5367 #ifdef DRAW_REMOTE_ELEMENTS 5376 remoteElements.insert(i);
5378 #ifdef DRAW_REMOTE_ELEMENTS 5387 #ifdef DRAW_REMOTE_ELEMENTS 5388 ESIEventLoop(YES,
"Remote element packing ; Press Ctrl-p to continue");
5400 for (
int elNum: remoteElements ) {
5403 for ( in = 1; in <= nn; in++ ) {
5408 nodesToSend.insert(inode);
5418 for (
int nodeNum: nodesToSend ) {
5430 for (
int elNum: remoteElements ) {
5453 std :: string _type;
5456 if ( iproc == myrank ) {
5465 pcbuff->
read(_type);
5466 if ( _type.size() == 0 ) {
5471 pcbuff->
read(_globnum);
5474 bool _newentry =
false;
5492 elemPartitions.
at(1) = iproc;
5496 pcbuff->
read(_type);
5497 if ( _type.size() == 0 ) {
5523 int i, pi, iNode, jNode, elems;
5524 std :: list< int > :: const_iterator sharedEdgeQueueIter;
5530 int globalSharedEdgesQueueEmpty, localSharedEdgesQueueEmpty = this->
sharedEdgesQueue.empty();
5531 #ifdef __VERBOSE_PARALLEL 5532 OOFEM_LOG_INFO(
"[%d] Subdivision :: exchangeSharedEdges: localSharedEdgesQueueEmpty %d\n",
5533 this->
giveRank(), localSharedEdgesQueueEmpty);
5535 MPI_Allreduce(& localSharedEdgesQueueEmpty, & globalSharedEdgesQueueEmpty, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);
5536 #ifdef __VERBOSE_PARALLEL 5537 OOFEM_LOG_INFO(
"[%d] Subdivision :: exchangeSharedEdges: globalSharedEdgesQueueEmpty %d\n",
5538 this->
giveRank(), globalSharedEdgesQueueEmpty);
5540 if ( !globalSharedEdgesQueueEmpty ) {
5541 #ifdef __VERBOSE_PARALLEL 5555 sharedEdgeQueueIter++ ) {
5556 pi = ( * sharedEdgeQueueIter );
5564 com.finishExchange();
5569 sharedEdgeQueueIter++ ) {
5570 pi = ( * sharedEdgeQueueIter );
5578 #ifdef __VERBOSE_PARALLEL 5597 OOFEM_ERROR(
"no element found sharing nodes %d and %d corresponding to edge %d",
5602 for ( i = 1; i <= elems; i++ ) {
5606 OOFEM_ERROR(
"element %d sharing nodes %d %d has no shared edges",
5624 int pi, iNode, jNode, rproc = pc.
giveRank();
5627 std :: list< int > :: const_iterator sharedEdgeQueueIter;
5630 if ( rproc == myrank ) {
5638 sharedEdgeQueueIter++ ) {
5639 pi = ( * sharedEdgeQueueIter );
5642 if ( sharedPartitions->
contains(rproc) ) {
5646 #ifdef __VERBOSE_PARALLEL 5647 OOFEM_LOG_INFO(
"[%d] Subdivision::packSharedEdges: sending [%d %d] to %d\n", myrank, edgeInfo.
at(1), edgeInfo.
at(2), rproc);
5665 int iNode, jNode, elems;
5668 std :: list< int > :: const_iterator sharedEdgeQueueIter;
5673 if ( iproc == myrank ) {
5680 pcbuff->
read(_type);
5686 #ifdef __VERBOSE_PARALLEL 5687 OOFEM_LOG_INFO(
"[%d] Subdivision::unpackSharedEdges: receiving [%d %d] from %d\n",
5688 myrank, edgeInfo.
at(1), edgeInfo.
at(2), iproc);
5694 if (!(iNode && jNode)) {
5695 pcbuff->
read(_type);
5719 OOFEM_ERROR(
"element %d sharing nodes %d %d has no shared edges",
5724 OOFEM_ERROR(
"element %d sharing nodes %d and %d has no shared edge %d",
5733 #ifdef __VERBOSE_PARALLEL 5734 OOFEM_LOG_INFO(
"[%d] Partition %d added to shared edge %d (%d %d) [%d %d]\n",
5735 myrank, iproc, elem->
giveSharedEdge(eIndex), iNode, jNode, edgeInfo.
at(1), edgeInfo.
at(2) );
5742 pcbuff->
read(_type);
5755 sharedNodeMap [ key ] = node;
5762 if ( sharedNodeMap.find(_globnum) != sharedNodeMap.end() ) {
5764 return ( sharedNodeMap [ _globnum ]->
giveNumber() );
5777 double icoord, jcoord;
5779 icoord = m->giveNode(i)->giveCoordinates()->at(1);
5780 jcoord = m->giveNode(j)->giveCoordinates()->at(1);
5782 if ( icoord < jcoord ) {
5786 if ( icoord > jcoord ) {
5790 icoord = m->giveNode(i)->giveCoordinates()->at(2);
5791 jcoord = m->giveNode(j)->giveCoordinates()->at(2);
5793 if ( icoord < jcoord ) {
5797 if ( icoord > jcoord ) {
5801 icoord = m->giveNode(i)->giveCoordinates()->at(3);
5802 jcoord = m->giveNode(j)->giveCoordinates()->at(3);
5804 if ( icoord < jcoord ) {
5808 if ( icoord > jcoord ) {
bool contains(int value) const
int addDofManTransaction(DomainTransactionType, int, DofManager *)
void exchangeSharedEdges()
Subdivision * giveSubdivision()
virtual void importConnectivity(ConnectivityTable *ct)
Material * createMaterial(const char *name, int num, Domain *domain)
Creates new instance of material corresponding to given keyword.
contextIOResultType storeYourself(DataStream &stream) const
Stores array to output stream.
void buildTopLevelNodeConnectivity(Subdivision::RS_Node *node)
void setEdgeNodes(int i, int j)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
int unpackSharedEdges(Subdivision *s, ProcessCommunicator &pc)
#define SUBDIVISION_SHARED_IRREGULAR_REC_TAG
virtual void importConnectivity(ConnectivityTable *ct)
virtual void makeSharedEdges()=0
std::list< int > sharedIrregularsQueue
DofManager in active domain is shared only by remote elements (these are only introduced for nonlocal...
virtual int evaluateLongestEdge()
void setLeIndex(int _n)
Sets the longest edge index.
int operator()(int i, int j)
int giveNumberOfSets() const
Returns number of sets.
bool isNeighborOf(Subdivision::RS_Element *elem)
Function * createFunction(const char *name, int num, Domain *domain)
Creates new instance of load time function corresponding to given keyword.
int giveDofManagerNumber(int i) const
Translates local to global indices for dof managers.
int giveEdgeIndex(int iNode, int jNode)
Abstract base class for all nonlocal barriers.
int addElementTransaction(DomainTransactionType, int, Element *)
Class implementing general initial condition.
void initGlobalSharedNodeMap()
dofManagerParallelMode giveParallelMode() const
int giveGlobalNumber() const
InitialCondition * giveIc(int n)
Service for accessing particular domain ic.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
REGISTER_Mesher(FreemInterface, MPT_FREEM)
ProblemCommunicator * giveProblemCommunicator(EngngModelCommType t)
void setEdgeNodes(int i, int j)
int importConnectivity(ConnectivityTable *ct)
int giveEdgeIndex(int iNode, int jNode)
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
virtual void update_neighbours()
int packAllData(T *ptr, int(T::*packFunc)(ProcessCommunicator &))
Pack all problemCommunicators data to their send buffers.
bool hasIrregulars()
Returns true if element has some irregular nodes.
void generate(std::list< int > &sharedEdgesQueue)
virtual double giveRequiredDensity()
NonlocalBarrier * giveNonlocalBarrier(int n)
Service for accessing particular domain nonlocal barrier representation.
void zero()
Sets all component to zero.
double & at(int i)
Coefficient access function.
NonlocalBarrier * createNonlocalBarrier(const char *name, int num, Domain *domain)
Creates new instance of nonlocal barrier corresponding to given keyword.
int max(int i, int j)
Returns bigger value form two given decimals.
int giveGlobalNumber() const
int packIrregularSharedGlobnums(Subdivision *s, ProcessCommunicator &pc)
#define OOFEG_RAW_GEOMETRY_LAYER
void setBoundaryFlag(bool isBoundary)
Sets the boundary flag.
const IntArray * giveNeighbors()
std::queue< int > subdivqueue
void giveSideNodes(int iside, IntArray &snodes)
int packSharedIrregulars(Subdivision *s, ProcessCommunicator &pc)
virtual const char * giveInputRecordName() const =0
int giveNumberOfInitialConditions() const
Returns number of initial conditions in domain.
ConnectivityTable * giveConnectivityTable()
Returns receiver's associated connectivity table.
const IntArray * givePartitionList()
Returns partition list of receiver.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
void setElementColor(EPixel color)
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
const IntArray & giveDefaultNodeDofIDArry()
Returns default DofID array which defines physical meaning of particular DOFs.
virtual void generate(std::list< int > &sharedEdgesQueue)
int evaluateLongestEdge()
int packSharedEdges(Subdivision *s, ProcessCommunicator &pc)
int giveSharedEdge(int iedge)
Abstract base class for all finite elements.
DofManager * createDofManager(const char *name, int num, Domain *domain)
Creates new instance of Dof manager corresponding to given keyword.
Base class for dof managers.
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
CrossSection * createCrossSection(const char *name, int num, Domain *domain)
Creates new instance of cross section corresponding to given keyword.
void setNeighbor(int iside, int nb)
int unpackSharedIrregulars(Subdivision *s, ProcessCommunicator &pc)
int giveNumberOfElements() const
Returns number of elements in domain.
GeneralBoundaryCondition * createBoundaryCondition(const char *name, int num, Domain *domain)
Creates new instance of boundary condition corresponding to given keyword.
bool isNodeLocalSharedIrregular(Subdivision::RS_Node *node, int myrank)
Returns true if receiver is irregular, shared node locally maintatined.
void assignGlobalNumbersToElements(Domain *d)
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order ...
int giveRank()
Returns corresponding rank of associated partition.
domainType giveDomainType()
Returns domain type.
bool isNodeLocalIrregular(Subdivision::RS_Node *node, int myrank)
void numberSharedEdges(int iNode, IntArray &connNodes)
#define SHARED_IRREGULAR_DATA_TAG
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual double giveRequiredDofManDensity(int num, TimeStep *tStep, int relative=0)=0
Returns the required mesh size n given dof manager.
IntArray neghbours_base_elements
FloatArray * giveCoordinates()
IntArray partitions
List of partition sharing the shared dof manager or remote partion containing remote dofmanager count...
void sort(IntArray &arry, operation op)
Sorts the receiver using quicksort algorithm.
void setParallelMode(dofManagerParallelMode _mode)
Sets parallel mode of receiver.
int buildTopLevelNodeConnectivity(ConnectivityTable *ct)
void setPartitions(IntArray _p)
bool isTerminal()
Returns true if receiver is terminal (not further subdivided)
This class represents the Rivara Subdivision algorithm for triangular meshes.
void setParallelMode(elementParallelMode _mode)
Sets parallel mode of element.
bool containsOnlyZeroes() const
Checks if receiver is all zero.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
const IntArray * giveToSendMap()
Returns receiver to send map.
Base abstract class representing cross section in finite element mesh.
virtual void bisect(std::queue< int > &subdivqueue, std::list< int > &sharedIrregularsQueue)
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
DofManager * giveDofManager(int label)
ErrorEstimator * giveErrorEstimator()
Returns Error Estimator associated to receiver.
void addEdge(Subdivision::RS_SharedEdge *obj)
void setParallelMode(dofManagerParallelMode _mode)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
elementParallelMode giveParallelMode() const
Class representing "master" degree of freedom.
const IntArray * givePartitions()
int giveMasterDofManagerNum() const
Returns Master Dof Manager Number.
virtual bool isIrregular()
CrossSection * giveCrossSection(int n)
Service for accessing particular domain cross section model.
Class representing domain transaction manager.
int packRemoteElements(RS_packRemoteElemsStruct *s, ProcessCommunicator &pc)
RS_Tetra(int number, Subdivision::RS_Mesh *mesh, int parent, IntArray &nodes)
void insertSorted(int value, int allocChunk=0)
Inserts given value into a receiver, which is assumed to be sorted.
EPixel getActiveCrackColor()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define OOFEM_LOG_INFO(...)
DomainTransactionManager * giveTransactionManager()
Returns domain transaction manager.
Material * giveMaterial(int n)
Service for accessing particular domain material model.
Element * giveElement(int n)
Service for accessing particular domain fe element.
void addPartition(int _p, int allocChunk)
void numberSharedEdges(int iNode, IntArray &connNodes)
virtual int write(const int *data, int count)
Writes count integer values from array pointed by data.
void setIrregular(int iedge, int ir)
void insertConnectedElement(int num)
void setDomainType(domainType _dType)
Sets domain type.
void clear()
Clears the array (zero size).
DofIDItem
Type representing particular dof type.
#define SUBDIVISION_MIGRATE_REMOTE_ELEMENTS_TAG
void addElement(Subdivision::RS_Element *obj)
#define OOFEG_RAW_GEOMETRY_WIDTH
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
#define _IFT_Element_nodes
Set of elements, boundaries, edges and/or nodes.
void giveSideNodes(int iside, IntArray &snodes)
int giveNeighbor(int iside)
void setLoadArray(IntArray &load)
Sets the array of applied loadings of the receiver.
int giveNumberOfCrossSectionModels() const
Returns number of cross section models in domain.
Class representing connectivity table.
int giveNumberOfMaterialModels() const
Returns number of material models in domain.
Class representing process communicator for engineering model.
Set * giveSet(int n)
Service for accessing particular domain set.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void giveEdgeNodes(int &i, int &j)
double giveRequiredDensity()
Abstract base class for all boundary conditions of problem.
virtual RemeshingCriteria * giveRemeshingCrit()=0
Returns reference to associated remeshing criteria.
int giveIrregular(int iedge)
virtual int giveEdgeIndex(int iNode, int jNode)=0
Abstract base class for all material models.
double distance_square(const FloatArray &iP1, const FloatArray &iP2, double &oXi, double &oXiUnbounded) const
void resize(int n)
Checks size of receiver towards requested bounds.
void generate(std::list< int > &sharedEdgesQueue)
void giveElementNeighbourList(IntArray &answer, IntArray &elemList)
Returns list of neighboring elements to given elements (they are included too).
virtual returnCode createMesh(TimeStep *tStep, int domainNumber, int domainSerNum, Domain **dNew)
Runs the mesh generation, mesh will be written to corresponding domain din file.
contextIOResultType restoreYourself(DataStream &stream)
Restores array from image on stream.
int giveNumberOfElements()
void setSharedEdge(int iedge, int num)
void appendDof(Dof *dof)
Adds the given Dof into the receiver.
Function * giveFunction(int n)
Service for accessing particular domain load time function.
RS_Triangle(int number, Subdivision::RS_Mesh *mesh, int parent, IntArray &nodes)
(Dynamic) In this case the communication pattern and the amount of data sent between nodes is not kno...
void bisect(std::queue< int > &subdivqueue, std::list< int > &sharedIrregularsQueue)
Class representing vector of real numbers.
void setPartitionList(const IntArray *_p)
Sets receiver's partition list.
void setNumberOfDofs(int _ndofs)
Sets number of dofs of the receiver; Deallocates existing DOFs; Resizes the dofArray accordingly...
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
virtual void drawGeometry()
int giveSerialNumber()
Returns domain serial (version) number.
bool isNeighborOf(Subdivision::RS_Element *elem)
#define SUBDIVISION_END_DATA
int giveSharedPartitions(IntArray &partitions)
int unpackIrregularSharedGlobnums(Subdivision *s, ProcessCommunicator &pc)
Element is local, there are no contributions from other domains to this element.
Abstract base class representing a function with vector input and output.
void giveNodeNeighbourList(IntArray &answer, IntArray &nodeList)
Returns list of elements sharing given nodes.
void bisect(std::queue< int > &subdivqueue, std::list< int > &sharedIrregularsQueue)
void setGlobalNumber(int gn)
bool exchangeSharedIrregulars()
Exchanges the shared irregulars between partitions.
Class representing "slave" degree of freedom.
Class representing communicator.
const IntArray * giveChildren()
bool containsNode(int _node)
virtual double giveDensity()
Subdivision::RS_SharedEdge * giveEdge(int i)
virtual void giveSideNodes(int iside, IntArray &snodes)=0
int giveNumberOfFunctions() const
Returns number of load time functions in domain.
#define SHARED_EDGE_DATA_TAG
#define CM_DefinitionGlobal
int evaluateLongestEdge()
void exchangeRemoteElements(Domain *d, IntArray &)
void setPartitionList(IntArray &pl)
Sets partition list of receiver.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
void zero()
Zeroes all coefficients of receiver.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Class implementing single timer, providing wall clock and user time capabilities. ...
const IntArray * givePartitions()
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
int giveNumberOfNonlocalBarriers() const
Returns number of nonlocal integration barriers.
void setGlobalNumber(int num)
Sets receiver globally unique number.
void times(double s)
Multiplies receiver with scalar.
ClassFactory & classFactory
Element in active domain is only mirror of some remote element.
void addNode(Subdivision::RS_Node *obj)
IntArray * giveLoadArray()
Returns the array containing applied loadings of the receiver.
virtual FloatArray * giveCoordinates()
int giveNumberOfProcesses()
OutputManager * giveOutputManager()
Returns domain output manager.
ProcessCommunicator * giveProcessCommunicator(int i)
Returns i-th problem communicator.
virtual int read(int *data, int count)
Reads count integer values into array pointed by data.
void insertGlobalSharedNodeMap(Subdivision::RS_Node *node)
int min(int i, int j)
Returns smaller value from two given decimals.
The Communicator and corresponding buffers (represented by this class) are separated in order to allo...
#define SUBDIVISION_SHARED_EDGE_REC_TAG
void setParallelMode(elementParallelMode _mode)
Abstract base class representing the "problem" under consideration.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
void preallocate(int futureSize)
Preallocates receiver to given futureSize if larger then allocatedSize.
std::list< int > sharedEdgesQueue
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
const IntArray * giveNodes()
Node * giveNode(int n)
Service for accessing particular domain node.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void setQueueFlag(bool _qf)
IntArray connectedElements
int sharedNodeGlobal2Local(int _globnum)
Class implementing node in finite element mesh.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Element * createElement(const char *name, int num, Domain *domain)
Creates new instance of element corresponding to given keyword.
DofManager is local, there are no contribution from other domains to this DofManager.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
double getUtime()
Returns total user time elapsed in seconds.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Subdivision::RS_Element * giveElement(int i)
void setGlobalNumber(int newNumber)
Sets receiver global number.
int findCommonValuesSorted(const IntArray &iarray, IntArray &common, int allocChunk=0) const
Extracts common values in receiver and iarray.
Subdivision::RS_Node * giveNode(int i)
const IntArray * giveSharedEdges()
Class representing solution step.
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.
void preallocateConnectedElements(int size)
void add(const FloatArray &src)
Adds array src to receiver.
void setPartitions(IntArray _p)
int unpackRemoteElements(Domain *d, ProcessCommunicator &pc)
void assignGlobalNumbersToSharedIrregulars()
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
virtual void importConnectivity(ConnectivityTable *ct)=0
void setGlobalNumber(int gn)
const IntArray * giveConnectedElements()