[MOAB-dev] get_adjacencies of same dim

Tim Tautges (ANL) tautges at mcs.anl.gov
Tue Jan 28 11:40:21 CST 2014


Yes, so what you really want here are bridge adjacencies, which are served by MeshTopoUtil::get_bridge_adjacencies.  The 
"from" entity(ies) is the triangle; the bridge is either nodes or edges; if you want the edge-adjacent entities, the 
bridge would be edges; the "to" entities are dimension 2.  That should give you back 3 tris for interior tris.

- tim

On 01/27/2014 11:35 PM, Paul Wilson wrote:
> (I may have led Patrick astray here in face-to-face conversation...)
>
> Now that I see your reply, Iulian, I think this makes sense.  In Patrick's example, there is no reason to actually
> expect only 3 responses for all triangles adjacent to another triangle since the triangles that share a node are also
> considered adjacent.
>
> Paul
>
> On 01/27/2014 05:13 PM, Grindeanu, Iulian R. wrote:
>> So I think the discussion is about "bridge" entities, for adjacencies; if the bridge entities are nodes, you will get
>> different result compared when bridge entities are edges, so this is why we should keep the current code. (and go
>> through bridge entities, then it is clear what kind of adjacency you want)
>>
>> Iulian
>> ------------------------------------------------------------------------------------------------------------------------
>> *From:* moab-dev-bounces at mcs.anl.gov [moab-dev-bounces at mcs.anl.gov] on behalf of Grindeanu, Iulian R. [iulian at mcs.anl.gov]
>> *Sent:* Monday, January 27, 2014 5:10 PM
>> *To:* Patrick Shriwise
>> *Cc:* moab-dev at mcs.anl.gov
>> *Subject:* Re: [MOAB-dev] get_adjacencies of same dim
>>
>> I think you found something;
>> In the code, when the target dimension is the same as source dimension, we return just the entity.
>> AEntityFactory.cpp:
>> ...
>>  599   else if (source_dimension == target_dimension) {
>>  600     target_entities.push_back( source_entity );
>>  601     result = MB_SUCCESS;
>>  602   }
>>  603   else {
>>
>> As a workaround, you probably want to go through edges/vertices, and from edges/vertices get the adjacent triangles.
>>
>> Tim, should we change the behavior and return all adjacent triangles? I know that there is a discussion in iMesh too
>> about that.
>>
>> Iulian
>> ------------------------------------------------------------------------------------------------------------------------
>> *From:* Patrick Shriwise [shriwise at wisc.edu]
>> *Sent:* Monday, January 27, 2014 4:33 PM
>> *To:* Grindeanu, Iulian R.
>> *Cc:* moab-dev at mcs.anl.gov
>> *Subject:* Re: [MOAB-dev] get_adjacencies of same dim
>>
>> On 01/27/2014 04:24 PM, Grindeanu, Iulian R. wrote:
>>> hello,
>>> are you using the last parameter / flag to the get_adjacency? By default it is intersect.
>>> maybe you want "union" of the input ?
>>>
>>>   virtual ErrorCode get_adjacencies(const Range &from_entities,
>>>                                           const int to_dimension,
>>>                                           const bool create_if_missing,
>>>                                           Range &adj_entities,
>>>                                           const int operation_type = Interface::INTERSECT);
>>>
>>> What are you getting and you do not expect it?
>>> Iulian
>>> ________________________________________
>>> From:moab-dev-bounces at mcs.anl.gov  [moab-dev-bounces at mcs.anl.gov] on behalf of Patrick Shriwise [shriwise at wisc.edu]
>>> Sent: Monday, January 27, 2014 4:08 PM
>>> To:moab-dev at mcs.anl.gov
>>> Subject: [MOAB-dev] get_adjacencies of same dim
>>>
>>> Hey all,
>>>
>>> Quick question. Working on a couple tests for ReadCGM and calling for
>>> the adjacencies of an entity which are the same dimension of the entity
>>> itself but I'm not getting the result I'm expecting. Any this special to
>>> know in this case?
>>>
>>> Cheers,
>>>
>>> --
>>> Patrick C. Shriwise
>>> Research Assistant
>>> University of Wisconsin - Madison
>>> Engineering Research Building - Rm. 428
>>> 1500 Engineering Drive
>>> Madison, WI 53706
>>> (608) 446-8173
>>>
>> I'm calling for the adjacencies of a triangle which I would expect to return a vector of entity handles of size 3, but
>> it seems to be returning a vector of size 1.
>>
>> To be specific I'm using:
>>
>>
>> virtual ErrorCode get_adjacencies(const Range &from_entities,
>>                                           const int to_dimension,
>>                                           const bool create_if_missing,
>>                                           std::vector<EntityHandle> &adj_entities,
>>                                           const int operation_type = Interface::INTERSECT);
>>
>> and here's my call: get_adjacencies( tri, 1, 2, false, adj_tris);
>> --
>> Patrick C. Shriwise
>> Research Assistant
>> University of Wisconsin - Madison
>> Engineering Research Building - Rm. 428
>> 1500 Engineering Drive
>> Madison, WI 53706
>> (608) 446-8173
>
> --
> -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
> Paul Wilson ~ UW-Madison ~ 608-263-0807 ~ cal:http://bit.ly/pphw-cal
> Professor, Engineering Physics. ~http://cnerg.engr.wisc.edu
> Faculty Director, Advanced Computing Infrastructure
>

-- 
================================================================
"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