Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
moab::Intx2Mesh Class Referenceabstract

#include <Intx2Mesh.hpp>

+ Inheritance diagram for moab::Intx2Mesh:
+ Collaboration diagram for moab::Intx2Mesh:

Public Member Functions

 Intx2Mesh (Interface *mbimpl)
 
virtual ~Intx2Mesh ()
 
ErrorCode intersect_meshes (EntityHandle mbs1, EntityHandle mbs2, EntityHandle &outputSet)
 
ErrorCode intersect_meshes_kdtree (EntityHandle mbset1, EntityHandle mbset2, EntityHandle &outputSet)
 
virtual ErrorCode computeIntersectionBetweenTgtAndSrc (EntityHandle tgt, EntityHandle src, double *P, int &nP, double &area, int markb[MAXEDGES], int markr[MAXEDGES], int &nsidesSrc, int &nsidesTgt, bool check_boxes_first=false)=0
 
virtual ErrorCode findNodes (EntityHandle tgt, int nsTgt, EntityHandle src, int nsSrc, double *iP, int nP)=0
 
virtual double setup_tgt_cell (EntityHandle tgt, int &nsTgt)=0
 
virtual ErrorCode FindMaxEdgesInSet (EntityHandle eset, int &max_edges)
 
virtual ErrorCode FindMaxEdges (EntityHandle set1, EntityHandle set2)
 
virtual ErrorCode createTags ()
 
ErrorCode DetermineOrderedNeighbors (EntityHandle inputSet, int max_edges, Tag &neighTag)
 
void set_error_tolerance (double eps)
 
void clean ()
 
void set_box_error (double berror)
 
ErrorCode create_departure_mesh_2nd_alg (EntityHandle &euler_set, EntityHandle &covering_lagr_set)
 
ErrorCode create_departure_mesh_3rd_alg (EntityHandle &lagr_set, EntityHandle &covering_set)
 
void correct_polygon (EntityHandle *foundIds, int &nP)
 

Protected Attributes

Interfacemb
 
EntityHandle mbs1
 
EntityHandle mbs2
 
Range rs1
 
Range rs2
 
EntityHandle outSet
 
Tag gid
 
Tag TgtFlagTag
 
Range TgtEdges
 
Tag tgtParentTag
 
Tag srcParentTag
 
Tag countTag
 
Tag srcNeighTag
 
Tag tgtNeighTag
 
Tag neighTgtEdgeTag
 
Tag orgSendProcTag
 
const EntityHandletgtConn
 for coverage mesh, will store the original sender More...
 
const EntityHandlesrcConn
 
CartVect tgtCoords [MAXEDGES]
 
CartVect srcCoords [MAXEDGES]
 
double tgtCoords2D [MAXEDGES2]
 
double srcCoords2D [MAXEDGES2]
 
std::vector< std::vector< EntityHandle > * > extraNodesVec
 
double epsilon_1
 
double epsilon_area
 
std::vector< double > allBoxes
 
double box_error
 
EntityHandle localRoot
 
Range localEnts
 
unsigned int my_rank
 
int max_edges_1
 
int max_edges_2
 
int counting
 

Detailed Description

Definition at line 55 of file Intx2Mesh.hpp.

Constructor & Destructor Documentation

◆ Intx2Mesh()

moab::Intx2Mesh::Intx2Mesh ( Interface mbimpl)

Definition at line 28 of file Intx2Mesh.cpp.

29  : mb( mbimpl ), mbs1( 0 ), mbs2( 0 ), outSet( 0 ), gid( 0 ), TgtFlagTag( 0 ), tgtParentTag( 0 ), srcParentTag( 0 ),
30  countTag( 0 ), srcNeighTag( 0 ), tgtNeighTag( 0 ), neighTgtEdgeTag( 0 ), orgSendProcTag( 0 ), tgtConn( NULL ),
31  srcConn( NULL ), epsilon_1( 0.0 ), epsilon_area( 0.0 ), box_error( 0.0 ), localRoot( 0 ), my_rank( 0 )
32 #ifdef MOAB_HAVE_MPI
33  ,
34  parcomm( NULL ), remote_cells( NULL ), remote_cells_with_tracers( NULL )
35 #endif
36  ,
37  max_edges_1( 0 ), max_edges_2( 0 ), counting( 0 )
38 {
39  gid = mbimpl->globalId_tag();
40 }

References gid, and moab::Interface::globalId_tag().

◆ ~Intx2Mesh()

moab::Intx2Mesh::~Intx2Mesh ( )
virtual

Definition at line 42 of file Intx2Mesh.cpp.

43 {
44  // TODO Auto-generated destructor stub
45 #ifdef MOAB_HAVE_MPI
46  if( remote_cells )
47  {
48  delete remote_cells;
49  remote_cells = NULL;
50  }
51 #endif
52 }

Member Function Documentation

◆ clean()

void moab::Intx2Mesh::clean ( )

Definition at line 795 of file Intx2Mesh.cpp.

796 {
797  //
798  int indx = 0;
799  for( Range::iterator eit = TgtEdges.begin(); eit != TgtEdges.end(); ++eit, indx++ )
800  {
801  delete extraNodesVec[indx];
802  }
803  // extraNodesMap.clear();
804  extraNodesVec.clear();
805  // also, delete some bit tags, used to mark processed tgts and srcs
807  counting = 0; // reset counting to original value
808 }

References moab::Range::begin(), counting, moab::Range::end(), extraNodesVec, mb, moab::Interface::tag_delete(), TgtEdges, and TgtFlagTag.

Referenced by intersect_meshes(), and intersect_meshes_kdtree().

◆ computeIntersectionBetweenTgtAndSrc()

virtual ErrorCode moab::Intx2Mesh::computeIntersectionBetweenTgtAndSrc ( EntityHandle  tgt,
EntityHandle  src,
double *  P,
int &  nP,
double &  area,
int  markb[MAXEDGES],
int  markr[MAXEDGES],
int &  nsidesSrc,
int &  nsidesTgt,
bool  check_boxes_first = false 
)
pure virtual

◆ correct_polygon()

void moab::Intx2Mesh::correct_polygon ( EntityHandle foundIds,
int &  nP 
)

Definition at line 812 of file Intx2Mesh.cpp.

