Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlackoilFluidSystem: use int for component indices #4460

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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