Perturbed extruded meshes
Dear firdrakers, how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2) Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid? Thanks a lot, Eike
Hi Eike, It's best to edit the coordinate field of the extruded mesh, particularly as you probably want to use a linear transform in r so that you don't have mountains at the top of the atmosphere too. Jemma has done this, she can fill you in with the details. all the best --Colin ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:01 To: firedrake Subject: [firedrake] Perturbed extruded meshes Dear firdrakers, how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2) Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid? Thanks a lot, Eike _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Hi Colin, oh, that's even better! The other test I want to do is do the outer iteration over the velocity, pressure, buoyancy system, i.e. not eliminating the buoyancy pointwise in the linear solve, and switch on orography. I know that it probably does not really make sense to do this in the linear solve (which has not to be done to high accuracy either), and you really want to use the non-linear Newton solve with pointwise buoyancy elimination in the linear solve. But looking at the linear solve could at least give us some ideas, in particular since John seems to be saying that in their paper the model does not work if the orography terms are not treated correctly in the linear solve. Or have you already played around with this and the PETSc solver? Eike On 27/02/15 09:05, Cotter, Colin J wrote:
Hi Eike, It's best to edit the coordinate field of the extruded mesh, particularly as you probably want to use a linear transform in r so that you don't have mountains at the top of the atmosphere too.
Jemma has done this, she can fill you in with the details.
all the best --Colin ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:01 To: firedrake Subject: [firedrake] Perturbed extruded meshes
Dear firdrakers,
how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like
r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2)
Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid?
Thanks a lot,
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
Hi Eike, We actually did try that within the context of our vertical slice code, so you can ask Jemma to show you what we did there too. (sorry for brief replies, I'm drowning in admissions admin at the moment!) cheers --cjc ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:13 To: firedrake Subject: Re: [firedrake] Perturbed extruded meshes Hi Colin, oh, that's even better! The other test I want to do is do the outer iteration over the velocity, pressure, buoyancy system, i.e. not eliminating the buoyancy pointwise in the linear solve, and switch on orography. I know that it probably does not really make sense to do this in the linear solve (which has not to be done to high accuracy either), and you really want to use the non-linear Newton solve with pointwise buoyancy elimination in the linear solve. But looking at the linear solve could at least give us some ideas, in particular since John seems to be saying that in their paper the model does not work if the orography terms are not treated correctly in the linear solve. Or have you already played around with this and the PETSc solver? Eike On 27/02/15 09:05, Cotter, Colin J wrote:
Hi Eike, It's best to edit the coordinate field of the extruded mesh, particularly as you probably want to use a linear transform in r so that you don't have mountains at the top of the atmosphere too.
Jemma has done this, she can fill you in with the details.
all the best --Colin ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:01 To: firedrake Subject: [firedrake] Perturbed extruded meshes
Dear firdrakers,
how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like
r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2)
Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid?
Thanks a lot,
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
Hi Eike, Take a look at line 304 of this: https://bitbucket.org/colinjcotter/slicemodels/src/b6d5eac9dbf28cbcf24aef5be... An example of how to use this is in examples/nonlinear_mountain.py I should be around in the chat for a couple of hours if you want to catch me… Jemma ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:01 To: firedrake Subject: [firedrake] Perturbed extruded meshes Dear firdrakers, how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2) Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid? Thanks a lot, Eike _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Hi Jemma, I think I figured it out now. Since the function I want to use is more complicated, I actually wrote a direct par_loop which modifies mesh.coordinates in place, I guess that’s also ok. When I plot the mesh it looks like what I want. Thanks, Eike -- Dr Eike Hermann Mueller Research Associate (PostDoc) Department of Mathematical Sciences University of Bath Bath BA2 7AY, United Kingdom +44 1225 38 5803 e.mueller@bath.ac.uk http://people.bath.ac.uk/em459/
On 27 Feb 2015, at 11:51, Shipton, Jemma <j.shipton@imperial.ac.uk> wrote:
Hi Eike,
Take a look at line 304 of this:
https://bitbucket.org/colinjcotter/slicemodels/src/b6d5eac9dbf28cbcf24aef5be...
An example of how to use this is in examples/nonlinear_mountain.py
I should be around in the chat for a couple of hours if you want to catch me…
Jemma ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:01 To: firedrake Subject: [firedrake] Perturbed extruded meshes
Dear firdrakers,
how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like
r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2)
Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid?
Thanks a lot,
Eike
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake <winmail.dat>_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Hi Eike, Yes, that should work too - we do something like that for periodic coordinates. Glad it's working for you! Jemma ________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [e.mueller@bath.ac.uk] Sent: 02 March 2015 10:00 To: firedrake Subject: Re: [firedrake] Perturbed extruded meshes Hi Jemma, I think I figured it out now. Since the function I want to use is more complicated, I actually wrote a direct par_loop which modifies mesh.coordinates in place, I guess that’s also ok. When I plot the mesh it looks like what I want. Thanks, Eike -- Dr Eike Hermann Mueller Research Associate (PostDoc) Department of Mathematical Sciences University of Bath Bath BA2 7AY, United Kingdom +44 1225 38 5803 e.mueller@bath.ac.uk<mailto:e.mueller@bath.ac.uk> http://people.bath.ac.uk/em459/ On 27 Feb 2015, at 11:51, Shipton, Jemma <j.shipton@imperial.ac.uk<mailto:j.shipton@imperial.ac.uk>> wrote: Hi Eike, Take a look at line 304 of this: https://bitbucket.org/colinjcotter/slicemodels/src/b6d5eac9dbf28cbcf24aef5be... An example of how to use this is in examples/nonlinear_mountain.py I should be around in the chat for a couple of hours if you want to catch me… Jemma ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:01 To: firedrake Subject: [firedrake] Perturbed extruded meshes Dear firdrakers, how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2) Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid? Thanks a lot, Eike _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake <winmail.dat>_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Dear all, is there a 2d square mesh with periodic boundary conditions or is this only supported in 1d? I realised that to get steep orography in my setup I would either have to work at very high resolution or shrink the size of the earth. So I thought instead it would be easier if I work in a 2+1 dimensional box which represents part of the atmosphere, but I do not want to have to worry about boundary conditions in the horizontal condition. Thanks, Eike -- Dr Eike Hermann Mueller Research Associate (PostDoc) Department of Mathematical Sciences University of Bath Bath BA2 7AY, United Kingdom +44 1225 38 5803 e.mueller@bath.ac.uk http://people.bath.ac.uk/em459/
On 2 Mar 2015, at 10:00, Eike Mueller <E.Mueller@bath.ac.uk> wrote:
Hi Jemma,
I think I figured it out now. Since the function I want to use is more complicated, I actually wrote a direct par_loop which modifies mesh.coordinates in place, I guess that’s also ok. When I plot the mesh it looks like what I want.
Thanks,
Eike --
Dr Eike Hermann Mueller Research Associate (PostDoc)
Department of Mathematical Sciences University of Bath Bath BA2 7AY, United Kingdom
+44 1225 38 5803 e.mueller@bath.ac.uk <mailto:e.mueller@bath.ac.uk> http://people.bath.ac.uk/em459/ <http://people.bath.ac.uk/em459/>
On 27 Feb 2015, at 11:51, Shipton, Jemma <j.shipton@imperial.ac.uk <mailto:j.shipton@imperial.ac.uk>> wrote:
Hi Eike,
Take a look at line 304 of this:
https://bitbucket.org/colinjcotter/slicemodels/src/b6d5eac9dbf28cbcf24aef5be... <https://bitbucket.org/colinjcotter/slicemodels/src/b6d5eac9dbf28cbcf24aef5be60e2c5756d0b677/slicemodels.py?at=master>
An example of how to use this is in examples/nonlinear_mountain.py
I should be around in the chat for a couple of hours if you want to catch me…
Jemma ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Eike Mueller [E.Mueller@bath.ac.uk] Sent: 27 February 2015 09:01 To: firedrake Subject: [firedrake] Perturbed extruded meshes
Dear firdrakers,
how can I perturb an extruded mesh? I want to add 'mountains' (i.e. bumps) to my spherical icosahedral mesh, so I want to change the radius according to something like
r = r(theta) = R_earth+H*exp(-0.5*theta^2/D^2)
Can I do this by moving around the underlying 2d host grid and then extruding that? How can I perturb the 2d grid?
Thanks a lot,
Eike
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake <https://mailman.ic.ac.uk/mailman/listinfo/firedrake> <winmail.dat>_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk <mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake <https://mailman.ic.ac.uk/mailman/listinfo/firedrake>
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk <mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake <https://mailman.ic.ac.uk/mailman/listinfo/firedrake>
On 2 Mar 2015, at 12:12, Eike Mueller <e.mueller@bath.ac.uk> wrote:
Dear all,
is there a 2d square mesh with periodic boundary conditions or is this only supported in 1d? I realised that to get steep orography in my setup I would either have to work at very high resolution or shrink the size of the earth.
So I thought instead it would be easier if I work in a 2+1 dimensional box which represents part of the atmosphere, but I do not want to have to worry about boundary conditions in the horizontal condition.
This is currently only supported in 1D sorry. One way to do this is the following: . Make a torus mesh (now you have a periodic mesh with the right topology but the wrong coordinates) . Build a VectorFunctionSpace(m, 'DG', 1, dim=2) on it Write a par_loop that transforms the torus coordinates into the flat coords of the square you want and replace the mesh's coordinates with these new coords. c.f. for example https://bitbucket.org/colinjcotter/slicemodels/src/b6d5eac9dbf28cbcf24aef5be... for a 1D example. Lawrence
Hi Lawrence, thanks, I will have a look at that. I think at the moment I stick to shrinking the radius of the earth to get a decent horizontal resolution for my steep mountains. Eike Sent from my iPod
On 2 Mar 2015, at 12:33, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
On 2 Mar 2015, at 12:12, Eike Mueller <e.mueller@bath.ac.uk> wrote:
Dear all,
is there a 2d square mesh with periodic boundary conditions or is this only supported in 1d? I realised that to get steep orography in my setup I would either have to work at very high resolution or shrink the size of the earth.
So I thought instead it would be easier if I work in a 2+1 dimensional box which represents part of the atmosphere, but I do not want to have to worry about boundary conditions in the horizontal condition.
This is currently only supported in 1D sorry.
One way to do this is the following:
. Make a torus mesh (now you have a periodic mesh with the right topology but the wrong coordinates)
. Build a VectorFunctionSpace(m, 'DG', 1, dim=2) on it
Write a par_loop that transforms the torus coordinates into the flat coords of the square you want and replace the mesh's coordinates with these new coords.
c.f. for example https://bitbucket.org/colinjcotter/slicemodels/src/b6d5eac9dbf28cbcf24aef5be... for a 1D example.
Lawrence _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
participants (5)
- 
                
                Cotter, Colin J
- 
                
                Eike Mueller
- 
                
                Eike Mueller
- 
                
                Lawrence Mitchell
- 
                
                Shipton, Jemma