813 {
814  int i = 0;
815  while( i < nP )
816  {
817  int nextIndex = ( i + 1 ) % nP;
818  if( nodes[i] == nodes[nextIndex] )
819  {
820 #ifdef ENABLE_DEBUG
821  // we need to reduce nP, and collapse nodes
822  if( dbg_1 )
823  {
824  std::cout << " nodes duplicated in list: ";
825  for( int j = 0; j < nP; j++ )
826  std::cout << nodes[j] << " ";
827  std::cout << "\n";
828  std::cout << " node " << nodes[i] << " at index " << i << " is duplicated"
829  << "\n";
830  }
831 #endif
832  // this will work even if we start from 1 2 3 1; when i is 3, we find nextIndex is 0,
833  // then next thing does nothing
834  // (nP-1 is 3, so k is already >= nP-1); it will result in nodes -> 1, 2, 3
835  for( int k = i; k < nP - 1; k++ )
836  nodes[k] = nodes[k + 1];
837  nP--; // decrease the number of nodes; also, decrease i, just if we may need to check
838  // again
839  i--;
840  }
841  i++;
842  }
843  return;
844 }

Referenced by moab::Intx2MeshInPlane::findNodes(), moab::Intx2MeshOnSphere::findNodes(), and moab::IntxRllCssphere::findNodes().

◆ create_departure_mesh_2nd_alg()

ErrorCode moab::Intx2Mesh::create_departure_mesh_2nd_alg ( EntityHandle euler_set,
EntityHandle covering_lagr_set 
)

◆ create_departure_mesh_3rd_alg()

ErrorCode moab::Intx2Mesh::create_departure_mesh_3rd_alg ( EntityHandle lagr_set,
EntityHandle covering_set 
)

◆ createTags()

ErrorCode moab::Intx2Mesh::createTags ( )
virtual

Definition at line 90 of file Intx2Mesh.cpp.

91 {
94  if( countTag ) mb->tag_delete( countTag );
95 
96  unsigned char def_data_bit = 0; // unused by default
97  // maybe the tgt tag is better to be deleted every time, and recreated;
98  // or is it easy to set all values to something again? like 0?
99  ErrorCode rval = mb->tag_get_handle( "tgtFlag", 1, MB_TYPE_BIT, TgtFlagTag, MB_TAG_CREAT, &def_data_bit );MB_CHK_SET_ERR( rval, "can't get tgt flag tag" );
100 
101  // create tgt edges if they do not exist yet; so when they are looked upon, they are found
102  // this is the only call that is potentially NlogN, in the whole method
103  rval = mb->get_adjacencies( rs2, 1, true, TgtEdges, Interface::UNION );MB_CHK_SET_ERR( rval, "can't get adjacent tgt edges" );
104 
105  // now, create a map from each edge to a list of potential new nodes on a tgt edge
106  // this memory has to be cleaned up
107  // change it to a vector, and use the index in range of tgt edges
108  int indx = 0;
109  extraNodesVec.resize( TgtEdges.size() );
110  for( Range::iterator eit = TgtEdges.begin(); eit != TgtEdges.end(); ++eit, indx++ )
111  {
112  std::vector< EntityHandle >* nv = new std::vector< EntityHandle >;
113  extraNodesVec[indx] = nv;
114  }
115 
116  int defaultInt = -1;
117 
118  rval = mb->tag_get_handle( "TargetParent", 1, MB_TYPE_INTEGER, tgtParentTag, MB_TAG_DENSE | MB_TAG_CREAT,
119  &defaultInt );MB_CHK_SET_ERR( rval, "can't create positive tag" );
120 
121  rval = mb->tag_get_handle( "SourceParent", 1, MB_TYPE_INTEGER, srcParentTag, MB_TAG_DENSE | MB_TAG_CREAT,
122  &defaultInt );MB_CHK_SET_ERR( rval, "can't create negative tag" );
123 
124  rval = mb->tag_get_handle( "Counting", 1, MB_TYPE_INTEGER, countTag, MB_TAG_DENSE | MB_TAG_CREAT, &defaultInt );MB_CHK_SET_ERR( rval, "can't create Counting tag" );
125 
126  // for each cell in set 1, determine its neigh in set 1 (could be null too)
127  // for each cell in set 2, determine its neigh in set 2 (if on boundary, could be 0)
128  rval = DetermineOrderedNeighbors( mbs1, max_edges_1, srcNeighTag );MB_CHK_SET_ERR( rval, "can't determine neighbors for set 1" );
129  rval = DetermineOrderedNeighbors( mbs2, max_edges_2, tgtNeighTag );MB_CHK_SET_ERR( rval, "can't determine neighbors for set 2" );
130 
131  // for tgt cells, save a dense tag with the bordering edges, so we do not have to search for
132  // them each time edges were for sure created before (tgtEdges)
133  std::vector< EntityHandle > zeroh( max_edges_2, 0 );
134  // if we have a tag with this name, it could be of a different size, so delete it
135  rval = mb->tag_get_handle( "__tgtEdgeNeighbors", neighTgtEdgeTag );
137  rval = mb->tag_get_handle( "__tgtEdgeNeighbors", max_edges_2, MB_TYPE_HANDLE, neighTgtEdgeTag,
138  MB_TAG_DENSE | MB_TAG_CREAT, &zeroh[0] );MB_CHK_SET_ERR( rval, "can't create tgt edge neighbors tag" );
139  for( Range::iterator rit = rs2.begin(); rit != rs2.end(); rit++ )
140  {
141  EntityHandle tgtCell = *rit;
142  int num_nodes = 0;
143  rval = mb->get_connectivity( tgtCell, tgtConn, num_nodes );MB_CHK_SET_ERR( rval, "can't get tgt conn" );
144  // account for padded polygons
145  while( tgtConn[num_nodes - 2] == tgtConn[num_nodes - 1] && num_nodes > 3 )
146  num_nodes--;
147 
148  int i = 0;
149  for( i = 0; i < num_nodes; i++ )
150  {
151  EntityHandle v[2] = { tgtConn[i],
152  tgtConn[( i + 1 ) % num_nodes] }; // this is fine even for padded polygons
153  std::vector< EntityHandle > adj_entities;
154  rval = mb->get_adjacencies( v, 2, 1, false, adj_entities, Interface::INTERSECT );
155  if( rval != MB_SUCCESS || adj_entities.size() < 1 ) return rval; // get out , big error
156  zeroh[i] = adj_entities[0]; // should be only one edge between 2 nodes
157  // also, even if number of edges is less than max_edges_2, they will be ignored, even if
158  // the tag is dense
159  }
160  // now set the value of the tag
161  rval = mb->tag_set_data( neighTgtEdgeTag, &tgtCell, 1, &( zeroh[0] ) );MB_CHK_SET_ERR( rval, "can't set edge tgt tag" );
162  }
163  return MB_SUCCESS;
164 }

References moab::Range::begin(), countTag, DetermineOrderedNeighbors(), moab::Range::end(), ErrorCode, extraNodesVec, moab::Interface::get_adjacencies(), moab::Interface::get_connectivity(), moab::Interface::INTERSECT, max_edges_1, max_edges_2, mb, MB_CHK_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_BIT, MB_TYPE_HANDLE, MB_TYPE_INTEGER, mbs1, mbs2, neighTgtEdgeTag, rs2, moab::Range::size(), srcNeighTag, srcParentTag, moab::Interface::tag_delete(), moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), tgtConn, TgtEdges, TgtFlagTag, tgtNeighTag, tgtParentTag, and moab::Interface::UNION.

