Exemplo n.º 1
0
void find_boundary_component_germs(GRID const& G, FACETSET & C,
				   int& num_comps, int& num_facets)

{
  typedef GRID                          grid_type;
  typedef grid_types<GRID>              gt;
  typedef typename gt::Facet            Facet;
  typedef typename gt::FacetIterator    FacetIterator;
  typedef iscellinside_pred<grid_type>  inside;
  typedef BoundaryComponentEdgeIterator2D<grid_type, inside> BCFacetIterator;

  partial_grid_function<Facet,bool> marked(G,false);

  num_comps = num_facets = 0;
  for(FacetIterator f = G.FirstFacet(); ! f.IsDone(); ++f)
    if( (! marked(*f))  && (G.IsOnBoundary(*f))) {
      C.push_back(*f);
      num_comps++;
      BCFacetIterator bf(*f,inside(G));
      while(! bf.IsDone()) {
	num_facets++;
	marked[*bf] = true;
	++bf;
      }
    }
}
Exemplo n.º 2
0
int count_boundary_facets(GRID const& G)
{
  typedef GRID                          grid_type;
  typedef grid_types<GRID>              gt;
  typedef typename gt::FacetIterator    FacetIterator;

  int nf = 0;
  for(FacetIterator f = G.FirstFacet(); ! f.IsDone(); ++f)
    if(G.IsOnBoundary(*f)) 
      ++nf;
  return nf;
}