Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cpp/modmesh/onedim/Euler1DCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,19 @@ void Euler1DCore::march_half_so0(bool odd_plane)

void Euler1DCore::treat_boundary_so0()
{
/* Non-reflecting boundary condition (NRBC) type 3 with $\lambda=0$
/* Non-reflecting boundary condition (NRBC) type 2 with $\lambda=0$
* (the third set in Chang 05) */
// Set outside value from inside value.
{
// Left boundary.
size_t const ic = 1;
size_t const ic = 0;
m_so0(ic, 0) = m_so0(ic + 1, 0);
m_so0(ic, 1) = m_so0(ic + 1, 1);
m_so0(ic, 2) = m_so0(ic + 1, 2);
}
{
// Right boundary.
size_t const ic = ncoord() - 2;
size_t const ic = ncoord() - 1;
m_so0(ic, 0) = m_so0(ic - 1, 0);
m_so0(ic, 1) = m_so0(ic - 1, 1);
m_so0(ic, 2) = m_so0(ic - 1, 2);
Expand All @@ -174,19 +174,19 @@ void Euler1DCore::treat_boundary_so0()

void Euler1DCore::treat_boundary_so1()
{
/* Non-reflecting boundary condition (NRBC) type 3 with $\lambda=0$
/* Non-reflecting boundary condition (NRBC) type 2 with $\lambda=0$
* (the third set in Chang 05) */
// Set outside value from inside value.
{
// Left boundary.
size_t const ic = 1;
size_t const ic = 0;
m_so1(ic, 0) = m_so1(ic + 1, 0);
m_so1(ic, 1) = m_so1(ic + 1, 1);
m_so1(ic, 2) = m_so1(ic + 1, 2);
}
{
// Right boundary.
size_t const ic = ncoord() - 2;
size_t const ic = ncoord() - 1;
m_so1(ic, 0) = m_so1(ic - 1, 0);
m_so1(ic, 1) = m_so1(ic - 1, 1);
m_so1(ic, 2) = m_so1(ic - 1, 2);
Expand Down
2 changes: 1 addition & 1 deletion cpp/modmesh/onedim/pymod/wrap_onedim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ class MODMESH_PYTHON_WRAPPER_VISIBILITY WrapEuler1DCore

(*this)
.def_timed("update_cfl", &wrapped_type::update_cfl, py::arg("odd_plane"))
.def_timed("march_half_so0", &wrapped_type::march_half_so0, py::arg("odd_plane"))
.def_timed("treat_boundary_so0", &wrapped_type::treat_boundary_so0)
.def_timed("treat_boundary_so1", &wrapped_type::treat_boundary_so1)
.def_timed("march_half_so0", &wrapped_type::march_half_so0, py::arg("odd_plane"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a refactoring PR. It is unnecessary to change the order of existing code. Next time please avoid doing it in a non-refactoring PR.

.def_timed("setup_march", &wrapped_type::setup_march);

(*this)
Expand Down
4 changes: 2 additions & 2 deletions cpp/modmesh/spacetime/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,11 +1004,11 @@ template <typename ST, typename CE, typename SE>
template <size_t ALPHA>
inline void SolverBase<ST, CE, SE>::march_half1_alpha()
{
march_half_so0(false);
treat_boundary_so0();
treat_boundary_so1();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing the unused solver?

march_half_so0(false);
update_cfl(true);
march_half_so1_alpha<ALPHA>(false);
treat_boundary_so1();
}

template <typename ST, typename CE, typename SE>
Expand Down
4 changes: 2 additions & 2 deletions cpp/modmesh/spacetime/kernel/BadEuler1DSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ inline void BadEuler1DSolver::march_half_so1_alpha(bool odd_plane)
template <size_t ALPHA>
inline void BadEuler1DSolver::march_half1_alpha()
{
march_half_so0(false);
treat_boundary_so0();
treat_boundary_so1();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto (Why changing the unused solver?)

march_half_so0(false);
update_cfl(true);
march_half_so1_alpha<ALPHA>(false);
treat_boundary_so1();
}

template <size_t ALPHA>
Expand Down
4 changes: 2 additions & 2 deletions cpp/modmesh/spacetime/pymod/wrap_spacetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,12 @@ class MODMESH_PYTHON_WRAPPER_VISIBILITY WrapBadEuler1DSolver
wrapper_type & def_group_march()
{
namespace py = pybind11;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware of trailing white spaces (TWS). Never add TWS.

(*this)
.def_timed("update_cfl", &wrapped_type::update_cfl, py::arg("odd_plane"))
.def_timed("march_half_so0", &wrapped_type::march_half_so0, py::arg("odd_plane"))
.def_timed("treat_boundary_so0", &wrapped_type::treat_boundary_so0)
.def_timed("treat_boundary_so1", &wrapped_type::treat_boundary_so1)
.def_timed("march_half_so0", &wrapped_type::march_half_so0, py::arg("odd_plane"))
.def_timed("setup_march", &wrapped_type::setup_march);

(*this)
Expand Down
2 changes: 1 addition & 1 deletion cpp/modmesh/spacetime/pymod/wrap_spacetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ class WrapSolverBase

(*this)
.def("update_cfl", &wrapped_type::update_cfl, py::arg("odd_plane"))
.def("march_half_so0", &wrapped_type::march_half_so0, py::arg("odd_plane"))
.def("treat_boundary_so0", &wrapped_type::treat_boundary_so0)
.def("treat_boundary_so1", &wrapped_type::treat_boundary_so1)
.def("march_half_so0", &wrapped_type::march_half_so0, py::arg("odd_plane"))
.def("setup_march", &wrapped_type::setup_march);

// clang-format off
Expand Down
5 changes: 2 additions & 3 deletions tests/test_onedim_euler.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ def test_array_getter(self):

def test_march_fine_interface(self):
def _march():
# first half step.
self.svr.march_half_so0(odd_plane=False)
self.svr.treat_boundary_so0()
self.svr.treat_boundary_so1()
self.svr.march_half_so0(odd_plane=False)
self.svr.update_cfl(odd_plane=True)
self.svr.march_half_so1_alpha2(odd_plane=False)
self.svr.treat_boundary_so1()
# second half step.
self.svr.march_half_so0(odd_plane=True)
self.svr.update_cfl(odd_plane=False)
Expand Down
9 changes: 4 additions & 5 deletions tests/test_spacetime_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,11 @@ def test_march(self):

def test_march_fine_interface(self):
def _march():
# first half step.
self.svr.march_half_so0(odd_plane=False)
self.svr.treat_boundary_so0()
self.svr.treat_boundary_so1()
self.svr.march_half_so0(odd_plane=False)
self.svr.update_cfl(odd_plane=True)
self.svr.march_half_so1_alpha2(odd_plane=False)
self.svr.treat_boundary_so1()
# second half step.
self.svr.march_half_so0(odd_plane=True)
self.svr.update_cfl(odd_plane=False)
Expand Down Expand Up @@ -439,11 +438,11 @@ def test_march(self):
def test_march_fine_interface(self):
def _march():
# first half step.
self.svr.march_half_so0(odd_plane=False)
self.svr.treat_boundary_so0()
self.svr.treat_boundary_so1()
self.svr.march_half_so0(odd_plane=False)
self.svr.update_cfl(odd_plane=True)
self.svr.march_half_so1_alpha2(odd_plane=False)
self.svr.treat_boundary_so1()
# second half st
self.svr.march_half_so0(odd_plane=True)
self.svr.update_cfl(odd_plane=False)
Expand Down