Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Pane_connectivity.C File Reference
#include <set>
#include <map>
#include <cassert>
#include <algorithm>
#include <iostream>
#include "kdtree_d.h"
#include "Pane_connectivity.h"
#include "Pane_boundary.h"
Include dependency graph for Pane_connectivity.C:

Go to the source code of this file.

Classes

class  Point_3_ref
 
class  KD_tree_3
 
class  KD_tree_pntref_3
 

Typedefs

typedef std::pair< int, int > pair_int
 
typedef std::pair< int, int > Node_ID
 

Functions

static void convert_nodelist (const std::vector< bool > &bs, std::vector< int > &nodes)
 
static void make_kd_tree (const std::vector< int > &nodes, const std::vector< Point_3< Real > > &pnts, std::vector< Point_3< Real > > &bbox, KD_tree_pntref_3 &ktree)
 
static bool intersect_bbox (const Point_3< Real > &bmin1, const Point_3< Real > &bmax1, const Point_3< Real > &bmin2, const Point_3< Real > &bmax2, Real eps)
 
static bool intersect_bbox (const Point_3< Real > &bmin, const Point_3< Real > &bmax, const std::vector< Point_3< Real > > &bbox, Real tol)
 
static void collect_coincident_nodes (const std::vector< int > &r_nodes, const std::vector< Point_3< Real > > &r_pnts, const std::vector< Point_3< Real > > &bbox, KD_tree_pntref_3 &ktree, double tol, std::vector< int > &nodes, std::vector< Point_3< Real > > &pnts)
 

Typedef Documentation

typedef std::pair<int,int> Node_ID

Definition at line 69 of file Pane_connectivity.C.

typedef std::pair<int,int> pair_int

Definition at line 68 of file Pane_connectivity.C.

Function Documentation

static void collect_coincident_nodes ( const std::vector< int > &  r_nodes,
const std::vector< Point_3< Real > > &  r_pnts,
const std::vector< Point_3< Real > > &  bbox,
KD_tree_pntref_3 ktree,
double  tol,
std::vector< int > &  nodes,
std::vector< Point_3< Real > > &  pnts 
)
static

Definition at line 379 of file Pane_connectivity.C.

References i, intersect_bbox(), n, Point_3< T >::x(), Point_3< T >::y(), and Point_3< T >::z().

Referenced by Pane_connectivity::collect_boundary_nodes().

384  {
385  unsigned int count = 0;
386 
387  while (count<r_nodes.size()) {
388  const Point_3<Real> &xmin=r_pnts[count], &xmax=r_pnts[count+1];
389 
390  if ( !intersect_bbox( xmin, xmax, bbox, tol))
391  { count += 2+r_nodes[count+1]; continue; }
392  int pane = r_nodes[count++];
393 
394  int nn = 0;
395  for ( int i=0, n = r_nodes[count++]; i<n; ++i, ++count) {
396  const Point_3<Real> &p=r_pnts[count];
397  Point_3_ref lb(p.x()-tol, p.y()-tol, p.z()-tol);
398  Point_3_ref ub(p.x()+tol, p.y()+tol, p.z()+tol);
399  KD_tree_pntref_3::Box box( lb, ub, 3);
400 
401  std::vector< Point_3_ref> outList; outList.reserve(4);
402  ktree.search( std::back_inserter( outList), box);
403  if ( !outList.empty()) {
404  if ( nn==0) {
405  nodes.push_back( -pane); // Use negative for remote panes
406  nodes.push_back( 0);
407  pnts.push_back( xmin); pnts.push_back( xmax);
408  }
409  nodes.push_back( r_nodes[count]);
410  pnts.push_back( p);
411  ++nn;
412  }
413  }
414  if ( nn>0) *(nodes.end()-nn-1) = nn;
415  }
416 }
KD_tree::Box box
Definition: Overlay_0d.C:47
blockLoc i
Definition: read.cpp:79
const NT & n
FT x() const
Definition: Point_3.h:129
FT y() const
Definition: Point_3.h:132
static bool intersect_bbox(const Point_3< Real > &bmin1, const Point_3< Real > &bmax1, const Point_3< Real > &bmin2, const Point_3< Real > &bmax2, Real eps)
FT z() const
Definition: Point_3.h:135