Referenced by intersect_meshes().

◆ DetermineOrderedNeighbors()

ErrorCode moab::Intx2Mesh::DetermineOrderedNeighbors ( EntityHandle  inputSet,
int  max_edges,
Tag neighTag 
)

Definition at line 166 of file Intx2Mesh.cpp.

167 {
168  Range cells;
169  ErrorCode rval = mb->get_entities_by_dimension( inputSet, 2, cells );MB_CHK_SET_ERR( rval, "can't get cells in set" );
170 
171  std::vector< EntityHandle > neighbors( max_edges );
172  std::vector< EntityHandle > zeroh( max_edges, 0 );
173  // nameless tag, as the name is not important; we will have 2 related tags, but one on tgt mesh,
174  // one on src mesh
175  rval = mb->tag_get_handle( "", max_edges, MB_TYPE_HANDLE, neighTag, MB_TAG_DENSE | MB_TAG_CREAT, &zeroh[0] );MB_CHK_SET_ERR( rval, "can't create neighbors tag" );
176 
177  for( Range::iterator cit = cells.begin(); cit != cells.end(); cit++ )
178  {
179  EntityHandle cell = *cit;
180  int nnodes = 3;
181  // will get the nnodes ordered neighbors;
182  // first cell is for nodes 0, 1, second to 1, 2, third to 2, 3, last to nnodes-1,
183  const EntityHandle* conn4;
184  rval = mb->get_connectivity( cell, conn4, nnodes );MB_CHK_SET_ERR( rval, "can't get connectivity of a cell" );
185  int nsides = nnodes;
186  // account for possible padded polygons
187  while( conn4[nsides - 2] == conn4[nsides - 1] && nsides > 3 )
188  nsides--;
189 
190  for( int i = 0; i < nsides; i++ )
191  {
192  EntityHandle v[2];
193  v[0] = conn4[i];
194  v[1] = conn4[( i + 1 ) % nsides];
195  // get all cells adjacent to these 2 vertices on the edge
196  std::vector< EntityHandle > adjcells;
197  std::vector< EntityHandle > cellsInSet;
198  rval = mb->get_adjacencies( v, 2, 2, false, adjcells, Interface::INTERSECT );MB_CHK_SET_ERR( rval, "can't adjacency to 2 verts" );
199  // now look for the cells contained in the input set;
200  // the input set should be a correct mesh, not overlapping cells, and manifold
201  size_t siz = adjcells.size();
202  for( size_t j = 0; j < siz; j++ )
203  if( mb->contains_entities( inputSet, &( adjcells[j] ), 1 ) ) cellsInSet.push_back( adjcells[j] );
204  siz = cellsInSet.size();
205 
206  if( siz > 2 )
207  {
208  std::cout << "non manifold mesh, error" << mb->list_entities( &( cellsInSet[0] ), cellsInSet.size() )
209  << "\n";MB_CHK_SET_ERR( MB_FAILURE, "non-manifold input mesh set" ); // non-manifold
210  }
211  if( siz == 1 )
212  {
213  // it must be the border of the input mesh;
214  neighbors[i] = 0; // we are guaranteed that ids are !=0; this is marking a border
215  // borders do not appear for a sphere in serial, but they do appear for
216  // parallel processing anyway
217  continue;
218  }
219  // here siz ==2, it is either the first or second
220  if( cell == cellsInSet[0] )
221  neighbors[i] = cellsInSet[1];
222  else
223  neighbors[i] = cellsInSet[0];
224  }
225  // fill the rest with 0
226  for( int i = nsides; i < max_edges; i++ )
227  neighbors[i] = 0;
228  // now simply set the neighbors tag; the last few positions will not be used, but for
229  // simplicity will keep them all (MAXEDGES)
230  rval = mb->tag_set_data( neighTag, &cell, 1, &neighbors[0] );MB_CHK_SET_ERR( rval, "can't set neigh tag" );
231  }
232  return MB_SUCCESS;
233 }

References moab::Range::begin(), moab::Interface::contains_entities(), moab::Range::end(), ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_connectivity(), moab::Interface::get_entities_by_dimension(), moab::Interface::INTERSECT, moab::Interface::list_entities(), mb, MB_CHK_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_HANDLE, moab::Interface::tag_get_handle(), and moab::Interface::tag_set_data().

Referenced by createTags().

◆ FindMaxEdges()

ErrorCode moab::Intx2Mesh::FindMaxEdges ( EntityHandle  set1,
EntityHandle  set2 
)
virtual

Definition at line 82 of file Intx2Mesh.cpp.

83 {
84  ErrorCode rval = FindMaxEdgesInSet( set1, max_edges_1 );MB_CHK_SET_ERR( rval, "can't determine max_edges in set 1" );
85  rval = FindMaxEdgesInSet( set2, max_edges_2 );MB_CHK_SET_ERR( rval, "can't determine max_edges in set 2" );
86 
87  return MB_SUCCESS;
88 }

References ErrorCode, FindMaxEdgesInSet(), max_edges_1, max_edges_2, MB_CHK_SET_ERR, and MB_SUCCESS.

Referenced by moab::TempestRemapper::ConstructCoveringSet(), main(), and test_intx_in_parallel_elem_based().

◆ FindMaxEdgesInSet()

ErrorCode moab::Intx2Mesh::FindMaxEdgesInSet ( EntityHandle  eset,
int &  max_edges 
)
virtual

Definition at line 53 of file Intx2Mesh.cpp.

54 {
55  Range cells;
56  ErrorCode rval = mb->get_entities_by_dimension( eset, 2, cells );MB_CHK_ERR( rval );
57 
58  max_edges = 0; // can be 0 for point clouds
59  for( Range::iterator cit = cells.begin(); cit != cells.end(); cit++ )
60  {
61  EntityHandle cell = *cit;
62  const EntityHandle* conn4;
63  int nnodes = 3;
64  rval = mb->get_connectivity( cell, conn4, nnodes );MB_CHK_SET_ERR( rval, "can't get connectivity of a cell" );
65  if( nnodes > max_edges ) max_edges = nnodes;
66  }
67  // if in parallel, communicate the actual max_edges; it is not needed for tgt mesh (to be
68  // global) but it is better to be consistent
69 #ifdef MOAB_HAVE_MPI
70  if( parcomm )
71  {
72  int local_max_edges = max_edges;
73  // now reduce max_edges over all processors
74  int mpi_err =
75  MPI_Allreduce( &local_max_edges, &max_edges, 1, MPI_INT, MPI_MAX, parcomm->proc_config().proc_comm() );
76  if( MPI_SUCCESS != mpi_err ) return MB_FAILURE;
77  }
78 #endif
79 
80  return MB_SUCCESS;
81 }

