Skip to content

Commit cd529d9

Browse files
committed
changed double to signed char for stoichMatrix
1 parent 2b2aeaf commit cd529d9

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

src/reactions/exampleSystems/BulkGeneric.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace bulkGeneric
4545
// um1Constants };
4646

4747

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

5050
constexpr
5151
simpleKineticTestType
@@ -68,7 +68,7 @@ simpleKineticTestRateParams =
6868
0
6969
};
7070

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

7373
constexpr
7474
simpleTestType

src/reactions/exampleSystems/ChainGeneric.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace ChainGeneric
1919
{
2020
// *****UNCRUSTIFY-OFF******
2121

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

2424
constexpr serialAllKineticType serialAllKineticParams =
2525
{

src/reactions/exampleSystems/MoMasBenchmark.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ namespace MoMasBenchmark
1919
{
2020
// *****UNCRUSTIFY-OFF******
2121

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

2525
constexpr easyCaseType easyCaseParams =
2626
{

src/reactions/geochemistry/Carbonate.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace geochemistry
2424
namespace carbonate
2525
{
2626

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

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

110110
}
111111

112-
using carbonateSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, int, 17, 10, 0 >;
113-
using carbonateSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, int, 17, 10, 10 >;
114-
using carbonateSystemType = reactionsSystems::MixedReactionsParameters< double, int, int, 16, 10, 9 >;
112+
using carbonateSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 17, 10, 0 >;
113+
using carbonateSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 17, 10, 10 >;
114+
using carbonateSystemType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 16, 10, 9 >;
115115

116116
constexpr carbonateSystemAllKineticType carbonateSystemAllKinetic( carbonate::stoichMatrix, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates, carbonate::mobileSpeciesFlag, 0 );
117117
constexpr carbonateSystemAllEquilibriumType carbonateSystemAllEquilibrium( carbonate::stoichMatrix, carbonate::equilibriumConstants, carbonate::forwardRates, carbonate::reverseRates, carbonate::mobileSpeciesFlag );

src/reactions/geochemistry/Forge.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace forge
2525
// Stoichiometric matrix [13 reactions × 23 species]
2626
// Columns 0–12: secondary species (must be -1 on diagonal)
2727
// Columns 13–22: primary species
28-
constexpr CArrayWrapper< double, 19, 26 > soichMatrix =
28+
constexpr CArrayWrapper< signed char, 19, 26 > soichMatrix =
2929
{// 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)
3030
{ -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₃⁻
3131
{ 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₃⁻
@@ -144,7 +144,7 @@ constexpr CArrayWrapper< int, 19 > mobileSpeciesFlag =
144144

145145
}
146146

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

149149

150150
constexpr forgeSystemType forgeSystem( forge::soichMatrix, forge::equilibriumConstants, forge::fwRateConstant, forge::reverseRateConstant, forge::mobileSpeciesFlag );

src/reactions/geochemistry/Ultramafics.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace geochemistry
2525
namespace ultramafics
2626
{
2727

28-
constexpr CArrayWrapper<double, 21, 25> stoichMatrix =
28+
constexpr CArrayWrapper<signed char, 21, 25> stoichMatrix =
2929
{ // 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)
3030
{ -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
3131
{ 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+
@@ -153,9 +153,9 @@ constexpr CArrayWrapper<int, 21> mobileSpeciesFlag =
153153
};
154154
}
155155

156-
using ultramaficSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 0 >;
157-
using ultramaficSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 21 >;
158-
using ultramaficSystemType = reactionsSystems::MixedReactionsParameters< double, int, int, 25, 21, 16 >;
156+
using ultramaficSystemAllKineticType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 25, 21, 0 >;
157+
using ultramaficSystemAllEquilibriumType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 25, 21, 21 >;
158+
using ultramaficSystemType = reactionsSystems::MixedReactionsParameters< double, int, signed char, 25, 21, 16 >;
159159

160160
constexpr ultramaficSystemAllKineticType ultramaficSystemAllKinetic( ultramafics::stoichMatrix, ultramafics::equilibriumConstants, ultramafics::forwardRates, ultramafics::reverseRates, ultramafics::mobileSpeciesFlag );
161161
constexpr ultramaficSystemAllEquilibriumType ultramaficSystemAllEquilibrium( ultramafics::stoichMatrix, ultramafics::equilibriumConstants, ultramafics::forwardRates, ultramafics::reverseRates, ultramafics::mobileSpeciesFlag );

src/reactions/reactionsSystems/Parameters.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct EquilibriumReactionsParameters
5353

5454
HPCREACT_HOST_DEVICE
5555
constexpr
56-
EquilibriumReactionsParameters( CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
56+
EquilibriumReactionsParameters( CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
5757
CArrayWrapper< RealType, NUM_REACTIONS > equilibriumConstant,
5858
CArrayWrapper< IntType, NUM_REACTIONS > mobileSecondarySpeciesFlag ):
5959
m_stoichiometricMatrix( stoichiometricMatrix ),
@@ -62,11 +62,11 @@ struct EquilibriumReactionsParameters
6262
{}
6363

6464

65-
HPCREACT_HOST_DEVICE RealType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
65+
HPCREACT_HOST_DEVICE IndexType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
6666
HPCREACT_HOST_DEVICE RealType equilibriumConstant( IndexType const r ) const { return m_equilibriumConstant[r]; }
6767
HPCREACT_HOST_DEVICE IntType mobileSecondarySpeciesFlag( IndexType const r ) const { return m_mobileSecondarySpeciesFlag[r]; }
6868

69-
CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
69+
CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
7070
CArrayWrapper< RealType, NUM_REACTIONS > m_equilibriumConstant;
7171
CArrayWrapper< IntType, NUM_REACTIONS > m_mobileSecondarySpeciesFlag;
7272
};
@@ -87,7 +87,7 @@ struct KineticReactionsParameters
8787
HPCREACT_HOST_DEVICE static constexpr IndexType numReactions() { return NUM_REACTIONS; }
8888

8989
HPCREACT_HOST_DEVICE
90-
constexpr KineticReactionsParameters( CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
90+
constexpr KineticReactionsParameters( CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
9191
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantForward,
9292
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantReverse,
9393
CArrayWrapper< RealType, NUM_REACTIONS > const & equilibriumConstant,
@@ -100,14 +100,14 @@ struct KineticReactionsParameters
100100
{}
101101

102102

103-
HPCREACT_HOST_DEVICE RealType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
103+
HPCREACT_HOST_DEVICE IndexType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
104104
HPCREACT_HOST_DEVICE RealType rateConstantForward( IndexType const r ) const { return m_rateConstantForward[r]; }
105105
HPCREACT_HOST_DEVICE RealType rateConstantReverse( IndexType const r ) const { return m_rateConstantReverse[r]; }
106106
HPCREACT_HOST_DEVICE RealType equilibriumConstant( IndexType const r ) const { return m_rateConstantForward[r] / m_rateConstantReverse[r]; }
107107

108108
HPCREACT_HOST_DEVICE IntType reactionRatesUpdateOption() const { return m_reactionRatesUpdateOption; }
109109

110-
CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
110+
CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
111111
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantForward;
112112
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantReverse;
113113
CArrayWrapper< RealType, NUM_REACTIONS > m_equilibiriumConstant;
@@ -131,7 +131,7 @@ struct MixedReactionsParameters
131131

132132
constexpr MixedReactionsParameters() = default;
133133

134-
constexpr MixedReactionsParameters( CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
134+
constexpr MixedReactionsParameters( CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > const & stoichiometricMatrix,
135135
CArrayWrapper< RealType, NUM_REACTIONS > const & equilibriumConstant,
136136
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantForward,
137137
CArrayWrapper< RealType, NUM_REACTIONS > const & rateConstantReverse,
@@ -162,7 +162,7 @@ struct MixedReactionsParameters
162162
EquilibriumReactionsParameters< RealType, IntType, IndexType, numSpecies(), numEquilibriumReactions() >
163163
equilibriumReactionsParameters() const
164164
{
165-
CArrayWrapper< RealType, numEquilibriumReactions(), numSpecies() > eqMatrix{};
165+
CArrayWrapper< IndexType, numEquilibriumReactions(), numSpecies() > eqMatrix{};
166166
CArrayWrapper< RealType, numEquilibriumReactions() > eqConstants{};
167167
CArrayWrapper< IntType, numEquilibriumReactions() > mobileSpeciesFlags{};
168168

@@ -184,7 +184,7 @@ struct MixedReactionsParameters
184184
KineticReactionsParameters< RealType, IntType, IndexType, numSpecies(), numKineticReactions() >
185185
kineticReactionsParameters() const
186186
{
187-
CArrayWrapper< RealType, numKineticReactions(), numSpecies() > kineticMatrix{};
187+
CArrayWrapper< IndexType, numKineticReactions(), numSpecies() > kineticMatrix{};
188188
CArrayWrapper< RealType, numKineticReactions() > rateConstantForward{};
189189
CArrayWrapper< RealType, numKineticReactions() > rateConstantReverse{};
190190
CArrayWrapper< RealType, numKineticReactions() > equilibriumConstant{};
@@ -239,12 +239,12 @@ struct MixedReactionsParameters
239239
}
240240
}
241241

242-
HPCREACT_HOST_DEVICE RealType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
242+
HPCREACT_HOST_DEVICE IndexType stoichiometricMatrix( IndexType const r, int const i ) const { return m_stoichiometricMatrix[r][i]; }
243243
HPCREACT_HOST_DEVICE RealType equilibriumConstant( IndexType const r ) const { return m_equilibriumConstant[r]; }
244244
HPCREACT_HOST_DEVICE RealType rateConstantForward( IndexType const r ) const { return m_rateConstantForward[r]; }
245245
HPCREACT_HOST_DEVICE RealType rateConstantReverse( IndexType const r ) const { return m_rateConstantReverse[r]; }
246246

247-
CArrayWrapper< RealType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
247+
CArrayWrapper< IndexType, NUM_REACTIONS, NUM_SPECIES > m_stoichiometricMatrix;
248248
CArrayWrapper< RealType, NUM_REACTIONS > m_equilibriumConstant;
249249
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantForward;
250250
CArrayWrapper< RealType, NUM_REACTIONS > m_rateConstantReverse;

0 commit comments

Comments
 (0)