Skip to content

Commit 80221f7

Browse files
committed
Replace HLLD Riemann Solver with the one from Athena++
- the Athena++ implementation seems much easier to follow and is noticably faster (for equivalent sets of optimization flags). - We slightly tweaked some of the expected VL+CT test results to account for this change. - Unfortunately, we need to drop the -fno-math-errno flag from linux_gcc.cmake, by default. The MHD_shock_tube_test showed that with the fno-math-errno flag, the 1D MHD shock tube problems have slightly different L1 error norms for the VL+CT solver, depending on the position in the transverse direction (In other words, if we ran the 1D shock tube test along the y-direction, the L1 error norm depends on the x,z components of the problem).
1 parent 6b9209b commit 80221f7

File tree

5 files changed

+443
-355
lines changed

5 files changed

+443
-355
lines changed

LICENSE_ATHENAPP

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
= Athena++ Software Public License =
2+
3+
BSD 3-Clause License
4+
5+
Copyright (c) 2016, PrincetonUniversity
6+
All rights reserved.
7+
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted provided that the following conditions are met:
10+
11+
* Redistributions of source code must retain the above copyright notice, this
12+
list of conditions and the following disclaimer.
13+
14+
* Redistributions in binary form must reproduce the above copyright notice,
15+
this list of conditions and the following disclaimer in the documentation
16+
and/or other materials provided with the distribution.
17+
18+
* Neither the name of the copyright holder nor the names of its
19+
contributors may be used to endorse or promote products derived from
20+
this software without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

config/linux_gcc.cmake

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ if(NOT __processedUserDefaults)
1616
# Set some architecture-specific optimization flags
1717
# (in the future, we might want to excercise more control over the targetted
1818
# instruction set to a higher level)
19-
set(__ARCH_C_OPT_FLAGS "-O3 -fopenmp-simd -march=native -DNDEBUG -funroll-loops -fno-trapping-math -fno-math-errno -fno-signed-zeros")
19+
20+
# if we use -fno-math-errno, that cause 1D MHD shock tube problems to have
21+
# slightly different L1 error norms for the VL+CT solver, depending on the
22+
# position in the transverse direction (see MHD_shock_tube_test)
23+
set(__ARCH_C_OPT_FLAGS "-O3 -fopenmp-simd -march=native -DNDEBUG -funroll-loops -fno-trapping-math -fno-signed-zeros")
2024

2125
set(CMAKE_C_FLAGS_RELEASE "${__ARCH_C_OPT_FLAGS}")
2226
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g ${__ARCH_C_OPT_FLAGS}")

input/vlct/run_MHD_shock_tube_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def analyze_tests():
7878
# use 1 block - if we use more than one block, it's unclear to me if it's
7979
# ok to have round-off errors)
8080

81-
r.append(err_compare(0.012524502240006011,"x"))
81+
r.append(err_compare(0.012523489882320429, "x"))
8282
r.append(err_compare(0.0, "x", std_dev=True))
83-
r.append(err_compare(0.012524502240005972,"y"))
83+
r.append(err_compare(0.012523489882320308, "y"))
8484
r.append(err_compare(0.0, "y", std_dev=True))
85-
r.append(err_compare(0.012524502240005921,"z"))
85+
r.append(err_compare(0.012523489882320315, "z"))
8686
r.append(err_compare(0.0, "z", std_dev=True))
8787

8888
n_passed = np.sum(r)

input/vlct/run_dual_energy_cloud_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def check_cloud_asym(fname, name, max_asym):
8181
def analyze_tests():
8282
r = []
8383
r += check_cloud_asym('hlld_cloud_0.0625/hlld_cloud_0.0625.block_list',
84-
'hlld_cloud', 5.5e-13)
84+
'hlld_cloud', 6.3e-13)
8585
r += check_cloud_asym('hllc_cloud_0.0625/hllc_cloud_0.0625.block_list',
8686
'hllc_cloud', 4.6e-13)
8787
r += check_cloud_asym('hlle_cloud_0.0625/hlle_cloud_0.0625.block_list',

0 commit comments

Comments
 (0)