[Users] Output file for one specific grid point

Ian Hinder ian.hinder at manchester.ac.uk
Thu Oct 17 06:46:14 CDT 2019



On 15 Oct 2019, at 22:05, Haas, Roland <rhaas at illinois.edu<mailto:rhaas at illinois.edu>> wrote:

Hello Severin,

However if I want to choose a point inside the spherical part
(outside of the cartesian grid) I can not gather any data.

I assume that the output thorn is only aware of the cartesian
coordinates? Do you (or anyone else) know if there is a way to bypass
this issue?
The output thorn is CarpetIOASCII, though I am not familiar enough with
it to know exactly how it finds out which point to output. It may well
not be aware of Llama (it would then use the "local" coordinates
instead of the "global", Cartesian ones).

You could write some C code to use Cactus's interpolator to get
interpolate the data. If the coordinate given is the location of an
actual grid point then there is (effectively) no interpolation. For an
example on how to use it, please see the Cactus docs:

https://www.einsteintoolkit.org/referencemanual/ReferenceManualch2.html#x4-110000A2

You could (ab)use CactusNumerical's InterpToArray thorn which lets you
do the same without writing code. For an example use, please see its
tests though for your use you will want to use the "scalar_vars" etc
parameters instead of "array1d_vars".

Hi,

You can use CarpetIOASCII and CarpetIOHDF5 to do what you want, more or less.

Each of the 6 angular patches will be output in separate files.  Each one has a mapping x,y,z->rho,sigma,r, where rho and sigma are two of the angular coordinates (different for each patch), and r is *always* the radial coordinate.  So, if you want to output a line in the radial direction, you need to use

CarpetIOASCII::out1d_vars = "myvar"
CarpetIOASCII::out1d_z = yes

I believe this is enough.  You will get the angular coordinates (0,0) for each patch, corresponding to the +x, -x, +y, -y and +z, -z axes, and the "z" coordinate in the 1D output file will be the radial direction.  This *might* depend on the value of n_angular; the angular coordinates chosen will come from out1D_zline_x and out1D_zline_y, which default to 0.  If the coordinates are such that 0 is between two grid points, then you might not get any data.  This will depend on whether n_angular is even or odd, but I don't remember the details from memory.  It's also possible that CarpetIOASCII will give you the nearest point in that case; I'm not sure.

You can do the same trick for output at a constant radius, either 1D or 2D, BUT you have to watch out for the fact that the radius will be chosen as, eg. for 2D output, the value of CarpetIOASCII::out2D_xyplane_z, which defaults to 0, where there is no data since the angular patches start at a finite radius r > 0.  So if you want a 2D surface at r = 100, you need to set CarpetIOASCII::out2D_xyplane_z = 100.

I believe the same works with HDF5.  It should also work for a single point; 0d output; see the parameters in CarpetIOASCII/param.ccl.  Just remember that the radial coordinate will be called "z"!

--
Ian Hinder
Research Software Engineer
University of Manchester, UK

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20191017/7c94e8e6/attachment.html 


More information about the Users mailing list