References moab::Range::begin(), moab::Range::end(), ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_entities_by_dimension(), mb, MB_CHK_ERR, MB_CHK_SET_ERR, and MB_SUCCESS.

Referenced by FindMaxEdges().

◆ findNodes()

virtual ErrorCode moab::Intx2Mesh::findNodes ( EntityHandle  tgt,
int  nsTgt,
EntityHandle  src,
int  nsSrc,
double *  iP,
int  nP 
)
pure virtual

◆ intersect_meshes()

ErrorCode moab::Intx2Mesh::intersect_meshes ( EntityHandle  mbs1,
EntityHandle  mbs2,
EntityHandle outputSet 
)

Definition at line 438 of file Intx2Mesh.cpp.

439 {
440  ErrorCode rval;
441  mbs1 = mbset1; // set 1 is departure, and it is completely covering the euler set on proc
442  mbs2 = mbset2;
443  outSet = outputSet;
444 #ifdef VERBOSE
445  std::stringstream ffs, fft;
446  ffs << "source_rank0" << my_rank << ".vtk";
447  rval = mb->write_mesh( ffs.str().c_str(), &mbset1, 1 );MB_CHK_ERR( rval );
448  fft << "target_rank0" << my_rank << ".vtk";
449  rval = mb->write_mesh( fft.str().c_str(), &mbset2, 1 );MB_CHK_ERR( rval );
450 
451 #endif
452  // really, should be something from t1 and t2; src is 1 (lagrange), tgt is 2 (euler)
453 
454  EntityHandle startSrc = 0, startTgt = 0;
455 
456  rval = mb->get_entities_by_dimension( mbs1, 2, rs1 );MB_CHK_ERR( rval );
457  rval = mb->get_entities_by_dimension( mbs2, 2, rs2 );MB_CHK_ERR( rval );
458  // std::cout << "rs1.size() = " << rs1.size() << " and rs2.size() = " << rs2.size() << "\n";
459  // std::cout.flush();
460 
461  createTags(); // will also determine max_edges_1, max_edges_2 (for src and tgt meshes)
462 
463  Range rs22 = rs2; // a copy of the initial range; we will remove from it elements as we
464  // advance ; rs2 is needed for marking the polygon to the tgt parent
465 
466  // create the local kdd tree with source elements; will use it to search
467  // more efficiently for the seeds in advancing front;
468  // some of the target cells will not be covered by source cells, and they need to be eliminated
469  // early from contention
470 
471  // build a kd tree with the rs1 (source) cells
472  AdaptiveKDTree kd( mb );
473  EntityHandle tree_root = 0;
474  rval = kd.build_tree( rs1, &tree_root );MB_CHK_ERR( rval );
475 
476  while( !rs22.empty() )
477  {
478 #if defined( ENABLE_DEBUG ) || defined( VERBOSE )
479  if( rs22.size() < rs2.size() )
480  {
481  std::cout << " possible not connected arrival mesh; my_rank: " << my_rank << " counting: " << counting
482  << "\n";
483  std::stringstream ffo;
484  ffo << "file0" << counting << "rank0" << my_rank << ".vtk";
485  rval = mb->write_mesh( ffo.str().c_str(), &outSet, 1 );MB_CHK_ERR( rval );
486  }
487 #endif
488  bool seedFound = false;
489  for( Range::iterator it = rs22.begin(); it != rs22.end(); ++it )
490  {
491  startTgt = *it;
492  int found = 0;
493  // find vertex positions
494  const EntityHandle* conn = NULL;
495  int nnodes = 0;
496  rval = mb->get_connectivity( startTgt, conn, nnodes );MB_CHK_ERR( rval );
497  // find leaves close to those positions
498  std::vector< double > positions;
499  positions.resize( nnodes * 3 );
500  rval = mb->get_coords( conn, nnodes, &positions[0] );MB_CHK_ERR( rval );
501  // find leaves within a distance from each vertex of target
502  // in those leaves, collect all cells; we will try for an intx in there, instead of
503  // looping over all rs1 cells, as before
504  Range close_source_cells;
505  std::vector< EntityHandle > leaves;
506  for( int i = 0; i < nnodes; i++ )
507  {
508 
509  leaves.clear();
510  rval = kd.distance_search( &positions[3 * i], epsilon_1, leaves, epsilon_1, epsilon_1 );MB_CHK_ERR( rval );
511 
512  for( std::vector< EntityHandle >::iterator j = leaves.begin(); j != leaves.end(); ++j )
513  {
514  Range tmp;
515  rval = mb->get_entities_by_dimension( *j, 2, tmp );MB_CHK_ERR( rval );
516 
517  close_source_cells.merge( tmp.begin(), tmp.end() );
518  }
519  }
520 
521  for( Range::iterator it2 = close_source_cells.begin(); it2 != close_source_cells.end() && !found; ++it2 )
522  {
523  startSrc = *it2;
524  double area = 0;
525  // if area is > 0 , we have intersections
526  double P[10 * MAXEDGES]; // max 8 intx points + 8 more in the polygon
527  //
528  int nP = 0;
529  int nb[MAXEDGES], nr[MAXEDGES]; // sides 3 or 4? also, check boxes first
530  int nsTgt, nsSrc;
531  rval =
532  computeIntersectionBetweenTgtAndSrc( startTgt, startSrc, P, nP, area, nb, nr, nsSrc, nsTgt, true );MB_CHK_ERR( rval );
533  if( area > 0 )
534  {
535  found = 1;
536  seedFound = true;
537  break; // found 2 elements that intersect; these will be the seeds
538  }
539  }
540  if( found )
541  break;
542  else
543  {
544 #if defined( VERBOSE )
545  std::cout << " on rank " << my_rank << " target cell " << ID_FROM_HANDLE( startTgt )
546  << " not intx with any source\n";
547 #endif
548  rs22.erase( startTgt );
549  }
550  }
551  if( !seedFound ) continue; // continue while(!rs22.empty())
552 
553  std::queue< EntityHandle > srcQueue; // these are corresponding to Ta,
554  srcQueue.push( startSrc );
555  std::queue< EntityHandle > tgtQueue;
556  tgtQueue.push( startTgt );
557 
558  Range toResetSrcs; // will be used to reset src flags for every tgt quad
559  // processed
560 
561  /*if (my_rank==0)
562  dbg_1 = 1;*/
563  unsigned char used = 1;
564  // mark the start tgt quad as used, so it will not come back again
565  rval = mb->tag_set_data( TgtFlagTag, &startTgt, 1, &used );MB_CHK_ERR( rval );
566  while( !tgtQueue.empty() )
567  {
568  // flags for the side : 0 means a src cell not found on side
569  // a paired src not found yet for the neighbors of tgt
570  Range nextSrc[MAXEDGES]; // there are new ranges of possible next src cells for
571  // seeding the side j of tgt cell
572 
573  EntityHandle currentTgt = tgtQueue.front();
574  tgtQueue.pop();
575  int nsidesTgt; // will be initialized now
576  double areaTgtCell = setup_tgt_cell( currentTgt, nsidesTgt ); // this is the area in the gnomonic plane
577  double recoveredArea = 0;
578  // get the neighbors of tgt, and if they are solved already, do not bother with that
579  // side of tgt
580  EntityHandle tgtNeighbors[MAXEDGES] = { 0 };
581  rval = mb->tag_get_data( tgtNeighTag, &currentTgt, 1, tgtNeighbors );MB_CHK_SET_ERR( rval, "can't get neighbors of current tgt" );
582 #ifdef ENABLE_DEBUG
583  if( dbg_1 )
584  {
585  std::cout << "Next: neighbors for current tgt ";
586  for( int kk = 0; kk < nsidesTgt; kk++ )
587  {
588  if( tgtNeighbors[kk] > 0 )
589  std::cout << mb->id_from_handle( tgtNeighbors[kk] ) << " ";
590  else
591  std::cout << 0 << " ";
592  }
593  std::cout << std::endl;
594  }
595 #endif
596  // now get the status of neighbors; if already solved, make them 0, so not to bother
597  // anymore on that side of tgt
598  for( int j = 0; j < nsidesTgt; j++ )
599  {
600  EntityHandle tgtNeigh = tgtNeighbors[j];
601  unsigned char status = 1;
602  if( tgtNeigh == 0 ) continue;
603  rval = mb->tag_get_data( TgtFlagTag, &tgtNeigh, 1, &status );MB_CHK_ERR( rval ); // status 0 is unused
604  if( 1 == status ) tgtNeighbors[j] = 0; // so will not look anymore on this side of tgt
605  }
606 
607 #ifdef ENABLE_DEBUG
608  if( dbg_1 )
609  {
610  std::cout << "reset sources: ";
611  for( Range::iterator itr = toResetSrcs.begin(); itr != toResetSrcs.end(); ++itr )
612  std::cout << mb->id_from_handle( *itr ) << " ";
613  std::cout << std::endl;
614  }
615 #endif
616  EntityHandle currentSrc = srcQueue.front();
617  // tgt and src queues are parallel; for clarity we should have kept in the queue pairs
618  // of entity handle std::pair<EntityHandle, EntityHandle>; so just one queue, with
619  // pairs;
620  // at every moment, the queue contains pairs of cells that intersect, and they form the
621  // "advancing front"
622  srcQueue.pop();
623  toResetSrcs.clear(); // empty the range of used srcs, will have to be set unused again,
624  // at the end of tgt element processing
625  toResetSrcs.insert( currentSrc );
626  // mb2->set_tag_data
627  std::queue< EntityHandle > localSrc;
628  localSrc.push( currentSrc );
629 #ifdef VERBOSE
630  int countingStart = counting;
631 #endif
632  // will advance-front search in the neighborhood of tgt cell, until we finish processing
633  // all
634  // possible src cells; localSrc queue will contain all possible src cells that cover
635  // the current tgt cell
636  while( !localSrc.empty() )
637  {
638  //
639  EntityHandle srcT = localSrc.front();
640  localSrc.pop();
641  double P[10 * MAXEDGES], area; //
642  int nP = 0;
643  int nb[MAXEDGES] = { 0 };
644  int nr[MAXEDGES] = { 0 };
645 
646  int nsidesSrc; ///
647  // area is in 2d, points are in 3d (on a sphere), back-projected, or in a plane
648  // intersection points could include the vertices of initial elements
649  // nb [j] = 0 means no intersection on the side j for element src (markers)
650  // nb [j] = 1 means that the side j (from j to j+1) of src poly intersects the
651  // tgt poly. A potential next poly in the tgt queue is the tgt poly that is
652  // adjacent to this side
653  rval = computeIntersectionBetweenTgtAndSrc( /* tgt */ currentTgt, srcT, P, nP, area, nb, nr, nsidesSrc,
654  nsidesTgt );MB_CHK_ERR( rval );
655  if( nP > 0 )
656  {
657 #ifdef ENABLE_DEBUG
658  if( dbg_1 )
659  {
660  for( int k = 0; k < 3; k++ )
661  {
662  std::cout << " nb, nr: " << k << " " << nb[k] << " " << nr[k] << "\n";
663  }
664  }
665 #endif
666 
667  // intersection found: output P and original triangles if nP > 2
668  EntityHandle neighbors[MAXEDGES] = { 0 };
669  rval = mb->tag_get_data( srcNeighTag, &srcT, 1, neighbors );
670  if( rval != MB_SUCCESS )
671  {
672  std::cout << " can't get the neighbors for src element " << mb->id_from_handle( srcT );
673  return MB_FAILURE;
674  }
675 
676  // add neighbors to the localSrc queue, if they are not marked
677  for( int nn = 0; nn < nsidesSrc; nn++ )
678  {
679  EntityHandle neighbor = neighbors[nn];
680  if( neighbor > 0 && nb[nn] > 0 ) // advance across src boundary nn
681  {
682  if( toResetSrcs.find( neighbor ) == toResetSrcs.end() )
683  {
684  localSrc.push( neighbor );
685 #ifdef ENABLE_DEBUG
686  if( dbg_1 )
687  {
688  std::cout << " local src elem " << mb->id_from_handle( neighbor )
689  << " for tgt:" << mb->id_from_handle( currentTgt ) << "\n";
690  mb->list_entities( &neighbor, 1 );
691  }
692 #endif
693  toResetSrcs.insert( neighbor );
694  }
695  }
696  }
697  // n(find(nc>0))=ac; % ac is starting candidate for neighbor
698  for( int nn = 0; nn < nsidesTgt; nn++ )
699  {
700  if( nr[nn] > 0 && tgtNeighbors[nn] > 0 )
701  nextSrc[nn].insert( srcT ); // potential src cell that can intersect
702  // the tgt neighbor nn
703  }
704  if( nP > 1 )
705  { // this will also construct triangles/polygons in the new mesh, if needed
706  rval = findNodes( currentTgt, nsidesTgt, srcT, nsidesSrc, P, nP );MB_CHK_ERR( rval );
707  }
708 
709  recoveredArea += area;
710  }
711 #ifdef ENABLE_DEBUG
712  else if( dbg_1 )
713  {
714  std::cout << " tgt, src, do not intersect: " << mb->id_from_handle( currentTgt ) << " "
715  << mb->id_from_handle( srcT ) << "\n";
716  }
717 #endif
718  } // end while (!localSrc.empty())
719  recoveredArea = ( recoveredArea - areaTgtCell ) / areaTgtCell; // replace now with recovery fraction
720 #if defined( ENABLE_DEBUG ) || defined( VERBOSE )
721  if( fabs( recoveredArea ) > epsilon_1 )
722  {
723 #ifdef VERBOSE
724  std::cout << " tgt area: " << areaTgtCell << " recovered :" << recoveredArea * ( 1 + areaTgtCell )
725  << " fraction error recovery:" << recoveredArea
726  << " tgtID: " << mb->id_from_handle( currentTgt ) << " countingStart:" << countingStart
727  << "\n";
728 #endif
729  }
730 #endif
731  // here, we are finished with tgtCurrent, take it out of the rs22 range (tgt, arrival
732  // mesh)
733  rs22.erase( currentTgt );
734  // also, look at its neighbors, and add to the seeds a next one
735 
736  for( int j = 0; j < nsidesTgt; j++ )
737  {
738  EntityHandle tgtNeigh = tgtNeighbors[j];
739  if( tgtNeigh == 0 || nextSrc[j].size() == 0 ) // if tgt is bigger than src, there could be no src
740  // to advance on that side
741  continue;
742  int nsidesTgt2 = 0;
743  setup_tgt_cell( tgtNeigh,
744  nsidesTgt2 ); // find possible intersection with src cell from nextSrc
745  for( Range::iterator nit = nextSrc[j].begin(); nit != nextSrc[j].end(); ++nit )
746  {
747  EntityHandle nextB = *nit;
748  // we identified tgt quad n[j] as possibly intersecting with neighbor j of the
749  // src quad
750  double P[10 * MAXEDGES], area; //
751  int nP = 0;
752  int nb[MAXEDGES] = { 0 };
753  int nr[MAXEDGES] = { 0 };
754 
755  int nsidesSrc; ///
757  /* tgt */ tgtNeigh, nextB, P, nP, area, nb, nr, nsidesSrc, nsidesTgt2 );MB_CHK_ERR( rval );
758  if( area > 0 )
759  {
760  tgtQueue.push( tgtNeigh );
761  srcQueue.push( nextB );
762 #ifdef ENABLE_DEBUG
763  if( dbg_1 )
764  std::cout << "new polys pushed: src, tgt:" << mb->id_from_handle( tgtNeigh ) << " "
765  << mb->id_from_handle( nextB ) << std::endl;
766 #endif
767  rval = mb->tag_set_data( TgtFlagTag, &tgtNeigh, 1, &used );MB_CHK_ERR( rval );
768  break; // so we are done with this side of tgt, we have found a proper next
769  // seed
770  }
771  }
772  }
773 
774  } // end while (!tgtQueue.empty())
775  }
776 #ifdef ENABLE_DEBUG
777  if( dbg_1 )
778  {
779  for( int k = 0; k < 6; k++ )
780  mout_1[k].close();
781  }
782 #endif
783  // before cleaning up , we need to settle the position of the intersection points
784  // on the boundary edges
785  // this needs to be collective, so we should maybe wait something
786 #ifdef MOAB_HAVE_MPI
787  rval = resolve_intersection_sharing();MB_CHK_SET_ERR( rval, "can't correct position, Intx2Mesh.cpp \n" );
788 #endif
789 
790  this->clean();
791  return MB_SUCCESS;
792 }

