Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ set(BOUT_SOURCES
./include/bout/deriv_store.hxx
./include/bout/derivs.hxx
./include/bout/difops.hxx
./include/bout/expr.hxx
./include/bout/fft.hxx
./include/bout/field.hxx
./include/bout/field2d.hxx
Expand Down
10 changes: 2 additions & 8 deletions include/bout/boundary_region.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ class BoundaryRegion;
#include <utility>

class Mesh;
namespace bout {
namespace globals {
extern Mesh* mesh; ///< Global mesh
} // namespace globals
} // namespace bout

/// Location of boundary
enum class BndryLoc {
Expand Down Expand Up @@ -40,10 +35,9 @@ class BoundaryRegionBase {
public:
BoundaryRegionBase() = delete;
BoundaryRegionBase(std::string name, Mesh* passmesh = nullptr)
: localmesh(passmesh ? passmesh : bout::globals::mesh), label(std::move(name)) {}
: localmesh(passmesh), label(std::move(name)) {}
BoundaryRegionBase(std::string name, BndryLoc loc, Mesh* passmesh = nullptr)
: localmesh(passmesh ? passmesh : bout::globals::mesh), label(std::move(name)),
location(loc) {}
: localmesh(passmesh), label(std::move(name)), location(loc) {}

virtual ~BoundaryRegionBase() = default;

Expand Down
208 changes: 0 additions & 208 deletions include/bout/expr.hxx

This file was deleted.

7 changes: 3 additions & 4 deletions include/bout/field.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* \brief field base class definition for differencing methods
*
**************************************************************************
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
* Copyright 2010 - 2025 BOUT++ contributors
*
* Contact: Ben Dudson, dudson2@llnl.gov
*
* Contact: Ben Dudson, bd512@york.ac.uk
*
* This file is part of BOUT++.
*
* BOUT++ is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -41,7 +41,6 @@ class Field;
#include "bout/region.hxx"
#include "bout/traits.hxx"
#include "bout/utils.hxx"
#include <bout/globals.hxx>
#include <bout/rvec.hxx>

class Mesh;
Expand Down
14 changes: 5 additions & 9 deletions include/bout/field2d.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* \brief Definition of 2D scalar field class
*
**************************************************************************
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
* Copyright 2010-2025 BOUT++ contributors
*
* Contact: Ben Dudson, bd512@york.ac.uk
* Contact: Ben Dudson, dudson2@llnl.gov
*
* This file is part of BOUT++.
*
Expand Down Expand Up @@ -55,16 +55,12 @@ class Field2D : public Field {
public:
using ind_type = Ind2D;
/*!
* Constructor, taking an optional mesh pointer
* This mesh pointer is not used until the data is allocated,
* since Field2D objects can be globals, created before a mesh
* has been created.
* Constructor
*
* @param[in] localmesh The mesh which defines the field size.
*
* By default the global Mesh pointer (mesh) is used.
*/
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
Field2D(Mesh* localmesh, CELL_LOC location_in = CELL_CENTRE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "CELL_CENTRE" is directly included [misc-include-cleaner]

  Field2D(Mesh* localmesh, CELL_LOC location_in = CELL_CENTRE,
                                                  ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "CELL_LOC" is directly included [misc-include-cleaner]

include/bout/field2d.hxx:26:

- class Field2D;
+ #include "bout/bout_types.hxx"
+ class Field2D;

DirectionTypes directions_in = {YDirectionType::Standard,
ZDirectionType::Average});

Expand All @@ -84,7 +80,7 @@ public:
* allocates data, and assigns the value \p val to all points including
* boundary cells.
*/
Field2D(BoutReal val, Mesh* localmesh = nullptr);
Field2D(BoutReal val, Mesh* localmesh);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "BoutReal" is directly included [misc-include-cleaner]

  Field2D(BoutReal val, Mesh* localmesh);
          ^


/// Constructor from Array and Mesh
Field2D(Array<BoutReal> data, Mesh* localmesh, CELL_LOC location = CELL_CENTRE,
Expand Down
10 changes: 4 additions & 6 deletions include/bout/field3d.hxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**************************************************************************
* Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
* Copyright 2010 - 2025 BOUT++ contributors
*
* Contact: Ben Dudson, bd512@york.ac.uk
* Contact: Ben Dudson, dudson2@llnl.gov
*
* This file is part of BOUT++.
*
Expand Down Expand Up @@ -161,10 +161,8 @@ public:
/*!
* Constructor
*
* Note: the global "mesh" can't be passed here because
* fields may be created before the mesh is.
*/
Field3D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
Field3D(Mesh* localmesh, CELL_LOC location_in = CELL_CENTRE,
DirectionTypes directions_in = {YDirectionType::Standard,
ZDirectionType::Standard});

Expand All @@ -178,7 +176,7 @@ public:
/// Constructor from 2D field
Field3D(const Field2D& f);
/// Constructor from value
Field3D(BoutReal val, Mesh* localmesh = nullptr);
Field3D(BoutReal val, Mesh* localmesh);
/// Constructor from Array and Mesh
Field3D(Array<BoutReal> data, Mesh* localmesh, CELL_LOC location = CELL_CENTRE,
DirectionTypes directions_in = {YDirectionType::Standard,
Expand Down
2 changes: 1 addition & 1 deletion include/bout/fv_ops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ const Field3D Div_f_v(const Field3D& n_in, const Vector3D& v, bool bndry_flux) {
n = toFieldAligned(n_in, "RGN_NOX");
Field3D vy = toFieldAligned(v.y, "RGN_NOX");

Field3D yresult = 0.0;
Field3D yresult{0.0, mesh};
yresult.setDirectionY(YDirectionType::Aligned);

BOUT_FOR(i, result.getRegion("RGN_NOBNDRY")) {
Expand Down
Loading