Hi Miklos,
thanks, unfortunately that seems to make things worse, since now it can’t even build the extruded mesh, and it crashes in line 4 below:
brokenelement,py:
1 from firedrake import *
2
3 host_mesh = UnitIcosahedralSphereMesh(0)
4 mesh = ExtrudedMesh(host_mesh,layers=4,extrusion_type='radial')
5
6 U1 = FiniteElement('BDFM',triangle,2)
7 U2 = FiniteElement('DG',triangle,1)
8 V0 = FiniteElement('CG',interval,2)
9 V1 = FiniteElement('DG',interval,1)
10
11 W2_elt = HDiv(OuterProductElement(U1,V1))+HDiv(OuterProductElement(U2,V0))
12 W2_broken_elt = BrokenElement(W2_elt)
13
14 W = FunctionSpace(mesh,W2_broken_elt)
eikemueller@Eikes-MBP $ python brokenelement.py
Traceback (most recent call last):
File "brokenelement.py", line 4, in <module>
mesh = ExtrudedMesh(host_mesh,layers=4,extrusion_type='radial')
File "<string>", line 2, in __init__
File "/Users/eikemueller/PostDocBath/EllipticSolvers/PyOP2/pyop2/profiling.py", line 197, in wrapper
return f(*args, **kwargs)
File "/Users/eikemueller/PostDocBath/EllipticSolvers/firedrake/firedrake/mesh.py", line 787, in __init__
flat_temp = FIAT.FlattenedElement(fiat_element)
AttributeError: 'module' object has no attribute ‘FlattenedElement’
With firedrake master I it crashes in line 14 with
eikemueller@Eikes-MBP $ python brokenelement.py
WARNING: Creating an EnrichedElement,
if you intended to create a MixedElement use '*' instead of '+'.
Traceback (most recent call last):
File "brokenelement.py", line 14, in <module>
W = FunctionSpace(mesh,W2_broken_elt)
File "/Users/eikemueller/PostDocBath/EllipticSolvers/PyOP2/pyop2/caching.py", line 160, in __new__
obj = make_obj()
File "/Users/eikemueller/PostDocBath/EllipticSolvers/PyOP2/pyop2/caching.py", line 141, in make_obj
obj.__init__(*args, **kwargs)
File "/Users/eikemueller/PostDocBath/EllipticSolvers/firedrake/firedrake/functionspace.py", line 540, in __init__
super(FunctionSpace, self).__init__(mesh, element, name, dim=1)
File "/Users/eikemueller/PostDocBath/EllipticSolvers/firedrake/firedrake/functionspace.py", line 52, in __init__
self.flattened_element = self.fiat_element.flattened_element()
AttributeError: Discontinuized instance has no attribute ‘flattened_element’
Once it is working, is there a way of taking a function space W2 constructed with the continuous BDFM1 elements, and transform it into a function space W2_broken with discontinuous elements? Say, for example, I have a a function which gets passed W2, can I construct W2_broken inside that function without rebuilding it from scratich? That would simplify the coding.
Thanks,
Eike
Hi Eike,
can you please try again the extruded case with FIAT and Firedrake
branches refactor-flattening?
Thanks,
Miklos
On 17/03/15 14:08, Eike Mueller wrote:
Hi Miklos,
thanks, that’s probably what I’m looking for. It
works if I just create a BDFM1 element on a 2d grid, and then
say
U1 = FiniteElement('BDFM',triangle,2)
U1_broken = BrokenElement(U1)
However, the 3d code below which builds elements on
an extruded mesh does not work. I’ve also tried to first create
BrokenElement versions of U1 and V1, and then combine them, but
that doesn’t work either.
Thanks,
Eike
It has methods for assembling a UFL form, appling
the locally assembled matrices to a vector, adding and
multiplying locally assembled matrices and calculating the
inverse (using dgels from LAPACK).
from firedrake import *
host_mesh = UnitIcosahedralSphereMesh(0)
mesh = ExtrudedMesh(host_mesh,layers=4,extrusion_type='radial')
U1 = FiniteElement('BDFM',triangle,2)
U2 = FiniteElement('DG',triangle,1)
V0 = FiniteElement('CG',interval,2)
V1 = FiniteElement('DG',interval,1)
W2_elt =
HDiv(OuterProductElement(U1,V1))+HDiv(OuterProductElement(U2,V0))
W2_broken_elt = BrokenElement(W2_elt)
W = FunctionSpace(mesh,W2_broken_elt)
WARNING: Creating an EnrichedElement,
if you intended to create a MixedElement use '*'
instead of '+'.
Traceback (most recent call last):
File "brokenelement.py", line 14, in <module>
W = FunctionSpace(mesh,W2_broken_elt)
File
"/Users/eikemueller/PostDocBath/EllipticSolvers/PyOP2/pyop2/caching.py",
line 160, in __new__
obj = make_obj()
File
"/Users/eikemueller/PostDocBath/EllipticSolvers/PyOP2/pyop2/caching.py",
line 141, in make_obj
obj.__init__(*args, **kwargs)
File
"/Users/eikemueller/PostDocBath/EllipticSolvers/firedrake/firedrake/functionspace.py",
line 540, in __init__
super(FunctionSpace, self).__init__(mesh, element, name,
dim=1)
File
"/Users/eikemueller/PostDocBath/EllipticSolvers/firedrake/firedrake/functionspace.py",
line 52, in __init__
self.flattened_element =
self.fiat_element.flattened_element()
AttributeError: Discontinuized instance has no attribute
'flattened_element'
Hi,
I'm not quite sure, but I think BrokenElement is
probably what you need.
BrokenElement keeps all the dofs and transformations and
their meaning, but re-associates all dofs with the cell
interior.
Regards,
Miklos
On 17/03/15 13:29, Eike
Mueller wrote:
Hi again,
Another slight problem is
that we don't have trace elements for
quadrilaterals or tensor product
elements at the moment. Our approach to
trace spaces is also rather hacked up,
we extract the facet basis functions
from an H(div) basis and the tabulator
returns DOFs by dotting the local basis
functions by the local normal.
we would also need a discontinuous
HDiv space, i.e. e.g. discontinuous versions of
RT0 and BDFM1. How can I get those?
Thanks,
Eike
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.ukhttps://mailman.ic.ac.uk/mailman/listinfo/firedrake