[petsc-dev] PetscSection

Jed Brown jedbrown at mcs.anl.gov
Sat Nov 10 18:14:13 CST 2012


On Sat, Nov 10, 2012 at 5:31 PM, Matthew Knepley <knepley at gmail.com> wrote:

> I was being too pessimistic. You can assign an intermediate node to any set
> of shared vertices, but I am not sure whether you start from the top or
> bottom,
> and the hard part is preallocation.
>

Hmm, I'm not sure how to do hanging nodes, but for a conforming mesh
starting with cell-to-vertex c2v[...]

# build inverse map
v2c = defaultdict(lambda v:[])
for c in cells:
  for v in c2v[c]:
    v2c[v].append(c)

# find common subsets
edges = set()
c2e = defaultdict(lambda c:set())
for v in vertices:
  for (v1,c1,v2,c2) in sorted_vertices_appearing_in_exactly_2_cells(v2c[v]);
    edges.add((v1,v2))
    c2e[c1].add((v1,v2))
    c2e[c2].add((v1,v2))

# repeat using edges to bound cell-to-face
...



The problem with this is that you don't automatically get consistent
orientation. If you need to work with basis functions, you need to orient,
in which case the ordering produced by the procedure above needs to be
fixed.

In my opinion, that orientation is critical, such that connectivity without
topology is of limited value. The topological dimension and number of
vertices is just not sufficient to identify the topology of an element. For
example, a hex can be collapsed to 7 vertices via an edge or across the
middle of a face.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20121110/c409f749/attachment.html>


More information about the petsc-dev mailing list