Subject: [FFC-dev] [HG FFC] Delete a lot of old stuff.

From: [email-masked] (FFC)
Date: Mon, 20 Apr 2009 22:44:40 +0200 (CEST)

One or more new changesets pushed to the primary ffc repository.
A short summary of the last three changesets is included below.

changeset:   1506:fbeeaf084b14549672b1f71a129e958c047a8979
tag:         tip
user:        Anders Logg <[email-masked]>
date:        Mon Apr 20 22:44:36 2009 +0200
files:       ffc/__init__.py ffc/compiler/analysis/elementdata.py ffc/compiler/analysis/formdata.py ffc/compiler/codegeneration/common/finiteelement.py ffc/compiler/codegeneration/quadrature/uflquadraturegenerator_utils.py ffc/compiler/codegeneration/tensor/tensorgenerator.py ffc/compiler/compiler.py ffc/compiler/language/README ffc/compiler/language/__init__.py ffc/compiler/language/algebra.py ffc/compiler/language/builtins.py ffc/compiler/language/index.py ffc/compiler/language/indexcall.py ffc/compiler/language/indexreordering.py ffc/compiler/language/integral.py ffc/compiler/language/operators.py ffc/compiler/language/reassignment.py ffc/compiler/language/restriction.py ffc/compiler/language/signature.py ffc/compiler/language/tokens.py ffc/compiler/representation/tensor/facetmap.py ffc/compiler/representation/tensor/factorization.py ffc/compiler/representation/tensor/geometrytensor.py ffc/compiler/representation/tensor/monomialextraction.py ffc/compiler/representation/tensor/monomialintegration.py ffc/compiler/representation/tensor/referencetensor.py ffc/compiler/representation/tensor/tensorreordering.py ffc/compiler/representation/tensor/tensorrepresentation.py ffc/compiler/representation/tensor/ufltensorrepresentation.py ffc/compiler/uflcompiler.py ffc/fem/finiteelement.py ffc/fem/mixedelement.py ffc/jit/jit.py ffc/jit/jitobject.py scripts/ffc test/unit/test.py
description:
Delete a lot of old stuff.

changeset:   1505:b6be99e11da21ba89d11651447f28815e591b115
user:        Anders Logg <[email-masked]>
date:        Mon Apr 20 21:29:22 2009 +0200
files:       ChangeLog demo/Constant.form demo/Elasticity.form demo/EnergyNorm.form demo/Equation.form demo/FacetIntegrals.form demo/FunctionOperators.form demo/Heat.form demo/Mass.form demo/MixedMixedElement.form demo/MixedPoisson.form demo/NavierStokes.form demo/NeumannProblem.form demo/Optimization.form demo/P5tet.form demo/P5tri.form demo/Poisson.form demo/PoissonDG.form demo/PoissonSystem.form demo/QuadratureElement.form demo/README demo/Stokes.form demo/SubDomain.form demo/SubDomains.form demo/TensorWeightedPoisson.form demo/VectorLaplaceGradCurl.form test/regression/reference/Constant.h test/regression/reference/Elasticity.h test/regression/reference/EnergyNorm.h test/regression/reference/Equation.h test/regression/reference/FacetIntegrals.h test/regression/reference/FunctionOperators.h test/regression/reference/Heat.h test/regression/reference/Mass.h test/regression/reference/MixedMixedElement.h test/regression/reference/MixedPoisson.h test/regression/reference/NavierStokes.h test/regression/reference/NeumannProblem.h test/regression/reference/Optimization.h test/regression/reference/P5tet.h test/regression/reference/P5tri.h test/regression/reference/Poisson.h test/regression/reference/PoissonDG.h test/regression/reference/PoissonSystem.h test/regression/reference/QuadratureElement.h test/regression/reference/Stokes.h test/regression/reference/SubDomain.h test/regression/reference/SubDomains.h test/regression/reference/TensorWeightedPoisson.h test/regression/reference/VectorLaplaceGradCurl.h test/regression/test.py test/simple_verify_tensors/reference.pickle test/simple_verify_tensors/test.py
description:
Remove .form files and update references

