8 #define _USE_MATH_DEFINES
29 :
Intx2Mesh( mbimpl ), areaMethod( amethod ), plane( 0 ), Rsrc( 0.0 ), Rdest( 0.0 )
55 for(
int i = 1; i < nsTgt; i++ )
57 middle = 1. / nsTgt * middle;
60 for(
int j = 0; j < nsTgt; j++ )
67 for(
int j = 1; j < nsTgt - 1; j++ )
86 bool check_boxes_first )
103 if( check_boxes_first )
113 if( !overlap3d && (
plane != planeb ) )
117 if( !overlap3d &&
plane == planeb )
119 for(
int j = 0; j < nsBlue; j++ )
132 for(
int j = 0; j < nsTgt; j++ )
137 for(
int j = 0; j < nsBlue; j++ )
146 for(
int j = 0; j < nsBlue; j++ )
155 std::cout <<
"gnomonic plane: " <<
plane <<
"\n";
156 std::cout <<
" target src\n";
157 for(
int j = 0; j < nsTgt; j++ )
161 for(
int j = 0; j < nsBlue; j++ )
173 if( extraPoints >= 1 )
175 for(
int k = 0; k < nsBlue; k++ )
184 markb[( k + nsBlue - 1 ) % nsBlue] =
196 if( extraPoints >= 1 )
198 for(
int k = 0; k < nsTgt; k++ )
204 markr[( k + nsTgt - 1 ) % nsTgt] =
221 for(
int k = 1; k < nP - 1; k++ )
223 #ifdef CHECK_CONVEXITY
225 for(
int k = 0; k < nP; k++ )
227 int k1 = ( k + 1 ) % nP;
228 int k2 = ( k1 + 1 ) % nP;
230 if( orientedArea < 0 && fabs(orientedArea) > std::numeric_limits<double>::epsilon() )
232 std::cout <<
" oriented area is negative: " << orientedArea <<
" k:" << k <<
" target, src:" << tgt
233 <<
" " << src <<
" \n";
256 for(
int n = 0; n < nP; n++ )
257 std::cout <<
" \t" << iP[2 * n] <<
"\t" << iP[2 * n + 1] <<
"\n";
271 std::vector< EntityHandle > foundIds;
272 foundIds.resize( nP );
273 #ifdef CHECK_CONVEXITY
279 for(
int i = 0; i < nP; i++ )
281 double* pp = &iP[2 * i];
290 for( j = 0; j < nsTgt && !found; j++ )
299 #ifdef CHECK_CONVEXITY
311 for( j = 0; j < nsBlue && !found; j++ )
321 #ifdef CHECK_CONVEXITY
336 double minArea = 1.e+38;
338 for( j = 0; j < nsTgt; j++ )
340 int j1 = ( j + 1 ) % nsTgt;
347 if( area < minArea && checkx < 2 *
epsilon_1 )
354 assert( index_min >= 0 );
364 std::cerr <<
" error in adjacent target edge: " <<
mb->
id_from_handle( adjTgtEdges[index_min] )
372 int nbExtraNodesSoFar = expts->size();
373 if( nbExtraNodesSoFar > 0 )
375 std::vector< CartVect > coords1;
376 coords1.resize( nbExtraNodesSoFar );
377 mb->
get_coords( &( *expts )[0], nbExtraNodesSoFar, &( coords1[0][0] ) );
379 for(
int k = 0; k < nbExtraNodesSoFar && !found; k++ )
382 double d2 = ( pos - coords1[k] ).
length();
386 foundIds[i] = ( *expts )[k];
387 #ifdef CHECK_CONVEXITY
401 ( *expts ).push_back( outNode );
404 foundIds[i] = outNode;
411 std::cout <<
" target quad: ";
412 for(
int j1 = 0; j1 < nsTgt; j1++ )
416 std::cout <<
" a point pp is not on a target quad " << *pp <<
" " << pp[1] <<
" target quad "
424 std::cout <<
" candidate polygon: nP" << nP <<
" plane: " <<
plane <<
"\n";
425 for(
int i1 = 0; i1 < nP; i1++ )
426 std::cout << iP[2 * i1] <<
" " << iP[2 * i1 + 1] <<
" " << foundIds[i1] <<
"\n";
433 #ifdef CHECK_CONVEXITY
464 #ifdef CHECK_CONVEXITY
466 std::vector< double > coords;
467 coords.resize( 3 * nP );
469 std::vector< CartVect > posi( nP );
472 for(
int k = 0; k < nP; k++ )
474 int k1 = ( k + 1 ) % nP;
475 int k2 = ( k1 + 1 ) % nP;
476 double orientedArea =
478 if( orientedArea < 0 )
480 std::cout <<
" np before 1 , 2, current " << npBefore1 <<
" " << npBefore2 <<
" " << nP <<
"\n";
481 for(
int i = 0; i < nP; i++ )
483 int nexti = ( i + 1 ) % nP;
484 double lengthEdge = ( posi[i] - posi[nexti] ).
length();
485 std::cout <<
" " << foundIds[i] <<
" edge en:" << lengthEdge <<
"\n";
487 std::cout <<
" old verts: " << oldNodes <<
" other intx:" << otherIntx <<
"\n";
489 std::cout <<
"rank:" <<
my_rank <<
" oriented area in 3d is negative: " << orientedArea <<
" k:" << k
490 <<
" target, src:" << tgt <<
" " << src <<
" \n";
498 std::cout <<
"Counting: " <<
counting <<
"\n";
499 std::cout <<
" polygon " <<
mb->
id_from_handle( polyNew ) <<
" nodes: " << nP <<
" :";
500 for(
int i1 = 0; i1 < nP; i1++ )
502 std::cout <<
" plane: " <<
plane <<
"\n";
503 std::vector< CartVect > posi( nP );
505 for(
int i1 = 0; i1 < nP; i1++ )
506 std::cout << foundIds[i1] <<
" " << posi[i1] <<
"\n";
508 std::stringstream fff;
509 fff <<
"file0" <<
counting <<
".vtk";
544 if( numTracers < 1 )
MB_CHK_SET_ERR( MB_FAILURE,
"no tracers data" );
546 std::vector< double > currentVals(
rs2.
size() * numTracers );
553 int n = remote_cells->get_n();
556 remote_cells_with_tracers =
new TupleList();
557 remote_cells_with_tracers->initialize( 2, 0, 1, numTracers,
559 remote_cells_with_tracers->enableWriteAccess();
560 for(
int i = 0; i < n; i++ )
562 remote_cells_with_tracers->vi_wr[2 * i] = remote_cells->vi_wr[2 * i];
563 remote_cells_with_tracers->vi_wr[2 * i + 1] = remote_cells->vi_wr[2 * i + 1];
565 remote_cells_with_tracers->vul_wr[i] =
566 remote_cells->vul_wr[i];
567 for(
int k = 0; k < numTracers; k++ )
568 remote_cells_with_tracers->vr_wr[numTracers * i + k] = 0;
569 remote_cells_with_tracers->inc_n();
573 remote_cells =
nullptr;
578 std::vector< double > newValues(
rs2.
size() * numTracers,
582 double check_intx_area = 0.;
587 int srcIndex, tgtIndex;
599 check_intx_area += areap;
608 if( !remote_cells_with_tracers )
MB_CHK_SET_ERR( MB_FAILURE,
"no remote cells, failure\n" );
612 "can't get arrival target for corresponding source gid" );
614 int index_in_remote = remote_cells_with_tracers->find( 1, global_id_src );
615 if( index_in_remote == -1 )
616 MB_CHK_SET_ERR( MB_FAILURE,
"can't find the global id element in remote cells\n" );
617 for(
int k = 0; k < numTracers; k++ )
618 remote_cells_with_tracers->vr_wr[index_in_remote * numTracers + k] +=
619 currentVals[numTracers * ( tgtIndex - 1 ) + k] * areap;
624 int arrTgtIndex =
rs2.
index( tgtArr );
625 if( -1 == arrTgtIndex )
MB_CHK_SET_ERR( MB_FAILURE,
"can't find the target arrival index" );
626 for(
int k = 0; k < numTracers; k++ )
627 newValues[numTracers * arrTgtIndex + k] += currentVals[( tgtIndex - 1 ) * numTracers + k] * areap;
631 MB_CHK_SET_ERR( rval,
"can't get arrival target for corresponding " );
636 if( remote_cells_with_tracers )
640 ( parcomm->proc_config().crystal_router() )->gs_transfer( 1, *remote_cells_with_tracers, 0 );
644 int n = remote_cells_with_tracers->get_n();
645 for(
int j = 0; j < n; j++ )
647 EntityHandle tgtCell = remote_cells_with_tracers->vul_rd[j];
648 int arrTgtIndex =
rs2.
index( tgtCell );
649 if( -1 == arrTgtIndex )
MB_CHK_SET_ERR( MB_FAILURE,
"can't find the target arrival index" );
650 for(
int k = 0; k < numTracers; k++ )
651 newValues[arrTgtIndex * numTracers + k] += remote_cells_with_tracers->vr_rd[j * numTracers + k];
658 void* data =
nullptr;
660 std::vector< double > total_mass_local( numTracers, 0. );
661 while( iter !=
rs2.
end() )
664 double* ptrArea = (
double*)data;
665 for(
int i = 0; i < count; i++, ++iter, j++, ptrArea++ )
667 for(
int k = 0; k < numTracers; k++ )
669 total_mass_local[k] += newValues[j * numTracers + k];
670 newValues[j * numTracers + k] /= ( *ptrArea );
677 std::vector< double > total_mass( numTracers, 0. );
678 double total_intx_area = 0;
680 MPI_Reduce( &total_mass_local[0], &total_mass[0], numTracers, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD );
681 if( MPI_SUCCESS != mpi_err )
return MB_FAILURE;
683 mpi_err = MPI_Reduce( &check_intx_area, &total_intx_area, 1, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD );
684 if( MPI_SUCCESS != mpi_err )
return MB_FAILURE;
687 for(
int k = 0; k < numTracers; k++ )
688 std::cout <<
"total mass now tracer k=" << k + 1 <<
" " << total_mass[k] <<
"\n";
689 std::cout <<
"check: total intersection area: (4 * M_PI * R^2): " << 4 * M_PI *
Rsrc *
Rsrc <<
" "
690 << total_intx_area <<
"\n";
693 if( remote_cells_with_tracers )
695 delete remote_cells_with_tracers;
696 remote_cells_with_tracers =
nullptr;
699 for(
int k = 0; k < numTracers; k++ )
700 std::cout <<
"total mass now tracer k=" << k + 1 <<
" " << total_mass_local[k] <<
"\n";
701 std::cout <<
"check: total intersection area: (4 * M_PI * R^2): " << 4 * M_PI *
Rsrc *
Rsrc <<
" "
702 << check_intx_area <<
"\n";
712 return Intx2Mesh::build_processor_euler_boxes( euler_set, local_verts, gnomonic );
719 int num_local_verts = (int)local_verts.
size();
721 assert( parcomm !=
nullptr );
723 if( num_local_verts == 0 )
727 "can't get local vertices from set" );
728 num_local_verts = (int)local_verts.
size();
734 for(
int i = 0; i < 6; i++ )
736 gnom_box[4 * i] = gnom_box[4 * i + 1] = DBL_MAX;
737 gnom_box[4 * i + 2] = gnom_box[4 * i + 3] = -DBL_MAX;
743 std::vector< double > coords( 3 * num_local_verts );
747 std::vector< int > gnplane;
748 gnplane.resize( num_local_verts );
749 for(
int i = 0; i < num_local_verts; i++ )
751 CartVect pos( &coords[3 * i] );
776 std::vector< double > elco( 3 * nnodes );
777 std::set< int > planes;
778 for(
int i = 0; i < nnodes; i++ )
780 int ix = local_verts.
index( conn[i] );
781 planes.insert( gnplane[ix] );
782 for(
int j = 0; j < 3; j++ )
784 elco[3 * i + j] = coords[3 * ix + j];
788 for( std::set< int >::iterator st = planes.begin(); st != planes.end(); ++st )
791 for(
int i = 0; i < nnodes; i++ )
793 CartVect pos( &elco[3 * i] );
798 for(
int k = 0; k < 2; k++ )
801 if( val < gnom_box[4 * ( pl - 1 ) + k] ) gnom_box[4 * ( pl - 1 ) + k] = val;
802 if( val > gnom_box[4 * ( pl - 1 ) + 2 + k] )
803 gnom_box[4 * ( pl - 1 ) + 2 + k] = val;
809 int numprocs = parcomm->proc_config().proc_size();
812 my_rank = parcomm->proc_config().proc_rank();
813 for(
int k = 0; k < 24; k++ )
818 #if ( MPI_VERSION >= 2 )
820 mpi_err = MPI_Allgather( MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, &
allBoxes[0], 24, MPI_DOUBLE,
821 parcomm->proc_config().proc_comm() );
824 std::vector< double > allBoxes_tmp( 24 * parcomm->proc_config().proc_size() );
825 mpi_err = MPI_Allgather( &
allBoxes[24 *
my_rank], 6, MPI_DOUBLE, &allBoxes_tmp[0], 24, MPI_DOUBLE,
826 parcomm->proc_config().proc_comm() );
830 if( MPI_SUCCESS != mpi_err )
return MB_FAILURE;
835 std::cout <<
" maximum number of vertices per cell are " <<
max_edges_1 <<
" on first mesh and " <<
max_edges_2
836 <<
" on second mesh \n";
837 for(
int i = 0; i < numprocs; i++ )
839 std::cout <<
"task: " << i <<
" \n";
840 for(
int pl = 1; pl <= 6; pl++ )
842 std::cout <<
" plane " << pl <<
" min: \t" <<
allBoxes[24 * i + 4 * ( pl - 1 )] <<
" \t"
843 <<
allBoxes[24 * i + 4 * ( pl - 1 ) + 1] <<
"\n";
844 std::cout <<
" \t max: \t" <<
allBoxes[24 * i + 4 * ( pl - 1 ) + 2] <<
" \t"
845 <<
allBoxes[24 * i + 4 * ( pl - 1 ) + 3] <<
"\n";
872 "can't create original sending processor tag" );
874 assert( parcomm !=
nullptr );
877 "can't get cells by dimension from mesh set" );
879 if( 1 == parcomm->proc_config().proc_size() )
889 "can't get vertices from mesh set" );
899 "can't create sending processor tag" );
905 int orig_sender = -1;
910 int size_gdofs_tag = 0;
911 std::vector< int > valsDOFs;
912 Tag gdsTag =
nullptr;
917 int size_imask_tag = 0;
922 if( meshCells.size() > 0 )
924 oneCell = meshCells[0];
926 "can't get original sending processor value" );
938 valsDOFs.resize( lenTag, -1 );
944 size_gdofs_tag = lenTag;
957 int local_int_array[3], global_int_array[3];
958 local_int_array[0] = orig_sender;
959 local_int_array[1] = size_gdofs_tag;
960 local_int_array[2] = size_imask_tag;
963 MPI_Allreduce( local_int_array, global_int_array, 3, MPI_INT, MPI_MAX, parcomm->proc_config().proc_comm() );
964 if( MPI_SUCCESS != mpi_err )
return MB_FAILURE;
965 orig_sender = global_int_array[0];
966 size_gdofs_tag = global_int_array[1];
967 size_imask_tag = global_int_array[2];
975 std::cout <<
"proc: " <<
my_rank <<
" size_gdofs_tag:" << size_gdofs_tag <<
"\n";
977 valsDOFs.resize( size_gdofs_tag );
981 int migrated_mesh = 0;
982 if( orig_sender != -1 ) migrated_mesh = 1;
989 size_t num_mesh_verts = mesh_verts.size();
992 std::vector< double > coords_mesh( 3 * num_mesh_verts );
996 std::vector< int > gnplane;
999 gnplane.resize( num_mesh_verts );
1000 for(
size_t i = 0; i < num_mesh_verts; i++ )
1002 CartVect pos( &coords_mesh[3 * i] );
1009 std::vector< int > gids( num_mesh_verts );
1021 for(
size_t k = 0; k < num_mesh_verts; k++ )
1027 int global_bad = local_bad;
1028 MPI_Allreduce( &local_bad, &global_bad, 1, MPI_INT, MPI_MAX, parcomm->proc_config().proc_comm() );
1033 std::cout <<
"[INFO] - source mesh vertices lack a valid GLOBAL_ID; assigning them "
1034 "before computing the coverage mesh.\n";
1036 MB_CHK_SET_ERR( parcomm->assign_global_ids( initial_distributed_set, 0, 1,
false,
true,
false ),
1037 "can't assign global ids to source vertices" );
1040 for(
size_t k = 0; k < num_mesh_verts; k++ )
1042 MB_SET_ERR( MB_FAILURE,
"vertex global id still invalid (" << gids[k]
1043 <<
") after assign_global_ids on rank " <<
my_rank );
1049 std::map< int, Range > Rto;
1050 int numprocs = parcomm->proc_config().proc_size();
1056 if( nb_ghost_layers > 0 )
1061 double global_diag = 0;
1062 mpi_err = MPI_Allreduce( &diagonal, &global_diag, 1, MPI_DOUBLE, MPI_MAX, parcomm->proc_config().proc_comm() );
1063 if( MPI_SUCCESS != mpi_err )
return MB_FAILURE;
1064 double extra_thickness = global_diag * nb_ghost_layers;
1065 if( gnomonic ) extra_thickness *= sqrt( 3. );
1068 std::cout <<
"ghost_layers:" << nb_ghost_layers <<
" max diagonal:" << global_diag
1069 <<
" extra thickness:" << extra_thickness <<
" box_error:" <<
box_error <<
"\n";
1071 for(
Range::iterator eit = meshCells.begin(); eit != meshCells.end(); ++eit )
1079 std::set< int > planes;
1080 std::vector< double > elco( 3 * num_nodes );
1081 for(
int i = 0; i < num_nodes; i++ )
1084 int index = mesh_verts.index( v );
1085 if( gnomonic ) planes.insert( gnplane[
index] );
1086 for(
int j = 0; j < 3; j++ )
1088 elco[3 * i + j] = coords_mesh[3 *
index + j];
1094 for( std::set< int >::iterator st = planes.begin(); st != planes.end(); ++st )
1097 double qmin[2] = { DBL_MAX, DBL_MAX };
1098 double qmax[2] = { -DBL_MAX, -DBL_MAX };
1099 for(
int i = 0; i < num_nodes; i++ )
1101 CartVect dp( &elco[3 * i] );
1106 for(
int j = 0; j < 2; j++ )
1108 if( qmin[j] > c2[j] ) qmin[j] = c2[j];
1109 if( qmax[j] < c2[j] ) qmax[j] = c2[j];
1114 for(
int p = 0; p < numprocs; p++ )
1116 double procMin1 =
allBoxes[24 * p + 4 * ( pl - 1 )];
1118 if( procMin1 >= DBL_MAX )
1120 double procMin2 =
allBoxes[24 * p + 4 * ( pl - 1 ) + 1];
1121 double procMax1 =
allBoxes[24 * p + 4 * ( pl - 1 ) + 2];
1122 double procMax2 =
allBoxes[24 * p + 4 * ( pl - 1 ) + 3];
1133 for(
int p = 0; p < numprocs; p++ )
1136 bool insert =
false;
1137 for(
int i = 0; i < num_nodes; i++ )
1139 if( box.contains_point( &elco[3 * i],
box_error ) )
1145 if( insert ) Rto[p].insert( q );
1160 for(
int p = 0; p < numprocs; p++ )
1162 Range& range_to_P = Rto[p];
1167 "can't get edges" );
1168 numq = numq + edgesToP.size();
1169 range_to_P.merge( edgesToP );
1172 if( range_to_P.empty() )
continue;
1174 std::cout <<
" proc : " <<
my_rank <<
" to proc " << p <<
" send " << range_to_P.size() <<
" cells "
1175 <<
" psize: " << range_to_P.psize() <<
"\n";
1179 numq = numq + range_to_P.size();
1180 numv = numv + vertsToP.size();
1182 range_to_P.merge( vertsToP );
1187 TLv.initialize( 2, 0, 0, 3, numv );
1188 TLv.enableWriteAccess();
1192 2 +
max_edges_1 + migrated_mesh + size_gdofs_tag +
1194 TLq.initialize( sizeTuple, 0, 0, 0,
1202 TLq.enableWriteAccess();
1204 std::cout <<
"from proc " <<
my_rank <<
" send " << numv <<
" vertices and " << numq <<
" elements\n";
1207 for(
int to_proc = 0; to_proc < numprocs; to_proc++ )
1209 if( to_proc == (
int)
my_rank )
continue;
1210 Range& range_to_P = Rto[to_proc];
1211 Range V = range_to_P.subset_by_type(
MBVERTEX );
1216 int index = mesh_verts.index( v );
1217 assert( -1 !=
index );
1218 int n = TLv.get_n();
1219 TLv.vi_wr[2 * n] = to_proc;
1220 TLv.vi_wr[2 * n + 1] = gids[
index];
1221 TLv.vr_wr[3 * n] = coords_mesh[3 *
index];
1222 TLv.vr_wr[3 * n + 1] = coords_mesh[3 *
index + 1];
1223 TLv.vr_wr[3 * n + 2] = coords_mesh[3 *
index + 2];
1227 Range Q =
subtract( range_to_P, mesh_verts );
1233 int n = TLq.get_n();
1234 TLq.vi_wr[sizeTuple * n] = to_proc;
1235 TLq.vi_wr[sizeTuple * n + 1] =
1245 for(
int i = 0; i < num_nodes; i++ )
1248 int index = mesh_verts.index( v );
1249 assert( -1 !=
index );
1250 TLq.vi_wr[sizeTuple * n + 2 + i] = gids[
index];
1254 TLq.vi_wr[sizeTuple * n + 2 + k] =
1263 "can't get original sender for polygon, in migrate scenario" );
1264 TLq.vi_wr[sizeTuple * n + currentIndexIntTuple] = orig_sender;
1265 currentIndexIntTuple++;
1268 if( size_gdofs_tag )
1271 for(
int i = 0; i < size_gdofs_tag; i++ )
1273 TLq.vi_wr[sizeTuple * n + currentIndexIntTuple + i] =
1278 if( size_imask_tag )
1282 TLq.vi_wr[sizeTuple * n + currentIndexIntTuple + size_gdofs_tag] = maskVal;
1291 ( parcomm->proc_config().crystal_router() )->gs_transfer( 1, TLv, 0 );
1292 ( parcomm->proc_config().crystal_router() )->gs_transfer( 1, TLq, 0 );
1298 std::map< int, EntityHandle > globalID_to_vertex_handle;
1304 for(
Range::iterator vit = mesh_verts.begin(); vit != mesh_verts.end(); ++vit, k++ )
1306 globalID_to_vertex_handle[gids[k]] = *vit;
1309 globalID_to_eh.clear();
1310 globalID_to_edgeh.clear();
1313 int n = TLv.get_n();
1314 for(
int i = 0; i < n; i++ )
1316 int globalId = TLv.vi_rd[2 * i + 1];
1317 if( globalID_to_vertex_handle.find( globalId ) ==
1318 globalID_to_vertex_handle.end() )
1322 double dp_pos[3] = { TLv.vr_wr[3 * i], TLv.vr_wr[3 * i + 1], TLv.vr_wr[3 * i + 2] };
1324 globalID_to_vertex_handle[globalId] = new_vert;
1327 "can't set global ID tag on new vertex " );
1336 Range local_q = local.subset_by_dimension( 2 );
1337 Range local_e = local.subset_by_dimension( 1 );
1339 for(
Range::iterator it = local_q.begin(); it != local_q.end(); ++it )
1344 assert( gid_el >= 0 );
1345 globalID_to_eh[gid_el] = q;
1351 for(
Range::iterator it = local_e.begin(); it != local_e.end(); ++it )
1356 assert( gid_el >= 0 );
1357 globalID_to_edgeh[gid_el] = q;
1367 for(
int i = 0; i < n; i++ )
1370 TLq.vi_rd[sizeTuple * i + 4] == 0;
1371 int globalIdEl = TLq.vi_rd[sizeTuple * i + 1];
1376 if( ( globalID_to_eh.find( globalIdEl ) != globalID_to_eh.end() ) && ( !isEdge ) )
continue;
1377 if( ( globalID_to_edgeh.find( globalIdEl ) != globalID_to_edgeh.end() ) && ( isEdge ) )
continue;
1383 int vgid = TLq.vi_rd[sizeTuple * i + 2 + j];
1384 if( vgid == 0 ) new_conn[j] = 0;
1389 assert( globalID_to_vertex_handle.find( vgid ) != globalID_to_vertex_handle.end() );
1390 new_conn[j] = globalID_to_vertex_handle[vgid];
1396 EntityType entType =
MBEDGE;
1397 if( nnodes == 3 ) entType =
MBTRI;
1398 if( nnodes == 4 ) entType =
MBQUAD;
1401 "can't create new element for second mesh " );
1404 globalID_to_edgeh[globalIdEl] = new_element;
1406 globalID_to_eh[globalIdEl] = new_element;
1407 local_q.insert( new_element );
1414 orig_sender = TLq.vi_wr[sizeTuple * i + currentIndexIntTuple];
1416 "can't set original sender for cell, in migrate scenario" );
1417 currentIndexIntTuple++;
1421 int from_proc = TLq.vi_rd[sizeTuple * i];
1425 if( size_gdofs_tag )
1427 for(
int j = 0; j < size_gdofs_tag; j++ )
1429 valsDOFs[j] = TLq.vi_wr[sizeTuple * i + currentIndexIntTuple + j];
1432 "can't set GLOBAL_DOFS data on coverage mesh" );
1435 if( size_imask_tag )
1437 int maskVal = TLq.vi_rd[sizeTuple * i + currentIndexIntTuple + size_gdofs_tag];
1439 "can't set GRID_IMASK data on coverage mesh" );
1446 std::cout <<
" proc " <<
my_rank <<
" add " << local_q.size() <<
" cells to covering set \n";
1453 #undef CHECK_CONVEXITY