Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Simple_manifold_2 Class Reference

Provides a data structure accessing nodes, elements, and edges in a pane, in a manner similar to the halfedge data structure, assuming the elements form a 2-manifold. More...

#include <Simple_manifold_2.h>

Inheritance diagram for Simple_manifold_2:
Collaboration diagram for Simple_manifold_2:

Public Types

typedef Facet_ID Edge_ID
 

Public Member Functions

 Simple_manifold_2 ()
 Default constructors. More...
 
 Simple_manifold_2 (const COM::Pane *p, const Simple_manifold_2 *parent=NULL, bool with_ghost=true)
 Constructors. More...
 
const COM::Pane * pane () const
 Obtain a const pointer to the pane. More...
 
bool is_real_node (int vID) const
 Is the given node a real node? More...
 
bool is_ghost_node (int vID) const
 Is the given node a ghost node? More...
 
bool is_real_element (int eid) const
 Is the element incident on the give edge a real element? More...
 
bool is_ghost_element (int eid) const
 Is the element incident on the give edge a ghost element? More...
 
int get_edge_index (const Edge_ID &eid, const int offset=0) const
 Get an index for internal edges. More...
 
int upperbound_edge_index () const
 Get size of internal edges. More...
 
void get_borders (std::vector< bool > &is_border, std::vector< bool > &is_isolated, std::vector< Edge_ID > *b, int *ng=NULL) const
 Obtain all the border nodes, isolated nodes, and border edges. More...
 
Size of nodes
int size_of_nodes () const
 Number of nodes of the pane. More...
 
int maxsize_of_nodes () const
 Maximum number of nodes allowed in the pane. More...
 
int size_of_real_nodes () const
 Number of real nodes of the pane. More...
 
int maxsize_of_real_nodes () const
 Maximum number of real nodes allowed in the pane. More...
 
int size_of_ghost_nodes () const
 Number of ghost nodes of the pane. More...
 
int maxsize_of_ghost_nodes () const
 Maximum number of ghost nodes allowed in the pane. More...
 
Size of faces
int size_of_elements () const
 Number of elements of the pane. More...
 
int maxsize_of_elements () const
 Maximum number of elements allowed in the pane. More...
 
int size_of_real_elements () const
 Number of real elements of the pane. More...
 
int maxsize_of_real_elements () const
 Maximum number of real elements allowed in the pane. More...
 
int size_of_ghost_elements () const
 Number of ghost elements of the pane. More...
 
int maxsize_of_ghost_elements () const
 Maximum number of ghost elements allowed in the pane. More...
 
int size_of_faces () const
 Number of elements of the pane. More...
 
int maxsize_of_faces () const
 Maximum number of elements allowed in the pane. More...
 
int size_of_real_faces () const
 Number of real elements of the pane. More...
 
int maxsize_of_real_faces () const
 Maximum number of real elements allowed in the pane. More...
 
int size_of_ghost_faces () const
 Number of ghost elements of the pane. More...
 
int maxsize_of_ghost_faces () const
 Maximum number of ghost elements allowed in the pane. More...
 
int size_of_triangles () const
 Total number of triangles of the pane. More...
 
int maxsize_of_triangles () const
 Maximum number of triangles allowed in the pane. More...
 
int size_of_real_triangles () const
 Number of real triangles of the pane. More...
 
int maxsize_of_real_triangles () const
 Maximum number of real triangles allowed in the pane. More...
 
int size_of_ghost_triangles () const
 Number of ghost triangles of the pane. More...
 
int maxsize_of_ghost_triangles () const
 Maximum number of ghost triangles allowed in the pane. More...
 
int size_of_quadrilaterals () const
 Total number of quadrilaterals of the pane. More...
 
int maxsize_of_quadrilaterals () const
 Maximum number of quadrilaterals allowed in the pane. More...
 
int size_of_real_quadrilaterals () const
 Number of real quadrilaterals of the pane. More...
 
int maxsize_of_real_quadrilaterals () const
 Maximum number of real quadrilaterals allowed in the pane. More...
 
int size_of_ghost_quadrilaterals () const
 Number of ghost quadrilaterals of the pane. More...
 
int maxsize_of_ghost_quadrilaterals () const
 Maximum number of ghost quadrilaterals allowed in the pane. More...
 
Size of edges
int size_of_halfedges () const
 Number of halfedges of the pane. More...
 
int size_of_real_halfedges () const
 Number of real halfedges of the pane. More...
 
int size_of_ghost_halfedges () const
 Number of ghost halfedges of the pane. More...
 
int size_of_edges () const
 Number of edges of the pane. More...
 
int size_of_real_edges () const
 Number of real edges of the pane. More...
 
int size_of_ghost_edges () const
 Number of ghost edges of the pane. More...
 
Size of border edges and nodes
int size_of_border_edges () const
 Number of border edges of the whole pane. More...
 
int size_of_real_border_edges () const
 Number of border edges of the real part of the pane. More...
 
int size_of_ghost_border_edges () const
 Number of border edges of the ghost part of the pane. More...
 
int size_of_isolated_nodes () const
 Number of isolated nodes. More...
 