changeset:   1504:cc48e5d8e03a5d3c15c20085ae682379081e2740
user:        Anders Logg <[email-masked]>
date:        Mon Apr 20 19:55:45 2009 +0200
files:       scripts/ffc
description:
Remove support for old style .form files.

----------------------------------------------------------------------
For more details, visit http://www.fenics.org/hg/ffc

---

From: Anders Logg <[email-masked]>
Date: Mon, 20 Apr 2009 22:46:27 +0200

I've made a first attempt to remove the old stuff. It mostly works but
there were some problems I couldn't figure out for the quadrature
representation.

The MixedPoisson demo fails for quadrature with the following error:

  File
  "/usr/lib/python2.5/site-packages/ffc/compiler/codegeneration/quadrature/uflquadraturegenerator_utils.py", line 842, in __create_mapping_basis
    name, non_zeros, zeros, ones = self.name_map[name]
KeyError: 'FE0_C3'

Any clues what goes wrong?

-- 
Anders

On Mon, Apr 20, 2009 at 10:44:40PM +0200, FFC wrote:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev

---

From: Kristian Oelgaard <[email-masked]>
Date: Tue, 21 Apr 2009 10:24:25 +0200

> The MixedPoisson demo fails for quadrature with the following error:
"/usr/lib/python2.5/site-packages/ffc/compiler/codegeneration/quadrature/uflquadraturegenerator_utils.py",
> line 842, in __create_mapping_basis

Yes, after some digging I discovered that it's because someone has changed

if ffc_element.value_mapping(component) == Mapping.AFFINE:
to
if ffc_element.space_mapping(component) == Mapping.AFFINE:

in many places.

However, value_mapping produces the following error now:

  File "/home/oelgaard/fenics/clone/ffc/ffc/fem/mixedelement.py", line 81, in
value_mapping
    i = Index(component)
NameError: global name 'Index' is not defined

This is probably because Index has been removed from FFC? So we should use
space_mapping?

The problem is that for:

BDM = FiniteElement("Brezzi-Douglas-Marini", triangle, q)
DG  = FiniteElement("Discontinuous Lagrange", triangle, q - 1)

mixed_element = BDM + DG

(tau, w) = TestFunctions(mixed_element)
(sigma, u) = TrialFunctions(mixed_element)

a = w*u*dx

The FFC element for the mixed basis function is:
Mixed finite element: [FiniteElement('Brezzi-Douglas-Marini', 'triangle', 1),
FiniteElement('Discontinuous Lagrange', 'triangle', 0)]

But when trying to get the mapping for component 2 (the DG element)

ffc_element.space_mapping(2) =  1

which is not equal to Mapping.AFFINE = 0

Is there a simple way of fixing this using space_mapping, or should we fix the
value_mapping?

Kristian

