Skip to content

Commit

Permalink
Remove some unnecessary includes from common headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Nov 7, 2024
1 parent 56934ee commit 91821ea
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 31 deletions.
3 changes: 1 addition & 2 deletions include/bout/coordinates.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@
#ifndef BOUT_COORDINATES_H
#define BOUT_COORDINATES_H

#include "bout/bout_types.hxx"
#include "bout/field2d.hxx"
#include "bout/field3d.hxx"
#include "bout/paralleltransform.hxx"
#include "bout/utils.hxx"
#include <bout/bout_types.hxx>

class Mesh;

Expand Down
7 changes: 1 addition & 6 deletions include/bout/field.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,19 @@ class Field;

#include <cmath>
#include <cstdio>
#include <memory>
#include <string>

#include "bout/field_data.hxx"

#include "bout/bout_types.hxx"
#include "bout/boutcomm.hxx"
#include "bout/boutexception.hxx"
#include "bout/field_data.hxx"
#include "bout/msg_stack.hxx"
#include "bout/region.hxx"
#include "bout/stencils.hxx"
#include "bout/traits.hxx"
#include "bout/utils.hxx"
#include <bout/globals.hxx>
#include <bout/rvec.hxx>

#include "bout/unused.hxx"

class Mesh;

/// Base class for scalar fields
Expand Down
12 changes: 4 additions & 8 deletions include/bout/field2d.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,21 @@ class Field2D;
#ifndef BOUT_FIELD2D_H
#define BOUT_FIELD2D_H

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

class Mesh;
#include "bout/field.hxx"
#include "bout/field_data.hxx"
class Field3D;
#include "bout/fieldperp.hxx"
#include "bout/stencils.hxx"

#include "bout/array.hxx"
#include "bout/region.hxx"
#include "bout/utils.hxx"

#include "bout/unused.hxx"

#if BOUT_HAS_RAJA
#include "RAJA/RAJA.hpp" // using RAJA lib
#endif

class Field3D;
class Mesh;

/*!
* \brief 2D X-Y scalar fields
*
Expand Down
14 changes: 5 additions & 9 deletions include/bout/field3d.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,19 @@ class Field3D;
#ifndef BOUT_FIELD3D_H
#define BOUT_FIELD3D_H

class Mesh; // #include "bout/mesh.hxx"
#include "bout/array.hxx"
#include "bout/assert.hxx"
#include "bout/bout_types.hxx"
#include "bout/field.hxx"
#include "bout/field2d.hxx"
#include "bout/fieldperp.hxx"
#include "bout/stencils.hxx"

#include "bout/array.hxx"
#include "bout/region.hxx"

#include "bout/assert.hxx"

#include "bout/utils.hxx"

#include <optional>
#include <vector>

class Mesh;

/// Class for 3D X-Y-Z scalar fields
/*!
This class represents a scalar field defined over the mesh.
Expand Down Expand Up @@ -573,7 +569,7 @@ void checkData(const Field3D& f, const std::string& region = "RGN_NOBNDRY");
/// Ignored with disabled CHECK; Throw an exception if \p f is not
/// allocated or if any elements are non-finite (for CHECK > 2)
inline void checkData(const Field3D& UNUSED(f),
const std::string& UNUSED(region) = "RGN_NOBNDRY"){};
const std::string& UNUSED(region) = "RGN_NOBNDRY") {};
#endif

/// Fourier filtering, removes all except one mode
Expand Down
1 change: 1 addition & 0 deletions include/bout/interpolation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define BOUT_INTERP_H

#include "bout/mesh.hxx"
#include "bout/stencils.hxx"

/// Perform interpolation between centre -> shifted or vice-versa
/*!
Expand Down
3 changes: 2 additions & 1 deletion include/bout/lapack_routines.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#ifndef BOUT_LAPACK_ROUTINES_H
#define BOUT_LAPACK_ROUTINES_H

#include <bout/utils.hxx>
#include "bout/dcomplex.hxx"
#include "bout/utils.hxx"

/* Tridiagonal inversion
*
Expand Down
1 change: 1 addition & 0 deletions include/bout/paralleltransform.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define BOUT_PARALLELTRANSFORM_H

#include "bout/bout_types.hxx"
#include "bout/dcomplex.hxx"
#include "bout/field3d.hxx"
#include "bout/options.hxx"
#include "bout/unused.hxx"
Expand Down
9 changes: 4 additions & 5 deletions include/bout/utils.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@

#include "bout/build_config.hxx"

#include "bout/bout_types.hxx"
#include "bout/boutexception.hxx"
#include "bout/dcomplex.hxx"

#include "bout/array.hxx"
#include "bout/assert.hxx"
#include "bout/bout_types.hxx"
#include "bout/boutexception.hxx"
#include "bout/msg_stack.hxx"
#include "bout/region.hxx"
#include "bout/unused.hxx"
Expand All @@ -48,6 +46,7 @@
#include <memory>
#include <set>
#include <string>
#include <sstream>

#ifdef _MSC_VER
// finite is not actually standard C++, it's a BSD extention for C
Expand Down Expand Up @@ -545,7 +544,7 @@ inline void checkData(BoutReal f) {
}
#else
/// Ignored with disabled CHECK; Throw an exception if \p f is not finite
inline void checkData(BoutReal UNUSED(f)){};
inline void checkData(BoutReal UNUSED(f)) {};
#endif

/*!
Expand Down

0 comments on commit 91821ea

Please sign in to comment.