Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/reactions/exampleSystems/BulkGeneric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace bulkGeneric
// um1Constants };


using simpleKineticTestType = reactionsSystems::MixedReactionsParameters< double, int, int, 5, 2, 0 >;
using simpleKineticTestType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 5, 2, 0 >;

constexpr
simpleKineticTestType
Expand All @@ -68,7 +68,7 @@ simpleKineticTestRateParams =
0
};

using simpleTestType = reactionsSystems::MixedReactionsParameters< double, int, int, 5, 2, 2 >;
using simpleTestType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 5, 2, 2 >;

constexpr
simpleTestType
Expand Down
2 changes: 1 addition & 1 deletion src/reactions/exampleSystems/ChainGeneric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace ChainGeneric
{
// *****UNCRUSTIFY-OFF******

using serialAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, int, 3, 3, 0 >;
using serialAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 3, 3, 0 >;

constexpr serialAllKineticType serialAllKineticParams =
{
Expand Down
4 changes: 2 additions & 2 deletions src/reactions/exampleSystems/MoMasBenchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace MoMasBenchmark
{
// *****UNCRUSTIFY-OFF******

using easyCaseType = reactionsSystems::MixedReactionsParameters< double, int, int, 12, 7, 7 >;
using mediumCaseType = reactionsSystems::MixedReactionsParameters< double, int, int, 14, 10, 9 >;
using easyCaseType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 12, 7, 7 >;
using mediumCaseType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 14, 10, 9 >;

constexpr easyCaseType easyCaseParams =
{
Expand Down
10 changes: 5 additions & 5 deletions src/reactions/geochemistry/Carbonate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace geochemistry
namespace carbonate
{

constexpr CArrayWrapper<double, 10, 17> stoichMatrix =
constexpr CArrayWrapper<signed char, 10, 17> stoichMatrix =
{ // OH- CO2 CO3-2 CaHCO3+ CaSO4 CaCl+ CaCl2 MgSO4 NaSO4- CaCO3 H+ HCO3- Ca+2 SO4-2 Cl- Mg+2 Na+
{ -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0 }, // OH- + H+ = H2O
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // CO2 + H2O = H+ + HCO3-
Expand All @@ -38,7 +38,7 @@ constexpr CArrayWrapper<double, 10, 17> stoichMatrix =
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 1, 1, 0, 0, 0, 0 } // CaCO3(s) + H+ = Ca+2 + HCO3- (kinetic)
};

constexpr CArrayWrapper<double, 10, 16> stoichMatrixNosolid =
constexpr CArrayWrapper<signed char, 10, 16> stoichMatrixNosolid =
{ // OH- CO2 CO3-2 CaHCO3+ CaSO4 CaCl+ CaCl2 MgSO4 NaSO4- H+ HCO3- Ca+2 SO4-2 Cl- Mg+2 Na+
{ -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0 }, // OH- + H+ = H2O
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // CO2 + H2O = H+ + HCO3-
Expand Down Expand Up @@ -109,9 +109,9 @@ constexpr CArrayWrapper<int, 10> mobileSpeciesFlag =

}

using carbonateSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, int, 17, 10, 0 >;
using carbonateSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, int, 17, 10, 10 >;
using carbonateSystemType = reactionsSystems::MixedReactionsParameters< double, int, int, 16, 10, 9 >;
using carbonateSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 17, 10, 0 >;
using carbonateSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 17, 10, 10 >;
using carbonateSystemType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 16, 10, 9 >;

constexpr carbonateSystemAllKineticType carbonateSystemAllKinetic( carbonate::stoichMatrix, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates, carbonate::mobileSpeciesFlag, 0 );
constexpr carbonateSystemAllEquilibriumType carbonateSystemAllEquilibrium( carbonate::stoichMatrix, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates, carbonate::mobileSpeciesFlag );
Expand Down
4 changes: 2 additions & 2 deletions src/reactions/geochemistry/Forge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace forge
// Stoichiometric matrix [13 reactions × 23 species]
// Columns 0–12: secondary species (must be -1 on diagonal)
// Columns 13–22: primary species
constexpr CArrayWrapper< double, 19, 26 > soichMatrix =
constexpr CArrayWrapper< signed char, 19, 26 > soichMatrix =
{// CaCO₃ CaHCO₃⁺ CaSO₄ CaCl⁺ CaCl₂ MgHCO₃⁺ MgCO₃ MgCl⁺ CO₂(aq) HSO₄⁻ KHSO₄ HSiO₃⁻ NaHSilO₃ NaCl KCl KSO₄⁻ | H⁺ Ca²⁺ Mg²⁺ Na⁺ K⁺ Al³⁺ HCO₃⁻ SO₄²⁻ Cl⁻ SiO₂(aq)
{ -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, // CaCO₃(aq) + H⁺ ⇌ Ca²⁺ + HCO₃⁻
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 }, // CaHCO₃⁺ ⇌ Ca²⁺ + HCO₃⁻
Expand Down Expand Up @@ -144,7 +144,7 @@ constexpr CArrayWrapper< int, 19 > mobileSpeciesFlag =

}

using forgeSystemType = reactionsSystems::MixedReactionsParameters< double, int, int, 26, 19, 16 >;
using forgeSystemType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 26, 19, 16 >;


constexpr forgeSystemType forgeSystem( forge::soichMatrix, forge::equilibriumConstants, forge::fwRateConstant, forge::reverseRateConstant, forge::mobileSpeciesFlag );
Expand Down
8 changes: 4 additions & 4 deletions src/reactions/geochemistry/Ultramafics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace geochemistry
namespace ultramafics
{

constexpr CArrayWrapper<double, 21, 25> stoichMatrix =
constexpr CArrayWrapper<signed char, 21, 25> stoichMatrix =
{ // OH- CO2(aq) CO3-- Mg2OH+++ Mg4(OH)++++ MgOH+ Mg2CO3++ MgCO3(aq) MgHCO3+ Mg(H3SiO4)2 MgH2SiO4 MgH3SiO4+ H2SiO4-- H3SiO4- H4(H2SiO4)---- H6(H2SiO4)-- Mg2SiO4 MgCO3 SiO2 Mg3Si2O5(OH)4 Mg(OH)2 H+ HCO3- Mg++ SiO2(aq)
{ -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0 }, // OH- + H+ = H2O
{ 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0 }, // CO2(aq) + H2O = HCO3- + H+
Expand Down Expand Up @@ -153,9 +153,9 @@ constexpr CArrayWrapper<int, 21> mobileSpeciesFlag =
};
}

using ultramaficSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 0 >;
using ultramaficSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 21 >;
using ultramaficSystemType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 16 >;
using ultramaficSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 25, 21, 0 >;
using ultramaficSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 25, 21, 21 >;
using ultramaficSystemType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 25, 21, 16 >;

constexpr ultramaficSystemAllKineticType ultramaficSystemAllKinetic( ultramafics::stoichMatrix, ultramafics::equilibriumConstants, ultramafics::forwardRates, ultramafics::reverseRates, ultramafics::mobileSpeciesFlag );
constexpr ultramaficSystemAllEquilibriumType ultramaficSystemAllEquilibrium( ultramafics::stoichMatrix, ultramafics::equilibriumConstants, ultramafics::forwardRates, ultramafics::reverseRates, ultramafics::mobileSpeciesFlag );
Expand Down
22 changes: 11 additions & 11 deletions src/reactions/reactionsSystems/Parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct EquilibriumReactionsParameters

HPCREACT_HOST_DEVICE
constexpr
EquilibriumReactionsParameters( CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
EquilibriumReactionsParameters( CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
CArrayWrapper< RealType, NUM_REACTIONS > equilibriumConstant,
CArrayWrapper< IntType, NUM_REACTIONS > mobileSecondarySpeciesFlag ):
m_stoichiometricMatrix( stoichiometricMatrix ),
Expand All @@ -62,11 +62,11 @@ struct EquilibriumReactionsParameters
{}


HPCREACT_HOST_DEVICE RealType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
HPCREACT_HOST_DEVICE IndexType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
HPCREACT_HOST_DEVICE RealType equilibriumConstant( IndexType const r ) const { return m_equilibriumConstant[r]; }
HPCREACT_HOST_DEVICE IntType mobileSecondarySpeciesFlag( IndexType const r ) const { return m_mobileSecondarySpeciesFlag[r]; }

CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
CArrayWrapper< RealType, NUM_REACTIONS > m_equilibriumConstant;
CArrayWrapper< IntType, NUM_REACTIONS > m_mobileSecondarySpeciesFlag;
};
Expand All @@ -87,7 +87,7 @@ struct KineticReactionsParameters
HPCREACT_HOST_DEVICE static constexpr IndexType numReactions() { return NUM_REACTIONS; }

HPCREACT_HOST_DEVICE
constexpr KineticReactionsParameters( CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
constexpr KineticReactionsParameters( CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantForward,
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantReverse,
CArrayWrapper< RealType, NUM_REACTIONS > const & equilibriumConstant,
Expand All @@ -100,14 +100,14 @@ struct KineticReactionsParameters
{}


HPCREACT_HOST_DEVICE RealType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
HPCREACT_HOST_DEVICE IndexType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
HPCREACT_HOST_DEVICE RealType rateConstantForward( IndexType const r ) const { return m_rateConstantForward[r]; }
HPCREACT_HOST_DEVICE RealType rateConstantReverse( IndexType const r ) const { return m_rateConstantReverse[r]; }
HPCREACT_HOST_DEVICE RealType equilibriumConstant( IndexType const r ) const { return m_rateConstantForward[r] / m_rateConstantReverse[r]; }

HPCREACT_HOST_DEVICE IntType reactionRatesUpdateOption() const { return m_reactionRatesUpdateOption; }

CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantForward;
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantReverse;
CArrayWrapper< RealType, NUM_REACTIONS > m_equilibiriumConstant;
Expand All @@ -131,7 +131,7 @@ struct MixedReactionsParameters

constexpr MixedReactionsParameters() = default;

constexpr MixedReactionsParameters( CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
constexpr MixedReactionsParameters( CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
CArrayWrapper< RealType, NUM_REACTIONS > const & equilibriumConstant,
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantForward,
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantReverse,
Expand Down Expand Up @@ -162,7 +162,7 @@ struct MixedReactionsParameters
EquilibriumReactionsParameters< RealType, IntType, IndexType, numSpecies(), numEquilibriumReactions() >
equilibriumReactionsParameters() const
{
CArrayWrapper< RealType, numEquilibriumReactions(), numSpecies() > eqMatrix{};
CArrayWrapper< IndexType, numEquilibriumReactions(), numSpecies() > eqMatrix{};
CArrayWrapper< RealType, numEquilibriumReactions() > eqConstants{};
CArrayWrapper< IntType, numEquilibriumReactions() > mobileSpeciesFlags{};

Expand All @@ -184,7 +184,7 @@ struct MixedReactionsParameters
KineticReactionsParameters< RealType, IntType, IndexType, numSpecies(), numKineticReactions() >
kineticReactionsParameters() const
{
CArrayWrapper< RealType, numKineticReactions(), numSpecies() > kineticMatrix{};
CArrayWrapper< IndexType, numKineticReactions(), numSpecies() > kineticMatrix{};
CArrayWrapper< RealType, numKineticReactions() > rateConstantForward{};
CArrayWrapper< RealType, numKineticReactions() > rateConstantReverse{};
CArrayWrapper< RealType, numKineticReactions() > equilibriumConstant{};
Expand Down Expand Up @@ -239,12 +239,12 @@ struct MixedReactionsParameters
}
}

HPCREACT_HOST_DEVICE RealType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
HPCREACT_HOST_DEVICE IndexType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
HPCREACT_HOST_DEVICE RealType equilibriumConstant( IndexType const r ) const { return m_equilibriumConstant[r]; }
HPCREACT_HOST_DEVICE RealType rateConstantForward( IndexType const r ) const { return m_rateConstantForward[r]; }
HPCREACT_HOST_DEVICE RealType rateConstantReverse( IndexType const r ) const { return m_rateConstantReverse[r]; }

CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
CArrayWrapper< RealType, NUM_REACTIONS > m_equilibriumConstant;
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantForward;
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantReverse;
Expand Down