[MOAB-dev] Trouble Creating AEntities
Tim Tautges
tautges at mcs.anl.gov
Mon Oct 14 16:17:57 CDT 2013
It's probably better to take all faces and call get_adjacencies with the create_if_missing flag = true:
Range faces, edges;
result = iface->get_entities_by_dimension(0, 2, faces);
result = iface->get_adjacencies(faces, 1, true, edges, Interface::UNION);
Make sure and include the UNION part at the end, otherwise it'll return after the first few faces 'cuz the intersection
will be empty.
- tim
On 10/14/2013 03:57 PM, Chris Eldred wrote:
> Hey MOAB-Dev,
>
> I am having trouble creating AEntities for a simple 2D planar mesh. I adapted ReadTemplate.cpp to create a mesh
> generator and it appears to be working fine (vertices are all present with correct vertex-vertex and vertex-face
> adjacencies and positions, faces are all present with correct vertex connectivity). However, when I try to create
> AEntities (ie edges) using the following code (iface is my Core instance):
>
> Range verts;
> result = iface->get_entities_by_type(0, MBVERTEX, verts);
> if (MB_SUCCESS != result) return result;
> result = MeshTopoUtil(iface).construct_aentities(verts);
> if (MB_SUCCESS != result) return result;
>
> //get edge entities, by type
> Range edges;
> rval = iface->get_entities_by_type(0, MBEDGE, edges);
> assert(rval == MB_SUCCESS);
>
> cout << "Number of edges is " << edges.size() << endl;
>
> I get the following output:
>
> Number of edges is 0
>
> Also, attempting to get vertex-edge adjacencies or bridge adjacencies through edges returns null sets.
>
> Any ideas as to what is going wrong?
>
> -Chris
>
> --
> Chris Eldred
> DOE Computational Science Graduate Fellow
> Graduate Student, Atmospheric Science, Colorado State University
> B.S. Applied Computational Physics, Carnegie Mellon University, 2009
> chris.eldred at gmail.com <mailto:chris.eldred at gmail.com> / celdred at atmos.colostate.edu <mailto:celdred at atmos.colostate.edu>
--
================================================================
"You will keep in perfect peace him whose mind is
steadfast, because he trusts in you." Isaiah 26:3
Tim Tautges Argonne National Laboratory
(tautges at mcs.anl.gov) (telecommuting from UW-Madison)
phone (gvoice): (608) 354-1459 1500 Engineering Dr.
fax: (608) 263-4499 Madison, WI 53706
More information about the moab-dev
mailing list