Skip to content

Commit

Permalink
fix warnings, clean NeoFOAM:: in test
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Oct 11, 2024
1 parent 4791d62 commit 9cab253
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/NeoFOAM/dsl/equation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Equation

const Executor& exec() const { return exec_; }

const std::size_t nCells() const { return nCells_; }
std::size_t nCells() const { return nCells_; }

scalar getDt() const { return dt_; }

Expand Down
2 changes: 1 addition & 1 deletion include/NeoFOAM/dsl/operator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class OperatorMixin
const Coeff& getCoefficient() const { return coeffs_; }

/* @brief Given an input this function reads required coeffs */
void build(const Input& input) {}
void build([[maybe_unused]] const Input& input) {}

protected:

Expand Down
2 changes: 1 addition & 1 deletion include/NeoFOAM/fields/field.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Field
{
void* ptr = nullptr;
std::visit(
[this, &ptr, size](const auto& concreteExec)
[&ptr, size](const auto& concreteExec)
{ ptr = concreteExec.alloc(size * sizeof(ValueType)); },
exec_
);
Expand Down
8 changes: 2 additions & 6 deletions test/dsl/coeff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ TEST_CASE("Coeff")
{
size_t size = 3;

NeoFOAM::Field<NeoFOAM::scalar> fieldA(exec, size, 0.0);
NeoFOAM::Field<NeoFOAM::scalar> fieldB(exec, size, 1.0);
Field fieldA(exec, size, 0.0);
Field fieldB(exec, size, 1.0);

SECTION("span")
{
Expand All @@ -82,8 +82,6 @@ TEST_CASE("Coeff")

SECTION("scalar")
{
NeoFOAM::Field<NeoFOAM::scalar> fieldA(exec, size, 0.0);

Coeff coeff = Coeff(2.0);
{
NeoFOAM::parallelFor(
Expand All @@ -99,8 +97,6 @@ TEST_CASE("Coeff")

SECTION("span and scalar")
{
NeoFOAM::Field<NeoFOAM::scalar> fieldA(exec, size, 0.0);
NeoFOAM::Field<NeoFOAM::scalar> fieldB(exec, size, 1.0);
Coeff coeff {-5.0, fieldB};
{
NeoFOAM::parallelFor(
Expand Down
6 changes: 3 additions & 3 deletions test/dsl/operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ TEST_CASE("Operator")
auto d = fB * Dummy(exec, vf);
auto e = Coeff(-3, fB) * Dummy(exec, vf);

auto coeffc = c.getCoefficient();
auto coeffd = d.getCoefficient();
auto coeffE = e.getCoefficient();
[[maybe_unused]] auto coeffC = c.getCoefficient();
[[maybe_unused]] auto coeffD = d.getCoefficient();
[[maybe_unused]] auto coeffE = e.getCoefficient();

Field source(exec, 1, 2.0);
c.explicitOperation(source);
Expand Down

0 comments on commit 9cab253

Please sign in to comment.