Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust the boundary plotting #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Loading