[Carpet] Buffer zones in old and new Carpet

Ian Hinder hinder at Gravity.PSU.Edu
Tue Mar 4 00:43:14 CET 2008


Hi,

I would like for the moment for my regridding thorn to be compatible
with both carpet-stable-3 and carpet development.  This thorn needs to
add buffer points to the grid structure it generates.  In development, I
think the best way to do this is to copy CarpetRegrid2 and use the
dd.buffer_width Carpet public variable.  However, this variable does not
exist in carpet-stable-3, as it was renamed.  What I would like to do is
something along the lines of

#ifdef dd.buffer_width
<use dd.buffer_width>
#else
<use dd.inner_buffer_width>
#endif

I don't think the above is a valid use of the pre-processor though.
Does anyone know how I can achieve what I want to?  Some ugly hacks are:

* Add a preprocessor macro HAVE_BUFFER_WIDTH or CARPET4 to the
development version, so that I can test it and do something accordingly

* Return the inner_buffer_width variable to the development version,
since it seems that unless you are using CarpetRegrid2, which provides a
thin abstraction over the concept, all buffer zones are inner buffer
zones anyway,

I'd prefer a solution that didn't involve adding legacy cruft to Carpet,
but I can't think of one.

-- 
Ian Hinder
hinder at gravity.psu.edu
http://www.gravity.psu.edu/~hinder


More information about the developers mailing list