-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XZInterpolation rename, and passing Options to XZInterpolation objects #1896
Conversation
ParallelTransforms now get options from a "paralleltransform" subsection of the mesh options, so by default [mesh:paralleltransform], when they are created by Coordinates. For FCITransform, this replaces the [fci] section.
These were used by the InterpolationFactory before the change to use the generic Factory.
In preparation for introducing other types of interpolation class, rename to make clear that XZInterpolation, and its various implementations, are specifically for 2d interpolations in the x-z plane.
Also rename: - src/mesh/interpolation.cxx to src/mesh/interpolation_xz.cxx. - src/mesh/interpolation/bilinear.cxx to src/mesh/interpolation/bilinear_xz.cxx - src/mesh/interpolation/hermite_spline.cxx to src/mesh/interpolation/hermite_spline.cxx - src/mesh/interpolation/lagrange4pt.cxx to src/mesh/interpolation/lagrange4pt.cxx - src/mesh/interpolation/monotonic_hermite_spline.cxx to src/mesh/interpolation/monotonic_hermite_spline.cxx
Since options for setting parallel transform were moved from the mesh:paralleltransform option to mesh:paralleltransform:type, update inputfiles and places where that option is read in example code.
Allows implementations to use passed-in options if needed. Rename interpolation options sections from "interpolation" to "xzinterpolation".
Convenience overload for the generic Factory that provides a method to create an object while getting the type from Options*. This is useful when creating objects inside another class which wants to pass a subsection from its own options.
I am not sure we should make it more complicated then needed. Are you intending to introduce other interpolation schemes?
Could you provide a script to fix input files automatically? |
Yes, there's a
@ZedThree suggested on Slack that we do so https://bout-project.slack.com/archives/CJYH9Q70X/p1579779782011800. It should be possible, but I'm not planning to write one due to lack of time. I think a good start would be to make an input file parser that preserves structure and comments when it writes out again (which the |
If that was done, we could use something like this
[Note: to run the above example needs a method adding to
and with the current |
LGTM. I'll add updater scripts next week |
Retain previous __str__ as `as_tree`
__delitem__, pop and rename
More in-line with BOUT++ style
Simplifies some logic in BoutOptions
Currently just "canonicalises" input files and adds "bout_version" option
Turns out Updating command line options in scripts might be trickier to do both automatically and accurately. Also, I think I missed why adding |
That does seem to be true. I suspect that I just thought that given we have an |
I think that would be better. I found it a bit confusing, as I thought I was missing something. |
…-comments Add v5 upgrader scripts for XZInterpolation
fci:y_periodic -> mesh:paralleltransform:y_periodic interpolation:type -> xzinterpolation:type
Is not currently used, so clearer to not have it at all.
optionsOrDefaultSection is already called on the Options* pointer by getType.
The option names were updated in #1896.
Rename
Interpolation
toXZInterpolation
as it only supports a specific type of interpolation, and we might introduce other types in future.Update the
XZInterpolation
constructor so it accepts anOptions* opt
argument, so the options can be used by the implementations.Structure the sections for the options controlling
ParallelTransform
objects andXZInterpolation
objects more sensibly. Previously: allInterpolation
objects used the[interpolation]
section;FCITransform
objects used an[fci]
section; and the type of parallel transform was set bymesh:paralleltransform
. Now theParallelTransform
s are created using aparalleltransform
subsection of the mesh options ([mesh:paralleltransform]
) by default, with the type set by e.g.The interpolations used by FCI take their type (and any other options that might be added in future) from a subsection of the
paralleltransform
section, e.g.Introduces another convenience overload for the generic
Factory
,Factory::create(Options* options, Args&&... args)
, that makes using factories inside another class neater, when following the pattern: calling class gets passedOptions
section in its constructor; calling class passes relevant subsection to member objects (and the subsection should determine the particular type of a generic member object).Breaking changes:
Interpolation
class is renamed toXZInterpolation
- should not affect user codeXZHermiteSpline
, etc.XZInterpolation
declaration moved frominclude/interpolation.hxx
toinclude/interpolation_xz.hxx
- should not affect user code#include "interpolation.hxx" in user code are probably for
interp_to(), which is not affected by this PR, and not for
XZInterpolation`type
entry of[mesh:paralleltransform]
section, instead ofparalleltransform
entry of[mesh]
section[mesh:paralleltransform]
instead of[fci]
fci:z_periodic
, which is nowmesh:paralleltransform:z_periodic
XZInterpolation
options is[xzinterpolation]
instead of[interpolation]
ParallelTransform
uses options from a subsection of[mesh:paralleltransform]
, for example the FCI interpolation options are set in[mesh:paralleltransform:xzinterpolation]