> > files:       ffc/__init__.py ffc/compiler/analysis/elementdata.py
> ffc/compiler/analysis/formdata.py
> ffc/compiler/codegeneration/common/finiteelement.py
> ffc/compiler/codegeneration/quadrature/uflquadraturegenerator_utils.py
> ffc/compiler/codegeneration/tensor/tensorgenerator.py
> ffc/compiler/compiler.py ffc/compiler/language/README
> ffc/compiler/language/__init__.py ffc/compiler/language/algebra.py
> ffc/compiler/language/builtins.py ffc/compiler/language/index.py
> ffc/compiler/language/indexcall.py ffc/compiler/language/indexreordering.py
> ffc/compiler/language/integral.py ffc/compiler/language/operators.py
> ffc/compiler/language/reassignment.py ffc/compiler/language/restriction.py
> ffc/compiler/language/signature.py ffc/compiler/language/tokens.py
> ffc/compiler/representation/tensor/facetmap.py
> ffc/compiler/representation/tensor/factorization.py
> ffc/compiler/representation/tensor/geometrytensor.py
> ffc/compiler/representation/tensor/monomialextraction.py
> ffc/compiler/representation/tensor/monomialintegration.py
> ffc/compiler/representation/tensor/referencetensor.py
> ffc/compiler/representation/tensor/tensorreordering.py
> ffc/compiler/representation/tensor/tensorrepresentation.py
> ffc/compiler/representation/tensor/ufltensorrepresentation.py
> ffc/compiler/uflcompiler.py ffc/fem/finiteelement.py ffc/fem/mixedelement.py
> ffc/jit/jit.py ffc/jit/jitobject.py scripts/ffc test/unit/test.py
> > description:
> > files:       ChangeLog demo/Constant.form demo/Elasticity.form
> demo/EnergyNorm.form demo/Equation.form demo/FacetIntegrals.form
> demo/FunctionOperators.form demo/Heat.form demo/Mass.form
> demo/MixedMixedElement.form demo/MixedPoisson.form demo/NavierStokes.form
> demo/NeumannProblem.form demo/Optimization.form demo/P5tet.form
> demo/P5tri.form demo/Poisson.form demo/PoissonDG.form demo/PoissonSystem.form
> demo/QuadratureElement.form demo/README demo/Stokes.form demo/SubDomain.form
> demo/SubDomains.form demo/TensorWeightedPoisson.form
> demo/VectorLaplaceGradCurl.form test/regression/reference/Constant.h
> test/regression/reference/Elasticity.h test/regression/reference/EnergyNorm.h
> test/regression/reference/Equation.h
> test/regression/reference/FacetIntegrals.h
> test/regression/reference/FunctionOperators.h
> test/regression/reference/Heat.h test/regression/reference/Mass.h
> test/regression/reference/MixedMixedElement.h
> test/regression/reference/MixedPoisson.h
> test/regression/reference/NavierStokes.h
> test/regression/reference/NeumannProblem.h
> test/regression/reference/Optimization.h test/regression/reference/P5tet.h
> test/regression/reference/P5tri.h test/regression/reference/Poisson.h
> test/regression/reference/PoissonDG.h
> test/regression/reference/PoissonSystem.h
> test/regression/reference/QuadratureElement.h
> test/regression/reference/Stokes.h test/regression/reference/SubDomain.h
> test/regression/reference/SubDomains.h
> test/regression/reference/TensorWeightedPoisson.h
> test/regression/reference/VectorLaplaceGradCurl.h test/regression/test.py
> test/simple_verify_tensors/reference.pickle
> test/simple_verify_tensors/test.py
> > description:

---

From: Anders Logg <[email-masked]>
Date: Tue, 21 Apr 2009 10:40:17 +0200

> if ffc_element.space_mapping(component) == Mapping.AFFINE:

Yes, that was me.

> This is probably because Index has been removed from FFC? So we should use

Yes, value_mapping is replaced by space_mapping since value_mapping
depends on the old Index class.

I made the replacement the code above and it seemed to work for most
examples with quadrature. The tensor representation has used
space_mapping for a while.

> Is there a simple way of fixing this using space_mapping, or should we fix the

I forgot how I handled this for the tensor representation, but when I
look now I haven't used space_mapping at all. One should instead call

  def component_element(self, component):
      "Return sub element and offset for given component."

For the above example with component = 2 this should return a tuple

  (sub_element, offset)

where sub_element is the DG element and offset is 2.

To get the mapping you can then call sub_element.mapping().

Will this work?

-- 
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Tue, 21 Apr 2009 10:43:18 +0200

> Is there a simple way of fixing this using space_mapping, or should we fix

I saw what appears to be a new function in mixedelement.py, component_element(),
which I think will do the trick.

Kristian

---

From: Anders Logg <[email-masked]>
Date: Tue, 21 Apr 2009 10:53:19 +0200

> which I think will do the trick.

Yes! :-)

-- 
Anders