diff --git a/include/IntegrationTools/pfield/Mesh.hh b/include/IntegrationTools/pfield/Mesh.hh index ed51c37c8..0ef719c84 100644 --- a/include/IntegrationTools/pfield/Mesh.hh +++ b/include/IntegrationTools/pfield/Mesh.hh @@ -582,7 +582,10 @@ namespace PRISMS { _coord[0] = COORD_X[i]; _coord[1] = COORD_Y[i]; - _coord[2] = COORD_Z[i]; + if (DIM > 2) + { + _coord[2] = COORD_Z[i]; + } for (int m = 0; m < DIM; m++) add_once(value[m], hist[m], _coord[m]); diff --git a/include/IntegrationTools/pfield/PField.hh b/include/IntegrationTools/pfield/PField.hh index e31e33f49..4b9d828dd 100644 --- a/include/IntegrationTools/pfield/PField.hh +++ b/include/IntegrationTools/pfield/PField.hh @@ -67,7 +67,7 @@ namespace PRISMS // Clone PField * - clone() const + clone() const override { return new PField(*this); } @@ -75,28 +75,28 @@ namespace PRISMS // ---------------------------------------------------------- // Use these functions if you want to evaluate a single value FieldType - operator()(const Coordinate &coord); + operator()(const Coordinate &coord) override; FieldType - grad(const Coordinate &coord, size_type di); + grad(const Coordinate &coord, size_type di) override; FieldType - hess(const Coordinate &coord, size_type di, size_type dj); + hess(const Coordinate &coord, size_type di, size_type dj) override; // ---------------------------------------------------------- // Use these functions to evaluate several values, then use 'get' methods to access // results void - eval(const Coordinate &coord); + eval(const Coordinate &coord) override; void - eval_grad(const Coordinate &coord); + eval_grad(const Coordinate &coord) override; void - eval_hess(const Coordinate &coord); + eval_hess(const Coordinate &coord) override; FieldType - operator()() const; + operator()() const override; FieldType - grad(size_type di) const; + grad(size_type di) const override; FieldType - hess(size_type di, size_type dj) const; + hess(size_type di, size_type dj) const override; // PField unique members ------------------------------------------