inaccurate projection of Expressions onto high-order elements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
*Edit, changed psiexpr to something more damning, updated errors below*
Code:
=======
from dolfin import *
mesh = UnitSquareMesh(
E = FunctionSpace(mesh, 'CG', 2)
psiexpr = Expression(
psi1 = Function(
psi2 = Function(
psi = TrialFunction(E)
chi = TestFunction(E)
a = psi*chi*dx
L = psiexpr*chi*dx
psi3 = Function(E)
solve(a==L,psi3)
print errornorm(
print errornorm(
print errornorm(
print
print errornorm(
print errornorm(
print errornorm(
print
print sqrt(assemble(
print sqrt(assemble(
print sqrt(assemble(
=======
Trunk output (dolfin version 1.1.0+, notice the exponents below):
1.27953563066e-15 psi1
0.000514738137008 psi2
0.000514742502223 psi3
0.000514738137008 1 - 2 errornorm
1.46884296622e-07 2 - 3 errornorm
0.000514742502223 3 - 1 errornorm
0.000514738137058 1 - 2 manual errornorm
1.46906436962e-07 2 - 3 manual errornorm
0.000514742502283 3 - 1 manual errornorm
FEniCS dev PPA output output (dolfin version 1.1.0):
1.27953563066e-15 psi1
3.6480070749e-07 psi2
1.35381390174e-15 psi3
3.64800707454e-07 1 - 2 errornorm
3.64800707458e-07 2 - 3 errornorm
3.44355978603e-16 3 - 1 errornorm
3.64805838291e-07 1 - 2 manual errornorm
3.64936234084e-07 2 - 3 manual errornorm
9.23118756652e-09 3 - 1 manual errornorm
FEniCS stable PPA output (dolfin version 1.1.0): same as Dev
Ubuntu-packaged FEniCS output (dolfin version 1.0.0):
1.2825848101e-15 psi1
3.39883963619e-07 psi2
1.37463683699e-15 psi3
3.39883963621e-07 1 - 2 errornorm
3.39883963643e-07 2 - 3 errornorm
3.85823947936e-16 3 - 1 errornorm
3.39911250342e-07 1 - 2 manual errornorm
3.40037905381e-07 2 - 3 manual errornorm
6.49275067829e-09 3 - 1 manual errornorm
Aside:
With dolfin 1.0.0, the program runs in well under a second. With all the others, it takes several seconds to run. Running cProfile shows the culprit:
ncalls tottime percall cumtime percall filename:
4 4.839 1.210 4.839 1.210 {_fem.new_DofMap}
7 0.250 0.036 0.250 0.036 {_function.
<snip>
description: | updated |
summary: |
- possibly inaccurate FE solves for high-order elements in trunk + inaccurate projection of Expressions onto high-order elements |
Changed in dolfin: | |
status: | Confirmed → Fix Committed |
Changed in dolfin: | |
milestone: | none → 1.2.0 |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
FunctionSpaces DG-0, CG-1, DG-1 do not show this behaviour.
But CG-2, DG-2, CG-3, DG-3, etc. do.