Skip to content

Commit

Permalink
Merge pull request #364 from bcaddy/dev-plmcvlDefault
Browse files Browse the repository at this point in the history
Update Most Builds to VL+PLMC
  • Loading branch information
evaneschneider authored Jan 26, 2024
2 parents 70341bd + f240b3b commit 4b50c55
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 89 deletions.
4 changes: 2 additions & 2 deletions builds/make.inc.template
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ DFLAGS += -DHDF5
# Reconstruction
#DFLAGS += -DPCM
#DFLAGS += -DPLMP
#DFLAGS += -DPLMC
DFLAGS += -DPPMP
DFLAGS += -DPLMC
#DFLAGS += -DPPMP
#DFLAGS += -DPPMC

# Riemann Solver
Expand Down
6 changes: 3 additions & 3 deletions builds/make.type.basic_scalar
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPPMC
DFLAGS += -DPLMC
DFLAGS += -DHLLC

# Integrator
DFLAGS += -DSIMPLE
#DFLAGS += -DVL
# DFLAGS += -DSIMPLE
DFLAGS += -DVL

# Apply a density and temperature floor
DFLAGS += -DDENSITY_FLOOR
Expand Down
2 changes: 1 addition & 1 deletion builds/make.type.disk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ DFLAGS += -DGRAVITY_5_POINTS_GRADIENT
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPPMC
DFLAGS += -DPLMC
DFLAGS += -DHLLC
DFLAGS += -DVL

Expand Down
2 changes: 1 addition & 1 deletion builds/make.type.dust
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MPI_GPU ?=
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPPMC
DFLAGS += -DPLMC
DFLAGS += -DHLLC

# DFLAGS += -DDE
Expand Down
7 changes: 5 additions & 2 deletions builds/make.type.hydro
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPPMC
DFLAGS += -DPLMC
DFLAGS += -DHLLC

# Integrator
ifeq ($(findstring cosmology,$(TYPE)),cosmology)
DFLAGS += -DSIMPLE
#DFLAGS += -DVL
else
DFLAGS += -DVL
endif

# Apply a density and temperature floor
DFLAGS += -DDENSITY_FLOOR
Expand Down
2 changes: 1 addition & 1 deletion builds/make.type.mhd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MPI_GPU ?=
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPPMC
DFLAGS += -DPLMC
DFLAGS += -DHLLD
DFLAGS += -DMHD

Expand Down
6 changes: 3 additions & 3 deletions builds/make.type.rot_proj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPPMC
DFLAGS += -DPLMC
DFLAGS += -DHLLC

# Integrator
DFLAGS += -DSIMPLE
#DFLAGS += -DVL
# DFLAGS += -DSIMPLE
DFLAGS += -DVL

# Apply a density and temperature floor
DFLAGS += -DDENSITY_FLOOR
Expand Down
6 changes: 3 additions & 3 deletions builds/make.type.static_grav
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
DFLAGS += -DCUDA
DFLAGS += -DMPI_CHOLLA
DFLAGS += -DPRECISION=2
DFLAGS += -DPPMC
DFLAGS += -DPLMC
DFLAGS += -DHLLC

# Integrator
DFLAGS += -DSIMPLE
#DFLAGS += -DVL
# DFLAGS += -DSIMPLE
DFLAGS += -DVL