References moab::Range::begin(), moab::AdaptiveKDTree::build_tree(), clean(), moab::Range::clear(), computeIntersectionBetweenTgtAndSrc(), counting, createTags(), moab::AdaptiveKDTree::distance_search(), moab::Range::empty(), moab::Range::end(), epsilon_1, moab::Range::erase(), ErrorCode, moab::Range::find(), findNodes(), moab::Range::front(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), moab::Interface::id_from_handle(), moab::ID_FROM_HANDLE(), moab::Range::insert(), moab::Interface::list_entities(), MAXEDGES, mb, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, mbs1, mbs2, moab::Range::merge(), my_rank, nr, outSet, rs1, rs2, setup_tgt_cell(), size, moab::Range::size(), srcNeighTag, moab::Interface::tag_get_data(), moab::Interface::tag_set_data(), TgtFlagTag, tgtNeighTag, and moab::Interface::write_mesh().

Referenced by compute_tracer_case1(), moab::TempestRemapper::ComputeOverlapMesh(), intersection_at_level(), main(), test_intx_in_parallel_elem_based(), and update_tracer().

◆ intersect_meshes_kdtree()

ErrorCode moab::Intx2Mesh::intersect_meshes_kdtree ( EntityHandle  mbset1,
EntityHandle  mbset2,
EntityHandle outputSet 
)

