← 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

    Status: Open => Answered

Garth Wells proposed the following answer:

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
the order follows the order of insertion.

Garth

> Ted
>

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