Nodes and edges connectivity
int get_origin (Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
 Get the ID of the origin of a given edge. More...
 
int get_destination (Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
 Get the ID of the destination of a given edge. More...
 
Edge_ID get_incident_edge (int vID) const
 Get the ID of an incident edge within the pane of a given node that originated from the node. More...
 
Edge_ID get_incident_real_edge (int vID) const
 Get the ID of an incident real edge within the pane of a given node. More...
 
Edge_ID get_incident_ghost_edge (int vID) const
 Get the ID of an incident real edge within the pane of a given node The incident edge may encode an isolated node. More...
 
Border nodes and edges
bool is_border_edge (const Edge_ID &eID) const
 Is a given edge on the boundary of the whole pane? More...
 
bool is_pure_real_border_edge (const Edge_ID &eID) const
 Determine whether a given edge is a border edge of real part of the whole pane (on physical border). More...
 
bool is_real_border_edge (const Edge_ID &eID) const
 Determine whether a given edge is a border edge of real part of the pane (either on physical border or between real and ghost elements) More...
 
bool is_ghost_border_edge (const Edge_ID &eID) const
 Determine whether a given edge is a border edge of ghost part of the pane (either on physical border or between real and ghost elements) More...
 
bool is_isolated_node (int vID) const
 Is the node isolated (i.e. not incident on any element)? More...
 
bool is_real_border_node (int vID) const
 Is the node on the pane boundary of real part (not isolated)? More...
 
bool is_ghost_border_node (int vID) const
 Is the node on pane boundary (not isolated)? It assumes vID is incident on the ghost (no checking is performed). More...
 
bool is_border_node (int vID) const
 Is the node on pane boundary (not isolated)? More...
 
int get_border_edgeID (Edge_ID eID) const
 Get the border edge index. Return -1 if not a border edge. More...
 
Edge_ID get_a_real_border_edge () const
 Obtain a border edge on real part of the pane. More...
 
Edge_ID get_a_ghost_border_edge () const
 Obtain a border edge on ghost part of the pane. More...
 
Edge_ID get_a_border_edge () const
 Obtain the ID of a border edge of the whole pane. More...
 
int get_a_real_border_node () const
 Obtain the ID of a border node of the real part of the pane. More...
 
int get_a_ghost_border_node () const
 Obtain the ID of a border node of the ghost part of the pane. More...
 
int get_a_border_node () const
 Obtain the ID of a border node. More...
 

Protected Member Functions

void init (const COM::Pane *p, const Simple_manifold_2 *parent=NULL, bool with_ghost=true)
 Initialize the database for the pane, including ghost information, opposite halfedges, incident halfedges, and border halfedges. More...
 
void determine_ghosts ()
 Determine the ghost nodes and elements. More...
 
void determine_opposite_halfedges ()
 Determine the opposite halfedges of each halfedge, and identify border halfedge. More...
 
void determine_incident_halfedges ()
 Determine an incident halfedge for each node. More...
 

Protected Attributes

const COM::Pane * _pane
 
bool _is_str
 
bool _with_ghost
 
std::vector< const
COM::Connectivity * > 
_elem_conns
 
int _nspe
 
int _maxsize_real_nodes
 
int _maxsize_real_elmts
 
int _size_real_borders
 
int _size_ghost_borders
 
int _size_rg_borders
 
std::vector< bool > _isghostnode
 
std::vector< bool > _isghostelmt
 
std::vector< Edge_ID_oeIDs_real_or_str
 
std::vector< Edge_ID_oeIDs_ghost
 
std::vector< Edge_ID_ieIDs_real_or_str
 
std::vector< Edge_ID_ieIDs_ghost
 
std::vector< Edge_ID_beIDs
 
std::vector< int > _isovIDs
 

Opposite Edges

Edge_ID get_opposite_real_edge (const Edge_ID &eID) const
 Get the ID of the opposite real edge of a given real or border edge. More...
 
Edge_ID get_opposite_ghost_edge (const Edge_ID &eID) const
 Get the ID of the opposite ghost edge of a given real or border edge. More...
 
Edge_ID get_opposite_edge (const Edge_ID &eID) const
 Get the ID of the opposite edge of a given interior or border edge. More...
 
Edge_ID get_opposite_edge_interior (const Edge_ID &eID) const
 Get the opposite edge of an interior edge of the whole pane. More...
 
Edge_ID get_opposite_real_edge_interior (const Edge_ID &eID) const
 Get the opposite edge of an interior edge of the real part. More...
 
Edge_ID get_opposite_ghost_edge_interior (const Edge_ID &eID) const
 Get the opposite edge of an interior edge of the ghost part. More...
 
Edge_ID get_opposite_edge_border (const Edge_ID &eID) const
 Get the opposite edge of a border edge for the whole pane. More...
 
Edge_ID get_opposite_real_edge_border (const Edge_ID &eID) const
 Get the opposite edge of a border edge for the real pane. More...
 
Edge_ID get_opposite_ghost_edge_border (const Edge_ID &eID) const
 Get the opposite edge of a border edge for the ghost pane. More...
 

Previous and next Edges

Edge_ID get_prev_edge (const Edge_ID &eID) const
 Get the ID of the previous edge of the element or along the boundary. More...
 
Edge_ID get_prev_real_edge (const Edge_ID &eID) const
 Get the ID of the previous real edge of the element or along the boundary. More...
 
Edge_ID get_prev_ghost_edge (const Edge_ID &eID) const
 Get the ID of the previous ghost edge of the element or along the boundary. More...
 
Edge_ID get_next_edge (const Edge_ID &eID) const
 Get the ID of the next edge of the element or along the boundary. More...
 
Edge_ID get_next_real_edge (const Edge_ID &eID) const
 Get the ID of the next real edge of the element or along the boundary. More...
 
Edge_ID get_next_ghost_edge (const Edge_ID &eID) const
 Get the ID of the next ghost edge of the element or along the boundary. More...
 
Edge_ID get_prev_edge_interior (const Edge_ID &eID) const
 
Edge_ID get_prev_real_edge_interior (const Edge_ID &eID) const
 
Edge_ID get_prev_ghost_edge_interior (const Edge_ID &eID) const
 
Edge_ID get_next_edge_interior (const Edge_ID &eID) const
 
Edge_ID get_next_real_edge_interior (const Edge_ID &eID) const
 
Edge_ID get_next_ghost_edge_interior (const Edge_ID &eID) const
 

Detailed Description

Provides a data structure accessing nodes, elements, and edges in a pane, in a manner similar to the halfedge data structure, assuming the elements form a 2-manifold.

It provides interfaces for accessing the real part, the ghost part, or the whole pane.

Definition at line 80 of file Simple_manifold_2.h.

Member Typedef Documentation

typedef Facet_ID Edge_ID

Definition at line 82 of file Simple_manifold_2.h.

Constructor & Destructor Documentation

Simple_manifold_2 ( const COM::Pane *  p,
const Simple_manifold_2 parent = NULL,
bool  with_ghost = true 
)
inlineexplicit

Constructors.

Definition at line 91 of file Simple_manifold_2.h.

References init().

94  { init(p, parent, with_ghost); }
void init(const COM::Pane *p, const Simple_manifold_2 *parent=NULL, bool with_ghost=true)
Initialize the database for the pane, including ghost information, opposite halfedges, incident halfedges, and border halfedges.

Here is the call graph for this function:

Member Function Documentation

void determine_ghosts ( )
protected

Determine the ghost nodes and elements.

Definition at line 81 of file Simple_manifold_2.C.

References _is_str, _isghostelmt, _isghostnode, _pane, _with_ghost, and COM_assertion_msg.

Referenced by init().

81  {
82  // _isghostnode and _isghostelmt not used for unstructured meshes
83  // and meshes without ghost
84  _isghostnode.clear();
85  _isghostelmt.clear();
86 
87  if ( !_is_str || !_with_ghost) return;
88 
89  // Fill in _isghostnode and _isghostelmt for structured mesh with ghosts
90  _isghostnode.resize( _pane->size_of_nodes(), false);
91  _isghostelmt.resize( _pane->size_of_elements(), false);
92 
93  COM_assertion_msg( false,
94  "Not fully implemented yet for structured mesh");
95 }
#define COM_assertion_msg(EX, msg)
std::vector< bool > _isghostelmt
const COM::Pane * _pane
std::vector< bool > _isghostnode

Here is the caller graph for this function:

void determine_incident_halfedges ( )
protected

Determine an incident halfedge for each node.

If the node is a border node, then determine its incident border halfedge. If the pane is unstructured and contains isolated nodes, determine an ordering of the isolated nodes.

Definition at line 250 of file Simple_manifold_2.C.

References _beIDs, _ieIDs_ghost, _ieIDs_real_or_str, _is_str, _isovIDs, _maxsize_real_elmts, _maxsize_real_nodes, _pane, _with_ghost, COM_assertion, COM_assertion_msg, get_opposite_ghost_edge_interior(), get_opposite_real_edge_interior(), get_origin(), i, Element_node_enumerator::id(), is_border_edge(), is_real_element(), is_real_node(), j, min(), Element_node_enumerator::next(), ni, Element_node_enumerator::size_of_edges(), and Element_node_enumerator::size_of_nodes().

Referenced by init().

250  {
252  int(_pane->size_of_real_nodes())==_maxsize_real_nodes &&
253  int(_pane->size_of_real_elements())==_maxsize_real_elmts,
254  "Support for maxsize not yet fully implemented");
255 
256  int nnodes, nelems;
257  if ( _is_str) { // For structured meshes, real and ghost are stored together
258  nnodes = _pane->size_of_nodes();
259  nelems = _pane->size_of_elements();
260  }
261  else {
262  nnodes = _pane->size_of_real_nodes();
263  nelems = _pane->size_of_real_elements();
264  }
265 
266  _ieIDs_real_or_str.clear(); _ieIDs_real_or_str.resize( nnodes, Edge_ID());
267 
268  Element_node_enumerator ene( _pane, 1);
269  for ( int j=0; j<nelems; ++j, ene.next()) {
270  int ne=ene.size_of_edges();
271 
272  for ( int i=0; i<ne; ++i) {
273  int vID=ene[i];
274 
275  // If the incident elements has not been assigned, or the
276  // incident edge is a border edge, then assign the incident elements.
277  Edge_ID prev( ene.id(),i?i-1:ne-1);
278  Edge_ID eoppID = is_real_element( ene.id()) ?
281 
282  Edge_ID &iid = _ieIDs_real_or_str[ vID-1];
283  if ( eoppID.is_border() && !is_border_edge( iid)) {
284  iid = eoppID;
285  COM_assertion( get_origin( iid) == vID);
286  }
287  else if ( iid==Edge_ID()) {
288  iid = Edge_ID( ene.id(), i);
289  COM_assertion( get_origin( iid, &ene) == vID);
290  }
291  }
292 
293  // Special treatment for edge centers of quadratic elements
294  int ne2 = std::min(ne+ne,ene.size_of_nodes());
295  for ( int i=ne, ni=ne2; i<ni; ++i) {
296  int vID=ene[i];
297 
298  // Make sure every edge centers points to one of its halfedge, and
299  // always points to the border halfedge if on the boundary.
300  Edge_ID eID( ene.id(), i-ne);
301  Edge_ID eoppID = is_real_element( ene.id()) ?
304 
305  Edge_ID &iid = _ieIDs_real_or_str[ vID-1];
306  if ( eoppID.is_border() && !is_border_edge( iid))
307  iid =eoppID;
308  else if ( iid==Edge_ID())
309  iid = eID;
310  }
311 
312  // Finally, handle face center.
313  if ( ne2<ene.size_of_nodes())
314  _ieIDs_real_or_str[ene[ne2]-1] = Edge_ID(ene.id(),0);
315  }
316 
317  if (!_is_str) {
318  // Identify isolated nodes that are not incident on any element
319  // and create a numbering for the isolated nodes.
320  _isovIDs.clear();
321  // Loop through all the nodes
322  for ( int i=1; i<=nnodes; ++i) {
323  Edge_ID &iid = _ieIDs_real_or_str[ i-1];
324  if ( iid == Edge_ID()) {
325  _isovIDs.push_back( i);
326  iid = Edge_ID( _beIDs.size()+_isovIDs.size(), -1);
327  }
328  }
329  }
330 
331  // We are done for structured mesh and unstructured without ghost
332  nnodes = _with_ghost ? _pane->size_of_ghost_nodes() : 0;
333  _ieIDs_ghost.clear(); _ieIDs_ghost.resize( nnodes, Edge_ID());
334  if ( _is_str || nnodes==0) return;
335 
336  // Handle ghost nodes and elements
337  nelems = _pane->size_of_ghost_elements();
338  if ( nelems>0) ene = Element_node_enumerator( _pane, _maxsize_real_elmts+1);
339 
340  for ( int j=0; j<nelems; ++j, ene.next()) {
341  int ne=ene.size_of_edges();
342 
343  for ( int i=0; i<ne; ++i) {
344  int vID=ene[i];
345  if ( is_real_node( vID)) continue; // skip real nodes.
346 
347  // If the incident elements has not been assigned, or the
348  // incident edge is a border edge, then assign the incident elements.
349  Edge_ID prev( ene.id(),i?i-1:ne-1);
351 
353  if ( eoppID.is_border() && !is_border_edge( iid)) {
354  iid = eoppID;
355  COM_assertion( get_origin( iid) == vID);
356  }
357  else if ( iid==Edge_ID()) {
358  iid = Edge_ID( ene.id(), i);
359  COM_assertion( get_origin( iid, &ene) == vID);
360  }
361  }
362 
363  // Special treatment for edge centers of quadratic elements
364  int ne2 = std::min(ne+ne,ene.size_of_nodes());
365  for ( int i=ne, ni=ne2; i<ni; ++i) {
366  int vID=ene[i];
367  if ( is_real_node( vID)) continue; // skip real nodes.
368 
369  // Make sure every edge centers points to one of its halfedge, and
370  // always points to the border halfedge if on the boundary.
371  Edge_ID eID( ene.id(), i-ne);
373 
375  if ( eoppID.is_border() && !is_border_edge( iid)) {
376  iid =eoppID;
377  COM_assertion( get_origin( iid) == vID);
378  }
379  else if ( iid==Edge_ID()) {
380  iid = eID;
381  COM_assertion( get_origin( iid, &ene) == vID);
382  }
383  }
384 
385  // Finally, handle face center.
386  if ( ne2<ene.size_of_nodes())
387  _ieIDs_ghost[ene[ne2]-_maxsize_real_nodes-1] = Edge_ID(ene.id(),0);
388  }
389 }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
An adaptor for enumerating node IDs of an element.
bool is_real_node(int vID) const
Is the given node a real node?
#define COM_assertion_msg(EX, msg)
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_ghost
bool is_border_edge(const Edge_ID &eID) const
Is a given edge on the boundary of the whole pane?
std::vector< Edge_ID > _ieIDs_real_or_str
Edge_ID get_opposite_ghost_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the ghost part.
blockLoc i
Definition: read.cpp:79
bool is_real_element(int eid) const
Is the element incident on the give edge a real element?
std::vector< int > _isovIDs
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
const COM::Pane * _pane
j indices j
Definition: Indexing.h:6
void int int REAL REAL REAL *z blockDim dim * ni
Definition: read.cpp:77
std::vector< Edge_ID > _beIDs
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.
Edge_ID get_opposite_real_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the real part.

Here is the call graph for this function:

Here is the caller graph for this function:

void determine_opposite_halfedges ( )
protected

Determine the opposite halfedges of each halfedge, and identify border halfedge.

Definition at line 98 of file Simple_manifold_2.C.

References _beIDs, _is_str, _maxsize_real_elmts, _nspe, _oeIDs_ghost, _oeIDs_real_or_str, _pane, _size_ghost_borders, _size_real_borders, _size_rg_borders, _with_ghost, Facet_ID::BndID, COM_assertion, Facet_ID::eid(), get_edge_index(), i, Element_node_enumerator::id(), Pane_dual_connectivity::incident_elements(), is_ghost_element(), is_real_element(), j, k, Element_node_enumerator::next(), nk, and Element_node_enumerator::size_of_edges().

Referenced by init().

98  {
99 
100  // Compute the dual connectivity.
102 
103  int nr = _nspe*_pane->size_of_real_elements();
104  _oeIDs_real_or_str.clear(); _oeIDs_real_or_str.resize( nr, Edge_ID());
105 
106  int ng = _with_ghost ? _nspe*_pane->size_of_ghost_elements():0;
107  _oeIDs_ghost.clear(); _oeIDs_ghost.resize( ng, Edge_ID());
108 
109  // Buffer array for holding border edges between real and ghost
110  std::vector<Edge_ID> beIDs_rg;
111 
112  // Determine the neighbor elements from the dual connectivity.
113  Element_node_enumerator ene( _pane, 1);
114  std::vector<int> ies1, ies2;
115  std::vector<int> ies_common; ies_common.reserve(2);
116 
117  // Process real elements of unstructured meshes or structured meshes
118  int nn = _is_str && _with_ghost
119  ? _pane->size_of_elements():_pane->size_of_real_elements();
120  for ( int j=0; j<nn; ++j, ene.next()) {
121  const int ne = ene.size_of_edges();
122  COM_assertion( _nspe>=ne);
123 
124  int ij = j*_nspe;
125  for ( int i=0; i<ne; ++i, ++ij) {
126  // Determine the elements that incident on both nodes of the edge
127  pdc.incident_elements( ene[i], ies1);
128  pdc.incident_elements( ene[(i==ne-1)?0:i+1], ies2);
129 
130  ies_common.clear();
131  std::back_insert_iterator< std::vector<int> > ii(ies_common);;
132  std::set_intersection( ies1.begin(), ies1.end(),
133  ies2.begin(), ies2.end(), ii);
134  COM_assertion( ies_common.size()<=2);
135 
136  int eid=0;
137  for ( std::vector<int>::iterator it_ies = ies_common.begin();
138  it_ies != ies_common.end(); ++it_ies)
139  if ( *it_ies != ene.id()) { eid = *it_ies; break; }
140 
141  // Determing the local side ID
142  if ( eid) {
143  int node_id = ene[i];
144  Element_node_enumerator ene_opp( _pane, eid);
145  const int nk=ene_opp.size_of_edges();
146  for ( int k=0; k<nk; ++k) if ( ene_opp[k] == node_id) {
147  Edge_ID opp = Edge_ID( eid, k?k-1:nk-1);
148 
149  bool isreal_edge = !_with_ghost || !_is_str || is_real_element( ene.id());
150  bool isghost_opp = _with_ghost && is_ghost_element( eid);
151 
152  if ( isreal_edge || isghost_opp)
153  // ghost elements of structured mesh
154  _oeIDs_real_or_str[ij] = opp;
155 
156  // Insert border edges incident on ghost elements into _beIDs_rg
157  if ( isghost_opp && isreal_edge) {
158  beIDs_rg.push_back( Edge_ID( ene.id(), i));
159 
160  Edge_ID bid = Edge_ID( beIDs_rg.size(), Edge_ID::BndID);
161  if (_is_str)
162  _oeIDs_real_or_str[ get_edge_index( opp)] = bid;
163  else
165  }
166 
167  break;
168  }
170  } // eid
171  else {
172  // Insert border edges of the real part into _beIDs
173  _beIDs.push_back( Edge_ID(ene.id(), i));
175  }
176  }
177  }
178 
179  // Save the number of real borders edges.
180  _size_real_borders = _beIDs.size();
181  _size_rg_borders = beIDs_rg.size();
182 
183  // Update the rg_border IDs
184  for ( int i=0; i<_size_rg_borders; ++i) {
185  Edge_ID gid = _oeIDs_real_or_str[get_edge_index(beIDs_rg[i])];
186 
187  Edge_ID *bid;
188  if ( _is_str)
189  bid = &_oeIDs_real_or_str[ get_edge_index( gid)];
190  else
192 
193  COM_assertion( bid->eid() == i+1);
194  *bid = Edge_ID( bid->eid()+_size_real_borders, Edge_ID::BndID);
195  }
196 
197  // Merge _beIDs and beIDs_rg together
198  _beIDs.insert( _beIDs.end(), beIDs_rg.begin(), beIDs_rg.end());
199  beIDs_rg.clear();
200 
201  // Process ghost elements
202  nn = _is_str || !_with_ghost ? 0 : _pane->size_of_ghost_elements();
204  for ( int j=0; j<nn; ++j, ene.next()) {
205  const int ne = ene.size_of_edges();
206  COM_assertion( _nspe>=ne);
207 
208  int ij = j*_nspe;
209  for ( int i=0; i<ne; ++i, ++ij) {
210  // Determine the elements that incident on both nodes of the edge
211  pdc.incident_elements( ene[i], ies1);
212  pdc.incident_elements( ene[(i==ne-1)?0:i+1], ies2);
213 
214  ies_common.clear();
215  std::back_insert_iterator< std::vector<int> > ii(ies_common);;
216  std::set_intersection( ies1.begin(), ies1.end(),
217  ies2.begin(), ies2.end(), ii);
218  COM_assertion( ies_common.size()<=2);
219 
220  int eid=0;
221  for ( std::vector<int>::iterator it_ies = ies_common.begin();
222  it_ies != ies_common.end(); ++it_ies)
223  if ( *it_ies != ene.id()) { eid = *it_ies; break; }
224 
225  // Determing the local side ID
226  if ( eid) {
227  if ( is_real_element( eid)) continue;
228 
229  int node_id = ene[i];
230  Element_node_enumerator ene_opp( _pane, eid);
231  const int nk=ene_opp.size_of_edges();
232  for ( int k=0; k<nk; ++k) if ( ene_opp[k] == node_id) {
233  _oeIDs_ghost[ij] = Edge_ID( eid, k?k-1:nk-1);
234  break;
235  }
237  }
238  else {
239  // Insert border edges of the ghost part of the pane into _beIDs
240  _beIDs.push_back( Edge_ID(ene.id(), i));
241  _oeIDs_ghost[ij] = Edge_ID( _beIDs.size(), Edge_ID::BndID);
242  }
243  }
244  }
245 
247 }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
An adaptor for enumerating node IDs of an element.
j indices k indices k
Definition: Indexing.h:6
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
std::vector< Edge_ID > _oeIDs_ghost
blockLoc i
Definition: read.cpp:79
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?
bool is_real_element(int eid) const
Is the element incident on the give edge a real element?
void int int * nk
Definition: read.cpp:74
const COM::Pane * _pane
j indices j
Definition: Indexing.h:6
std::vector< Edge_ID > _beIDs
Constructs the dual connectivity for the whole pane (including ghost nodes and elements), which contains information about incident elements for each node.

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_a_border_edge ( ) const
inline

Obtain the ID of a border edge of the whole pane.

Definition at line 569 of file Simple_manifold_2.h.

References _size_ghost_borders, _size_real_borders, _size_rg_borders, and Facet_ID::BndID.

569  {
570  if ( _size_real_borders>0)
571  return Edge_ID( 1, Edge_ID::BndID);
572  else if ( _size_ghost_borders>0)
574  else
575  return Edge_ID();
576  }
int get_a_border_node ( ) const
inline

Obtain the ID of a border node.

Definition at line 596 of file Simple_manifold_2.h.

References _beIDs, _size_ghost_borders, _size_real_borders, _size_rg_borders, and get_origin().

596  {
597  if ( _size_real_borders>0)
598  return get_origin(_beIDs[0]);
599  else if ( _size_ghost_borders>0)
601  else
602  return -1;
603  }
std::vector< Edge_ID > _beIDs
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.

Here is the call graph for this function:

Edge_ID get_a_ghost_border_edge ( ) const
inline

Obtain a border edge on ghost part of the pane.

Maybe between real and ghost.

Definition at line 561 of file Simple_manifold_2.h.

References _size_ghost_borders, _size_real_borders, _size_rg_borders, and Facet_ID::BndID.

int get_a_ghost_border_node ( ) const
inline

Obtain the ID of a border node of the ghost part of the pane.

The node, however, may be a real node.

Definition at line 588 of file Simple_manifold_2.h.

References _beIDs, _size_ghost_borders, _size_real_borders, _size_rg_borders, and get_origin().

588  {
591  else
592  return -1;
593  }
std::vector< Edge_ID > _beIDs
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.

Here is the call graph for this function:

Edge_ID get_a_real_border_edge ( ) const
inline

Obtain a border edge on real part of the pane.

Definition at line 552 of file Simple_manifold_2.h.

References _size_real_borders, _size_rg_borders, and Facet_ID::BndID.

552  {
554  return Edge_ID( 1, Edge_ID::BndID);
555  else
556  return Edge_ID();
557  }
int get_a_real_border_node ( ) const
inline

Obtain the ID of a border node of the real part of the pane.

Definition at line 579 of file Simple_manifold_2.h.

References _beIDs, _size_real_borders, _size_rg_borders, and get_origin().

579  {
581  return get_origin(_beIDs[0]);
582  else
583  return -1;
584  }
std::vector< Edge_ID > _beIDs
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.

Here is the call graph for this function:

int get_border_edgeID ( Edge_ID  eID) const
inline

Get the border edge index. Return -1 if not a border edge.

Definition at line 546 of file Simple_manifold_2.h.

References Facet_ID::eid(), and Facet_ID::is_border().

Referenced by Window_manifold_2::determine_counterparts(), and Pane_manifold_2::is_physical_border_edge().

546  {
547  if ( !eID.is_border()) { assert(false); return -1; }
548  else return eID.eid();
549  }

Here is the call graph for this function:

Here is the caller graph for this function:

void get_borders ( std::vector< bool > &  is_border,
std::vector< bool > &  is_isolated,
std::vector< Edge_ID > *  b,
int *  ng = NULL 
) const

Obtain all the border nodes, isolated nodes, and border edges.

If ng is not NULL, then obtain the borders of the whole pane (including the ghost part), and load the number of ghost nodes into ng.

Definition at line 392 of file Simple_manifold_2.C.

References _beIDs, _is_str, _maxsize_real_nodes, _size_ghost_borders, _size_real_borders, _size_rg_borders, _with_ghost, i, is_border_node(), is_isolated_node(), is_real_border_node(), offset(), size_of_ghost_nodes(), and size_of_real_nodes().

395  {
396 
397  int nr = size_of_real_nodes();
398  int nnodes;
399 
400  if ( ng != NULL) {
401  *ng = _with_ghost ? size_of_ghost_nodes() : 0;
402  nnodes = nr + *ng;
403  }
404  else
405  nnodes = nr;
406 
407  // First, get the isolated nodes
408  is_isolated.resize( nnodes, false);
409  if ( !_is_str) {
410  for ( int i=0; i<nr; ++i)
411  is_isolated[ i] = is_isolated_node( i+1);
412  }
413 
414  // Second, obtain the border nodes
415  is_border.resize( nnodes, false);
416  if ( ng && *ng) {
417  for ( int i=0; i<nr; ++i)
418  is_border[ i] = is_border_node( i+1);
419 
420  // Loop through all the nodes
421  const int offset=_maxsize_real_nodes-nr+1, nlast = nr+*ng;
422  for ( int i=nr; i<nlast; ++i)
423  is_border[ i] = is_border_node( offset+i);
424  }
425  else {
426  for ( int i=0; i<nr; ++i)
427  is_border[ i] = is_real_border_node( i+1);
428  }
429 
430  // Finally, fill in the border edges into b if exist.
431  if ( b) {
432  b->clear();
433 
434  if ( ng) {
436  b->insert( b->end(), &_beIDs[0], &_beIDs[_size_real_borders]);
437 
439  b->insert( b->end(), &_beIDs[nstart],
440  &_beIDs[nstart+_size_ghost_borders]);
441  }
442  else {
443  b->insert( b->end(), &_beIDs[0],
445  }
446  }
447 }
bool is_real_border_node(int vID) const
Is the node on the pane boundary of real part (not isolated)?
int size_of_real_nodes() const
Number of real nodes of the pane.
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211
blockLoc i
Definition: read.cpp:79
int size_of_ghost_nodes() const
Number of ghost nodes of the pane.
std::vector< Edge_ID > _beIDs
bool is_border_node(int vID) const
Is the node on pane boundary (not isolated)?
bool is_isolated_node(int vID) const
Is the node isolated (i.e. not incident on any element)?

Here is the call graph for this function:

int get_destination ( Edge_ID  eID,
Element_node_enumerator ene_in = NULL 
) const
inline

Get the ID of the destination of a given edge.

Definition at line 375 of file Simple_manifold_2.h.

References _pane, Facet_ID::eid(), get_opposite_ghost_edge_border(), get_opposite_real_edge_border(), Facet_ID::is_border(), is_real_border_edge(), and Facet_ID::lid().

Referenced by Halfedge::destination().

375  {
376  if ( eID.is_border()) {
377  Edge_ID opp;
378  if (is_real_border_edge( eID)) opp = get_opposite_real_edge_border( eID);
379  else opp = get_opposite_ghost_edge_border( eID);
380 
381  Element_node_enumerator ene( _pane, opp.eid());
382  return ene[opp.lid()];
383  }
384  else {
385  if ( ene_in)
386  return (*ene_in)[eID.lid()+1==ene_in->size_of_edges()?0:eID.lid()+1];
387  else {
388  Element_node_enumerator ene( _pane, eID.eid());
389  return ene[eID.lid()+1==ene.size_of_edges()?0:eID.lid()+1];
390  }
391  }
392  }
An adaptor for enumerating node IDs of an element.
bool is_real_border_edge(const Edge_ID &eID) const
Determine whether a given edge is a border edge of real part of the pane (either on physical border o...
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
int size_of_edges() const
Number of edges per element.
const COM::Pane * _pane
Edge_ID get_opposite_ghost_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the ghost pane.
Edge_ID get_opposite_real_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the real pane.

Here is the call graph for this function:

Here is the caller graph for this function:

int get_edge_index ( const Edge_ID eid,
const int  offset = 0 
) const
inline

Get an index for internal edges.

Definition at line 639 of file Simple_manifold_2.h.

References _nspe, Facet_ID::eid(), Facet_ID::lid(), and offset().

Referenced by determine_opposite_halfedges(), get_incident_edge(), get_next_edge_interior(), get_next_ghost_edge_interior(), get_next_real_edge_interior(), get_opposite_ghost_edge_border(), get_opposite_ghost_edge_interior(), get_opposite_real_edge_interior(), get_prev_edge_interior(), get_prev_ghost_edge_interior(), and get_prev_real_edge_interior().

640  { return (eid.eid()-offset-1)*_nspe+eid.lid(); }
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_incident_edge ( int  vID) const
inline

Get the ID of an incident edge within the pane of a given node that originated from the node.

If the vertex is on the pane boundary, it will return a border edge. For isolated nodes, it returns an ID similar to that for a border edge, except that the element ID given will be the index of the isolated node (starting from 1) plus the total number of border edges.

Definition at line 400 of file Simple_manifold_2.h.

References _beIDs, _ieIDs_ghost, _ieIDs_real_or_str, _is_str, _maxsize_real_nodes, _oeIDs_real_or_str, _size_real_borders, _size_rg_borders, COM_assertion, Facet_ID::eid(), get_edge_index(), get_origin(), Facet_ID::is_border(), and is_ghost_node().

Referenced by Node::halfedge().

400  {
401  Edge_ID eID;
402  if ( _is_str || !is_ghost_node( vID))
403  eID = _ieIDs_real_or_str[ vID-1];
404  else
405  eID = _ieIDs_ghost[ vID-_maxsize_real_nodes-1];
406 
407  // If the edge is between real and ghost, then return the real edge.
408  if ( eID.is_border() && eID.eid()>_size_real_borders &&
410  eID = _oeIDs_real_or_str[ get_edge_index(_beIDs[eID.eid()-1])];
411  COM_assertion( get_origin( eID)==vID);
412  }
413  return eID;
414  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_ghost
std::vector< Edge_ID > _ieIDs_real_or_str
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
bool is_ghost_node(int vID) const
Is the given node a ghost node?
std::vector< Edge_ID > _beIDs
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_incident_ghost_edge ( int  vID) const
inline

Get the ID of an incident real edge within the pane of a given node The incident edge may encode an isolated node.

Definition at line 439 of file Simple_manifold_2.h.

References _ieIDs_ghost, _ieIDs_real_or_str, _is_str, _maxsize_real_nodes, _size_real_borders, COM_assertion_msg, Facet_ID::eid(), get_next_real_edge_interior(), get_opposite_real_edge_border(), get_opposite_real_edge_interior(), Facet_ID::is_border(), is_ghost_border_edge(), and is_ghost_node().

439  {
440  bool isghost = is_ghost_node( vID);
441  Edge_ID eID;
442  if ( _is_str || !isghost)
443  eID = _ieIDs_real_or_str[ vID-1];
444  else
445  eID = _ieIDs_ghost[ vID-_maxsize_real_nodes-1];
446  if ( isghost) return eID;
447 
448  if ( eID.is_border() && eID.eid()<=_size_real_borders) {
449  // If vID is between real and ghost, and on the real boundary,
450  // get the border edge between real and ghost.
451  eID = get_opposite_real_edge_border( eID);
452  Edge_ID eID0 = eID;
453  while ( (eID = get_opposite_real_edge_interior
454  ( get_next_real_edge_interior(eID))) != eID0 &&
455  !is_ghost_border_edge( eID));
456  COM_assertion_msg( eID.is_border(),
457  "No ghost edge incident on given vertex");
458  }
459 
460  return eID;
461  }
bool is_ghost_border_edge(const Edge_ID &eID) const
Determine whether a given edge is a border edge of ghost part of the pane (either on physical border ...
#define COM_assertion_msg(EX, msg)
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_ghost
std::vector< Edge_ID > _ieIDs_real_or_str
Edge_ID get_next_real_edge_interior(const Edge_ID &eID) const
bool is_ghost_node(int vID) const
Is the given node a ghost node?
Edge_ID get_opposite_real_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the real pane.
Edge_ID get_opposite_real_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the real part.

Here is the call graph for this function:

Edge_ID get_incident_real_edge ( int  vID) const
inline

Get the ID of an incident real edge within the pane of a given node.

The incident edge may encode an isolated node.

Definition at line 418 of file Simple_manifold_2.h.

References _beIDs, _ieIDs_real_or_str, _size_real_borders, _size_rg_borders, COM_assertion, COM_assertion_msg, Facet_ID::eid(), get_next_ghost_edge_interior(), get_opposite_ghost_edge_border(), get_opposite_ghost_edge_interior(), get_origin(), Facet_ID::is_border(), is_real_border_edge(), and is_real_node().

Referenced by Pane_manifold_2::get_bnode_index(), and Node::halfedge().

418  {
419  COM_assertion( is_real_node( vID));
420  Edge_ID eID = _ieIDs_real_or_str[ vID-1];
421 
422  if ( eID.is_border() && eID.eid()<=int(_beIDs.size()) &&
424  // If vID is between real and ghost, and on the ghost boundary,
425  // get the border edge between real and ghost.
426  Edge_ID eID0 = eID = get_opposite_ghost_edge_border( eID);
427  while ( (eID = get_opposite_ghost_edge_interior
428  ( get_next_ghost_edge_interior(eID))) != eID0 &&
429  !is_real_border_edge( eID));
430  COM_assertion_msg( eID.is_border() && get_origin( eID)==vID,
431  "No real edge incident on given vertex");
432  }
433 
434  return eID;
435  }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
bool is_real_border_edge(const Edge_ID &eID) const
Determine whether a given edge is a border edge of real part of the pane (either on physical border o...
bool is_real_node(int vID) const
Is the given node a real node?
#define COM_assertion_msg(EX, msg)
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_real_or_str
Edge_ID get_opposite_ghost_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the ghost part.
Edge_ID get_next_ghost_edge_interior(const Edge_ID &eID) const
Edge_ID get_opposite_ghost_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the ghost pane.
std::vector< Edge_ID > _beIDs
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_next_edge ( const Edge_ID eID) const
inline

Get the ID of the next edge of the element or along the boundary.

Definition at line 314 of file Simple_manifold_2.h.

References get_next_edge_interior(), get_opposite_edge_border(), get_opposite_edge_interior(), get_prev_edge_interior(), and Facet_ID::is_border().

Referenced by Pane_manifold_2::get_next_edge().

314  {
315  if ( !eID.is_border())
316  return get_next_edge_interior( eID);
317  else {
318  Edge_ID oeID = get_opposite_edge_border( eID);
319  while ( !oeID.is_border())
321  return oeID;
322  }
323  }
Edge_ID get_prev_edge_interior(const Edge_ID &eID) const
Edge_ID get_opposite_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the whole pane.
Edge_ID get_next_edge_interior(const Edge_ID &eID) const
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Edge_ID get_opposite_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the whole pane.

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_next_edge_interior ( const Edge_ID eID) const
inlineprivate

Definition at line 811 of file Simple_manifold_2.h.

References _is_str, _maxsize_real_elmts, _nspe, _oeIDs_ghost, _oeIDs_real_or_str, Facet_ID::eid(), get_edge_index(), i, is_ghost_element(), and Facet_ID::lid().

Referenced by get_next_edge().

811  {
812  // If not a border edge, then track it within an element.
813  int i=eID.lid()+1;
814  if ( i>=_nspe) return Edge_ID( eID.eid(), 0);
815 
816  if ( _is_str || !is_ghost_element( eID.eid())) {
817  int eindex = get_edge_index( Edge_ID(eID.eid(), i));
818  if ( _oeIDs_real_or_str[eindex]==Edge_ID()) i=0;
819  }
820  else {
821  int eindex = get_edge_index( Edge_ID(eID.eid(), i), _maxsize_real_elmts);
822  if ( _oeIDs_ghost[eindex]==Edge_ID()) i=0;
823  }
824  return Edge_ID( eID.eid(), i);
825  }
std::vector< Edge_ID > _oeIDs_real_or_str
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
std::vector< Edge_ID > _oeIDs_ghost
blockLoc i
Definition: read.cpp:79
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_next_ghost_edge ( const Edge_ID eID) const
inline

Get the ID of the next ghost edge of the element or along the boundary.

Definition at line 339 of file Simple_manifold_2.h.

References get_next_ghost_edge_interior(), get_opposite_ghost_edge(), get_opposite_ghost_edge_interior(), get_prev_ghost_edge_interior(), and Facet_ID::is_border().

339  {
340  if ( !eID.is_border())
341  return get_next_ghost_edge_interior( eID);
342  else {
343  Edge_ID oeID = get_opposite_ghost_edge( eID);
344  while ( !oeID.is_border())
347  return oeID;
348  }
349  }
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Edge_ID get_opposite_ghost_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the ghost part.
Edge_ID get_opposite_ghost_edge(const Edge_ID &eID) const
Get the ID of the opposite ghost edge of a given real or border edge.
Edge_ID get_next_ghost_edge_interior(const Edge_ID &eID) const
Edge_ID get_prev_ghost_edge_interior(const Edge_ID &eID) const

Here is the call graph for this function:

Edge_ID get_next_ghost_edge_interior ( const Edge_ID eID) const
inlineprivate

Definition at line 840 of file Simple_manifold_2.h.

References _is_str, _maxsize_real_elmts, _nspe, _oeIDs_ghost, _oeIDs_real_or_str, COM_assertion, Facet_ID::eid(), get_edge_index(), i, is_ghost_element(), and Facet_ID::lid().

Referenced by get_incident_real_edge(), get_next_ghost_edge(), and get_prev_ghost_edge().

840  {
841  COM_assertion( is_ghost_element( eID.eid()));
842 
843  // If not a border edge, then track it within an element.
844  int i=eID.lid()+1;
845  if ( i>=_nspe) return Edge_ID( eID.eid(), 0);
846 
847  if ( _is_str) {
848  int eindex = get_edge_index( Edge_ID(eID.eid(), i));
849  if ( _oeIDs_real_or_str[eindex]==Edge_ID()) i=0;
850  }
851  else {
852  int eindex = get_edge_index( Edge_ID(eID.eid(), i), _maxsize_real_elmts);
853  if ( _oeIDs_ghost[eindex]==Edge_ID()) i=0;
854  }
855  return Edge_ID( eID.eid(), i);
856  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
std::vector< Edge_ID > _oeIDs_ghost
blockLoc i
Definition: read.cpp:79
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_next_real_edge ( const Edge_ID eID) const
inline

Get the ID of the next real edge of the element or along the boundary.

Definition at line 326 of file Simple_manifold_2.h.

References get_next_real_edge_interior(), get_opposite_real_edge(), get_opposite_real_edge_interior(), get_prev_real_edge_interior(), and Facet_ID::is_border().

Referenced by Pane_manifold_2::get_next_edge().

326  {
327  if ( !eID.is_border())
328  return get_next_real_edge_interior( eID);
329  else {
330  Edge_ID oeID = get_opposite_real_edge( eID);
331  while ( !oeID.is_border())
333  ( get_prev_real_edge_interior( oeID));
334  return oeID;
335  }
336  }
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Edge_ID get_opposite_real_edge(const Edge_ID &eID) const
Get the ID of the opposite real edge of a given real or border edge.
Edge_ID get_next_real_edge_interior(const Edge_ID &eID) const
Edge_ID get_opposite_real_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the real part.
Edge_ID get_prev_real_edge_interior(const Edge_ID &eID) const

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_next_real_edge_interior ( const Edge_ID eID) const
inlineprivate

Definition at line 827 of file Simple_manifold_2.h.

References _nspe, _oeIDs_real_or_str, COM_assertion, Facet_ID::eid(), get_edge_index(), i, is_ghost_element(), and Facet_ID::lid().

Referenced by get_incident_ghost_edge(), get_next_real_edge(), and get_prev_real_edge().

827  {
828  COM_assertion( !is_ghost_element( eID.eid()));
829 
830  // If not a border edge, then track it within an element.
831  int i=eID.lid()+1;
832  if ( i>=_nspe) return Edge_ID( eID.eid(), 0);
833 
834  int eindex = get_edge_index( Edge_ID(eID.eid(), i));
835  if ( _oeIDs_real_or_str[eindex]==Edge_ID()) i=0;
836 
837  return Edge_ID( eID.eid(), i);
838  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
blockLoc i
Definition: read.cpp:79
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_opposite_edge ( const Edge_ID eID) const
inline

Get the ID of the opposite edge of a given interior or border edge.

If its opposite is a border edge, it returns a border edge ID.

Definition at line 263 of file Simple_manifold_2.h.

References get_opposite_edge_border(), get_opposite_edge_interior(), and Facet_ID::is_border().

Referenced by Pane_manifold_2::get_opposite_edge().

263  {
264 
265  if ( eID.is_border())
266  return get_opposite_edge_border(eID);
267  else
268  return get_opposite_edge_interior(eID);
269  }
Edge_ID get_opposite_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the whole pane.
Edge_ID get_opposite_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the whole pane.

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_opposite_edge_border ( const Edge_ID eID) const
inlineprivate

Get the opposite edge of a border edge for the whole pane.

Definition at line 726 of file Simple_manifold_2.h.

References _beIDs, _size_real_borders, _size_rg_borders, COM_assertion, Facet_ID::eid(), and Facet_ID::is_border().

Referenced by get_next_edge(), and get_opposite_edge().

726  {
727  // Precondition: eID is a border edge of the whole pane
728  COM_assertion( eID.is_border() && eID.eid()<=int(_beIDs.size()) &&
729  (eID.eid()<=_size_real_borders ||
731 
732  return _beIDs[ eID.eid()-1];
733  }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
std::vector< Edge_ID > _beIDs

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_opposite_edge_interior ( const Edge_ID eID) const
inlineprivate

Get the opposite edge of an interior edge of the whole pane.

Definition at line 682 of file Simple_manifold_2.h.

Referenced by get_next_edge(), and get_opposite_edge().

682  {
683  COM_assertion( !eID.is_border());
684 
685  if ( _is_str || !is_ghost_element( eID.eid())) {
686  return _oeIDs_real_or_str[ get_edge_index( eID)];
687  }
688  else {
689  Edge_ID opp;
691 
692  if ( !opp.is_border() || opp.eid()>_size_rg_borders+_size_real_borders)
693  return opp;
694  else {
695  Edge_ID opp2 = _beIDs[ opp.eid()-1];
696  COM_assertion( opp2 != eID);
697  return opp2;
698  }
699  }
700  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
std::vector< Edge_ID > _oeIDs_ghost
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?
std::vector< Edge_ID > _beIDs

Here is the caller graph for this function:

Edge_ID get_opposite_ghost_edge ( const Edge_ID eID) const
inline

Get the ID of the opposite ghost edge of a given real or border edge.

If its opposite is a border edge, it returns a border edge ID.

Definition at line 252 of file Simple_manifold_2.h.

References COM_assertion, Facet_ID::eid(), get_opposite_ghost_edge_border(), get_opposite_ghost_edge_interior(), Facet_ID::is_border(), and is_ghost_element().

Referenced by get_next_ghost_edge(), and get_prev_ghost_edge().

252  {
253  COM_assertion( eID.is_border() || is_ghost_element( eID.eid()));
254 
255  if ( eID.is_border())
256  return get_opposite_ghost_edge_border(eID);
257  else
259  }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
Edge_ID get_opposite_ghost_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the ghost part.
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?
Edge_ID get_opposite_ghost_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the ghost pane.

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_opposite_ghost_edge_border ( const Edge_ID eID) const
inlineprivate

Get the opposite edge of a border edge for the ghost pane.

Definition at line 749 of file Simple_manifold_2.h.

References _beIDs, _oeIDs_real_or_str, _size_real_borders, COM_assertion, Facet_ID::eid(), get_edge_index(), Facet_ID::is_border(), and is_real_element().

Referenced by get_destination(), get_incident_real_edge(), and get_opposite_ghost_edge().

749  {
750  // Precondition: eID is a border edge
751  COM_assertion( eID.is_border() && eID.eid()>_size_real_borders &&
752  eID.eid()<=int(_beIDs.size()));
753 
754  Edge_ID opp = _beIDs[ eID.eid()-1];
755 
756  if ( is_real_element( opp.eid())) {
757  opp = _oeIDs_real_or_str[ get_edge_index(opp)];
758  COM_assertion( opp != eID);
759  }
760  return opp;
761  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
bool is_real_element(int eid) const
Is the element incident on the give edge a real element?
std::vector< Edge_ID > _beIDs

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_opposite_ghost_edge_interior ( const Edge_ID eID) const
inlineprivate

Get the opposite edge of an interior edge of the ghost part.

Definition at line 716 of file Simple_manifold_2.h.

References _is_str, _maxsize_real_elmts, _oeIDs_ghost, _oeIDs_real_or_str, COM_assertion, Facet_ID::eid(), get_edge_index(), Facet_ID::is_border(), and is_ghost_element().

Referenced by determine_incident_halfedges(), get_incident_real_edge(), get_next_ghost_edge(), get_opposite_ghost_edge(), get_opposite_real_edge_interior(), and get_prev_ghost_edge().

716  {
717  COM_assertion( !eID.is_border() && is_ghost_element( eID.eid()));
718 
719  if ( _is_str)
720  return _oeIDs_real_or_str[ get_edge_index(eID)];
721  else
723  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
std::vector< Edge_ID > _oeIDs_ghost
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_opposite_real_edge ( const Edge_ID eID) const
inline

Get the ID of the opposite real edge of a given real or border edge.

If its opposite is a border edge, it returns a border edge ID.

Definition at line 241 of file Simple_manifold_2.h.

Referenced by Pane_manifold_2::convert_pconn_edge2ghost(), Window_manifold_2::determine_counterparts(), get_next_real_edge(), Pane_manifold_2::get_opposite_edge(), and get_prev_real_edge().

241  {
242  COM_assertion( eID.is_border() || is_real_element( eID.eid()));
243 
244  if ( eID.is_border())
245  return get_opposite_real_edge_border(eID);
246  else
248  }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
bool is_real_element(int eid) const
Is the element incident on the give edge a real element?
Edge_ID get_opposite_real_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the real pane.
Edge_ID get_opposite_real_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the real part.

Here is the caller graph for this function:

Edge_ID get_opposite_real_edge_border ( const Edge_ID eID) const
inlineprivate

Get the opposite edge of a border edge for the real pane.

Definition at line 736 of file Simple_manifold_2.h.

References _beIDs, _size_real_borders, _size_rg_borders, COM_assertion, Facet_ID::eid(), Facet_ID::is_border(), and is_real_element().

Referenced by get_destination(), and get_incident_ghost_edge().

736  {
737  // Precondition: eID is a border edge
738  COM_assertion( eID.is_border() &&
740 
741  Edge_ID opp = _beIDs[ eID.eid()-1];
742 
743  // Postcondition: opp is incident on a real element.
744  COM_assertion( is_real_element( opp.eid()));
745  return opp;
746  }
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
bool is_real_element(int eid) const
Is the element incident on the give edge a real element?
std::vector< Edge_ID > _beIDs

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_opposite_real_edge_interior ( const Edge_ID eID) const
inlineprivate

Get the opposite edge of an interior edge of the real part.

Definition at line 703 of file Simple_manifold_2.h.

References _oeIDs_real_or_str, COM_assertion, Facet_ID::eid(), get_edge_index(), get_opposite_ghost_edge_interior(), Facet_ID::is_border(), is_ghost_element(), and is_real_element().

Referenced by determine_incident_halfedges(), get_incident_ghost_edge(), get_next_real_edge(), and get_prev_real_edge().

703  {
704  COM_assertion( !eID.is_border() && is_real_element( eID.eid()));
705 
707 
708  // If points to a ghost element, then we need to follow the link
709  if ( !opp.is_border() && is_ghost_element( opp.eid()))
711 
712  return opp;
713  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Edge_ID get_opposite_ghost_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the ghost part.
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?
bool is_real_element(int eid) const
Is the element incident on the give edge a real element?

Here is the call graph for this function:

Here is the caller graph for this function:

int get_origin ( Edge_ID  eID,
Element_node_enumerator ene_in = NULL 
) const
inline

Get the ID of the origin of a given edge.

If the edge is between real and ghost, then consider the border edge as part of real.

Definition at line 357 of file Simple_manifold_2.h.

Referenced by determine_incident_halfedges(), get_a_border_node(), get_a_ghost_border_node(), get_a_real_border_node(), get_incident_edge(), get_incident_real_edge(), and Halfedge::origin().

357  {
358  if ( eID.is_border()) {
359  Edge_ID opp;
360  if (is_real_border_edge( eID)) opp = get_opposite_real_edge_border( eID);
361  else opp = get_opposite_ghost_edge_border( eID);
362 
363  Element_node_enumerator ene( _pane, opp.eid());
364  return ene[opp.lid()+1==ene.size_of_edges()?0:opp.lid()+1];
365  }
366  else {
367  if ( ene_in)
368  return (*ene_in)[eID.lid()];
369  else
370  return Element_node_enumerator( _pane, eID.eid())[eID.lid()];
371  }
372  }
An adaptor for enumerating node IDs of an element.
bool is_real_border_edge(const Edge_ID &eID) const
Determine whether a given edge is a border edge of real part of the pane (either on physical border o...
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
const COM::Pane * _pane
Edge_ID get_opposite_ghost_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the ghost pane.
Edge_ID get_opposite_real_edge_border(const Edge_ID &eID) const
Get the opposite edge of a border edge for the real pane.

Here is the caller graph for this function:

Edge_ID get_prev_edge ( const Edge_ID eID) const
inline

Get the ID of the previous edge of the element or along the boundary.

Definition at line 276 of file Simple_manifold_2.h.

Referenced by Pane_manifold_2::get_prev_edge().

276  {
277  if ( !eID.is_border())
278  return get_prev_edge_interior( eID);
279  else {
280  Edge_ID oeID = get_opposite_edge( eID);
281  while ( !oeID.is_border())
283  return oeID;
284  }
285  }
Edge_ID get_prev_edge_interior(const Edge_ID &eID) const
Edge_ID get_next_edge_interior(const Edge_ID &eID) const
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Edge_ID get_opposite_edge(const Edge_ID &eID) const
Get the ID of the opposite edge of a given interior or border edge.
Edge_ID get_opposite_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the whole pane.

Here is the caller graph for this function:

Edge_ID get_prev_edge_interior ( const Edge_ID eID) const
inlineprivate

Definition at line 767 of file Simple_manifold_2.h.

References _is_str, _maxsize_real_elmts, _nspe, _oeIDs_ghost, _oeIDs_real_or_str, Facet_ID::eid(), get_edge_index(), i, is_ghost_element(), and Facet_ID::lid().

Referenced by get_next_edge().

767  {
768  // If not a border edge, then track it within an element.
769  int i=(eID.lid()?eID.lid()-1:_nspe-1);
770 
771  if ( _is_str || !is_ghost_element( eID.eid())) {
772  int eindex = get_edge_index( Edge_ID(eID.eid(), i));
773  while ( _oeIDs_real_or_str[eindex--]==Edge_ID()) { --i; assert(i); }
774  }
775  else {
776  int eindex = get_edge_index( Edge_ID(eID.eid(), i), _maxsize_real_elmts);
777  while ( _oeIDs_ghost[eindex--]==Edge_ID()) { --i; assert(i); }
778  }
779  return Edge_ID( eID.eid(), i);
780  }
std::vector< Edge_ID > _oeIDs_real_or_str
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
std::vector< Edge_ID > _oeIDs_ghost
blockLoc i
Definition: read.cpp:79
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_prev_ghost_edge ( const Edge_ID eID) const
inline

Get the ID of the previous ghost edge of the element or along the boundary.

Definition at line 301 of file Simple_manifold_2.h.

References get_next_ghost_edge_interior(), get_opposite_ghost_edge(), get_opposite_ghost_edge_interior(), get_prev_ghost_edge_interior(), and Facet_ID::is_border().

301  {
302  if ( !eID.is_border())
303  return get_prev_ghost_edge_interior(eID);
304  else {
305  Edge_ID oeID = get_opposite_ghost_edge( eID);
306  while ( !oeID.is_border())
309  return oeID;
310  }
311  }
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Edge_ID get_opposite_ghost_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the ghost part.
Edge_ID get_opposite_ghost_edge(const Edge_ID &eID) const
Get the ID of the opposite ghost edge of a given real or border edge.
Edge_ID get_next_ghost_edge_interior(const Edge_ID &eID) const
Edge_ID get_prev_ghost_edge_interior(const Edge_ID &eID) const

Here is the call graph for this function:

Edge_ID get_prev_ghost_edge_interior ( const Edge_ID eID) const
inlineprivate

Definition at line 794 of file Simple_manifold_2.h.

References _is_str, _maxsize_real_elmts, _nspe, _oeIDs_ghost, _oeIDs_real_or_str, COM_assertion, Facet_ID::eid(), get_edge_index(), i, is_ghost_element(), and Facet_ID::lid().

Referenced by get_next_ghost_edge(), and get_prev_ghost_edge().

794  {
795  COM_assertion( is_ghost_element( eID.eid()));
796 
797  // If not a border edge, then track it within an element.
798  int i=(eID.lid()?eID.lid()-1:_nspe-1);
799 
800  if ( _is_str) {
801  int eindex = get_edge_index( Edge_ID(eID.eid(), i));
802  while ( _oeIDs_real_or_str[eindex--]==Edge_ID()) { --i; assert(i); }
803  }
804  else {
805  int eindex = get_edge_index( Edge_ID(eID.eid(), i), _maxsize_real_elmts);
806  while ( _oeIDs_ghost[eindex--]==Edge_ID()) { --i; assert(i); }
807  }
808  return Edge_ID( eID.eid(), i);
809  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
std::vector< Edge_ID > _oeIDs_ghost
blockLoc i
Definition: read.cpp:79
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_prev_real_edge ( const Edge_ID eID) const
inline

Get the ID of the previous real edge of the element or along the boundary.

Definition at line 288 of file Simple_manifold_2.h.

References get_next_real_edge_interior(), get_opposite_real_edge(), get_opposite_real_edge_interior(), get_prev_real_edge_interior(), and Facet_ID::is_border().

Referenced by Pane_manifold_2::get_prev_edge().

288  {
289  if ( !eID.is_border())
290  return get_prev_real_edge_interior( eID);
291  else {
292  Edge_ID oeID = get_opposite_real_edge( eID);
293  while ( !oeID.is_border())
295  ( get_next_real_edge_interior( oeID));
296  return oeID;
297  }
298  }
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
Edge_ID get_opposite_real_edge(const Edge_ID &eID) const
Get the ID of the opposite real edge of a given real or border edge.
Edge_ID get_next_real_edge_interior(const Edge_ID &eID) const
Edge_ID get_opposite_real_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the real part.
Edge_ID get_prev_real_edge_interior(const Edge_ID &eID) const

Here is the call graph for this function:

Here is the caller graph for this function:

Edge_ID get_prev_real_edge_interior ( const Edge_ID eID) const
inlineprivate

Definition at line 782 of file Simple_manifold_2.h.

References _nspe, _oeIDs_real_or_str, COM_assertion, Facet_ID::eid(), get_edge_index(), i, is_ghost_element(), and Facet_ID::lid().

Referenced by get_next_real_edge(), and get_prev_real_edge().

782  {
783  COM_assertion( !is_ghost_element( eID.eid()));
784 
785  // If not a border edge, then track it within an element.
786  int i=(eID.lid()?eID.lid()-1:_nspe-1);
787 
788  int eindex = get_edge_index( Edge_ID(eID.eid(), i));
789  while ( _oeIDs_real_or_str[eindex--]==Edge_ID()) { --i; assert(i); }
790 
791  return Edge_ID( eID.eid(), i);
792  }
std::vector< Edge_ID > _oeIDs_real_or_str
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
int get_edge_index(const Edge_ID &eid, const int offset=0) const
Get an index for internal edges.
blockLoc i
Definition: read.cpp:79
bool is_ghost_element(int eid) const
Is the element incident on the give edge a ghost element?

Here is the call graph for this function:

Here is the caller graph for this function:

MAP_BEGIN_NAMESPACE void init ( const COM::Pane *  p,
const Simple_manifold_2 parent = NULL,
bool  with_ghost = true 
)
protected

Initialize the database for the pane, including ghost information, opposite halfedges, incident halfedges, and border halfedges.

Typically called by constructors.

Definition at line 31 of file Simple_manifold_2.C.

References _beIDs, _elem_conns, _ieIDs_ghost, _ieIDs_real_or_str, _is_str, _isghostelmt, _isghostnode, _isovIDs, _maxsize_real_elmts, _maxsize_real_nodes, _nspe, _oeIDs_ghost, _oeIDs_real_or_str, _pane, _with_ghost, COM_assertion_msg, determine_ghosts(), determine_incident_halfedges(), determine_opposite_halfedges(), i, and max().

Referenced by Simple_manifold_2().

33  {
34  COM_assertion_msg( p, "Caught NULL pointer");
35  _pane = p;
36  _is_str = p->is_structured();
37 
38  // Initialize _nspe to 4 for structured or mixed meshes and to the
39  // actual number of edges per element for other type of meshes.
40  if ( _is_str) {
41  _with_ghost = with_ghost && p->size_of_ghost_layers()>0;
42  _nspe = 4;
43  }
44  else {
45  // It is possible to have ghost nodes but no ghost elements and vice versa
46  _with_ghost = with_ghost &&
47  (p->size_of_ghost_nodes()>0 || p->size_of_ghost_elements()>0);
48 
49  p->elements( _elem_conns);
50  _nspe = 0;
51  // Loop through the connectivity
52  for ( int i=_elem_conns.size()-1; i>=0; --i) {
53  _nspe = std::max( _nspe, int( _elem_conns[i]->size_of_edges_pe()));
54  }
55  }
56 
57  _maxsize_real_nodes = p->maxsize_of_real_nodes();
58  _maxsize_real_elmts = p->maxsize_of_real_elements();
59 
60  if ( parent) {
61  _isghostnode = parent->_isghostnode;
62  _isghostelmt = parent->_isghostelmt;
63 
64  // Copy border infomation from parent
66  _oeIDs_ghost = parent->_oeIDs_ghost;
68  _ieIDs_ghost = parent->_ieIDs_ghost;
69 
70  _beIDs = parent->_beIDs;
71  _isovIDs = parent->_isovIDs;
72  }
73  else {
77  }
78 }
std::vector< Edge_ID > _oeIDs_real_or_str
std::vector< const COM::Connectivity * > _elem_conns
#define COM_assertion_msg(EX, msg)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
std::vector< Edge_ID > _ieIDs_ghost
std::vector< Edge_ID > _ieIDs_real_or_str
std::vector< bool > _isghostelmt
std::vector< Edge_ID > _oeIDs_ghost
blockLoc i
Definition: read.cpp:79
std::vector< int > _isovIDs
const COM::Pane * _pane
std::vector< bool > _isghostnode
std::vector< Edge_ID > _beIDs
void determine_incident_halfedges()
Determine an incident halfedge for each node.
void determine_ghosts()
Determine the ghost nodes and elements.
void determine_opposite_halfedges()
Determine the opposite halfedges of each halfedge, and identify border halfedge.

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_border_edge ( const Edge_ID eID) const
inline

Is a given edge on the boundary of the whole pane?

Definition at line 468 of file Simple_manifold_2.h.

Referenced by determine_incident_halfedges(), and is_border_node().

468  {
469  if ( !eID.is_border()) return false;
470  if ( eID.eid()>int(_beIDs.size())) return false;
471 
472  return !_with_ghost || eID.eid() <= _size_real_borders ||
474  }
std::vector< Edge_ID > _beIDs

Here is the caller graph for this function:

bool is_border_node ( int  vID) const
inline

Is the node on pane boundary (not isolated)?

Definition at line 535 of file Simple_manifold_2.h.

References _ieIDs_ghost, _ieIDs_real_or_str, _is_str, _maxsize_real_nodes, is_border_edge(), and is_ghost_node().

Referenced by get_borders().

535  {
536  Edge_ID eID;
537  if ( _is_str || !is_ghost_node( vID))
538  eID = _ieIDs_real_or_str[ vID-1];
539  else
540  eID = _ieIDs_ghost[ vID-_maxsize_real_nodes-1];
541 
542  return is_border_edge( eID);
543  }
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_ghost
bool is_border_edge(const Edge_ID &eID) const
Is a given edge on the boundary of the whole pane?
std::vector< Edge_ID > _ieIDs_real_or_str
bool is_ghost_node(int vID) const
Is the given node a ghost node?

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_ghost_border_edge ( const Edge_ID eID) const
inline

Determine whether a given edge is a border edge of ghost part of the pane (either on physical border or between real and ghost elements)

Definition at line 494 of file Simple_manifold_2.h.

References _beIDs, _size_real_borders, _with_ghost, Facet_ID::eid(), and Facet_ID::is_border().

Referenced by get_incident_ghost_edge().

494  {
495  if ( !eID.is_border()) return false;
496  if ( eID.eid()>int(_beIDs.size())) return false;
497 
498  return _with_ghost && eID.eid() > _size_real_borders;
499  }
std::vector< Edge_ID > _beIDs

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_ghost_border_node ( int  vID) const
inline

Is the node on pane boundary (not isolated)? It assumes vID is incident on the ghost (no checking is performed).

Definition at line 524 of file Simple_manifold_2.h.

References _beIDs, _ieIDs_ghost, _ieIDs_real_or_str, _is_str, _maxsize_real_nodes, Facet_ID::eid(), Facet_ID::is_border(), and is_ghost_node().

524  {
525  Edge_ID eID;
526  if ( _is_str || !is_ghost_node( vID))
527  eID = _ieIDs_real_or_str[ vID-1];
528  else
529  eID = _ieIDs_ghost[ vID-_maxsize_real_nodes-1];
530 
531  return eID.is_border() && eID.eid() <= int(_beIDs.size());
532  }
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_ghost
std::vector< Edge_ID > _ieIDs_real_or_str
bool is_ghost_node(int vID) const
Is the given node a ghost node?
std::vector< Edge_ID > _beIDs

Here is the call graph for this function:

bool is_ghost_element ( int  eid) const
inline

Is the element incident on the give edge a ghost element?

Definition at line 631 of file Simple_manifold_2.h.

References _is_str, _isghostelmt, and _maxsize_real_elmts.

Referenced by determine_opposite_halfedges(), get_next_edge_interior(), get_next_ghost_edge_interior(), get_next_real_edge_interior(), get_opposite_ghost_edge(), get_opposite_ghost_edge_interior(), get_opposite_real_edge_interior(), get_prev_edge_interior(), get_prev_ghost_edge_interior(), and get_prev_real_edge_interior().

631  {
632  if ( !_is_str) // Unstructured mesh
633  return eid > _maxsize_real_elmts;
634  else // Structured
635  return !_isghostelmt.empty() && _isghostelmt[ eid-1];
636  }
std::vector< bool > _isghostelmt

Here is the caller graph for this function:

bool is_ghost_node ( int  vID) const
inline

Is the given node a ghost node?

Definition at line 615 of file Simple_manifold_2.h.

References _is_str, _isghostnode, and _maxsize_real_nodes.

Referenced by get_incident_edge(), get_incident_ghost_edge(), is_border_node(), is_ghost_border_node(), and is_real_border_node().

615  {
616  if ( !_is_str) // Unstructured mesh
617  return vID > _maxsize_real_nodes;
618  else // Structured mesh
619  return !_isghostnode.empty() && _isghostnode[ vID-1];
620  }
std::vector< bool > _isghostnode

Here is the caller graph for this function:

bool is_isolated_node ( int  vID) const
inline

Is the node isolated (i.e. not incident on any element)?

Definition at line 502 of file Simple_manifold_2.h.

References _beIDs, _ieIDs_real_or_str, _is_str, _maxsize_real_nodes, Facet_ID::eid(), and Facet_ID::is_border().

Referenced by get_borders(), and Node::is_isolated().

502  {
503  // Ghost nodes are not allowed to be isolated.
504  if ( _is_str || vID>_maxsize_real_nodes) return false;
505 
506  Edge_ID eID = _ieIDs_real_or_str[ vID-1];
507  return eID.is_border() && eID.eid()>int(_beIDs.size());
508  }
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_real_or_str
std::vector< Edge_ID > _beIDs

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_pure_real_border_edge ( const Edge_ID eID) const
inline

Determine whether a given edge is a border edge of real part of the whole pane (on physical border).

Definition at line 478 of file Simple_manifold_2.h.

References _size_real_borders, _with_ghost, Facet_ID::eid(), and Facet_ID::is_border().

Referenced by Pane_manifold_2::is_border_edge().

478  {
479  if ( !eID.is_border()) return false;
480 
481  return !_with_ghost || eID.eid() <= _size_real_borders;
482  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_real_border_edge ( const Edge_ID eID) const
inline

Determine whether a given edge is a border edge of real part of the pane (either on physical border or between real and ghost elements)

Definition at line 486 of file Simple_manifold_2.h.

References _size_real_borders, _size_rg_borders, _with_ghost, Facet_ID::eid(), and Facet_ID::is_border().

Referenced by get_destination(), get_incident_real_edge(), Pane_manifold_2::get_next_edge(), and Pane_manifold_2::is_border_edge().

486  {
487  if ( !eID.is_border()) return false;
488 
489  return !_with_ghost || eID.eid() <= _size_real_borders+_size_rg_borders;
490  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_real_border_node ( int  vID) const
inline

Is the node on the pane boundary of real part (not isolated)?

Definition at line 511 of file Simple_manifold_2.h.

References _beIDs, _ieIDs_ghost, _ieIDs_real_or_str, _is_str, _maxsize_real_nodes, Facet_ID::eid(), Facet_ID::is_border(), is_ghost_node(), and is_real_node().

Referenced by get_borders().

511  {
512  if ( !is_real_node( vID)) return false;
513  Edge_ID eID;
514  if ( _is_str || !is_ghost_node( vID))
515  eID = _ieIDs_real_or_str[ vID-1];
516  else
517  eID = _ieIDs_ghost[ vID-_maxsize_real_nodes-1];
518 
519  return eID.is_border() && eID.eid() <= int(_beIDs.size());
520  }
bool is_real_node(int vID) const
Is the given node a real node?
MAP::Facet_ID Edge_ID
Definition: Manifold_2.h:49
std::vector< Edge_ID > _ieIDs_ghost
std::vector< Edge_ID > _ieIDs_real_or_str
bool is_ghost_node(int vID) const
Is the given node a ghost node?
std::vector< Edge_ID > _beIDs

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_real_element ( int  eid) const
inline

Is the element incident on the give edge a real element?

Definition at line 623 of file Simple_manifold_2.h.

References _is_str, _isghostelmt, and _maxsize_real_elmts.

Referenced by determine_incident_halfedges(), determine_opposite_halfedges(), get_opposite_ghost_edge_border(), get_opposite_real_edge_border(), and get_opposite_real_edge_interior().

623  {
624  if ( !_is_str) // Unstructured mesh
625  return eid <= _maxsize_real_elmts;
626  else // Structured mesh
627  return _isghostelmt.empty() || !_isghostelmt[ eid-1];
628  }
std::vector< bool > _isghostelmt

Here is the caller graph for this function:

bool is_real_node ( int  vID) const
inline

Is the given node a real node?

Definition at line 607 of file Simple_manifold_2.h.

References _is_str, _isghostnode, and _maxsize_real_nodes.

Referenced by determine_incident_halfedges(), get_incident_real_edge(), and is_real_border_node().

607  {
608  if ( !_is_str) // Unstructured mesh
609  return vID <= _maxsize_real_nodes;
610  else // Structured mesh
611  return _isghostnode.empty() || !_isghostnode[ vID-1];
612  }
std::vector< bool > _isghostnode

Here is the caller graph for this function:

int maxsize_of_elements ( ) const
inline

Maximum number of elements allowed in the pane.

Definition at line 127 of file Simple_manifold_2.h.

References _pane.

127 { return _pane->maxsize_of_elements(); }
const COM::Pane * _pane
int maxsize_of_faces ( ) const
inline

Maximum number of elements allowed in the pane.

Definition at line 145 of file Simple_manifold_2.h.

References _pane.

145 { return _pane->maxsize_of_elements(); }
const COM::Pane * _pane
int maxsize_of_ghost_elements ( ) const
inline

Maximum number of ghost elements allowed in the pane.

Definition at line 139 of file Simple_manifold_2.h.

References _pane.

139 { return _pane->maxsize_of_ghost_elements(); }
const COM::Pane * _pane
int maxsize_of_ghost_faces ( ) const
inline

Maximum number of ghost elements allowed in the pane.

Definition at line 157 of file Simple_manifold_2.h.

References _pane.

157 { return _pane->maxsize_of_ghost_elements(); }
const COM::Pane * _pane
int maxsize_of_ghost_nodes ( ) const
inline

Maximum number of ghost nodes allowed in the pane.

Definition at line 118 of file Simple_manifold_2.h.

References _pane.

118 { return _pane->maxsize_of_ghost_nodes();}
const COM::Pane * _pane
int maxsize_of_ghost_quadrilaterals ( ) const

Maximum number of ghost quadrilaterals allowed in the pane.

int maxsize_of_ghost_triangles ( ) const

Maximum number of ghost triangles allowed in the pane.

int maxsize_of_nodes ( ) const
inline

Maximum number of nodes allowed in the pane.

Definition at line 106 of file Simple_manifold_2.h.

References _pane.

106 { return _pane->maxsize_of_nodes(); }
const COM::Pane * _pane
int maxsize_of_quadrilaterals ( ) const

Maximum number of quadrilaterals allowed in the pane.

int maxsize_of_real_elements ( ) const
inline

Maximum number of real elements allowed in the pane.

Definition at line 133 of file Simple_manifold_2.h.

References _maxsize_real_elmts.

133 { return _maxsize_real_elmts; }
int maxsize_of_real_faces ( ) const
inline

Maximum number of real elements allowed in the pane.

Definition at line 151 of file Simple_manifold_2.h.

References _pane.

151 { return _pane->maxsize_of_real_elements(); }
const COM::Pane * _pane
int maxsize_of_real_nodes ( ) const
inline

Maximum number of real nodes allowed in the pane.

Definition at line 112 of file Simple_manifold_2.h.

References _maxsize_real_nodes.

112 { return _maxsize_real_nodes; }
int maxsize_of_real_quadrilaterals ( ) const

Maximum number of real quadrilaterals allowed in the pane.

int maxsize_of_real_triangles ( ) const

Maximum number of real triangles allowed in the pane.

int maxsize_of_triangles ( ) const

Maximum number of triangles allowed in the pane.

const COM::Pane* pane ( ) const
inline

Obtain a const pointer to the pane.

Definition at line 97 of file Simple_manifold_2.h.

References _pane.

Referenced by Node::addr(), Halfedge::addr(), Node::attr(), Halfedge::attr(), Window_manifold_2::determine_counterparts(), Halfedge::edge_center(), Halfedge::face_center(), Node::operator<(), Halfedge::operator<(), Node::pane(), Halfedge::pane(), and Node::point().

97 { return _pane; }
const COM::Pane * _pane

Here is the caller graph for this function:

int size_of_border_edges ( ) const
inline

Number of border edges of the whole pane.

Definition at line 220 of file Simple_manifold_2.h.

int size_of_edges ( ) const

Number of edges of the pane.

Referenced by Pane_manifold_2::size_of_edges().

Here is the caller graph for this function:

int size_of_elements ( ) const
inline

Number of elements of the pane.

Definition at line 124 of file Simple_manifold_2.h.

Referenced by upperbound_edge_index().

124 { return _pane->size_of_elements(); }
const COM::Pane * _pane

Here is the caller graph for this function:

int size_of_faces ( ) const
inline

Number of elements of the pane.

Definition at line 142 of file Simple_manifold_2.h.

References _pane.

Referenced by Pane_manifold_2::size_of_faces().

142 { return _pane->size_of_elements(); }
const COM::Pane * _pane

Here is the caller graph for this function:

int size_of_ghost_border_edges ( ) const
inline

Number of border edges of the ghost part of the pane.

Definition at line 228 of file Simple_manifold_2.h.

References _size_ghost_borders, and _size_rg_borders.

int size_of_ghost_edges ( ) const

Number of ghost edges of the pane.

int size_of_ghost_elements ( ) const
inline

Number of ghost elements of the pane.

Definition at line 136 of file Simple_manifold_2.h.

References _pane.

136 { return _pane->size_of_ghost_elements(); }
const COM::Pane * _pane
int size_of_ghost_faces ( ) const
inline

Number of ghost elements of the pane.

Definition at line 154 of file Simple_manifold_2.h.

References _pane.

154 { return _pane->size_of_ghost_elements(); }
const COM::Pane * _pane
int size_of_ghost_halfedges ( ) const

Number of ghost halfedges of the pane.

int size_of_ghost_nodes ( ) const
inline

Number of ghost nodes of the pane.

Definition at line 115 of file Simple_manifold_2.h.

References _pane.

Referenced by get_borders().

115 { return _pane->size_of_ghost_nodes(); }
const COM::Pane * _pane

Here is the caller graph for this function:

int size_of_ghost_quadrilaterals ( ) const

Number of ghost quadrilaterals of the pane.

int size_of_ghost_triangles ( ) const

Number of ghost triangles of the pane.

int size_of_halfedges ( ) const

Number of halfedges of the pane.

int size_of_isolated_nodes ( ) const
inline

Number of isolated nodes.

Definition at line 232 of file Simple_manifold_2.h.

References _isovIDs.

233  { return _isovIDs.size(); }
std::vector< int > _isovIDs
int size_of_nodes ( ) const
inline

Number of nodes of the pane.

Definition at line 103 of file Simple_manifold_2.h.

Referenced by Pane_manifold_2::size_of_nodes().

103 { return _pane->size_of_nodes(); }
const COM::Pane * _pane

Here is the caller graph for this function:

int size_of_quadrilaterals ( ) const

Total number of quadrilaterals of the pane.

Referenced by Pane_manifold_2::size_of_quadrilaterals().

Here is the caller graph for this function:

int size_of_real_border_edges ( ) const
inline

Number of border edges of the real part of the pane.

Definition at line 224 of file Simple_manifold_2.h.

References _size_real_borders, and _size_rg_borders.

Referenced by Pane_manifold_2::convert_pconn_edge2ghost().

Here is the caller graph for this function:

int size_of_real_edges ( ) const

Number of real edges of the pane.

Referenced by Pane_manifold_2::size_of_edges().

Here is the caller graph for this function:

int size_of_real_elements ( ) const
inline

Number of real elements of the pane.

Definition at line 130 of file Simple_manifold_2.h.

References _pane.

130 { return _pane->size_of_real_elements(); }
const COM::Pane * _pane
int size_of_real_faces ( ) const
inline

Number of real elements of the pane.

Definition at line 148 of file Simple_manifold_2.h.

References _pane.

Referenced by Pane_manifold_2::size_of_faces().

148 { return _pane->size_of_real_elements(); }
const COM::Pane * _pane

Here is the caller graph for this function:

int size_of_real_halfedges ( ) const

Number of real halfedges of the pane.

int size_of_real_nodes ( ) const
inline

Number of real nodes of the pane.

Definition at line 109 of file Simple_manifold_2.h.

References _pane.

Referenced by get_borders(), and Pane_manifold_2::size_of_nodes().

109 { return _pane->size_of_real_nodes(); }
const COM::Pane * _pane

Here is the caller graph for this function:

int size_of_real_quadrilaterals ( ) const

Number of real quadrilaterals of the pane.

Referenced by Pane_manifold_2::size_of_quadrilaterals().

Here is the caller graph for this function:

int size_of_real_triangles ( ) const

Number of real triangles of the pane.

Referenced by Pane_manifold_2::size_of_triangles().

Here is the caller graph for this function:

int size_of_triangles ( ) const

Total number of triangles of the pane.

Referenced by Pane_manifold_2::size_of_triangles().

Here is the caller graph for this function:

int upperbound_edge_index ( ) const
inline

Get size of internal edges.

Definition at line 643 of file Simple_manifold_2.h.

References _nspe, and size_of_elements().

644  { return size_of_elements()*_nspe; }
int size_of_elements() const
Number of elements of the pane.

Here is the call graph for this function:

Member Data Documentation

std::vector<const COM::Connectivity*> _elem_conns
protected

Definition at line 866 of file Simple_manifold_2.h.

Referenced by init().

std::vector<bool> _isghostelmt
protected

Definition at line 877 of file Simple_manifold_2.h.

Referenced by determine_ghosts(), init(), is_ghost_element(), and is_real_element().

std::vector<bool> _isghostnode
protected

Definition at line 876 of file Simple_manifold_2.h.

Referenced by determine_ghosts(), init(), is_ghost_node(), and is_real_node().

std::vector<int> _isovIDs
protected

Definition at line 901 of file Simple_manifold_2.h.

Referenced by determine_incident_halfedges(), init(), and size_of_isolated_nodes().


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