Here is the call graph for this function:

Here is the caller graph for this function:

static void convert_nodelist ( const std::vector< bool > &  bs,
std::vector< int > &  nodes 
)
static

Definition at line 87 of file Pane_connectivity.C.

References i, and s.

Referenced by Pane_connectivity::get_local_boundary_nodes().

88  {
89  nodes.clear();
90  const int s = bs.size();
91  for ( int i=0; i<s; ++i)
92  if ( bs[i]) nodes.push_back( i+1);
93 }
double s
Definition: blastest.C:80
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

static bool intersect_bbox ( const Point_3< Real > &  bmin1,
const Point_3< Real > &  bmax1,
const Point_3< Real > &  bmin2,
const Point_3< Real > &  bmax2,
Real  eps 
)
static

Definition at line 355 of file Pane_connectivity.C.

References Point_3< T >::x(), Point_3< T >::y(), and Point_3< T >::z().

Referenced by collect_coincident_nodes(), and intersect_bbox().

357  {
358  // check for emptiness ??
359  if (bmax1.x()+eps < bmin2.x() || bmax2.x()+eps < bmin1.x())
360  return false;
361  if (bmax1.y()+eps < bmin2.y() || bmax2.y()+eps < bmin1.y())
362  return false;
363  if (bmax1.z()+eps < bmin2.z() || bmax2.z()+eps < bmin1.z())
364  return false;
365  return true;
366 }
FT x() const
Definition: Point_3.h:129
FT y() const
Definition: Point_3.h:132
FT z() const
Definition: Point_3.h:135

Here is the call graph for this function:

Here is the caller graph for this function:

static bool intersect_bbox ( const Point_3< Real > &  bmin,
const Point_3< Real > &  bmax,
const std::vector< Point_3< Real > > &  bbox,
Real  tol 
)
static

Definition at line 369 of file Pane_connectivity.C.

References i, intersect_bbox(), and n.

370  {
371  for ( int i=0, n=bbox.size(); i<n; i+=2) {
372  if ( intersect_bbox( bmin, bmax, bbox[i], bbox[i+1], tol))
373  return true;
374  }
375  return false;
376 }
blockLoc i
Definition: read.cpp:79
const NT & n
static bool intersect_bbox(const Point_3< Real > &bmin1, const Point_3< Real > &bmax1, const Point_3< Real > &bmin2, const Point_3< Real > &bmax2, Real eps)

Here is the call graph for this function:

static void make_kd_tree ( const std::vector< int > &  nodes,
const std::vector< Point_3< Real > > &  pnts,
std::vector< Point_3< Real > > &  bbox,
KD_tree_pntref_3 ktree 
)
static

Definition at line 334 of file Pane_connectivity.C.

References i, and n.

Referenced by Pane_connectivity::collect_boundary_nodes(), and Pane_connectivity::create_b2map().

337  {
338  if ( nodes.empty()) return;
339  assert( nodes.size() == pnts.size());
340  std::vector< Point_3_ref> b; b.reserve( pnts.size());
341  bbox.clear();
342 
343  unsigned int count = 0;
344  while (count<nodes.size()) {
345  bbox.push_back( pnts[count]);
346  bbox.push_back( pnts[++count]);
347  for ( int i=0, n = nodes[count++]; i<n; ++i, ++count) {
348  b.push_back( Point_3_ref(pnts[count],count));
349  }
350  }
351  ktree.build( b);
352 }
blockLoc i
Definition: read.cpp:79
const NT & n

Here is the caller graph for this function: