Dear David,
Thanks for your fast answer.
I change the coordinates for saving purpose only (once the WF are solved).
So my objective is to solve the WF in a fixed 2D RectangleMesh, and then save the functions in a 3D mesh in which I apply the coordinate transforms to get moving boundaries.
I managed to do this when Ny>1, and I changed my code so that it works for Ny=1, but I would like a general command that works whatever the value of Ny.
So my question would be : how can I make the link between the x-coordinates in a RectangleMesh, and the x-coordinates in the 3D mesh obtained by extrusion of the RectangleMesh ?
For instance, for a function h_2D defined in the RectangleMesh, if I want to change the z-coordinate of the extruded mesh as z_new = z*h_2D/H0 so that the top boundary of the 3D domain for a given (xi,yi) coordinates moves as h_2D(xi,yi), how can I find the indices "..." to substitute into the following expression :
mesh_3D.coordinates.dat.data[ ..., 2]*= h_2D.dat.data[ ... ]/H0 ?
Thank you very much,
Floriane
Dear all,
I have a question concerning the mesh definition with RectangleMesh:
I define my mesh as a Rectangle mesh, with quadrilaterals as:
hor_mesh = RectangleMesh(Nx, Ny, 10.0, 1.0, quadrilateral=True).
As my functions are only (x,t) dependent, I'd like to get only one element in y, i.e. Ny=1.
However I noticed that if I set Ny=1, then the x-coordinates are swapped from 10.0 to 0.0 . Basically, I obtain
hor_mesh.coordinates.dat.data[:,0] = [10.0 10.0 9.9 9.9 ...... 0.0]
instead of
hor_mesh.coordinates.dat.data[:,0] = [0.0 0.0 0.1 0.1 ........ 10.0] (that I obtain for Ny>1)
Can someone explain me what happens there ? Is there a way to avoid that ?
And if I use the integral on ds(1), will it be at x=0 of x=10 in that case?
The reason why I want to understand this is because I apply a change of coordinate in some part of the domain (let's say for x<L<Lx) and the coordinate transform does not give the right result for Ny=1 (while it does for Ny>1).
Thanks in advance for your help,
Floriane