Skip to content

Commit

Permalink
Resolve "Suspicious comparison in collisions_intra.hpp"
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBourne committed Sep 25, 2023
1 parent 15d8959 commit adb6566
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/geometryXVx/rhs/collisions_intra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ CollisionsIntra::CollisionsIntra(IDomainSpXVx const& mesh, double nustar0)
int const ncells(ddc::select<IDimVx>(mesh).size() - 1);
if constexpr (uniform_edge_v) {
double const step(ddc::step<IDimVx>());
ddc::init_discrete_space<
ddc::UniformPointSampling<GhostedVx>>(vx0 - step, vxN + step, ncells + 3);
ddc::init_discrete_space(
ddc::UniformPointSampling<GhostedVx>::
init(ddc::Coordinate<GhostedVx>(vx0 - step),
ddc::Coordinate<GhostedVx>(vxN + step),
ddc::DiscreteVector<ddc::UniformPointSampling<GhostedVx>>(
ncells + 3)));
} else {
int const npoints(ncells + 3);
std::vector<ddc::Coordinate<GhostedVx>> breaks(npoints);
Expand All @@ -87,8 +91,12 @@ CollisionsIntra::CollisionsIntra(IDomainSpXVx const& mesh, double nustar0)

if constexpr (uniform_edge_v) {
double const step(ddc::step<IDimVx>());
ddc::init_discrete_space<
ddc::UniformPointSampling<GhostedVxStaggered>>(vx0 - step, vxN + step, ncells + 2);
ddc::init_discrete_space(
ddc::UniformPointSampling<GhostedVxStaggered>::
init(ddc::Coordinate<GhostedVxStaggered>(vx0 - step / 2),
ddc::Coordinate<GhostedVxStaggered>(vxN + step / 2),
ddc::DiscreteVector<ddc::UniformPointSampling<GhostedVxStaggered>>(
ncells + 2)));
} else {
int const npoints(ncells + 2);
std::vector<ddc::Coordinate<GhostedVxStaggered>> breaks(npoints);
Expand Down
2 changes: 1 addition & 1 deletion src/geometryXVx/rhs/collisions_intra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CollisionsIntra : public IRightHandSide
}

static constexpr bool uniform_edge_v
= std::is_same_v<RDimVx, ddc::UniformPointSampling<RDimVx>>;
= std::is_same_v<IDimVx, ddc::UniformPointSampling<RDimVx>>;

public:
using ghosted_vx_point_sampling = std::conditional_t<
Expand Down

0 comments on commit adb6566

Please sign in to comment.