On Wed, Jan 08, 2014 at 04:07:35PM +0000, Garth N. Wells wrote:
> On 2014-01-08 15:21, Anders Logg wrote:
> >I would claim that the connectivity is stored very efficiently.  The
> >simplest example is D--0 connectivity for a mesh which is for each
> >cell which vertices belong to it. That data is stored as one big array
> >of integers, something like
> >
> >  0 1 2 3 0 1 2 4 ...
> >
> >which means that tetrahedron 0 has vertices 0 1 2 3, tetrahedron 1 has
> >vertices 0 1 2 4 etc.
> >
> >There are D + 1 different kinds of entities in a mesh. For a
> >tetrahedron we have vertex, edge, face, cell and so the total number
> >of connectivities that may be computed is (D + 1)*(D + 1). Not all
> >these are needed, but they can all be computed.
> >
> >For solving Poisson's equation, we first need D--0. To see which
> >connectivities are computed, one can do info(mesh, True) to print the
> >following little table:
> >
> >    0 1 2 3
> >  0 - - - -
> >  1 - - - -
> >  2 - - - -
> >  3 x - - -
> >
> >To set boundary conditions, one needs to create the faces of the mesh
> >(which are not stored a priori). One will then get the following
> >connectivities:
> >
> >    0 1 2 3
> >  0 - - - x
> >  1 - - - -
> >  2 x - - -
> >  3 x - x x
> >
> >Here we see the following connectivities:
> >
> >  3--0 = the vertices of all cells = the cells
> >  0--3 = the cells connected to all vertices
> >  3--3 = the cells connected to all cells (via vertices)
> >  2--0 = the vertices of all faces = the faces
> >  3--2 = the faces of all cells
> >
> >These get computed in order:
> >
> >  0--3 is computed from 3--0 (by "inversion")
> >  3--3 is computed from 3--0 and 0--3
> >  2--0 and 3--2 are computed from 3--3 by a local search
> >
> >3--3 is needed in order for a cell to communicate with its neighboring
> >cells to decide on how to number the common face (if any).
> >
>
> 3--3 connectivity is *undefined*.

Yes, in general, but we have *chosen* to define it as 3--0--3.

The reason for this choice is that we start with 3--0, from which we
can easily compute 3--0--3.

In other words, we start with cell-vertex data and hence the only way
for two cells to figure out if they share common entities (for example
faces) is to go via the vertices. Unless you have some other brilliant
idea.

--
Anders


> DOLFIN presently assumes that 3--3
> == 3--0--3. To number a common face, what's required is 3--2 and
> 2--3. In Chris's test, 3--3 uses ~17 times more memory than 3--2.



> Garth
>
> >Once the faces have been computed, the other information can be thrown
> >away to save memory. I suggest experimenting with initializing the
> >connectivities explicitly before setting boundary conditions, then
> >clear those that are not needed:
> >
> >  mesh.topology()(3,3).clear()
> >
> >That should save some memory. It is conceivable that we can make
> >improvements to TopologyComputation.cpp so that connectivities no
> >longer needed are deleted on the fly once they have been used to build
> >up the connectivities actually requested.
> >
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to