BOUT++ v4.3.0
4.3.0 is a big feature release:
Field
s are now "tagged" with their "y-direction": that is, whether
they are in field-aligned space or not. This allows us to perform
more internal checking, for example, that only field-aligned
Field3D
s are passed tofromFieldAligned
and that calculations
are done in the correct y-direction space. Users may need to call
f.setDirectionY(YDirectionType::Aligned)
for aField3D f
to set
the direction tag- Add
toFieldAligned
andfromFieldAligned
free functions bout::utils::is_Field
and variants provide simpler methods of
checking that input types areField
s in templated code- Many, many more functions and operators support staggering. We're
now also much more consistent about checking function arguments have
compatible staggered locations - New
emptyFrom(f)
andzeroFrom(f)
helper functions for creating
Field
s either allocated but not initialised, or allocated and
initialised to0.0
respectively, while ensuring the result is
compatible with theField
f
(same mesh, same staggering, etc.) - Expressions used in input files now have support for unicode,
escaping characters and implicit multiplication. See
#1333 for more
details. - Internationalisation support, including translations for French,
German, Spanish, and Simplified and Traditional Chinese - Keyword arguments for boundaries in input files, e.g.
dirichlet(1, width=3)
- File-level attributes in output files
- Write more things to output files, including processor indices and
parallel transform information - Complete overhaul of the derivative operators:
- derivative operators can now use native vectorisation where
possible, as well parallelisation via OpenMP. - users can register their own derivative operators and choose
them at runtime - more consistent handling of staggering in all directions and for
allField
types - better handling of field-aligned
Field
s
- derivative operators can now use native vectorisation where
- Various bug fixes for parallel derivative inversions
- Introduced
zstart
andzend
, in preparation for introducing
guard cells in the z-direction Options
has several new features:- it can now store
Field
s. This uses an implementation
of C++17'sstd::variant
backported to work with
C++11. Unfortunately, there are some compilers which have
problems (see installation issues for help) Options::isSection
gained the ability to check whether an
input argument is a subsection or not- now records the type of the option when used
- gained the
.doc
method which allows documentation to be added
as an attribute, which can be recorded in theBOUT.settings
file post-run
- it can now store
- FFTW is now an optional dependency
- A non-Fourier implementation of
Delp2
- A generic linear operator inversion class (see
#1439) Array
,Matrix
andTensor
all gained areallocate
method. This allows dynamic resizing of those objects, but
invalidates the existing dataFieldFactory
now has separate parsing and generating stages, so
functions can be parsed once and evaluated multiple times (e.g. for
time-dependent functions)- Enable communications for simulations with no core, only divertor
legs Coordinates
on staggered grids can now be read from grid files- New
FDDX_U2
implementation - Support for SUNDIALS versions 2.6 to 4.1.0
BoutInitialise
has been pulled apart into separate utility
functions under thebout::experimental
namespace so that they can
be used individuallyLaplaceCyclic
now acceptsC1
andC2
coefficients which may be
differentLaplaceNaulin
may use the DC parts ofC
for faster convergenceLaplaceNaulin
also gained an under-relaxation factor, which may
improve convergence and robustness- The
Laplace
solvers gained auses3DCoefs
method. This returns
true
if the solver can make use ofField3D
coefficients rather
than using the DC component of them - A new time
Solver
: Runge-Kutta-Legendre stabilised explicit
method,splitrk
. See
#1673 for more
details - Experimental support for CMake
- Added
HeatFluxSNB
which calculates heat flux using the
Shurtz-Nicolai-Busquet (SNB) model. Nonlocal (kinetic) corrections
to the Spitzer-Harm collisional heat flux, which become important
when the mean free path becomes a small (~1%) fraction of the
temperature scale length - The new
BOUT_SCOREP_REGION("name")
will automatically instrument a
scope with Score-P if BOUT++ was compiled with Score-P
support (see the documentation for more information) NYPE
may be given instead ofNXPE
in input files for decomposing
the mesh in(x, y)
- Many fixes and improvements for Hypnotoad:
- Use centred differencing to compute
dx
frompsi
instead of
forward differencing - Fix for when the separatrix is exactly on a grid point
- Fix for when the separatrix is very close to the X-point
- Fix computation of
ShiftAngle
- Add a checkbox to the 'Output' tab, which if selected outputs
metrics for orthogonal coordinates (i.e. usingShiftedMetric
) - We now check what coordinate system was used to generate grid
files in Hypnotoad when reading them in BOUT++ - Lots of fixes for non-orthogonal grids (see
#1593,
#1596, and
#1636) - Use double precision everywhere
- Add option to write y-boundary guard cells
- See here for a complete
list
- Use centred differencing to compute
- Many, many more tests! Unit test coverage since v4.2.0 has doubled
- We have begun to move parts of the codebase into a
bout::
namespace. This should help ensure we play nice with other
libraries, as well as logically group related things across parts of
the codebase
Deprecations:
invert_laplace
: create an instance of aLaplacian
via
Laplacian::create
and use thesetCoef*
andsolve
methods- Karniadakis time
Solver
: the current implementation is very slow
and will be removed in 5.0 MsgStack::setPoint
: useMsgStack::push("")
- The following
Mesh
methods were experimental, low-level
communication routines that turned out to not be so useful:sendToProc
receiveFromProc
UpXSplitIndex
DownXSplitIndex
sendYOutIndest
sendYOutOutdest
sendYInIndest
sendYInOutdest
irecvYOutIndest
irecvYOutOutdest
irecvYInIndest
irecvYInOutdest
Mesh::XGLOBAL
andMesh::YGLOBAL
: useMesh::getGlobalXIndex
and
eitherMesh::getGlobalYIndexNoBoundaries
or
Mesh::getGlobalYIndex
instead. The former (NoBoundaries
) is a
direct replacement forYGLOBAL
, whereas the latter includes the
boundaries and so is consistent withXGLOBAL
which does tooLaplacian::setFlags
: useLaplacian::setGlobalFlags
,
Laplacian::setInnerBoundaryFlags
and
Laplacian::setOuterBoundaryFlags
instead- The staggered parallel differential operators that end
CtoL
or
LtoC
(e.g.Div_par_CtoL
,Grad_par_LtoC
): the corresponding
versions without the suffix now support staggering. For example,
instead ofDiv_par_CtoL(f)
useDiv_par(f, CELL_YLOW)
instead
Removed:
- The
serial
implementation ofparderiv
. Thecyclic
version
works both serially and in parallel comm_group
: not used internally and too low-level to be useful- Support for the
scipy
andscientific
netCDF libraries in
boututils
has been dropped. These were very slow andscientific
is no longer available Laplace3D
: useLaplacian
instead