<div class="gmail_extra">On Sat, Nov 10, 2012 at 5:31 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":61g">I was being too pessimistic. You can assign an intermediate node to any set<br>
of shared vertices, but I am not sure whether you start from the top or bottom,<br>
and the hard part is preallocation.</div></blockquote></div><br></div><div class="gmail_extra">Hmm, I'm not sure how to do hanging nodes, but for a conforming mesh starting with cell-to-vertex c2v[...]</div><div class="gmail_extra">
<br></div><div class="gmail_extra"># build inverse map</div><div class="gmail_extra">v2c = defaultdict(lambda v:[])</div><div class="gmail_extra">for c in cells:</div><div class="gmail_extra">  for v in c2v[c]:</div><div class="gmail_extra">
    v2c[v].append(c)</div><div class="gmail_extra"><br></div><div class="gmail_extra"># find common subsets</div><div class="gmail_extra">edges = set()</div><div class="gmail_extra">c2e = defaultdict(lambda c:set())</div>
<div class="gmail_extra">for v in vertices:  </div><div class="gmail_extra">  for (v1,c1,v2,c2) in sorted_vertices_appearing_in_exactly_2_cells(v2c[v]);</div><div class="gmail_extra">    edges.add((v1,v2))<br></div><div class="gmail_extra">
    c2e[c1].add((v1,v2))</div><div class="gmail_extra">    c2e[c2].add((v1,v2))</div><div class="gmail_extra"><br></div><div class="gmail_extra"># repeat using edges to bound cell-to-face</div><div class="gmail_extra">...</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">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.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">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.</div>