[Dune-devel] [Dune] List of surrounding points for any given vertex in 2D triangular meshes
Oliver Sander
sander at igpm.rwth-aachen.de
Fri Jan 17 17:31:20 CET 2014
Am 17.01.2014 17:22, schrieb Sacconi, Andrea:
> Hi DUNErs,
>
> I would like to ask you a quick question.
> Suppose that you are working with 2D, triangular meshes; to be more precise, conforming meshes. For any given vertex, there is a certain number of surrounding vertices around, topologically connected with it. In other words, all the vertices which are second extreme of a segment, whose first extreme is the given point.
> What is the quickest way, within DUNE framework, to extract the global index of those vertices, given the index of the one in the middle?
>
> I was thinking of iterating over the elements, playing around with intersections and subIndices but it seems inefficient.
> Any clever suggestions?
>
If you want to do the least amount of coding: assemble a P1 mass matrix and look
at the matrix occupation pattern. The neighbors of vertex i correspond to the
non-zero entries of the i-th row of that matrix.
If you want fast code: strip away everything from the assembler that is not needed,
and consider using a smarter data structure than a crs matrix. The result will not
be extremely fast, but that's pretty much as good as it gets with the Dune interface.
Cheers,
Oliver
> Thank you very much!
> Andrea
> __________________________________________________________
>
> Andrea Sacconi
> PhD student, Applied Mathematics
> AMMP Section, Department of Mathematics, Imperial College London,
> London SW7 2AZ, UK
> a.sacconi11 at imperial.ac.uk
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 534 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20140117/d372ef1f/attachment.sig>
More information about the Dune-devel
mailing list