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
4 changes: 4 additions & 0 deletions include/bout/coordinates.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include <bout/field3d.hxx>
#include <bout/paralleltransform.hxx>

#include <string>

class Mesh;

/*!
Expand Down Expand Up @@ -249,6 +251,8 @@ private:
void checkCovariant();
// check that contravariant tensors are positive (if expected) and finite (always)
void checkContravariant();
/// Read quantities with given suffix from `Mesh`
void readFromMesh(Options* options, const std::string& suffix);
};

#endif // BOUT_COORDINATES_H
21 changes: 12 additions & 9 deletions include/bout/griddata.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ class GridDataSource;
#ifndef BOUT_GRIDDATA_H
#define BOUT_GRIDDATA_H

#include "mesh.hxx"
#include "bout/bout_types.hxx"
#include "bout/options.hxx"

#include <bout/bout_types.hxx>
#include <bout/field2d.hxx>
#include <bout/field3d.hxx>
#include <bout/mesh.hxx>
#include <bout/options.hxx>
#include <bout/unused.hxx>

#include <string>
#include <vector>

/// Interface class to serve grid data
/*!
Expand All @@ -46,8 +49,8 @@ public:
GridDataSource(const bool source_is_file = false) : is_file(source_is_file) {}
virtual ~GridDataSource() = default;

virtual bool
hasVar(const std::string& name) = 0; ///< Test if source can supply a variable
/// Test if source can supply a variable
virtual bool hasVar(const std::string& name) const = 0;

/// Get a string
virtual bool get(Mesh* m, std::string& sval, const std::string& name,
Expand Down Expand Up @@ -95,9 +98,9 @@ class GridFile : public GridDataSource {
public:
GridFile() = delete;
GridFile(std::string gridfilename);
~GridFile() = default;
~GridFile() override = default;

bool hasVar(const std::string& name) override;
bool hasVar(const std::string& name) const override;

/// Get a string
bool get(Mesh* m, std::string& sval, const std::string& name,
Expand Down Expand Up @@ -178,7 +181,7 @@ public:
/*!
* Checks if the options has a given variable
*/
bool hasVar(const std::string& name) override;
bool hasVar(const std::string& name) const override;

/*!
* Reads strings from options. Uses Options::get to handle
Expand Down
4 changes: 2 additions & 2 deletions include/bout/mesh.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public:
// Boundary regions

/// Return a vector containing all the boundary regions on this processor
virtual std::vector<BoundaryRegion*> getBoundaries() = 0;
virtual std::vector<BoundaryRegion*> getBoundaries() const = 0;

/// Get the set of all possible boundaries in this configuration
virtual std::set<std::string> getPossibleBoundaries() const { return {}; }
Expand All @@ -496,7 +496,7 @@ public:
/// get only xout:
/// mesh->getBoundariesPar(Mesh::BoundaryParType::xout)
virtual std::vector<std::shared_ptr<BoundaryRegionPar>>
getBoundariesPar(BoundaryParType type = BoundaryParType::all) = 0;
getBoundariesPar(BoundaryParType type = BoundaryParType::all) const = 0;

/// Add a parallel(Y) boundary to this processor
virtual void addBoundaryPar(std::shared_ptr<BoundaryRegionPar> UNUSED(bndry),
Expand Down
Loading
Loading