Skip to content

Commit

Permalink
Merge pull request #4460 from akva2/fluidsystem_int_comp_indices
Browse files Browse the repository at this point in the history
BlackoilFluidSystem: use int for component indices
  • Loading branch information
atgeirr authored Feb 12, 2025
2 parents adfe6a5 + 41c5fd4 commit c22694c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions opm/material/fluidsystems/BlackOilDefaultIndexTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ class BlackOilDefaultIndexTraits
{
public:
//! Index of the water phase
static const unsigned waterPhaseIdx = 0;
static constexpr unsigned waterPhaseIdx = 0;
//! Index of the oil phase
static const unsigned oilPhaseIdx = 1;
static constexpr unsigned oilPhaseIdx = 1;
//! Index of the gas phase
static const unsigned gasPhaseIdx = 2;
static constexpr unsigned gasPhaseIdx = 2;

//! Index of the oil component
static const unsigned oilCompIdx = 0;
static constexpr int oilCompIdx = 0;
//! Index of the water component
static const unsigned waterCompIdx = 1;
static constexpr int waterCompIdx = 1;
//! Index of the gas component
static const unsigned gasCompIdx = 2;
static constexpr int gasCompIdx = 2;
};

} // namespace Opm
Expand Down
6 changes: 3 additions & 3 deletions opm/material/fluidsystems/BlackOilFluidSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,11 @@ class BlackOilFluidSystem : public BaseFluidSystem<Scalar, BlackOilFluidSystem<S
static constexpr unsigned numComponents = 3;

//! Index of the oil component
static constexpr unsigned oilCompIdx = IndexTraits::oilCompIdx;
static constexpr int oilCompIdx = IndexTraits::oilCompIdx;
//! Index of the water component
static constexpr unsigned waterCompIdx = IndexTraits::waterCompIdx;
static constexpr int waterCompIdx = IndexTraits::waterCompIdx;
//! Index of the gas component
static constexpr unsigned gasCompIdx = IndexTraits::gasCompIdx;
static constexpr int gasCompIdx = IndexTraits::gasCompIdx;

protected:
static unsigned char numActivePhases_;
Expand Down

0 comments on commit c22694c

Please sign in to comment.