Definition at line 237 of file Intx2Mesh.cpp.

238 {
239  ErrorCode rval;
240  mbs1 = mbset1; // set 1 is departure, and it is completely covering the euler set on proc
241  mbs2 = mbset2;
242  outSet = outputSet;
243  rval = mb->get_entities_by_dimension( mbs1, 2, rs1 );MB_CHK_ERR( rval );
244  rval = mb->get_entities_by_dimension( mbs2, 2, rs2 );MB_CHK_ERR( rval );
245  // from create tags, copy relevant ones
248  if( countTag ) mb->tag_delete( countTag );
249 
250  // create tgt edges if they do not exist yet; so when they are looked upon, they are found
251  // this is the only call that is potentially NlogN, in the whole method
252  rval = mb->get_adjacencies( rs2, 1, true, TgtEdges, Interface::UNION );MB_CHK_SET_ERR( rval, "can't get adjacent tgt edges" );
253 
254  int indx = 0;
255  extraNodesVec.resize( TgtEdges.size() );
256  for( Range::iterator eit = TgtEdges.begin(); eit != TgtEdges.end(); ++eit, indx++ )
257  {
258  std::vector< EntityHandle >* nv = new std::vector< EntityHandle >;
259  extraNodesVec[indx] = nv;
260  }
261 
262  int defaultInt = -1;
263 
264  rval = mb->tag_get_handle( "TargetParent", 1, MB_TYPE_INTEGER, tgtParentTag, MB_TAG_DENSE | MB_TAG_CREAT,
265  &defaultInt );MB_CHK_SET_ERR( rval, "can't create positive tag" );
266 
267  rval = mb->tag_get_handle( "SourceParent", 1, MB_TYPE_INTEGER, srcParentTag, MB_TAG_DENSE | MB_TAG_CREAT,
268  &defaultInt );MB_CHK_SET_ERR( rval, "can't create negative tag" );
269 
270  rval = mb->tag_get_handle( "Counting", 1, MB_TYPE_INTEGER, countTag, MB_TAG_DENSE | MB_TAG_CREAT, &defaultInt );MB_CHK_SET_ERR( rval, "can't create Counting tag" );
271 
272  // for tgt cells, save a dense tag with the bordering edges, so we do not have to search for
273  // them each time edges were for sure created before (tgtEdges)
274  // if we have a tag with this name, it could be of a different size, so delete it
275  rval = mb->tag_get_handle( "__tgtEdgeNeighbors", neighTgtEdgeTag );
277  std::vector< EntityHandle > zeroh( max_edges_2, 0 );
278  rval = mb->tag_get_handle( "__tgtEdgeNeighbors", max_edges_2, MB_TYPE_HANDLE, neighTgtEdgeTag,
279  MB_TAG_DENSE | MB_TAG_CREAT, &zeroh[0] );MB_CHK_SET_ERR( rval, "can't create tgt edge neighbors tag" );
280  for( Range::iterator rit = rs2.begin(); rit != rs2.end(); rit++ )
281  {
282  EntityHandle tgtCell = *rit;
283  int num_nodes = 0;
284  rval = mb->get_connectivity( tgtCell, tgtConn, num_nodes );MB_CHK_SET_ERR( rval, "can't get tgt conn" );
285  // account for padded polygons
286  while( tgtConn[num_nodes - 2] == tgtConn[num_nodes - 1] && num_nodes > 3 )
287  num_nodes--;
288 
289  int i = 0;
290  for( i = 0; i < num_nodes; i++ )
291  {
292  EntityHandle v[2] = { tgtConn[i],
293  tgtConn[( i + 1 ) % num_nodes] }; // this is fine even for padded polygons
294  std::vector< EntityHandle > adj_entities;
295  rval = mb->get_adjacencies( v, 2, 1, false, adj_entities, Interface::INTERSECT );
296  if( rval != MB_SUCCESS || adj_entities.size() < 1 ) return rval; // get out , big error
297  zeroh[i] = adj_entities[0]; // should be only one edge between 2 nodes
298  // also, even if number of edges is less than max_edges_2, they will be ignored, even if
299  // the tag is dense
300  }
301  // now set the value of the tag
302  rval = mb->tag_set_data( neighTgtEdgeTag, &tgtCell, 1, &( zeroh[0] ) );MB_CHK_SET_ERR( rval, "can't set edge tgt tag" );
303  }
304 
305  // create the kd tree on source cells, and intersect all targets in an expensive loop
306  // build a kd tree with the rs1 (source) cells
307  AdaptiveKDTree kd( mb );
308  EntityHandle tree_root = 0;
309  rval = kd.build_tree( rs1, &tree_root );MB_CHK_ERR( rval );
310 
311  // find out max edge on source mesh;
312  double max_length = 0;
313  {
314  std::vector< double > coords;
315  coords.resize( 3 * max_edges_1 );
316  for( Range::iterator it = rs1.begin(); it != rs1.end(); it++ )
317  {
318  const EntityHandle* conn = NULL;
319  int nnodes;
320  rval = mb->get_connectivity( *it, conn, nnodes );MB_CHK_SET_ERR( rval, "can't get connectivity" );
321  while( conn[nnodes - 2] == conn[nnodes - 1] && nnodes > 3 )
322  nnodes--;
323  rval = mb->get_coords( conn, nnodes, &coords[0] );MB_CHK_SET_ERR( rval, "can't get coordinates" );
324  for( int j = 0; j < nnodes; j++ )
325  {
326  int next = ( j + 1 ) % nnodes;
327  double leng;
328  leng = ( coords[3 * j] - coords[3 * next] ) * ( coords[3 * j] - coords[3 * next] ) +
329  ( coords[3 * j + 1] - coords[3 * next + 1] ) * ( coords[3 * j + 1] - coords[3 * next + 1] ) +
330  ( coords[3 * j + 2] - coords[3 * next + 2] ) * ( coords[3 * j + 2] - coords[3 * next + 2] );
331  leng = sqrt( leng );
332  if( leng > max_length ) max_length = leng;
333  }
334  }
335  }
336  // maximum sag on a spherical mesh make sense only for intx on a sphere, with radius 1 :(
337  double tolerance = 1.e-15;
338  if( max_length < 1. )
339  {
340  // basically, the sag for an arc of length max_length on a circle of radius 1
341  tolerance = 1. - sqrt( 1 - max_length * max_length / 4 );
343  tolerance = 3 * tolerance; // we use it for gnomonic plane too, projected sag could be =* sqrt(2.)
344  // be more generous, use 1.5 ~= sqrt(2.)
345 
346  if( !my_rank )
347  {
348  std::cout << " max edge length: " << max_length << " tolerance for kd tree: " << tolerance << "\n";
349  std::cout << " box overlap tolerance: " << box_error << "\n";
350  }
351  }
352  for( Range::iterator it = rs2.begin(); it != rs2.end(); ++it )
353  {
354  EntityHandle tcell = *it;
355  // find vertex positions
356  const EntityHandle* conn = NULL;
357  int nnodes = 0;
358  rval = mb->get_connectivity( tcell, conn, nnodes );MB_CHK_ERR( rval );
359  // find leaves close to those positions
360  double areaTgtCell = setup_tgt_cell( tcell, nnodes ); // this is the area in the gnomonic plane
361  double recoveredArea = 0;
362  std::vector< double > positions;
363  positions.resize( nnodes * 3 );
364  rval = mb->get_coords( conn, nnodes, &positions[0] );MB_CHK_ERR( rval );
365 
366  // distance to search will be based on average edge length
367  double av_len = 0;
368  for( int k = 0; k < nnodes; k++ )
369  {
370  int ik = ( k + 1 ) % nnodes;
371  double len1 = 0;
372  for( int j = 0; j < 3; j++ )
373  {
374  double len2 = positions[3 * k + j] - positions[3 * ik + j];
375  len1 += len2 * len2;
376  }
377  av_len += sqrt( len1 );
378  }
379  if( nnodes > 0 ) av_len /= nnodes;
380  // find leaves within a distance from each vertex of target
381  // in those leaves, collect all cells; we will try for an intx in there
382  Range close_source_cells;
383  std::vector< EntityHandle > leaves;
384  for( int i = 0; i < nnodes; i++ )
385  {
386  leaves.clear();
387  rval = kd.distance_search( &positions[3 * i], av_len, leaves, tolerance, epsilon_1 );MB_CHK_ERR( rval );
388 
389  for( std::vector< EntityHandle >::iterator j = leaves.begin(); j != leaves.end(); ++j )
390  {
391  Range tmp;
392  rval = mb->get_entities_by_dimension( *j, 2, tmp );MB_CHK_ERR( rval );
393 
394  close_source_cells.merge( tmp.begin(), tmp.end() );
395  }
396  }
397 #ifdef VERBOSE
398  if( close_source_cells.empty() )
399  {
400  std::cout << " there are no close source cells to target cell " << tcell << " id from handle "
401  << mb->id_from_handle( tcell ) << "\n";
402  }
403 #endif
404  for( Range::iterator it2 = close_source_cells.begin(); it2 != close_source_cells.end(); ++it2 )
405  {
406  EntityHandle startSrc = *it2;
407  double area = 0;
408  // if area is > 0 , we have intersections
409  double P[10 * MAXEDGES]; // max 8 intx points + 8 more in the polygon
410  //
411  int nP = 0;
412  int nb[MAXEDGES], nr[MAXEDGES]; // sides 3 or 4? also, check boxes first
413  int nsTgt, nsSrc;
414  rval = computeIntersectionBetweenTgtAndSrc( tcell, startSrc, P, nP, area, nb, nr, nsSrc, nsTgt, true );MB_CHK_ERR( rval );
415  if( area > 0 )
416  {
417  if( nP > 1 )
418  { // this will also construct triangles/polygons in the new mesh, if needed
419  rval = findNodes( tcell, nnodes, startSrc, nsSrc, P, nP );MB_CHK_ERR( rval );
420  }
421  recoveredArea += area;
422  }
423  }
424  recoveredArea = ( recoveredArea - areaTgtCell ) / areaTgtCell; // replace now with recovery fract
425  }
426  // before cleaning up , we need to settle the position of the intersection points
427  // on the boundary edges
428  // this needs to be collective, so we should maybe wait something
429 #ifdef MOAB_HAVE_MPI
430  rval = resolve_intersection_sharing();MB_CHK_SET_ERR( rval, "can't correct position, Intx2Mesh.cpp \n" );
431 #endif
432 
433  this->clean();
434  return MB_SUCCESS;
435 }

