Skip to content

Commit

Permalink
updated unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter La Follette authored and Peter La Follette committed Apr 2, 2024
1 parent 2b0bb13 commit 48b0f56
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/main_unit_test_bmi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ int main(int argc, char *argv[])

// Benchmark values of wetting fronts depth and moisture (b is for benchmark)
//std::vector<double> depth_wf_b = {1.873813, 44.00,175.0, 200.0}; // in cm
std::vector<double> depth_wf_b = {4.3762450616157, 44.00,175.0, 200.0}; // in cm
std::vector<double> theta_wf_b = {0.2153965837523, 0.172703948143618, 0.252113867764474, 0.179593529195751};
std::vector<double> depth_wf_b = {4.55355, 44.00,175.0, 200.0}; // in cm
std::vector<double> theta_wf_b = {0.213716, 0.172703948143618, 0.252113867764474, 0.179593529195751};

int m_to_cm = 100;
int m_to_mm = 1000;
Expand Down Expand Up @@ -518,7 +518,7 @@ int main(int argc, char *argv[])

// check total infiltration, AET, and PET.
double infiltration_check_mm = 1.896; // in mm
double AET_check_mm = 0.0288829525; // in mm
double AET_check_mm = 0.029801; // in mm
double PET_check_mm = 0.104; // in mm
double infiltration_computed = 0.0;
double PET_computed = 0.0;
Expand Down Expand Up @@ -562,6 +562,9 @@ int main(int argc, char *argv[])
std::stringstream errMsg;
errMsg << "Error between benchmark and simulated AET is "<< fabs(AET_check_mm - AET_computed * m_to_mm)
<< " which is unexpected. \n";
printf("benchmark AET: %lf \n", AET_check_mm);
printf("computed AET: %lf \n", AET_computed*m_to_mm);

throw std::runtime_error(errMsg.str());
}

Expand Down

0 comments on commit 48b0f56

Please sign in to comment.