Subject: [FFC-dev] [HG FFC] A first try of fixing bug for Nedelec elements and quadrature representation.

From: [email-masked] (FFC)
Date: Tue, 23 Jun 2009 11:57:51 +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:   1563:83d241d069fa497d4833f449149b577b53d373f9
tag:         tip
user:        "Kristian Oelgaard <[email-masked]>"
date:        Tue Jun 23 11:57:38 2009 +0200
files:       ffc/compiler/codegeneration/quadrature/quadraturetransformer.py ffc/compiler/codegeneration/quadrature/quadraturetransformer2.py
description:
A first try of fixing bug for Nedelec elements and quadrature representation.

changeset:   1562:9c3306a9272a5bb96ac09a92fa6fa47896b95eaa
user:        "Kristian Oelgaard <[email-masked]>"
date:        Tue Jun 23 11:05:22 2009 +0200
files:       ffc/compiler/codegeneration/quadrature/quadraturegenerator.py test/regression/reference/Constant.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/MixedPoisson.h test/regression/reference/NavierStokes.h test/regression/reference/NeumannProblem.h test/regression/reference/Optimization.h test/regression/reference/Poisson.h test/regression/reference/PoissonDG.h test/regression/reference/PoissonSystem.h test/regression/reference/QuadratureElement.h test/regression/reference/ReactionDiffusion.h test/regression/reference/StabilisedStokes.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
description:
Use format when tabulating the coordinates of the integration points.

changeset:   1561:c5341f7db3dfccb34e254eb7925ba7e7d4a75fd4
user:        "Kristian Oelgaard <[email-masked]>"
date:        Tue Jun 23 10:28:30 2009 +0200
files:       ffc/compiler/codegeneration/quadrature/quadraturegenerator.py ffc/compiler/representation/quadrature/quadraturerepresentation.py 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/MixedPoisson.h test/regression/reference/NavierStokes.h test/regression/reference/NeumannProblem.h test/regression/reference/Optimization.h test/regression/reference/Poisson.h test/regression/reference/PoissonDG.h test/regression/reference/PoissonSystem.h test/regression/reference/QuadratureElement.h test/regression/reference/ReactionDiffusion.h test/regression/reference/StabilisedStokes.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/simple_verify_tensors/reference.pickle
description:
Tabulate the coordinates of integration points in a comment inside tabulate_tensor().

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

---

From: "Garth N. Wells" <[email-masked]>
Date: Tue, 23 Jun 2009 17:02:39 +0100

> A first try of fixing bug for Nedelec elements and quadrature representation.

Does this mean that it's fixed?

Garth

> files:       ffc/compiler/codegeneration/quadrature/quadraturegenerator.py ffc/compiler/representation/quadrature/quadraturerepresentation.py 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/MixedPoisson.h test/regression/reference/NavierStokes.h test/regression/reference/NeumannProblem.h test/regression/reference/Optimization.h test/regression/reference/Poisson.h test/regression/reference/PoissonDG.h test/regression/reference/PoissonSystem.h test/regression/reference/QuadratureElement.h test/regression/reference/ReactionDiffusion.h test/regression/reference/StabilisedStokes.h test/regression/reference/Stokes.h test/regression/reference/SubDomain.h test/regression/reference/SubDomains.h test/reg
ression/reference/TensorWeightedPoisson.h test/regression/reference/VectorLaplaceGradCurl.h test/simple_verify_tensors/reference.pickle
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev

---

From: Kristian Oelgaard <[email-masked]>
Date: Tue, 23 Jun 2009 18:12:32 +0200

Quoting "Garth N. Wells" <[email-masked]>:

> > files:
> ffc/compiler/codegeneration/quadrature/quadraturetransformer.py
> ffc/compiler/codegeneration/quadrature/quadraturetransformer2.py
> > description:

No, it means that it's more fixed than it was before. There was an obvious
copy/paste bug for coefficients, but I still see differences between tensor and
quadrature in some cases.
It does 'work' (so it did before) for the VectorLaplaceGradCurl form in the demo
directory.

The following is where I'm stuck at the moment:

[mail to Marie]
Tensor representation seems to ignore metadata i.e.,

*dx(0,metadata={"quadrature_order":1})

does nothing. On the other hand quadrature representation lets UFL compute the
order, but this order is too low for Nedelec elements (should be k+1 right?).

Also, consider the following two cases:

# Mixed (similar to VectorLaplaceGradCurl)
element = FiniteElement("N1curl", triangle, 0)

element2 = FiniteElement("Lagrange", triangle, 1)
E = element2 + element

(tau, v) = TestFunctions(E)
(sigma, u) = TrialFunctions(E)

a = inner(v, u)*dx

# Standard
v = TestFunction(element)
u = TrialFunction(element)

a = inner(v, u)*dx

If I assemble mesh(1,1) for the mixed case I get matching global tensors when
comparing tensor and quadrature.
Note that I have to use
a = inner(v, u)*dx(0,metadata={"quadrature_order":2})
for quadrature to integrate exactly.

If I assemble mesh(1,1) for the standard case I don't get matching tensors.
(This is the same thing that causes the discrepancy for the functional I guess)

Now the funny thing is that if I compare the standard case for quadrature to the
Kuu part of the mixed case I actually DO get the same numbers (as I would
expect).

To me, this indicates that quadrature is working for both cases, and tensor
representation is only working when use in a mixed setting. OR there is
something fundamentally wrong with my understanding of these elements.

Kristian

> > files:       ffc/compiler/codegeneration/quadrature/quadraturegenerator.py
> test/regression/reference/Constant.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/MixedPoisson.h
> test/regression/reference/NavierStokes.h
> test/regression/reference/NeumannProblem.h
> test/regression/reference/Optimization.h test/regression/reference/Poisson.h
> test/regression/reference/PoissonDG.h
> test/regression/reference/PoissonSystem.h
> test/regression/reference/QuadratureElement.h
> test/regression/reference/ReactionDiffusion.h
> test/regression/reference/StabilisedStokes.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
> > description:
> > files:       ffc/compiler/codegeneration/quadrature/quadraturegenerator.py
> ffc/compiler/representation/quadrature/quadraturerepresentation.py
> 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/MixedPoisson.h
> test/regression/reference/NavierStokes.h
> test/regression/reference/NeumannProblem.h
> test/regression/reference/Optimization.h test/regression/reference/Poisson.h
> test/regression/reference/PoissonDG.h
> test/regression/reference/PoissonSystem.h
> test/regression/reference/QuadratureElement.h
> test/regression/reference/ReactionDiffusion.h
> test/regression/reference/StabilisedStokes.h
> test/regression/reference/Stokes.h test/regression/reference/SubDomain.h
> test/regression/reference/SubDomains.h test/reg
> ression/reference/TensorWeightedPoisson.h
> test/regression/reference/VectorLaplaceGradCurl.h
> test/simple_verify_tensors/reference.pickle
> > description:

---

From: Marie Rognes <[email-masked]>
Date: Tue, 07 Jul 2009 01:55:13 +0200

> Does this mean that it's fixed?

Both the tensor and quadrature representation should now be reliable for 
H(div) and H(curl) elements (again).

One caveat for the general audience: Direct interpolation onto function 
spaces with interior integral degrees of freedom  (such as
higher order Raviart-Thomas, BDM and Nedelecs) is utterly unreliable (as 
before).

--
Marie

---

From: Anders Logg <[email-masked]>
Date: Mon, 6 Jul 2009 16:59:43 +0200

> higher order Raviart-Thomas, BDM and Nedelecs) is utterly unreliable (as 

Would it be possible to add a warning about this?

-- 
Anders