← Back to team overview

dolfin team mailing list archive

Re: [Question #97807]: How to Obtain the Coordinates of the Vertices of a Mesh with P2 and Higher Elements

 

Question #97807 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/97807

Garth Wells proposed the following answer:

Garth N. Wells wrote:
> 
> Ted Kord wrote:
>> Question #97807 on DOLFIN changed:
>> https://answers.launchpad.net/dolfin/+question/97807
>>
>>     Status: Answered => Open
>>
>> Ted Kord is still having a problem:
>> No, V's not a vector-valued space.
>>
>> By duplicates, I mean that the vertices that are on a common edge
>> between elements are repeated in the enumeration. For example, for a
>> 4x4 rectangle with 2 P2 elements, i.e.,  nx = ny = 1
>>
>>     Rectangle mesh(0.0, 0.0, 4.0, 4.0, nx, ny)
>>
>> V.dofmap().tabulate_coordinates(...)  produces:
>>
>> 0:  (0, 0)
>> 1:  (4, 0)
>> 2:  (4, 4)
>> 3:  (4, 2)
>> 4:  (2, 2)
>> 5:  (2, 0)
>> 6:  (0, 0)
>> 7:  (0, 4)
>> 8:  (4, 4)
>> 9:  (2, 4)
>> 10: (2, 2)
>> 11: (0, 2)
>>
>> Vertices 0 and 6, 2 and 8, 4 and 10 are repeated.
>>
>> I'd like to eliminate these without sorting so that the vertices are
>> still evaluated in the correct order.
>>
>> Is there already a function to do this or is there a better way?
>>
> 
> You can insert the dofs into a dolfin::Set. It's like a std::std, but

I meant 'std::set'.

Garth

> the order follows the order of insertion.
> 
> Garth
> 
>> Ted
>>
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.



References