# Apply a density and temperature floor
DFLAGS += -DDENSITY_FLOOR
Expand Down
4 changes: 4 additions & 0 deletions src/global/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ void Parse_Param(char *name, char *value, struct Parameters *parms)
#endif // DE
} else if (strcmp(name, "output_always") == 0) {
int tmp = atoi(value);
// In this case the CHOLLA_ASSERT macro runs into issuse with the readability-simplify-boolean-expr clang-tidy check
// due to some weird macro expansion stuff. That check has been disabled here for now but in clang-tidy 18 the
// IgnoreMacro option should be used instead.
// NOLINTNEXTLINE(readability-simplify-boolean-expr)
CHOLLA_ASSERT((tmp == 0) or (tmp == 1), "output_always must be 1 or 0.");
parms->output_always = tmp;
#ifdef MHD
Expand Down
133 changes: 73 additions & 60 deletions src/reconstruction/plmc_cuda_tests.cu
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

TEST(tHYDROPlmcReconstructor, CorrectInputExpectCorrectOutput)
{
#ifndef VL
std::cerr << "Warning: The tHYDROPlmcReconstructor.CorrectInputExpectCorrectOutput only supports the Van Leer (VL) "
"integrator"
<< std::endl;
return;
#endif // VL
// Set up PRNG to use
std::mt19937_64 prng(42);
std::uniform_real_distribution<double> doubleRand(0.1, 5);
Expand All @@ -49,66 +55,71 @@ TEST(tHYDROPlmcReconstructor, CorrectInputExpectCorrectOutput)
dev_grid.cpyHostToDevice(host_grid);

// Fiducial Data
std::vector<std::unordered_map<int, double>> fiducial_interface_left = {{{26, 2.1584359129984056},
{27, 0.70033864721549188},
{106, 2.2476363309467553},
{107, 3.0633780053857027},
{186, 2.2245934101106259},
{187, 2.1015872413794123},
{266, 2.1263341057778309},
{267, 3.9675148506537838},
{346, 3.3640057502842691},
{347, 21.091316282933843}},
{{21, 0.72430827309279655},
{37, 0.19457128219588618},
{101, 5.4739527659741896},
{117, 4.4286255636679313},
{181, 0.12703829036056602},
{197, 2.2851440769830953},
{261, 1.5337035731959561},
{277, 2.697375839048191},
{341, 22.319601655044117},
{357, 82.515887983144168}},
{{25, 2.2863650183226212},
{29, 1.686415421301841},
{105, 0.72340346106443465},
{109, 5.4713687086831388},
{185, 3.929100145230096},
{189, 4.9166140516911483},
{265, 0.95177493689267167},
{269, 0.46056494878491938},
{345, 3.6886096301452787},
{349, 16.105488797582133}}};
std::vector<std::unordered_map<int, double>> fiducial_interface_right = {{{25, 3.8877922383184833},
{26, 0.70033864721549188},
{105, 1.5947787943675635},
{106, 3.0633780053857027},
{185, 4.0069556576401011},
{186, 2.1015872413794123},
{265, 1.7883678016935785},
{266, 3.9675148506537838},
{345, 2.8032969746372527},
{346, 21.091316282933843}},
{{17, 0.43265217076853835},
{33, 0.19457128219588618},
{97, 3.2697645945288754},
{113, 4.4286255636679313},
{177, 0.07588397666718491},
{193, 2.2851440769830953},
{257, 0.91612950577699748},
{273, 2.697375839048191},
{337, 13.332201861384396},
{353, 82.515887983144168}},
{{5, 2.2863650183226212},
{9, 1.686415421301841},
{85, 0.72340346106443465},
{89, 1.7792505446336098},
{165, 5.3997753452111859},
{169, 1.4379190463124139},
{245, 0.95177493689267167},
{249, 0.46056494878491938},
{325, 6.6889498465051407},
{329, 1.6145084086614281}}};
std::vector<std::unordered_map<int, double>> fiducial_interface_left = {{{26, 3.8877922383184833},
{27, 0.70033864721549188},
{106, 5.6625525038177784},
{107, 3.0633780053857027},
{186, 4.0069556576401011},
{187, 2.1015872413794123},
{266, 5.1729859852329314},
{267, 3.9675148506537838},
{346, 9.6301414677176531},
{347, 21.091316282933843}},
{{21, 0.74780807318015607},
{37, 0.19457128219588618},
{101, 5.6515522777659895},
{117, 4.4286255636679313},
{181, 0.13115998072061905},
{197, 2.2851440769830953},
{261, 1.5834637771067519},
{277, 2.697375839048191},
{341, 23.043749364531674},
{357, 82.515887983144168}},
{{25, 2.2863650183226212},
{29, 1.686415421301841},
{105, 0.72340346106443465},
{109, 5.9563546443402542},
{185, 3.6128571662018358},
{189, 5.3735653401079038},
{265, 0.95177493689267167},
{269, 0.46056494878491938},
{345, 3.1670194578067843},
{349, 19.142817472509272}}};

std::vector<std::unordered_map<int, double>> fiducial_interface_right =

{{{25, 3.8877922383184833},
{26, 0.70033864721549188},
{105, 1.594778794367564},
{106, 3.0633780053857027},
{185, 4.0069556576401011},
{186, 2.1015872413794123},
{265, 1.7883678016935782},
{266, 3.9675148506537838},
{345, 2.8032969746372531},
{346, 21.091316282933843}},
{{17, 0.43265217076853835},
{33, 0.19457128219588618},
{97, 3.2697645945288754},
{113, 4.4286255636679313},
{177, 0.07588397666718491},
{193, 2.2851440769830953},
{257, 0.91612950577699748},
{273, 2.697375839048191},
{337, 13.332201861384396},
{353, 82.515887983144168}},
{{5, 2.2863650183226212},
{9, 1.686415421301841},
{85, 0.72340346106443465},
{89, 1.77925054463361},
{165, 5.3997753452111859},
{169, 1.4379190463124141},
{245, 0.95177493689267167},
{249, 0.46056494878491938},
{325, 6.6889498465051398},
{329, 1.6145084086614285}}}

;

// Loop over different directions
for (size_t direction = 0; direction < 3; direction++) {
Expand Down Expand Up @@ -161,6 +172,8 @@ TEST(tHYDROPlmcReconstructor, CorrectInputExpectCorrectOutput)
? 0.0
: fiducial_interface_right.at(direction)[i];

// if (test_val != 0.0) std::cout << "{" << i << ", " << to_string_exact(test_val) << "}," << std::endl;

testing_utilities::Check_Results(
fiducial_val, test_val,
"right interface at i=" + std::to_string(i) + ", in direction " + std::to_string(direction));
Expand Down
24 changes: 12 additions & 12 deletions src/system_tests/mhd_system_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, SlowMagnetosonicWaveRightMovingC
#ifdef PCM
waveTest.runL1ErrorTest(4.E-7, 4.E-7);
#elif defined(PLMC)
waveTest.runL1ErrorTest(2.0E-8, 2.7E-8);
waveTest.runL1ErrorTest(2.0E-8, 2.75E-8);
#elif defined(PPMC)
waveTest.runL1ErrorTest(1.45E-9, 1.3E-9);
#endif // PCM
Expand Down Expand Up @@ -266,7 +266,7 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, SlowMagnetosonicWaveLeftMovingCo
#ifdef PCM
waveTest.runL1ErrorTest(4.E-7, 4.E-7);
#elif defined(PLMC)
waveTest.runL1ErrorTest(2.0E-8, 2.7E-8);
waveTest.runL1ErrorTest(2.0E-8, 2.75E-8);
#elif defined(PPMC)
waveTest.runL1ErrorTest(1.45E-9, 1.3E-9);
#endif // PCM
Expand Down Expand Up @@ -416,12 +416,12 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, FastMagnetosonicWaveExpectSecond
waveTest.setFiducialNumTimeSteps(numTimeSteps[domain_direction - 1]);

// Run the wave
waveTest.runL1ErrorTest(3.0E-8, 4.0E-8);
waveTest.runL1ErrorTest(7.0E-8, 1.5E-7);

// Check the scaling
double const low_res_l2norm = waveTest.getL2Norm();
testing_utilities::Check_Results(4.0, low_res_l2norm / high_res_l2norms["fast_" + std::to_string(domain_direction)],
"", 0.17);
"", 0.2);
}

TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, SlowMagnetosonicWaveExpectSecondOrderConvergence)
Expand Down Expand Up @@ -452,12 +452,12 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, SlowMagnetosonicWaveExpectSecond
waveTest.setFiducialNumTimeSteps(numTimeSteps[domain_direction - 1]);

