Skip to content
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

Fix various documentation issues #2844

Open
wants to merge 32 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3f311e0
Docs: Fix some double-backtick issues
ZedThree Jan 22, 2024
0bc5206
Docs: Update code layout
ZedThree Jan 22, 2024
297b284
Docs: Fix underline too short
ZedThree Jan 22, 2024
e6bc5c5
Docs: Don't include boutdata/boututils in docs
ZedThree Jan 22, 2024
41da8a8
Docs: Fix reference link
ZedThree Jan 22, 2024
96723d0
Docs: Fix bullet points (require blank line before start)
ZedThree Jan 22, 2024
82c0708
Docs: Fix wrong start of literal block
ZedThree Jan 22, 2024
e1591bc
Docs: Fix snippet for Scorep
ZedThree Jan 22, 2024
dcb33f4
Docs: Fix unknown role
ZedThree Jan 22, 2024
aa4a655
Docs: Fix syntax for footnote
ZedThree Jan 22, 2024
6640e94
Fix a couple of "most vexing parse" that doxygen doesn't like
ZedThree Jan 22, 2024
534fe4d
Docs: Don't keep separate doxygen config for readthedocs
ZedThree Jan 22, 2024
87ec9b0
Remove unused `#define` from petsc/slepc solvers
ZedThree Jan 22, 2024
1eb0c4f
Remove duplicate function pointer alias
ZedThree Jan 22, 2024
f47847c
Remove unnecessary type alias
ZedThree Jan 22, 2024
3ee4153
Docs: Add a couple of macros that doxygen should ignore
ZedThree Jan 22, 2024
bc43456
Docs: Don't process .cxx files
ZedThree Jan 22, 2024
37fea91
Docs: Fix some latex equations in docstrings
ZedThree Jan 23, 2024
f616515
Tweak `HypreLib` docs
ZedThree Jan 24, 2024
de2599d
Docs: Always set breathe config even if not generating files
ZedThree Jan 24, 2024
e30da8c
Docs: Don't show header to include in docs
ZedThree Jan 24, 2024
8e6c93d
Docs: Don't run doxygen on python files
ZedThree Jan 24, 2024
709de64
Docs: Fix some egregiously outdated solver docs
ZedThree Jan 24, 2024
3ed4c7c
Docs: Fix some broken links now `.cxx` files aren't included
ZedThree Jan 24, 2024
d4559e3
Docs: Fix file-level docstrings not rendering correctly
ZedThree Jan 25, 2024
8feddbb
Docs: Fix a bunch of LaTeX/codeblock rendering issues
ZedThree Jan 25, 2024
678b41e
Apply clang-format changes
ZedThree Jan 25, 2024
4be06d2
Merge branch 'next' of github.com:boutproject/BOUT-dev into fix-docs-…
dschwoerer Mar 1, 2024
f6ae060
Add MIT License text
dschwoerer Mar 1, 2024
54ee04e
Merge pull request #2875 from boutproject/fix-docs-warnings-db
bendudson Mar 11, 2024
d344f42
Revert "Docs: Don't include boutdata/boututils in docs"
dschwoerer Mar 14, 2024
f665c24
Merge pull request #2881 from boutproject/fix-docs-warnings-db
bendudson Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion include/bout/adios_object.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*!************************************************************************
/*!\file*******************************************************************
* Provides access to the ADIOS library, handling initialisation and
* finalisation.
*
Expand Down
2 changes: 1 addition & 1 deletion include/bout/assert.hxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*!
/*!\file
* Defines a macro ASSERT which throws a BoutException if a given
* condition is false. Whether the assertion is tested depends on
* the checking level, so assetions can be removed for optimised runs.
Expand Down
9 changes: 9 additions & 0 deletions include/bout/bout.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#ifndef BOUT_H
#define BOUT_H

//NOLINTBEGIN(unused-includes)
#include "bout/build_config.hxx"

#include "bout/boutcomm.hxx"
Expand All @@ -53,6 +54,7 @@
#include "bout/vector3d.hxx"
#include "bout/version.hxx"
#include "bout/where.hxx"
//NOLINTEND(unused-includes)

// BOUT++ main functions

Expand All @@ -79,6 +81,13 @@
* either by including boutmain.hxx or by including bout/physicsmodel.hxx
* and using the BOUTMAIN macro.
*
* Outputs
* -------
*
* Any non-zero return value should halt the simulation. If the return value is
* less than zero, the exit status from BOUT++ is 0, otherwise it is the return
* value of BoutInitialise.
*
*/
int BoutInitialise(int& argc, char**& argv);

