Oh okay I did not realize there was a TensorFunctionSpace(). Though if this is the way to go:
eps = 0.001D = TensorFunctionSpace(mesh,"CG",1)D.interpolate(Expression(("x[1]*x[1]+eps*x[0]*x[0]","-(1-eps)*x[0]*x[1]","-(1-eps)*x[0]*x[1]",""x[0]*x[0]+eps*x[1]*x[1]",eps=eps)))
I get an error saying TensorFunctionSpace object has no attribute interpolate
On Tue, Sep 22, 2015 at 12:55 PM, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
5) For an anisotropic diffusion problem, I would like to use this diffusivity tensor:
D(x) = [y^2+eps*x^2, -(1-eps)*x*y;-(1-eps)*x*y, eps*y^2+x^2]
where eps is a user-defined scalar, and x and y correspond to the x and y coordinates of the cell. How would I express that?
How does this behave within a cell? Is it constant on each cell? Should it vary linearly/quadratically/...?
Presumably just make a TensorFunctionSpace of the right type, and interpolate an Expression in the usual way. I *think* you need an Expression of length 4, as if the tensor was flattened.
Thanks,Justin
On Tue, Sep 22, 2015 at 12:18 PM, Andrew McRae <A.T.T.McRae@bath.ac.uk> wrote:
_______________________________________________4) Do you guys support Hexahedron elements? When I look through the documentation for UnitCubeMesh and BoxMesh, I see no option for non-tetrahedron elements.
We support semi-structured hexahedral meshes, though not *fully* unstructured. One has to go via the ExtrudedMesh functionality to get these.
For example, to quote Henrik in a different mailing list thread,
meshbase = RectangleMesh(Nx, Ny, Lx, Ly, quadrilateral=True)
mesh = ExtrudedMesh(meshbase, Nz, Delta_z)
Or you can supply your own base quadrilateral mesh:
m = Mesh("quadmesh.msh")
mesh = ExtrudedMesh(m, ...)
If your cells aren't perfect cuboids then some approximations are made in the quadrature calculations; if this seems to be hurting you badly then I can give further instructions.
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