Re: [firedrake] More questions
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, ...)
For element families supported, see http://femtable.org/ to start with.
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
Oh okay I did not realize there was a TensorFunctionSpace(). Though if this is the way to go: eps = 0.001 D = 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, ...)
For element families supported, see http://femtable.org/ to start with.
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
On 22 Sep 2015, at 20:07, Justin Chang <jychang48@gmail.com> wrote:
Oh okay I did not realize there was a TensorFunctionSpace(). Though if this is the way to go:
eps = 0.001 D = 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
You'll need to build a Function on D and interpolate onto that. diffusivity = Function(D) diffusivity.interpolate(...) The other thing you can do is: eps = Constant(val) coords = mesh.coordinates x = coords[0] y = coords[1] D = as_tensor([[y**2 + eps*x**2, -(1-eps)*x*y], -(1-eps)*x*y, eps*y**2 + x**2]]) Now you can use D in your variation all form as a 2x2 tensor. Note that this may blow up the estimated quadratic equation degree a bit too much as opposed to Andrew's solution. Lawrence
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, ...)
For element families supported, see http://femtable.org/ to start with.
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
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
On 22 Sep 2015, at 20:19, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
Note that this may blow up the estimated quadratic
Quadrature, not quadratic. Damn autocorrect. Lawrence
equation degree a bit too much as opposed to Andrew's solution.
Final question (for now): 6) I am looking through the upwind_advection.py example and was wondering if there are papers, books, and/or lecture notes that outline the approach/mathematics exactly. Thanks, Justin On Tue, Sep 22, 2015 at 1:20 PM, Lawrence Mitchell < lawrence.mitchell@imperial.ac.uk> wrote:
On 22 Sep 2015, at 20:19, Lawrence Mitchell < lawrence.mitchell@imperial.ac.uk> wrote:
Note that this may blow up the estimated quadratic
Quadrature, not quadratic. Damn autocorrect.
Lawrence
equation degree a bit too much as opposed to Andrew's solution.
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 23/09/15 05:43, Justin Chang wrote:
Final question (for now):
6) I am looking through the upwind_advection.py example and was wondering if there are papers, books, and/or lecture notes that outline the approach/mathematics exactly.
At lowest order, you can consider DG schemes to just look like finite volume (in some senses). Randy LeVeque's book "Finite Volume Methods for Hyperbolic Problems" is the classic monograph in this area. Bernado Cockburn's 2003 paper is a reasonably brief overview of DG schemes. @article {Cockburn:2003, author = {Cockburn, B.}, title = {{Discontinuous Galerkin methods}}, journal = {Zeitschrift f\"{u}r Angewandte Mathematik und Mechanik}, volume = 83, number = 11, doi = {10.1002/zamm.200310088}, pages = {731--754}, year = 2003, } Jan Hesthaven and Tim Warburton's book "Nodal discontinuous galerkin methods: algorithms, analysis and applications" is quite well regarded I think, but I have not read it myself. Colin and/or Andrew may have other suggestions? Cheers, Lawrence -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWAmmQAAoJECOc1kQ8PEYvSYYH/23mfijl21FkIOy8UxFHIIjv 3Cleps0r8DMkfSemPYs7Uk3IxMysdB5+rUPuK/OUWFiou3PkDRbHjfZiMn1/tTpN 1teUb6Y0ZtwRJeJXLs5rfHfw00OxpHCRPjIMz79ofAijbAHIa8g172K7xEUKv/NO kK0jxSAy8YrDvXqEByjx+irk+mk/I+hrRj0XedntbYwz5OvJqCPJMngQ5CU5ZhMO 0YT0zx8gA4PpO4/K6qIiJA1FLwXltJ67Botg88hXCD43xwa+MWQTg1J8YRMontNl VAY5CGGX24xOIdRXChRup5srQy1eYmo9WtbpJjDPnlXVasetT3G+xn+BZT8JrU0= =fwrz -----END PGP SIGNATURE-----
Yeah I have been doing some literature searching and figured that what was implemented was one way of implementing DG. I suppose the only real unanswered questions I have now are the first three from my original mail :)
On Sep 23, 2015, at 2:57 AM, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 23/09/15 05:43, Justin Chang wrote:
Final question (for now):
6) I am looking through the upwind_advection.py example and was wondering if there are papers, books, and/or lecture notes that outline the approach/mathematics exactly.
At lowest order, you can consider DG schemes to just look like finite volume (in some senses). Randy LeVeque's book "Finite Volume Methods for Hyperbolic Problems" is the classic monograph in this area.
Bernado Cockburn's 2003 paper is a reasonably brief overview of DG schemes.
@article {Cockburn:2003, author = {Cockburn, B.}, title = {{Discontinuous Galerkin methods}}, journal = {Zeitschrift f\"{u}r Angewandte Mathematik und Mechanik}, volume = 83, number = 11, doi = {10.1002/zamm.200310088}, pages = {731--754}, year = 2003, }
Jan Hesthaven and Tim Warburton's book "Nodal discontinuous galerkin methods: algorithms, analysis and applications" is quite well regarded I think, but I have not read it myself.
Colin and/or Andrew may have other suggestions?
Cheers,
Lawrence -----BEGIN PGP SIGNATURE----- Version: GnuPG v1
iQEcBAEBAgAGBQJWAmmQAAoJECOc1kQ8PEYvSYYH/23mfijl21FkIOy8UxFHIIjv 3Cleps0r8DMkfSemPYs7Uk3IxMysdB5+rUPuK/OUWFiou3PkDRbHjfZiMn1/tTpN 1teUb6Y0ZtwRJeJXLs5rfHfw00OxpHCRPjIMz79ofAijbAHIa8g172K7xEUKv/NO kK0jxSAy8YrDvXqEByjx+irk+mk/I+hrRj0XedntbYwz5OvJqCPJMngQ5CU5ZhMO 0YT0zx8gA4PpO4/K6qIiJA1FLwXltJ67Botg88hXCD43xwa+MWQTg1J8YRMontNl VAY5CGGX24xOIdRXChRup5srQy1eYmo9WtbpJjDPnlXVasetT3G+xn+BZT8JrU0= =fwrz -----END PGP SIGNATURE-----
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
participants (3)
- 
                
                Andrew McRae
- 
                
                Justin Chang
- 
                
                Lawrence Mitchell