References moab::Range::begin(), box_error, moab::AdaptiveKDTree::build_tree(), clean(), moab::Range::clear(), computeIntersectionBetweenTgtAndSrc(), countTag, moab::AdaptiveKDTree::distance_search(), moab::Range::empty(), moab::Range::end(), epsilon_1, ErrorCode, extraNodesVec, findNodes(), moab::Interface::get_adjacencies(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), moab::Interface::id_from_handle(), moab::Interface::INTERSECT, max_edges_1, max_edges_2, MAXEDGES, mb, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_HANDLE, MB_TYPE_INTEGER, mbs1, mbs2, moab::Range::merge(), my_rank, neighTgtEdgeTag, nr, outSet, rs1, rs2, setup_tgt_cell(), moab::Range::size(), srcParentTag, moab::Interface::tag_delete(), moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), tgtConn, TgtEdges, tgtParentTag, moab::tolerance, and moab::Interface::UNION.

Referenced by moab::TempestRemapper::ComputeOverlapMesh().

◆ set_box_error()

void moab::Intx2Mesh::set_box_error ( double  berror)
inline

Definition at line 136 of file Intx2Mesh.hpp.

137  {
138  box_error = berror;
139  }

References box_error.

Referenced by moab::TempestRemapper::ConstructCoveringSet(), create_mesh(), main(), and test_intx_in_parallel_elem_based().

