Skip to content

Commit b1a0605

Browse files
committed
added more tests
1 parent a6763b5 commit b1a0605

File tree

4 files changed

+697
-307
lines changed

4 files changed

+697
-307
lines changed

cmake/Macros.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ macro(hpcReact_add_code_checks)
5151

5252
if( CPPCHECK_FOUND )
5353
add_test( NAME testCppCheck
54-
COMMAND bash -c "make cppcheck_check 2> >(tee cppcheck.err) >/dev/null && exit $(cat cppcheck.err | wc -l)"
54+
COMMAND bash -c "${CMAKE_MAKE_PROGRAM} cppcheck_check 2> >(tee cppcheck.err) >/dev/null && exit $(cat cppcheck.err | wc -l)"
5555
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
5656
)
5757
endif()
5858

5959
if( CLANGTIDY_FOUND )
6060
add_test( NAME testClangTidy
61-
COMMAND bash -c "make clang_tidy_check 2> >(tee tidyCheck.err) >/dev/null && exit $(cat tidyCheck.err | wc -l)"
61+
COMMAND bash -c "${CMAKE_MAKE_PROGRAM} clang_tidy_check 2> >(tee tidyCheck.err) >/dev/null && exit $(cat tidyCheck.err | wc -l)"
6262
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
6363
)
6464
endif()

src/reactions/bulkGeneric/unitTests/testEquilibriumReactions.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,17 +246,7 @@ TEST( testEquilibriumReactions, testCarbonateSystem2 )
246246
log( initialPrimarySpeciesConcentration[6] )
247247
};
248248

249-
double logPrimarySpeciesConcentration[numPrimarySpecies] =
250-
{
251-
logInitialPrimarySpeciesConcentration[0],
252-
logInitialPrimarySpeciesConcentration[1],
253-
logInitialPrimarySpeciesConcentration[2],
254-
logInitialPrimarySpeciesConcentration[3],
255-
logInitialPrimarySpeciesConcentration[4],
256-
logInitialPrimarySpeciesConcentration[5],
257-
logInitialPrimarySpeciesConcentration[6]
258-
};
259-
249+
double logPrimarySpeciesConcentration[numPrimarySpecies];
260250
EquilibriumReactionsType::enforceEquilibrium_Aggregate( 0,
261251
carbonateSystem,
262252
logInitialPrimarySpeciesConcentration,
@@ -270,7 +260,7 @@ TEST( testEquilibriumReactions, testCarbonateSystem2 )
270260
2.491372274738741e-03, // SO4-2
271261
1.858609094598949e+00, // Cl-
272262
9.881874292035110e-03, // Mg+2
273-
1.072307827865370e+00 // Na+1
263+
1.072307827865370e+00 // Na+1
274264
};
275265

276266
for( int r=0; r<numPrimarySpecies; ++r )

src/reactions/bulkGeneric/unitTests/testKineticReactions.cpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,26 @@ TEST( testKineticReactions, computeReactionRatesTest_carbonateSystem )
129129
3.76e-1, // HCO3-
130130
3.87e-2, // Ca+2
131131
3.21e-2, // SO4-2
132-
1.89, // Cl-
132+
1.89, // Cl-
133133
1.65e-2, // Mg+2
134-
1.09 // Na+1
134+
1.09 // Na+1
135135
};
136136

137-
double const expectedReactionRates[11] = { -9.9632648e-01, -1.41376e-01, -3.7599919536e-01, -1.41376e-01, -1.45512e-02, -1.455119956008e-02, -1.24227e-03, -7.3143e-02, -1.3824027e-01,
138-
-5.2965000e-04, -3.4989e-02 };
137+
double const expectedReactionRates[11] = { -0.001424736,-12610.7392,-0.175591624,-473.6096,-269197.19999999984,-0.00012441275624000003,-18012.914999999986,-1.56526019999999e6,-346983.07769999903,-14247.58499999999,-2.316271799999999e6 };
139138
double const expectedReactionRatesDerivatives[11][18] =
140139
{
141-
{ 3.67352e+13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.77e-03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
142-
{ 0.0, 4.37e-07, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.76e-01, -3.76e-01, 0.0, 0.0, 0.0, 0.0, 0.0 },
143-
{ 0.0, 0.0, 8.0464e+09, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.14e-06, -1.00e+00, 0.0, 0.0, 0.0, 0.0, 0.0 },
144-
{ 0.0, 0.0, 0.0, 1.70e-04, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.76e-01, -3.76e-01, 0.0, 0.0, 0.0, 0.0, 0.0 },
145-
{ 0.0, 0.0, 0.0, 0.0, 8.13e-02, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.87e-02, -3.76e-01, 0.0, 0.0, 0.0, 0.0 },
146-
{ 0.0, 0.0, 0.0, 0.0, 0.0, 4.3992e+06, 0.0, 0.0, 0.0, 0.0, 0.0, 1.17e-09, -3.87e-02, -3.76e-01, 0.0, 0.0, 0.0, 0.0 },
147-
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6.92e-03, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.21e-02, -3.87e-02, 0.0, 0.0, 0.0 },
148-
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.68e+00, 0.0, 0.0, 0.0, 0.0, 0.0, -1.89e+00, 0.0, -3.87e-02, 0.0, 0.0 },
149-
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.98e+00, 0.0, 0.0, 0.0, 0.0, -3.5721e+00, 0.0, -1.46286e-01, 0.0, 0.0 },
150-
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.72e-03, 0.0, 0.0, 0.0, 0.0, -1.65e-02, 0.0, -3.21e-02, 0.0 },
151-
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.51e-01, 0.0, 0.0, 0.0, -1.09e+00, 0.0, 0.0, -3.21e-02 }
152-
};
140+
{ 5.264e10,0,0,0,0,0,0,0,0,0,0,0.000014,0,0,0,0,0,0 },
141+
{ 0,0.039,0,0,0,0,0,0,0,0,0,-33539.2,-33539.2,0,0,0,0,0 },
142+
{ 0,0,3.76e9,0,0,0,0,0,0,0,0,1.e-6,-0.467,0,0,0,0,0 },
143+
{ 0,0,0,0.57,0,0,0,0,0,0,0,-1259.6,-1259.6,0,0,0,0,0 },
144+
{ 0,0,0,0,1.5e6,0,0,0,0,0,0,0,-715950.,-6.956e6,0,0,0,0 },
145+
{ 0,0,0,0,0,37600.,0,0,0,0,0,1.e-11,-0.000330885,-0.0032148000000000003,0,0,0,0 },
146+
{ 0,0,0,0,0,0,100000.,0,0,0,0,0,0,-465449.99999999994,-561150.,0,0,0 },
147+
{ 0,0,0,0,0,0,0,1.e8,0,0,0,0,0,-4.0446e7,0,-828180.,0,0 },
148+
{ 0,0,0,0,0,0,0,0,1.e7,0,0,0,0,-8.965971e6,0,-367177.86,0,0 },
149+
{ 0,0,0,0,0,0,0,0,0,100000.,0,0,0,0,-443850.,0,-863489.9999999999,0 },
150+
{ 0,0,0,0,0,0,0,0,0,0,1.e7,0,0,0,-7.2158e7,0,0,-2.12502e6 }
151+
} ;
153152

154153
computeReactionRatesTest< double, false >( carbonateSystem,
155154
initialSpeciesConcentration,

0 commit comments

Comments
 (0)