// Run the wave
waveTest.runL1ErrorTest(3.0E-8, 4.0E-8);
waveTest.runL1ErrorTest(5.4E-8, 8.0E-8);

// Check the scaling
double const low_res_l2norm = waveTest.getL2Norm();
testing_utilities::Check_Results(4.0, low_res_l2norm / high_res_l2norms["slow_" + std::to_string(domain_direction)],
"", 0.17);
"", 0.2);
}

TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, AlfvenWaveExpectSecondOrderConvergence)
Expand Down Expand Up @@ -487,12 +487,12 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, AlfvenWaveExpectSecondOrderConve
waveTest.setFiducialNumTimeSteps(numTimeSteps[domain_direction - 1]);

// Run the wave
waveTest.runL1ErrorTest(3.0E-8, 4.0E-8);
waveTest.runL1ErrorTest(4.5E-8, 8.0E-8);

// Check the scaling
double const low_res_l2norm = waveTest.getL2Norm();
testing_utilities::Check_Results(4.0, low_res_l2norm / high_res_l2norms["alfven_" + std::to_string(domain_direction)],
"", 0.17);
"", 0.2);
}

TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, MHDContactWaveExpectSecondOrderConvergence)
Expand Down Expand Up @@ -523,12 +523,12 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedAngle, MHDContactWaveExpectSecondOrderC
waveTest.setFiducialNumTimeSteps(numTimeSteps[domain_direction - 1]);

// Run the wave
waveTest.runL1ErrorTest(3.0E-8, 4.0E-8);
waveTest.runL1ErrorTest(5.0E-8, 8.0E-8);

// Check the scaling
double const low_res_l2norm = waveTest.getL2Norm();
testing_utilities::Check_Results(
4.0, low_res_l2norm / high_res_l2norms["contact_" + std::to_string(domain_direction)], "", 0.17);
4.0, low_res_l2norm / high_res_l2norms["contact_" + std::to_string(domain_direction)], "", 0.2);
}

INSTANTIATE_TEST_SUITE_P(, tMHDSYSTEMLinearWavesParameterizedAngle,
Expand Down Expand Up @@ -645,7 +645,7 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedMpi, SlowMagnetosonicWaveRightMovingCor
#ifdef PCM
waveTest.runL1ErrorTest(4.E-7, 4.E-7);
#elif defined(PLMC)
waveTest.runL1ErrorTest(2.0E-8, 2.7E-8);
waveTest.runL1ErrorTest(2.0E-8, 2.75E-8);
#elif defined(PPMC)
waveTest.runL1ErrorTest(1.4E-9, 1.3E-9);
#endif // PCM
Expand Down Expand Up @@ -681,7 +681,7 @@ TEST_P(tMHDSYSTEMLinearWavesParameterizedMpi, SlowMagnetosonicWaveLeftMovingCorr
#ifdef PCM
waveTest.runL1ErrorTest(4.E-7, 4.E-7);
#elif defined(PLMC)
waveTest.runL1ErrorTest(2.0E-8, 2.7E-8);
waveTest.runL1ErrorTest(2.0E-8, 2.8E-8);
#elif defined(PPMC)
waveTest.runL1ErrorTest(1.4E-9, 1.3E-9);
#endif // PCM
Expand Down

0 comments on commit 4b50c55

Please sign in to comment.