◆ set_error_tolerance()

void moab::Intx2Mesh::set_error_tolerance ( double  eps)
inline

Definition at line 119 of file Intx2Mesh.hpp.

120  {
121  epsilon_1 = eps;
122  epsilon_area = eps * sqrt( eps );
123  }

References epsilon_1, and epsilon_area.

Referenced by moab::TempestRemapper::ConstructCoveringSet(), main(), test_intx_in_parallel_elem_based(), and update_tracer().

◆ setup_tgt_cell()

virtual double moab::Intx2Mesh::setup_tgt_cell ( EntityHandle  tgt,
int &  nsTgt 
)
pure virtual

Member Data Documentation

◆ allBoxes

std::vector< double > moab::Intx2Mesh::allBoxes
protected

Definition at line 250 of file Intx2Mesh.hpp.

◆ box_error

◆ counting

int moab::Intx2Mesh::counting
protected

◆ countTag

◆ epsilon_1

◆ epsilon_area

◆ extraNodesVec

std::vector< std::vector< EntityHandle >* > moab::Intx2Mesh::extraNodesVec
protected

◆ gid

Tag moab::Intx2Mesh::gid
protected

◆ localEnts

Range moab::Intx2Mesh::localEnts
protected

Definition at line 254 of file Intx2Mesh.hpp.

◆ localRoot

EntityHandle moab::Intx2Mesh::localRoot
protected

Definition at line 253 of file Intx2Mesh.hpp.

◆ max_edges_1

int moab::Intx2Mesh::max_edges_1
protected

◆ max_edges_2

int moab::Intx2Mesh::max_edges_2
protected

◆ mb

◆ mbs1

EntityHandle moab::Intx2Mesh::mbs1
protected

Definition at line 197 of file Intx2Mesh.hpp.

Referenced by createTags(), intersect_meshes(), and intersect_meshes_kdtree().

◆ mbs2

EntityHandle moab::Intx2Mesh::mbs2
protected

Definition at line 198 of file Intx2Mesh.hpp.

Referenced by createTags(), intersect_meshes(), and intersect_meshes_kdtree().

◆ my_rank

unsigned int moab::Intx2Mesh::my_rank
protected

◆ neighTgtEdgeTag

◆ orgSendProcTag

Tag moab::Intx2Mesh::orgSendProcTag
protected

Definition at line 223 of file Intx2Mesh.hpp.

Referenced by moab::Intx2MeshOnSphere::findNodes().

◆ outSet

◆ rs1

◆ rs2

◆ srcConn

◆ srcCoords

◆ srcCoords2D

◆ srcNeighTag

Tag moab::Intx2Mesh::srcNeighTag
protected

Definition at line 216 of file Intx2Mesh.hpp.

Referenced by createTags(), and intersect_meshes().

◆ srcParentTag

◆ tgtConn

◆ tgtCoords

◆ tgtCoords2D

◆ TgtEdges

◆ TgtFlagTag

Tag moab::Intx2Mesh::TgtFlagTag
protected

Definition at line 206 of file Intx2Mesh.hpp.

Referenced by clean(), createTags(), and intersect_meshes().

◆ tgtNeighTag

Tag moab::Intx2Mesh::tgtNeighTag
protected

Definition at line 218 of file Intx2Mesh.hpp.

Referenced by createTags(), and intersect_meshes().

◆ tgtParentTag


The documentation for this class was generated from the following files: