Skip to content

Commit

Permalink
Resolve "Fix -Wpedantic warnings"
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau committed Feb 21, 2024
1 parent 438e363 commit ed4cf9f
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion simulations/utilities/simulation_utils_tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ void display_time_difference(
= std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time).count();
std::cout << title << time_h << "h " << time_min - time_h * 60 << "min "
<< time_s - time_min * 60 << "s " << time_ms - time_s * 1000 << "ms " << std::endl;
};
}
8 changes: 4 additions & 4 deletions src/geometryXYVxVy/poisson/fftpoissonsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void FftPoissonSolver::operator()(
fft(Kokkos::DefaultHostExecutionSpace(),
intermediate_chunk.span_view(),
rho.span_view(),
(ddc::kwArgs_fft) {.normalization = norm});
ddc::kwArgs_fft {norm});

// Solve Poisson's equation -d2Phi/dx2 = rho
// in Fourier space as -kx*kx*FFT(Phi)=FFT(rho))
Expand Down Expand Up @@ -84,7 +84,7 @@ void FftPoissonSolver::operator()(
ifft(Kokkos::DefaultHostExecutionSpace(),
electric_field_x.span_view(),
fourier_efield.span_view(),
ddc::kwArgs_fft {.normalization = norm});
ddc::kwArgs_fft {norm});

// Calculate y component
ddc::for_each(k_mesh, [&](IndexFxFy const ikxky) {
Expand All @@ -97,15 +97,15 @@ void FftPoissonSolver::operator()(
ifft(Kokkos::DefaultHostExecutionSpace(),
electric_field_y.span_view(),
fourier_efield.span_view(),
ddc::kwArgs_fft {.normalization = norm});
ddc::kwArgs_fft {norm});
Kokkos::Profiling::popRegion();

// Perform the inverse 1D FFT of the solution to deduce the electrostatic potential
ddc::
ifft(Kokkos::DefaultHostExecutionSpace(),
electrostatic_potential.span_view(),
intermediate_chunk.span_view(),
(ddc::kwArgs_fft) {.normalization = norm});
ddc::kwArgs_fft {norm});

Kokkos::Profiling::popRegion();
}
2 changes: 1 addition & 1 deletion src/timestepper/crank_nicolson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class CrankNicolson : public ITimeStepper


} while (not_converged and (counter < m_max_counter));
};
}


/**
Expand Down
2 changes: 1 addition & 1 deletion src/timestepper/euler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ class Euler : public ITimeStepper
// ----------- Update y --------------
// Calculate y_new := y_n + h*k_1
y_update(y, m_k1, dt);
};
}
};
2 changes: 1 addition & 1 deletion src/timestepper/rk2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,5 @@ class RK2 : public ITimeStepper
// ----------- Update y --------------
// Calculate y_{n+1} := y_n + h*k_2
y_update(y, m_k2, dt);
};
}
};
2 changes: 1 addition & 1 deletion src/timestepper/rk3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class RK3 : public ITimeStepper

// Calculate y_{n+1} := y_n + (k1 + 4 * k2 + k3) * h/6
y_update(y, m_k_total, dt / 6.);
};
}

private:
void copy(ValSpan copy_to, ValView copy_from) const
Expand Down
2 changes: 1 addition & 1 deletion src/timestepper/rk4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class RK4 : public ITimeStepper

// Calculate y_{n+1} := y_n + (k1 + 2 * k2 + 2 * k3 + k4) * h/6
y_update(y, m_k_total, dt / 6.);
};
}

private:
void copy(ValSpan copy_to, ValView copy_from) const
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ddc_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ restrict_to_domain(
coord -= length;
return coord;
}
}; // namespace ddcHelper
} // namespace ddcHelper

namespace detail {

Expand Down
4 changes: 2 additions & 2 deletions src/utils/utils_tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ KOKKOS_FUNCTION double norm_inf(ddc::Coordinate<Tags...> coord)
double result = 0.0;
((result = std::max(result, fabs(coord.template get<Tags>()))), ...);
return result;
};
}


/**
Expand All @@ -42,4 +42,4 @@ KOKKOS_FUNCTION double norm_inf(ddc::Coordinate<Tags...> coord)
KOKKOS_FUNCTION inline double norm_inf(double const coord)
{
return coord;
};
}
2 changes: 1 addition & 1 deletion src/utils/vector_field_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ inline constexpr typename ChunkType::view_type get(
}


}; // namespace ddcHelper
} // namespace ddcHelper

template <class ChunkType, class... DDims>
class VectorFieldCommon<ChunkType, ddc::detail::TypeSeq<DDims...>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void Interpolation_on_random_coord(
} else {
std::cout << " FAILED" << std::endl;
}
};
}

/**
* @brief A class of function on polar coordinates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void save_feet(
file_feet << std::endl;
});
file_feet.close();
};
}


/**
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_ddcHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Tag

using Coord = Coordinate<Tag>;

}; // namespace
} // namespace

TEST(DDCHelper, UniformPeriodicRestriction)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ class ConstantExtrapolationBoundaryValue2D : public SplineBoundaryValue2D<BSplin
coord_type_no_bc const eval_pos_no_bc_max)
: m_eval_pos_bc(eval_pos_bc)
, m_eval_pos_no_bc_min(eval_pos_no_bc_min)
, m_eval_pos_no_bc_max(eval_pos_no_bc_max) {};
, m_eval_pos_no_bc_max(eval_pos_no_bc_max)
{
}

/**
* @brief Instantiate a ConstantExtrapolationBoundaryValue2D with periodic splines
Expand All @@ -181,7 +183,9 @@ class ConstantExtrapolationBoundaryValue2D : public SplineBoundaryValue2D<BSplin
explicit ConstantExtrapolationBoundaryValue2D(coord_type_bc const eval_pos_bc)
: m_eval_pos_bc(eval_pos_bc)
, m_eval_pos_no_bc_min(coord_type_no_bc(0.))
, m_eval_pos_no_bc_max(coord_type_no_bc(0.)) {};
, m_eval_pos_no_bc_max(coord_type_no_bc(0.))
{
}


~ConstantExtrapolationBoundaryValue2D() override = default;
Expand Down
8 changes: 4 additions & 4 deletions vendor/sll/include/sll/mapping/circular_to_cartesian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class CircularToCartesian
double to_pseudo_cartesian_jacobian_11_center(Domain const& grid) const
{
return 1.;
};
}

/**
* @brief Compute the (1,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.
Expand All @@ -272,7 +272,7 @@ class CircularToCartesian
double to_pseudo_cartesian_jacobian_12_center(Domain const& grid) const
{
return 0.;
};
}

/**
* @brief Compute the (2,1) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.
Expand All @@ -290,7 +290,7 @@ class CircularToCartesian
double to_pseudo_cartesian_jacobian_21_center(Domain const& grid) const
{
return 0.;
};
}

/**
* @brief Compute the (2,2) coefficient of the pseudo-Cartesian Jacobian matrix at the central point.
Expand All @@ -308,5 +308,5 @@ class CircularToCartesian
double to_pseudo_cartesian_jacobian_22_center(Domain const& grid) const
{
return 1.;
};
}
};
4 changes: 2 additions & 2 deletions vendor/sll/tests/constant_extrapolation_bc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void Evaluate_on_outside_coord(IDomainRP const& grid, Function& exact_function,

// Compare the obtained values with the exact function. ----------------------------------
check_constant_outside_domain(function_evaluated, exact_function, coords, outside_coords, TOL);
};
}



Expand Down Expand Up @@ -499,7 +499,7 @@ void Evaluate_on_outside_coord(IDomainXY const& grid, Function& exact_function,

// Compare the obtained values with the exact function. ----------------------------------
check_constant_outside_domain(function_evaluated, exact_function, coords, outside_coords, TOL);
};
}



Expand Down
4 changes: 2 additions & 2 deletions vendor/sll/tests/gauss_legendre_integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int test_integrate()
}

return test_passed;
};
}

/// This test integrates polynomials of the form x^p for p <= 2*order-1
/// where order is the order of the GaussLegendre integration method.
Expand Down Expand Up @@ -168,7 +168,7 @@ int test_compute_points_and_weights()
}

return test_passed;
};
}

TEST(GaussLegendre, IntegrateDouble)
{
Expand Down

0 comments on commit ed4cf9f

Please sign in to comment.