-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add placeholder for the 2/3D Euler CESE solver #403
Add placeholder for the 2/3D Euler CESE solver #403
Conversation
* Add the the placeholder `modmesh::EulerCore` C++ class and wrap it to Python as `modmesh.EulerCore`. * Add the test file `tests/test_euler.py`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checkin is only to add the placeholder code for the multi-dimensional Euler solver.
@j8xixo12 @tigercosmos @Gene0315 Maybe you will be interested.
namespace modmesh | ||
{ | ||
|
||
class EulerCore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solver core for the Euler equation. I hope there is a better name than core, but I haven't got one. I will wait a while before adding code comment block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Core" sounds fine, unless you have other Euler stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is that core.py
is already used. That could be clumsy when making shorthands for local variable names. But I do not have a better idea yet. It's not practical to spend a lot of time pondering a "perfect name". Only time can tell.
@@ -0,0 +1,38 @@ | |||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placeholder header for the new multidim
module. But it should just use the modmesh
namespace without a sub-namespace.
|
||
protected: | ||
|
||
WrapEulerCore(pybind11::module & mod, const char * pyname, const char * clsdoc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the placeholding C++ class available in Python.
@@ -48,6 +49,7 @@ void initialize(pybind11::module_ mod) | |||
initialize_buffer(mod); | |||
initialize_universe(mod); | |||
initialize_mesh(mod); | |||
initialize_multidim(mod); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add code in the multidim
directory.
|
||
def test_construct(self): | ||
mh = mm.StaticMesh(ndim=2, nnode=0) | ||
mm.EulerCore(mesh=mh, time_increment=0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, add the most basic existence test for the placeholder class.
@@ -0,0 +1,30 @@ | |||
# Copyright (c) 2019, Yung-Yu Chen <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to be 2024.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The year remained in the past because the content was almost identical to the original file it copied from.
namespace modmesh | ||
{ | ||
|
||
class EulerCore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Core" sounds fine, unless you have other Euler stuff.
namespace python | ||
{ | ||
|
||
using namespace modmesh; // NOLINT(google-build-using-namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't. Thanks for spotting it. It will be fixed in the next upload.
class EulerCoreTC(unittest.TestCase): | ||
|
||
def test_construct(self): | ||
mh = mm.StaticMesh(ndim=2, nnode=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does mh
stand for? I would expect a name that is related to "mesh".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means mesh. Shorthands are important for readability. The shorthand has be used for a couple of years.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I thought the first m
meant "modmesh".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary line:
using namespace modmesh; // NOLINT(google-build-using-namespace)
modmesh::EulerCore
C++ class and wrap it to Python asmodmesh.EulerCore
.tests/test_euler.py
This PR is for issue #404.