Expand Down
4 changes: 3 additions & 1 deletion include/bout/dcomplex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

using dcomplex = std::complex<BoutReal>;

const dcomplex Im(0, 1); // 1i
/// Imaginary unit, ``1i``
//NOLINTNEXTLINE(readability-identifier-length)
constexpr dcomplex Im{0, 1};

/// Complex type for passing data to/from FORTRAN
struct fcmplx {
Expand Down
4 changes: 2 additions & 2 deletions include/bout/difops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ inline Field3D Div_par_flux(const Field3D& v, const Field3D& f, CELL_LOC outloc,
}

/*!
* second parallel derivative
* Second parallel derivative:
* \f[
* (\mathbf{b} dot \nabla)(\mathbf{b} dot \nabla)
* (\mathbf{b} \cdot \nabla)(\mathbf{b} \cdot \nabla)
* \f]
*
* Note: For parallel Laplacian use LaplacePar
Expand Down
2 changes: 1 addition & 1 deletion include/bout/field.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ FIELD_FUNC(exp, ::exp)
/// Natural logarithm of \p f over region \p rgn, inverse of
/// exponential
///
/// \f$\ln(\exp(f)) = f\f$
/// \f[\ln(\exp(f)) = f\f]
///
/// This loops over the entire domain, including guard/boundary cells by
/// default (can be changed using the rgn argument)
Expand Down
7 changes: 4 additions & 3 deletions include/bout/field_accessor.hxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/// \file
///
/// FieldAccessor
///
/// Provides quick but unsafe access to field and coordinate system data
///

#pragma once
#ifndef FIELD_ACCESSOR_H__
Expand Down Expand Up @@ -119,9 +120,9 @@ using Field2DAccessor = FieldAccessor<location, Field2D>;
///
/// Usage:
///
/// ddt(fa)[i] =
/// ddt(fa)[i] = /* expression */
///
/// where fa is a FieldAccessor, and i is an int
/// where ``fa`` is a FieldAccessor, and ``i`` is an int
///
template <CELL_LOC location, class FieldType>
BOUT_HOST_DEVICE inline BoutRealArray& ddt(const FieldAccessor<location, FieldType>& fa) {
Expand Down
94 changes: 50 additions & 44 deletions include/bout/fv_ops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,71 +13,77 @@
#include <bout/mesh.hxx>

namespace FV {
/*!
* Div ( a Grad_perp(f) ) -- ∇⊥ ( a ⋅ ∇⊥ f) -- Vorticity
*/
/// Vorticity:
/// \f[
/// \nabla_\perp (a \cdot \nabla_\perp(f))
/// \f]
Field3D Div_a_Grad_perp(const Field3D& a, const Field3D& x);

[[deprecated("Please use Div_a_Grad_perp instead")]] inline Field3D
Div_a_Laplace_perp(const Field3D& a, const Field3D& x) {
return Div_a_Grad_perp(a, x);
}

/*!
* Divergence of a parallel diffusion Div( k * Grad_par(f) )
*/
/// Divergence of a parallel diffusion
/// \f[
/// \nabla_\parallel(k \cdot \nabla_\parallel(f) )
/// \f]
const Field3D Div_par_K_Grad_par(const Field3D& k, const Field3D& f,
bool bndry_flux = true);

/*!
* 4th-order derivative in Y, using derivatives
* on cell boundaries.
*
* A one-sided 3rd-order derivative, given a value
* at a boundary is:
*
* d3f/dx3 ~= 16/5 f_b - 6 f_0 + 4 f_1 - 6/5 f_2
*
* where f_b is the value on the boundary; f_0 is the cell
* to the left of the boundary; f_1 to the left of f_0 and f_2
* to the left of f_1
*
* f_2 | f_1 | f_0 |
* f_b
*
* NB: Uses to/from FieldAligned coordinates
*
* No fluxes through domain boundaries
*/
/// 4th-order derivative in Y, using derivatives
/// on cell boundaries.
///
/// A one-sided 3rd-order derivative, given a value
/// at a boundary is:
///
/// \f[
/// \frac{d^3f}{dx^3} \simeq \tfrac{16}{5} f_b - 6 f_0 + 4 f_1 - \tfrac{6}{5} f_2
/// \f]
///
/// where:
///
/// - \f$f_b\f$ is the value on the boundary,
/// - \f$f_0\f$ is the cell to the left of the boundary,
/// - \f$f_1\f$ to the left of \f$f_0\f$, and
/// - \f$f_2\f$ to the left of f_1:
///
/// .. code:: text
/// f_2 | f_1 | f_0 |
/// f_b
///
/// NB: Uses to/from FieldAligned coordinates
///
/// No fluxes through domain boundaries
const Field3D D4DY4(const Field3D& d, const Field3D& f);

/*!
* 4th-order dissipation term
*
*
* A one-sided 3rd-order derivative, given a value
* at a boundary is:
*
* d3f/dx3 ~= 16/5 f_b - 6 f_0 + 4 f_1 - 6/5 f_2
*
* where f_b is the value on the boundary; f_0 is the cell
* to the left of the boundary; f_1 to the left of f_0 and f_2
* to the left of f_1
*
* f_2 | f_1 | f_0 |
* f_b
*/
/// 4th-order dissipation term
///
/// \f[
/// \frac{d^3f}{dx^3} \simeq \tfrac{16}{5} f_b - 6 f_0 + 4 f_1 - \tfrac{6}{5} f_2
/// \f]
///
/// where:
///
/// - \f$f_b\f$ is the value on the boundary,
/// - \f$f_0\f$ is the cell to the left of the boundary,
/// - \f$f_1\f$ to the left of \f$f_0\f$, and
/// - \f$f_2\f$ to the left of f_1:
///
/// .. code:: text
/// f_2 | f_1 | f_0 |
/// f_b
const Field3D D4DY4_Index(const Field3D& f, bool bndry_flux = true);

/*!
* Stencil used for Finite Volume calculations
* which includes cell face values L and R
*/
struct Stencil1D {
// Cell centre values
/// Cell centre values
BoutReal c, m, p, mm, pp;

// Left and right cell face values
/// Left and right cell face values
BoutReal L, R;
};

Expand Down
12 changes: 12 additions & 0 deletions include/bout/generic_factory.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/// \file
/// Base type for factories

// Copyright 2018-2022 Peter Hill, BOUT++ Team
// SPDX-License-Identifier: MIT
ZedThree marked this conversation as resolved.
Show resolved Hide resolved

#pragma once
#ifndef BOUT_GENERIC_FACTORY_H
#define BOUT_GENERIC_FACTORY_H
Expand Down Expand Up @@ -48,6 +52,14 @@
/// RegisterInFactory<Base, Derived, MyFactory, Options*> register("derived_type");
/// auto foo = MyFactory::getInstance().create("derived_type");
///
/// In a .cxx file the static members should be declared:
///
/// constexpr decltype(MyFactory::type_name) MyFactory::type_name;
/// constexpr decltype(MyFactory::section_name) MyFactory::section_name;
/// constexpr decltype(MyFactory::option_name) MyFactory::option_name;
/// constexpr decltype(MyFactory::default_type) MyFactory::default_type;
///
///
/// @tparam BaseType The base class that this factory creates
/// @tparam DerivedFactory The derived factory inheriting from this class
/// @tparam TypeCreator The function signature for creating a new BaseType
Expand Down
14 changes: 11 additions & 3 deletions include/bout/gyro_average.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ constexpr int GYRO_FLAGS = INVERT_BNDRY_ONE + INVERT_RHS;

/// Gyro-average using Taylor series approximation
///
/// \f$ \Gamma(f) = f + \rho^2 \nabla_\perp^2(f)\f$
/// \f[
/// \Gamma(f) = f + \rho^2 \nabla_\perp^2(f)
/// \f]
///
/// Note: Faster, but less robust than Pade approximations
///
Expand All @@ -51,7 +53,9 @@ Field3D gyroTaylor0(const Field3D& f, const Field3D& rho);

/// Gyro-average using Pade approximation
///
/// \f$ \Gamma_0 = (1 - \rho^2 \nabla_\perp^2)g = f\f$
/// \f[
/// \Gamma_0 = (1 - \rho^2 \nabla_\perp^2)g = f
/// \f]
///
/// NOTE: Uses Z average of rho for efficient inversion
///
Expand All @@ -70,7 +74,11 @@ Field3D gyroPade0(const Field3D& f, const Field2D& rho,
Field3D gyroPade0(const Field3D& f, BoutReal rho, int inner_boundary_flags = GYRO_FLAGS,
int outer_boundary_flags = GYRO_FLAGS);

/// Pade approximation \f$Gamma_1 = (1 - \frac{1}{2} \rho^2 \nabla_\perp^2)g = f\f$
/// Pade approximation
///
/// \f[
/// \Gamma_1 = (1 - \frac{1}{2} \rho^2 \nabla_\perp^2)g = f
/// \f]
///
/// Note: Have to use Z average of rho for efficient inversion
///
Expand Down
38 changes: 20 additions & 18 deletions include/bout/hyprelib.hxx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*!************************************************************************
/*! \file ******************************************************************
* Provides access to the Hypre library, handling initialisation and
* finalisation.
*
* Usage
* -----
*
* #include <bout/hyprelib.hxx>
* #include <bout/hyprelib.hxx>
*
* class MyClass {
* public:
* class MyClass {
* HypreLib lib;
* public:
* // ...
* };
*
* private:
* HypreLib lib;
* };
*
*
* This will then automatically initialise Hypre the first time an object
* is created, and finalise it when the last object is destroyed.
*
**************************************************************************
* This will then automatically ensure Hypre is initialised the first
* time an instance is created, and finalise it when the last instances is
* destroyed (across all objects using `HypreLib`)
*/
/**************************************************************************
* Copyright 2012 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
*
* Contact: Ben Dudson, [email protected]
Expand All @@ -43,16 +43,17 @@
#ifndef BOUT_HYPRELIB_H
#define BOUT_HYPRELIB_H

#include "bout/build_config.hxx"
#include "bout/build_defines.hxx"

namespace bout {
#if BOUT_HAS_HYPRE
/*!
* Handles initialisation and finalisation of Hypre library.
* The first instance which is created initialises Hypre.
* Keeps a count of the number of how many instances exist
* when the last instance is destroyed it finalises Hypre.
*
* The first instance which is created initialises Hypre. Keeps a
* count of the number of how many instances exist, and when the last
* instance is destroyed it finalises Hypre.
*/
#if BOUT_HAS_HYPRE
class HypreLib {
public:
explicit HypreLib();
Expand All @@ -64,10 +65,11 @@ public:

~HypreLib();

/// Immediately finalise Hypre library
static void cleanup();

private:
static int count; ///< How many instances?
static int count; ///< Current number of instances
};

#else // BOUT_HAS_HYPRE
Expand Down
Loading
Loading