MOAB: Mesh Oriented datABase  (version 5.3.1)
HalfFacetRep.hpp
Go to the documentation of this file.
00001 /**
00002  * MOAB, a Mesh-Oriented datABase, is a software component for creating,
00003  * storing and accessing finite element mesh data.
00004  *
00005  * Copyright 2004 Sandia Corporation.  Under the terms of Contract
00006  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
00007  * retains certain rights in this software.
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  */
00015 
00016 #ifndef MOAB_HALF_FACET_REP_HPP
00017 #define MOAB_HALF_FACET_REP_HPP
00018 
00019 #include "moab/Core.hpp"
00020 #include "moab/Range.hpp"
00021 #include "moab/CN.hpp"
00022 
00023 namespace moab
00024 {
00025 
00026 /*!
00027  *  \brief   HalfFacetRep class implements the Array-Based Half-Facet(AHF) Mesh data structure on
00028  * top of MOAB. \        It is based on a generalized notion of a half-facet derived from that a
00029  * half-edge/half-face data structure for 2D/3D. \        The core construct of AHF are its two
00030  * maps: sibling-half-facets(SIBHFS) and vertex-to-half-facet(V2HF) \        1. SIBHFS: Maps every
00031  * half-facet in the mesh to its sibling half-facets, \        2. V2HF: Maps each vertex to an
00032  * incident half-facet \        Using these two maps, a range of adjacency queries is performed. The
00033  * maps are stored in dense tags over entities and vertices.
00034  *  \
00035  *  \        Adjacency functions:
00036  *  \        1. upward-incidence queries: vertex -> edge, edge -> faces, edge -> cells, face ->cells
00037  *  \        2. neighborhood (same-dimensional) adjacency queries: edge -> edges, face -> faces,
00038  * cell -> cells, etc. \        3. downward adjacency queries: face -> edges, cell -> edges, etc.
00039  *  \
00040  *  \        Mesh types supported:
00041  *  \        1D(edges), 2D(triangles, quads), 3D(tet, pyramid, prism, hex), Mixed dimensional meshes
00042  *  \
00043  *  \        CURRENTLY NOT SUPPORTED:
00044  *  \        1. Meshes with mixed entity types of same dimension. Ex. a volume mesh with both tets
00045  * and prisms. \        2. create_if_missing = true \        3. Modified meshes
00046  *  \
00047  */
00048 
00049 typedef EntityHandle HFacet;
00050 
00051 const int MAXSIZE = 200;
00052 
00053 //! ENUM for the type of input mesh.
00054 enum MESHTYPE
00055 {
00056     CURVE = 0,       // Homogeneous curve mesh
00057     SURFACE,         // Homogeneous surface mesh
00058     SURFACE_MIXED,   // Mixed surface with embedded curves
00059     VOLUME,          // Homogeneous volume mesh
00060     VOLUME_MIXED_1,  // Volume mesh with embedded curves
00061     VOLUME_MIXED_2,  // Volume mesh with embedded surface
00062     VOLUME_MIXED     // Volume mesh with embedded curves and surfaces
00063 };
00064 
00065 enum
00066 {
00067     MAX_VERTICES    = 8,
00068     MAX_EDGES       = 12,
00069     MAX_FACES       = 6,
00070     MAX_VERTS_HF    = 4,
00071     MAX_INCIDENT_HF = 4
00072 };
00073 
00074 class Core;
00075 class ParallelComm;
00076 class HalfFacetRep
00077 {
00078 
00079   public:
00080     HalfFacetRep( Core* impl, ParallelComm* comm = 0, moab::EntityHandle rset = 0, bool filter_ghosts = true );
00081 
00082     ~HalfFacetRep();
00083 
00084     bool check_mixed_entity_type();
00085 
00086     // User interface functions
00087 
00088     //! Constructs the sibling-half-facet and vertex-to-incident-half-facet maps for each dimension
00089     //! present in the input. This routine should be called before any calls for adjacency is made.
00090     ErrorCode initialize();
00091 
00092     //! Deinitialize
00093     ErrorCode deinitialize();
00094 
00095     //! Prints the tag values.
00096     ErrorCode print_tags( int dim );
00097 
00098     //! Get the adjacencies associated with an entity.
00099     /** Given an entity of dimension <em>d</em>, gather all the adjacent <em>D</em> dimensional
00100      * entities where <em>D >, = , < d </em>.
00101      *
00102      * \param source_entity EntityHandle to which adjacent entities have to be found.
00103      * \param target_dimension Int Dimension of the desired adjacent entities.
00104      * \param target_entities Vector in which the adjacent EntityHandle are returned.
00105      */
00106 
00107     ErrorCode get_adjacencies( const EntityHandle source_entity, const unsigned int target_dimension,
00108                                std::vector< EntityHandle >& target_entities );
00109 
00110     //! Get the upward incidences associated with an entity.
00111     /** Given an entity of dimension <em>d</em>, gather all the incident <em>D(>d)</em> dimensional
00112      * entities.
00113      * :
00114      * \param ent EntityHandle to which incident entities have to be found.
00115      * \param out_dim Dimension of the desired incidence information.
00116      * \param adjents Vector in which the incident entities are returned.
00117      * \param local_id Set to false by default. If true, returns the local id's of the half-facets
00118      * \param lids Vector in which the local id's are returned.
00119      */
00120 
00121     ErrorCode get_up_adjacencies( EntityHandle ent, int out_dim, std::vector< EntityHandle >& adjents,
00122                                   std::vector< int >* lids = NULL );
00123 
00124     //! Get the same-dimensional entities connected with an entity.
00125     /** Given an entity of dimension <em>d</em>, gather all the entities connected via <em>d-1</em>
00126      * dimensional entities. Same as bridge_adjacencies in MOAB.
00127      *
00128      * \param ent EntityHandle to which neighbor entities have to be found.
00129      * \param adjents Vector in which the neighbor entities are returned.
00130      */
00131 
00132     ErrorCode get_neighbor_adjacencies( EntityHandle ent, std::vector< EntityHandle >& adjents );
00133 
00134     //! Get the downward adjacent entities connected with an entity.
00135     /** Given an entity of dimension <em>d</em>, gather all the <em>d-1</em> dimensional entities.
00136      *
00137      * \param ent EntityHandle to which neighbor entities have to be found.
00138      * \param out_dim Dimension of the desired downward adjacency.
00139      * \param adjents Vector in which the neighbor entities are returned.
00140      */
00141 
00142     ErrorCode get_down_adjacencies( EntityHandle ent, int out_dim, std::vector< EntityHandle >& adjents );
00143 
00144     // 1D Maps and queries
00145 
00146     //! Given a range of edges, determines the map for sibling half-verts and stores them into
00147     //! SIBHVS_EID, SIBHVS_LVID tags.
00148     /** Compute all sibling half-vertices for all half-vertices in the given curve. The sibling
00149      * half-verts is defined in terms of the containing edge and the local id of the vertex w.r.t
00150      * that edge. That is, the map consists of two pieces of information: <EntityHandle eid, int
00151      * lvid>
00152      *
00153      * \param edges Range of edges.
00154      */
00155 
00156     ErrorCode determine_sibling_halfverts( Range& verts, Range& edges );
00157 
00158     //! Given a range of edges, determines the map for incident half-verts and stores them into
00159     //! V2HV_EID, V2HV_LVID tags.
00160     /** Compute a map between a vertex and an incident half-vertex. This map is not always required,
00161      * but is essential for local neighborhood searching as it acts like an anchor to start the
00162      * search.
00163      *
00164      * \param edges Range of edges
00165      */
00166 
00167     ErrorCode determine_incident_halfverts( Range& edges );
00168 
00169     //! Given a vertex, finds the edges incident on it.
00170     /** Given a vertex handle, it starts by first finding an incident half-vert by using the
00171      * incident half-vert map, and then obtaining all the sibling half-verts of the corresponding
00172      * half-vertex.
00173      *
00174      * \param vid EntityHandle of the query vertex
00175      * \param adjents Vector returning the incident edges
00176      * \param local_id False by default. If true, returns the local vertex id's corresponding to vid
00177      * \param lvids Vector returning the local vertex id's
00178      */
00179 
00180     ErrorCode get_up_adjacencies_1d( EntityHandle vid, std::vector< EntityHandle >& adjents,
00181                                      std::vector< int >* lvids = NULL );
00182 
00183     //! Given an edge, finds vertex-connected neighbor edges
00184     /** Given an edge, it gathers all the incident edges of each vertex of the edge.
00185      *
00186      * \param eid EntityHandle of the query edge
00187      * \param adjents Vector returning neighbor edges
00188      */
00189 
00190     ErrorCode get_neighbor_adjacencies_1d( EntityHandle eid, std::vector< EntityHandle >& adjents );
00191 
00192     // 2D Maps and queries
00193 
00194     //! Given a range of faces, determines the sibling half-edges and stores them into SIBHES_FID,
00195     //! SIBHES_LEID tags.
00196     /** Compute all sibling half-edges for all half-edges in the given surface.
00197      * The sibling half-edges is defined in terms of the containing face and the local id of the
00198      * edge w.r.t that entity. That is, the map consists of two pieces of information: <EntityHandle
00199      * fid, int leid>
00200      *
00201      * \param faces Range of faces
00202      */
00203 
00204     ErrorCode determine_sibling_halfedges( Range& faces );
00205 
00206     //! Given a range of faces, determines the incident half-edges and stores them into V2HE_FID,
00207     //! V2HE_LEID tags.
00208     /** Compute a map between a vertex and an incident half-edge.
00209      * This map is not always required, but is essential for local neighborhood searching as it acts
00210      * like an anchor to start the search.
00211      *
00212      * \param faces Range of faces
00213      */
00214 
00215     ErrorCode determine_incident_halfedges( Range& faces );
00216 
00217     //! Given a vertex, finds the faces incident on it.
00218     /** Given a vertex, it first finds an incident half-edge via v2he map, and then
00219      * collects all the incident half-edges/faces via the sibhes map.
00220      *
00221      * \param vid EntityHandle of the query vertex
00222      * \param adjents Vector returning the incident faces
00223      */
00224 
00225     ErrorCode get_up_adjacencies_vert_2d( EntityHandle vid, std::vector< EntityHandle >& adjents );
00226 
00227     //! Given an edge, finds the faces incident on it.
00228     /** Given an edge, it first finds a matching half-edge corresponding to eid, and then
00229      * collects all the incident half-edges/faces via the sibhes map.
00230      *
00231      * \param eid EntityHandle of the query edge
00232      * \param adjents Vector returning the incident faces
00233      * \param local_id By default false. If true, returns the local edge id's corresponding to the
00234      * input edge \param leids Vector returning local edge ids
00235      */
00236 
00237     ErrorCode get_up_adjacencies_2d( EntityHandle eid, std::vector< EntityHandle >& adjents,
00238                                      std::vector< int >* leids = NULL );
00239 
00240     //! Given a half-edge <fid, leid>, finds the faces incident on it.
00241     /**
00242      *
00243      * \param fid EntityHandle of the containing face
00244      * \param leid local id of the edge w.r.t to the face
00245      * \param add_inent If true, adds the input fid into the returning vector of adjents.
00246      * \param adjents Vector returning the incident faces
00247      * \param local_id By default false. If true, returns the local edge id's as well.
00248      * \param leids Vector returning local edge ids
00249      */
00250 
00251     ErrorCode get_up_adjacencies_2d( EntityHandle fid, int leid, bool add_inent, std::vector< EntityHandle >& adj_ents,
00252                                      std::vector< int >* adj_leids = NULL, std::vector< int >* adj_orients = NULL );
00253 
00254     //! Given an edge, finds edge-connected neighbor face
00255     /** Given an face, it gathers all the neighbor faces of each local edge of the face.
00256      *
00257      * \param fid EntityHandle of the query face
00258      * \param adjents Vector returning neighbor faces
00259      */
00260 
00261     ErrorCode get_neighbor_adjacencies_2d( EntityHandle fid, std::vector< EntityHandle >& adjents );
00262 
00263     //! Given a face, finds its edges.
00264     /** Given a face, it first finds incident edges on each vertex of the face, and then
00265      *  it performs a set intersection to gather all the edges of the given face.
00266      *
00267      * \param fid EntityHandle of the query face
00268      * \param adjents Vector returning its edges
00269      */
00270 
00271     ErrorCode get_down_adjacencies_2d( EntityHandle fid, std::vector< EntityHandle >& adjents );
00272 
00273     //! Given a range of faces, finds the total number of edges.
00274 
00275     int find_total_edges_2d( Range& faces );
00276 
00277     ErrorCode get_face_edges( EntityHandle fid, std::vector< EntityHandle >& edges );
00278 
00279     // 3D Maps and queries
00280 
00281     //! Given a range of cells, determines the sibling half-faces and stores them into SIBHFS_CID,
00282     //! SIBHFS_LFID tags.
00283     /** Compute all sibling half-faces for all half-faces in the given volume.
00284      * The sibling half-faces is defined in terms of the containing cell and the local id of the
00285      * face w.r.t that cell. That is, the map consists of two pieces of information: <EntityHandle
00286      * cid, int lfid>
00287      *
00288      * \param faces Range of cells
00289      */
00290 
00291     ErrorCode determine_sibling_halffaces( Range& cells );
00292 
00293     //! Given a range of cells, determines the incident half-faces and stores them into V2HF_CID,
00294     //! V2HF_LFID tags.
00295     /** Compute a map between a vertex and an incident half-face.
00296      * This map is not always required, but is essential for local neighborhood searching as it acts
00297      * like an anchor to start the search.
00298      *
00299      * \param faces Range of cells
00300      */
00301 
00302     ErrorCode determine_incident_halffaces( Range& cells );
00303 
00304     //! Given a range of cells, tags all border vertices with a true value.
00305     /** Tag border vertices by using the sibhf_cid map. All vertices on half-faces with no sibling
00306      * half-faces are considered as border vertices.
00307      *
00308      * \param cells Range of cells
00309      * \param isborder: A dense tag over all vertices of size 1. Value is true for a border vertex,
00310      * otherwise is false.
00311      */
00312 
00313     ErrorCode determine_border_vertices( Range& cells, Tag isborder );
00314 
00315     //! Given a vertex, finds the cells incident on it.
00316     /** Given a vertex, it first finds an incident half-face via v2hf map, and then
00317      * collects all the incident half-faces via the sibhfs map.
00318      *
00319      * \param vid EntityHandle of the query vertex
00320      * \param adjents Vector returning the incident cells
00321      */
00322 
00323     ErrorCode get_up_adjacencies_vert_3d( EntityHandle vid, std::vector< EntityHandle >& adjents );
00324 
00325     //! Given an edge, finds the cells incident on it.
00326     /** Given an edge, it first finds a matching local edge in a cell corresponding to eid, and then
00327      * collects all the incident cells via the sibhfs map.
00328      *
00329      * \param eid EntityHandle of the query edge
00330      * \param adjents Vector returning the incident cells
00331      * \param local_id By default false. If true, returns the local edge id's corresponding to the
00332      * input edge \param leids Vector returning local edge ids
00333      */
00334 
00335     ErrorCode get_up_adjacencies_edg_3d( EntityHandle eid, std::vector< EntityHandle >& adjents,
00336                                          std::vector< int >* leids = NULL );
00337 
00338     //! Given a local edge <cid, leid>, finds the cells incident on it.
00339     /** Given a local edge, it gathers all the incident cells via the sibhfs map.
00340      *
00341      * \param cid EntityHandle of the cell containing the local edge
00342      * \param leid local edge id w.r.t the cell
00343      * \param adjents Vector returning the incident cells
00344      * \param local_id By default false. If true, returns the local edge id's corresponding to the
00345      * input edge \param leids Vector returning local edge ids
00346      */
00347 
00348     ErrorCode get_up_adjacencies_edg_3d( EntityHandle cid, int leid, std::vector< EntityHandle >& adjents,
00349                                          std::vector< int >* leids = NULL, std::vector< int >* adj_orients = NULL );
00350 
00351     ErrorCode get_up_adjacencies_edg_3d_comp( EntityHandle cid, int leid, std::vector< EntityHandle >& adjents,
00352                                               std::vector< int >* leids       = NULL,
00353                                               std::vector< int >* adj_orients = NULL );
00354 
00355     //! Given an face, finds the cells incident on it.
00356     /** Given an face, it first finds a matching half-face in a cell corresponding to face, and then
00357      * collects all the incident cells via the sibhfs map.
00358      *
00359      * \param fid EntityHandle of the query face
00360      * \param adjents Vector returning the incident cells
00361      * \param local_id By default false. If true, returns the local face id's corresponding to the
00362      * input face \param leids Vector returning local face ids
00363      */
00364 
00365     ErrorCode get_up_adjacencies_face_3d( EntityHandle fid, std::vector< EntityHandle >& adjents,
00366                                           std::vector< int >* lfids = NULL );
00367 
00368     //! Given a local face <cid, lfid>, finds the cells incident on it.
00369     /** Given a local face, it gathers all the incident cells via the sibhfs map.
00370      *
00371      * \param cid EntityHandle of the cell containing the local edge
00372      * \param lfid local face id w.r.t the cell
00373      * \param adjents Vector returning the incident cells
00374      * \param local_id By default false. If true, returns the local face id's corresponding to the
00375      * input face \param lfids Vector returning local face ids
00376      */
00377 
00378     ErrorCode get_up_adjacencies_face_3d( EntityHandle cid, int lfid, std::vector< EntityHandle >& adjents,
00379                                           std::vector< int >* lfids = NULL );
00380 
00381     //! Given a cell, finds face-connected neighbor cells
00382     /** Given a cell, it gathers all the neighbor cells of each local face of the cell.
00383      *
00384      * \param cid EntityHandle of the query cell
00385      * \param adjents Vector returning neighbor cells
00386      */
00387 
00388     ErrorCode get_neighbor_adjacencies_3d( EntityHandle cid, std::vector< EntityHandle >& adjents );
00389 
00390     //! Given a cell, finds its edges.
00391     /** Given a cell, it first finds incident edges on each vertex of the cell, and then
00392      *  it performs a set intersection to gather all the edges of the given cell.
00393      *
00394      * \param cid EntityHandle of the query cell
00395      * \param adjents Vector returning its edges
00396      */
00397 
00398     ErrorCode get_down_adjacencies_edg_3d( EntityHandle cid, std::vector< EntityHandle >& adjents );
00399 
00400     //! Given a cell, finds its faces.
00401     /** Given a cell, it first finds incident faces on each vertex of the cell, and then
00402      *  performs a set intersection to gather all the faces of the given cell.
00403      *
00404      * \param cid EntityHandle of the query cell
00405      * \param adjents Vector returning its faces
00406      */
00407 
00408     ErrorCode get_down_adjacencies_face_3d( EntityHandle cid, std::vector< EntityHandle >& adjents );
00409 
00410     /* Find the number of edges and faces of given range of cells
00411      * */
00412     ErrorCode find_total_edges_faces_3d( const Range& cells, int* nedges, int* nfaces );
00413 
00414     ErrorCode count_subentities( Range& edges, Range& faces, Range& cells, int* nedges, int* nfaces );
00415 
00416     void get_memory_use( unsigned long long& entity_total, unsigned long long& memory_total );
00417 
00418     ErrorCode get_half_facet_in_comp( EntityHandle cid, int leid, std::vector< EntityHandle >& ents,
00419                                       std::vector< int >& lids, std::vector< int >& lfids );
00420 
00421     /**************************
00422      *  Interface to AHF maps   *
00423      **************************/
00424     HFacet create_halffacet( EntityHandle handle, int lid );
00425 
00426     EntityHandle fid_from_halfacet( const HFacet facet, EntityType type );
00427 
00428     int lid_from_halffacet( const HFacet facet );
00429 
00430     ErrorCode update_entity_ranges( EntityHandle fileset );
00431 
00432     ErrorCode resize_hf_maps( EntityHandle start_vert, int nverts, EntityHandle start_edge, int nedges,
00433                               EntityHandle start_face, int nfaces, EntityHandle start_cell, int ncells );
00434 
00435     ErrorCode get_sibling_map( EntityType type, EntityHandle ent, EntityHandle* sib_entids, int* sib_lids,
00436                                int num_halffacets );
00437 
00438     ErrorCode get_sibling_map( EntityType type, EntityHandle ent, int lid, EntityHandle& sib_entid, int& sib_lid );
00439 
00440     ErrorCode set_sibling_map( EntityType type, EntityHandle ent, EntityHandle* set_entids, int* set_lids,
00441                                int num_halffacets );
00442 
00443     ErrorCode set_sibling_map( EntityType type, EntityHandle ent, int lid, EntityHandle& set_entid, int& set_lid );
00444 
00445     ErrorCode get_incident_map( EntityType type, EntityHandle vid, std::vector< EntityHandle >& inci_entid,
00446                                 std::vector< int >& inci_lid );
00447 
00448     ErrorCode set_incident_map( EntityType type, EntityHandle vid, std::vector< EntityHandle >& set_entid,
00449                                 std::vector< int >& set_lid );
00450 
00451     bool check_nonmanifold_vertices( EntityType type, EntityHandle vid );
00452 
00453     /**********************
00454      *         Local Maps
00455      * ********************/
00456     //! 2D local maps
00457     struct LocalMaps2D
00458     {
00459         //! Number of vertices in a face
00460         short int num_verts_in_face;
00461         //! Local ids of the next half-edge
00462         int next[MAX_INCIDENT_HF];
00463         //! Local ids of the previous half-edge
00464         int prev[MAX_INCIDENT_HF];
00465     };
00466     static const LocalMaps2D lConnMap2D[2];
00467 
00468     //! 3D local maps
00469     struct LocalMaps3D
00470     {
00471         //! Number of vertices in cell
00472         short int num_verts_in_cell;
00473         //! Number of edges in cell
00474         short int num_edges_in_cell;
00475         // Number of faces in cell
00476         short int num_faces_in_cell;
00477         //! Number of vertices in each half-face
00478         int hf2v_num[MAX_FACES];
00479         //! Map: Half-face to local vertex ids
00480         int hf2v[MAX_FACES][MAX_VERTS_HF];
00481         //! Number of incident half-faces on each vertex
00482         int v2hf_num[MAX_VERTICES];
00483         //! Map: Local vertices to incident half-facets
00484         int v2hf[MAX_VERTICES][MAX_INCIDENT_HF];
00485         //!  Map: Local edges to local vertices
00486         int e2v[MAX_EDGES][2];
00487         //! Map: Local edges to incident half-faces
00488         int e2hf[MAX_EDGES][2];
00489         //! Map: Half-faces to local edges
00490         int f2leid[MAX_FACES][MAX_VERTS_HF];
00491         //! Map: local vertices to local edges
00492         int lookup_leids[MAX_VERTICES][MAX_VERTICES];
00493         //! Search edge verts:
00494         int search_everts[5];
00495         int search_fverts[2];
00496         int v2le[4][5];
00497     };
00498     static const LocalMaps3D lConnMap3D[4];
00499     MESHTYPE thismeshtype;
00500 
00501     std::map< EntityType, int > cell_index;
00502 
00503     int get_index_in_lmap( EntityHandle cid );
00504     ErrorCode get_entity_ranges( Range& verts, Range& edges, Range& faces, Range& cells );
00505     MESHTYPE get_mesh_type( int nverts, int nedges, int nfaces, int ncells );
00506 
00507     EntityHandle* get_rset()
00508     {
00509         return &_rset;
00510     }
00511 
00512   protected:
00513     HalfFacetRep();
00514 
00515     Core* mb;
00516     ParallelComm* pcomm;
00517     EntityHandle _rset;
00518     bool _filterghost;
00519     bool mInitAHFmaps;
00520 
00521     Range _verts, _edges, _faces, _cells;
00522 
00523     // AHF map storage containers for 1D, 2D, 3D
00524     std::vector< HFacet > sibhvs, v2hv;
00525     std::vector< HFacet > sibhes, v2he;
00526     std::vector< HFacet > sibhfs, v2hf;
00527 
00528     // AHF maps for non-manifold vertices 2D, 3D
00529     std::multimap< EntityHandle, HFacet > v2hes, v2hfs;
00530 
00531     // Auxiliary storage for local searches.
00532     EntityHandle queue_fid[MAXSIZE], Stkcells[MAXSIZE], cellq[MAXSIZE];
00533     EntityHandle trackfaces[MAXSIZE], trackcells[MAXSIZE];
00534     int queue_lid[MAXSIZE];
00535 
00536     struct adj_matrix
00537     {
00538         int val[4][4];
00539     };
00540 
00541     static const adj_matrix adjMatrix[7];
00542     int get_index_for_meshtype( MESHTYPE mesh_type );
00543 
00544     // These two flags are for checking mixed entity type meshes
00545     bool is_mixed;
00546     bool chk_mixed;
00547 
00548     ErrorCode init_curve();
00549     ErrorCode init_surface();
00550     ErrorCode init_volume();
00551 
00552     //! Contains the local information for 2D entities
00553     /** Given a face, find the face type specific information
00554      *
00555      * \param face EntityHandle. Used to gather info about the type of face for which local info is
00556      * required \param nepf: Returns the number of vertices/edges for given face type.
00557      */
00558 
00559     //! Contains the local information for 2D entities
00560     /** Given number of edges, returns local indices of next and previous local edges.
00561        *
00562        * \param nepf: The number of vertices/edges for given face type.
00563        * \param next, prev: Local ids of next and previous edges w.r.t to the face
00564        *
00565        * Note: For 2D entities, the number of vertices and edges are same and each local edge is
00566        outgoing
00567        * corresponding to the local vertex, i.e,
00568 
00569               v2        v3 __e2__v2
00570               /\          |      |
00571           e2 /  \ e1    e3|      |e1
00572             /____\        |______|
00573           v0  e0  v1     v0  e0  v1
00574       */
00575 
00576     //! Given a half-edge as <he_fid,he_lid> , finds the half-edges incident on it and adds them
00577     //  to an input queue if it not already added.
00578     /** Given an half-edge, obtain all the incident half-edges via the sibhes map and add them to a
00579      * given queue of half-edges, if they do not already exist in the queue. This function is used
00580      * to increment the search space for finding a matching half-edge.
00581      *
00582      * \param he_fid EntityHandle of query half-edge
00583      * \param he_lid Local id of query half-edge
00584      */
00585 
00586     ErrorCode get_up_adjacencies_2d( EntityHandle he_fid, int he_lid, int* qsize, int* count );
00587 
00588     //! Given an edge, finds a matching half-edge in the surface.
00589     /** Given an edge eid, it first collects few half-edges belonging to one-ring neighborhood of
00590      * the starting vertex of the given edge, and then simultaneously searches and adds to the local
00591      * list of half-edges for searching, till it finds a matching half-edge.
00592      *
00593      * \param eid EntityHandle of the query edge
00594      * \param hefid, helid: Returns the matching half-edge corresponding to the query edge.
00595      */
00596 
00597     bool find_matching_halfedge( EntityHandle eid, EntityHandle* hefid, int* helid );
00598 
00599     //! Gather half-edges to a queue of half-edges.
00600     /** Given a vertex vid, and a half-edge <he_fid,he_lid>, add another half-edge in the same face
00601      * sharing the vertex
00602      */
00603 
00604     ErrorCode gather_halfedges( EntityHandle vid, EntityHandle he_fid, int he_lid, int* qsize, int* count );
00605 
00606     //! Obtains another half-edge belonging to the same face as the input half-edge
00607     /** It uses the local maps to find another half-edge that is either incident or outgoing
00608      * depending on vid and input half-edge
00609      */
00610 
00611     ErrorCode another_halfedge( EntityHandle vid, EntityHandle he_fid, int he_lid, EntityHandle* he2_fid,
00612                                 int* he2_lid );
00613 
00614     ErrorCode mark_halfedges( EntityHandle vid, EntityHandle he_fid, int he_lid, Range& faces,
00615                               std::vector< char >& markHEdgs, HFacet& bnd_hf );
00616 
00617     //! Collect and compare to find a matching half-edge with the given edge connectivity.
00618     /** Given edge connectivity, compare to an input list of half-edges to find a matching half-edge
00619      * and add a list of half-edges belonging to the one-ring neighborhood to a queue till it finds
00620      * a match.
00621      */
00622 
00623     bool collect_and_compare( const EntityHandle vid, const EntityHandle* edg_vert, int* qsize, int* count,
00624                               EntityHandle* he_fid, int* he_lid );
00625 
00626     ErrorCode add_cells_of_single_component( EntityHandle vid, EntityHandle curcid, int curlid,
00627                                              std::multimap< EntityHandle, EntityHandle >& comps, HFacet& hf );
00628     bool find_cell_in_component( EntityHandle vid, EntityHandle cell,
00629                                  std::multimap< EntityHandle, EntityHandle >& comps );
00630 
00631     //! Given an edge, finds a matching local edge in an incident cell.
00632     /** Find a local edge with the same connectivity as the input edge, belonging to an incident
00633      * cell.
00634      *
00635      * \param eid EntityHandle of the edge
00636      * \param cid Returns EntityHandle of the incident cell
00637      * \param leid Returns the local id of the edge corresponding to the input edge w.r.t the
00638      * incident cell.
00639      */
00640 
00641     bool find_matching_implicit_edge_in_cell( EntityHandle eid, std::vector< EntityHandle >& cid,
00642                                               std::vector< int >& leid );
00643 
00644     //! Given a face, finds a matching local face in an incident cell.
00645     /** Find a local face with the same connectivity as the input face, belonging to an incident
00646      * cell.
00647      *
00648      * \param fid EntityHandle of the face
00649      * \param cid Returns EntityHandle of the incident cell
00650      * \param lfid Returns the local id of the face corresponding to the input face w.r.t the
00651      * incident cell.
00652      */
00653 
00654     bool find_matching_halfface( EntityHandle fid, EntityHandle* cid, int* leid );
00655 
00656     bool find_match_in_array( EntityHandle ent, EntityHandle* ent_list, int count, bool get_index = false,
00657                               int* index = NULL );
00658 };
00659 
00660 }  // namespace moab
00661 
00662 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines