← Back to team overview

ufl team mailing list archive

Re: [HG UFL] Changed all use of domain string to a Cell.

 

On Mon, Dec 22, 2008 at 10:19:33AM +0100, UFL wrote:
> One or more new changesets pushed to the primary ufl repository.
> A short summary of the last three changesets is included below.
> 
> changeset:   455:340cd15f28155e9b35e1cbfb0f29ca8be076d1f9
> tag:         tip
> user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date:        Mon Dec 22 10:19:47 2008 +0100
> files:       demo/mixed_poisson.ufl test/algorithms.py test/classcoverage.py test/elements.py test/ffcforms.py test/forms.py ufl/__init__.py ufl/algorithms/ad.py ufl/algorithms/checks.py ufl/algorithms/formdata.py ufl/algorithms/transformations.py ufl/base.py ufl/basisfunction.py ufl/differentiation.py ufl/finiteelement.py ufl/form.py ufl/function.py ufl/geometry.py ufl/objects.py ufl/operators.py ufl/variable.py
> description:
> Changed all use of domain string to a Cell.
> Now we can do stuff like:
> 
> cell = tetrahedron
> dim = cell.dim()
> n = cell.n()
> x = cell.x()
> I = Id(dim)
> f = VectorConstant(cell)
> a = sin(x[0])*dot(n, f)*dx
> 
> A good habit will be to define "cell = triangle" etc
> at the top, making the rest more dimension independent.

Very nice.

-- 
Anders


> 
> changeset:   454:12ccc726c55348de78185810749bf89ef9e1f1bf
> user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date:        Fri Dec 19 19:18:48 2008 +0100
> files:       ufl/finiteelement.py ufl/permutation.py
> description:
> Attempt at implementing MixedElement.extract_component for
> mixed elements where value components are flattened
> into a long vector, e.g. a tensor+vector+scalar element.
> 
> 
> changeset:   453:958e2a23876e02195da0c702a6329047fb4a4c3b
> user:        "Martin Sandve Alnæs <martinal@xxxxxxxxx>"
> date:        Thu Dec 18 23:25:55 2008 +0100
> files:       ufl/finiteelement.py ufl/geometry.py
> description:
> Quickly sketched a minor idea:
> With a Cell class we could do this:
> 
>   triangle = Cell("triangle")
>   quadratic_triangle = Cell("triangle", 2)
> 
>   cell = triangle # we can predefine interval, triangle, tetrahedron, etc.
>   element = FiniteElement("CG", cell, 1) # instead of domain2dim[domain], we can just do cell.dim()
>   n = cell.n() # returns FacetNormal(domain), no change in other code
>   x = cell.x()
>   ...
> 
> The Cell class is implemented but not used.
> Putting it to use instead of the domain string
> will be a small task causing no problems in UFL.
> 
> ----------------------------------------------------------------------
> For more details, visit http://www.fenics.org/hg/ufl

> _______________________________________________
> UFL-dev mailing list
> UFL-dev@xxxxxxxxxx
> http://fenics.org/mailman/listinfo/ufl-dev

Attachment: signature.asc
Description: Digital signature


References