Skip to content
Open
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
32 changes: 32 additions & 0 deletions cpp/modmesh/onedim/Euler1DCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ void Euler1DCore::treat_boundary_so0()
m_so0(ic, 1) = m_so0(ic - 1, 1);
m_so0(ic, 2) = m_so0(ic - 1, 2);
}

// Set the boundary point eqaul to the inside point.
{
// Left boundary.
size_t const ic = 0;
m_so0(ic, 0) = m_so0(ic + 2, 0);
m_so0(ic, 1) = m_so0(ic + 2, 1);
m_so0(ic, 2) = m_so0(ic + 2, 2);
}
{
// Right boundary.
size_t const ic = ncoord() - 1;
m_so0(ic, 0) = m_so0(ic - 2, 0);
m_so0(ic, 1) = m_so0(ic - 2, 1);
m_so0(ic, 2) = m_so0(ic - 2, 2);
}
}

void Euler1DCore::treat_boundary_so1()
Expand All @@ -191,6 +207,22 @@ void Euler1DCore::treat_boundary_so1()
m_so1(ic, 1) = m_so1(ic - 1, 1);
m_so1(ic, 2) = m_so1(ic - 1, 2);
}

// Set the boundary point eqaul to the inside point.
{
// Left boundary.
size_t const ic = 0;
m_so1(ic, 0) = m_so1(ic + 2, 0);
m_so1(ic, 1) = m_so1(ic + 2, 1);
m_so1(ic, 2) = m_so1(ic + 2, 2);
}
{
// Right boundary.
size_t const ic = ncoord() - 1;
m_so1(ic, 0) = m_so1(ic - 2, 0);
m_so1(ic, 1) = m_so1(ic - 2, 1);
m_so1(ic, 2) = m_so1(ic - 2, 2);
}
}

SimpleArray<double> Euler1DCore::temperature() const
Expand Down