41 _with_ghost = with_ghost && p->size_of_ghost_layers()>0;
47 (p->size_of_ghost_nodes()>0 || p->size_of_ghost_elements()>0);
94 "Not fully implemented yet for structured mesh");
103 int nr =
_nspe*
_pane->size_of_real_elements();
110 std::vector<Edge_ID> beIDs_rg;
114 std::vector<int> ies1, ies2;
115 std::vector<int> ies_common; ies_common.reserve(2);
119 ?
_pane->size_of_elements():
_pane->size_of_real_elements();
120 for (
int j=0;
j<nn; ++
j, ene.
next()) {
125 for (
int i=0;
i<ne; ++
i, ++ij) {
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);
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; }
143 int node_id = ene[
i];
146 for (
int k=0;
k<
nk; ++
k)
if ( ene_opp[
k] == node_id) {
152 if ( isreal_edge || isghost_opp)
157 if ( isghost_opp && isreal_edge) {
198 _beIDs.insert(
_beIDs.end(), beIDs_rg.begin(), beIDs_rg.end());
204 for (
int j=0;
j<nn; ++
j, ene.
next()) {
209 for (
int i=0;
i<ne; ++
i, ++ij) {
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);
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; }
229 int node_id = ene[
i];
232 for (
int k=0;
k<
nk; ++
k)
if ( ene_opp[
k] == node_id) {
254 "Support for maxsize not yet fully implemented");
258 nnodes =
_pane->size_of_nodes();
259 nelems =
_pane->size_of_elements();
262 nnodes =
_pane->size_of_real_nodes();
263 nelems =
_pane->size_of_real_elements();
269 for (
int j=0;
j<nelems; ++
j, ene.
next()) {
272 for (
int i=0;
i<ne; ++
i) {
295 for (
int i=ne,
ni=ne2;
i<
ni; ++
i) {
322 for (
int i=1;
i<=nnodes; ++
i) {
334 if (
_is_str || nnodes==0)
return;
337 nelems =
_pane->size_of_ghost_elements();
340 for (
int j=0;
j<nelems; ++
j, ene.
next()) {
343 for (
int i=0;
i<ne; ++
i) {
365 for (
int i=ne,
ni=ne2;
i<
ni; ++
i) {
393 std::vector< bool> &is_isolated,
394 std::vector< Edge_ID > *b,
408 is_isolated.resize( nnodes,
false);
410 for (
int i=0;
i<nr; ++
i)
415 is_border.resize( nnodes,
false);
417 for (
int i=0;
i<nr; ++
i)
422 for (
int i=nr;
i<nlast; ++
i)
426 for (
int i=0;
i<nr; ++
i)
439 b->insert( b->end(), &
_beIDs[nstart],
443 b->insert( b->end(), &
_beIDs[0],
449 #define SIZE_OF_ELMTS( prefix, name, nedges) \
450 int Simple_manifold_2:: prefix##name() const { \
452 std::vector<const COM::Connectivity*>::const_iterator it=_elem_conns.begin(); \
453 for ( ; it != _elem_conns.end(); ++it) { \
454 if ( (*it)->size_of_edges_pe()==nedges) \
455 n += (*it)-> prefix##items(); \
476 #define SIZE_OF_EDGES( prefix, name, multiple) \
477 int Simple_manifold_2::prefix##name() const { \
478 int n=prefix##border_edges(); \
479 std::vector<const COM::Connectivity*>::const_iterator it=_elem_conns.begin(); \
480 for ( ; it != _elem_conns.end(); ++it) { \
481 n += (*it)->prefix##items()*(*it)->size_of_edges_pe(); \
483 return n/=multiple; \
std::vector< Edge_ID > _oeIDs_real_or_str
#define MAP_END_NAMESPACE
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.
std::vector< const COM::Connectivity * > _elem_conns
#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)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
#define SIZE_OF_ELMTS(prefix, name, nedges)
bool is_real_border_node(int vID) const
Is the node on the pane boundary of real part (not isolated)?
std::vector< Edge_ID > _ieIDs_ghost
int size_of_real_nodes() const
Number of real nodes of the pane.
bool is_border_edge(const Edge_ID &eID) const
Is a given edge on the boundary of the whole pane?
void incident_elements(int node_id, std::vector< int > &elists)
Obtain the IDs of the elements incident on a given node.
real *8 function offset(vNorm, x2, y2, z2)
std::vector< Edge_ID > _ieIDs_real_or_str
int eid() const
Element ID of the halfedge.
int id() const
Get the local id of the element within the pane.
std::vector< bool > _isghostelmt
Edge_ID get_opposite_ghost_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the ghost part.
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.
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
int size_of_edges() const
Number of edges per element.
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?
int size_of_nodes() const
Number of nodes per element.
Provides a data structure accessing nodes, elements, and edges in a pane, in a manner similar to the ...
std::vector< int > _isovIDs
int size_of_ghost_nodes() const
Number of ghost nodes of the pane.
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
The ID of a facet (edge in 2D and face in 3D) encodes an element ID and the local facet's ID internal...
std::vector< bool > _isghostnode
#define MAP_BEGIN_NAMESPACE
void next()
Go to the next element within the connectivity tables of a pane.
void int int REAL REAL REAL *z blockDim dim * ni
std::vector< Edge_ID > _beIDs
#define SIZE_OF_EDGES(prefix, name, multiple)
void determine_incident_halfedges()
Determine an incident halfedge for each node.
int get_origin(Edge_ID eID, Element_node_enumerator *ene_in=NULL) const
Get the ID of the origin of a given edge.
bool is_border_node(int vID) const
Is the node on pane boundary (not isolated)?
Edge_ID get_opposite_real_edge_interior(const Edge_ID &eID) const
Get the opposite edge of an interior edge of the real part.
Constructs the dual connectivity for the whole pane (including ghost nodes and elements), which contains information about incident elements 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.
bool is_isolated_node(int vID) const
Is the node isolated (i.e. not incident on any element)?