GithubHelp home page GithubHelp logo

solvcon / modmesh Goto Github PK

View Code? Open in Web Editor NEW
25.0 10.0 32.0 1.17 MB

Toolkit for solving partial differential equations

License: BSD 3-Clause "New" or "Revised" License

CMake 2.69% Makefile 0.68% C++ 65.48% Python 30.76% Shell 0.35% Dockerfile 0.05%

modmesh's Introduction

modmesh is a toolkit for solving partial differential equations

Check the Github Actions workflow for how to build the code. Check https://github.com/solvcon/mmnote for the theoretical and numerical notes.

modmesh's People

Contributors

buganini avatar dboyliao avatar j8xixo12 avatar minchuncho avatar oiu850714 avatar q40603 avatar tai271828 avatar terrychan999 avatar threemonth03 avatar tigercosmos avatar tychuang1211 avatar tychuang2385 avatar yanagiragi avatar yenpeichen07 avatar yu-rou-weng avatar yungyuc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modmesh's Issues

viewer crashes when loading app linear_wave

build version: the latest codebase, commit hash f376359
pybind11: 2.9.2, that said, installed by INSTALL_PREFIX=${HOME}/work-my-projects/solvcon/modmesh-installation ./contrib/dependency/install.sh pybind11
numpy: python3-numpy/focal,now 1:1.17.4-5ubuntu3 amd64 [installed] (from ubuntu focal 20.04 archive)
OS: ubuntu mate 20.04

Steps to Reproduce

  1. build the viewer with the above environment
  2. launch the viewer ./build/dbg38/cpp/binary/viewer/viewer
  3. click App of the viewer and load linear_wave

Expected Result

linear wave app is loaded, and some graphs are plotted.

Actual Result

The viewer exits immediately and gives you the trace. See below comment #115 (comment) instead.

$ ./build/dbg38/cpp/binary/viewer/viewer

(viewer:467416): Gtk-WARNING **: 21:40:35.983: Theme parsing error: gtk-widgets.css:1425:21: Junk at end of value for border-width

(viewer:467416): Gtk-WARNING **: 21:40:35.986: Theme parsing error: menu.css:31:57: Expected semicolon
terminate called after throwing an instance of 'pybind11::error_already_set'
  what():  ModuleNotFoundError: No module named 'matplotlib'

At:
  /home/tai271828/work-my-projects/solvcon/modmesh/modmesh/app/linear_wave.py(30): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(848): exec_module
  <frozen importlib._bootstrap>(686): _load_unlocked
  <frozen importlib._bootstrap>(975): _find_and_load_unlocked
  <frozen importlib._bootstrap>(991): _find_and_load

Aborted (core dumped)

Additional Result

Load sample_mesh works properly with the same build.

Improve the switch case in calc_max_nface()

In #33, StaticMeshBase::calc_max_nface() is implemented using switch case:

            // FIXME: This switch is sub-optimal.
            switch (cltpn(it))
            {
            case 1:
                max_nfc += PointCellType().nface();
                break;
            case 2:
                max_nfc += LineCellType().nface();
                break;
            case 3:
                max_nfc += QuadrilateralCellType().nface();
                break;
            case 4:
                max_nfc += TriangleCellType().nface();
                break;
            case 5:
                max_nfc += HexahedronCellType().nface();
                break;
            case 6:
                max_nfc += TetrahedronCellType().nface();
                break;
            case 7:
                max_nfc += PrismCellType().nface();
                break;
            case 8:
                max_nfc += PyramidCellType().nface();
                break;
            default:
                break;
            }

There should be a better way to do it and changing the CellType classes is allowed.

Make "viewer" act like a Python interpreter

The viewer binary invokes pybind11::scoped_interpreter() in the beginning of the process. From

modmesh::python::Interpreter::instance().initialize();
to
m_interpreter = new pybind11::scoped_interpreter(true, 0, nullptr, true);

It might not be too far away for us to make the viewer binary work like a Python interpreter, i.e., equip with interactive REPL in text console. Then the binary can work as both an entry point of the GUI and the interpreter.

Crash with the RHI rendering backend

On a Mac of an older version, supposedly below 12, the viewer app is likely to crash with the RHI rendering backend.

In my case, the following error messages first appeared while running sample_mesh and the viewer app failed to render the edges and axes as expected.

2022-08-05 15:04:47.683571+0800 viewer[9581:98839] Failed to create render pipeline state: Vertex attribute vertexNormal(1) is missing from the vertex descriptor
2022-08-05 15:04:47.683640+0800 viewer[9581:98839] [Qt3D.Renderer.RHI.Backend] Failed to build graphics pipeline: Creation Failed
2022-08-05 15:04:47.683704+0800 viewer[9581:98839] Failed to create render pipeline state: Vertex attribute vertexNormal(1) is missing from the vertex descriptor
2022-08-05 15:04:47.683727+0800 viewer[9581:98839] [Qt3D.Renderer.RHI.Backend] Failed to build graphics pipeline: Creation Failed
2022-08-05 15:04:47.683986+0800 viewer[9581:98839] Failed to create render pipeline state: Vertex attribute vertexNormal(1) is missing from the vertex descriptor
2022-08-05 15:04:47.684011+0800 viewer[9581:98839] [Qt3D.Renderer.RHI.Backend] Failed to build graphics pipeline: Creation Failed
2022-08-05 15:04:47.684224+0800 viewer[9581:98839] Failed to create render pipeline state: Vertex attribute vertexNormal(1) is missing from the vertex descriptor
2022-08-05 15:04:47.684256+0800 viewer[9581:98839] [Qt3D.Renderer.RHI.Backend] Failed to build graphics pipeline: Creation Failed

Even, a while after the running, the viewer app straight crashed with a segmentation fault.

As specified in the document (https://doc.qt.io/qtforpython/overviews/qt3drender-porting-to-rhi.html), the workaround is to switch the Qt6 rendering backend from RHI to OpenGL by setting the environment variable QT3D_RENDERER=opengl before running the viewer app.
Moreover, the doc also lists several limitations of RHI rendering backend which may be the culprit of the crash.

Sidenote: The issue originated with a macOS of version 11.6.8 and Qt of version 6.3.1.

Fix unwanted overlay in the viewer

When the mesh is shown in the viewer in the first time, everything looks OK:

image

But showing a (slightly) different mesh using modmesh.view.show() does not remove the first mesh and have the first and second overlaid in the widget:

image

There should be a way to avoid the unwanted overlay.

Turn the "python" widget into a REPL interactive shell

Currently the viewer is using a primitive widget to take Python code to run and it is not easy to use:

image

There should be a REPL widget working like the Python REPL or iPython.

  • Add an interactive Python command console #145
  • Remove the Python text box at the right-hand side #146
  • Redirect the buffered outputs to the console display, see discussions in #144 (comment) @tigercosmos
  • Support to type more than one line.
  • Add a run button for the command line, it will be more straightforward.
    • It might not be the best way for the console UI. Need more thoughts.

`NameError: name 'window' is not defined` in matplotlib with PySide6

Build Environment

  • modmesh: the latest codebase, commit hash 2b7945f , which will be available in master after #174 is merged
  • pybind11: 2.11.0dev1
  • python: 3.9.10
  • numpy: 1.23.0.dev0+692
  • matplotlib: 3.6.2
  • PySide6: 6.2.3
  • OS: osx ventura 13.0.1

Reproduction Procedure

  1. build the viewer with the above environment and the cmake parameter -DMODMESH_USE_PYSIDE=ON
  2. launch the viewer ./build/clion/debugtidy/cpp/binary/viewer/viewer.app/Contents/MacOS/viewer
  3. click App of the viewer and load euler1d

Expected Result

The app is loaded without Python exception

Actual Result

The app is loaded and can be executed without problem, but terminal prints Python exception thrown from matplotlib:

Traceback (most recent call last):
  File ".../python3.9/site-packages/matplotlib/backends/backend_qt.py", line 240, in showEvent
    window.screenChanged.connect(self._update_screen)
NameError: name 'window' is not defined

Additional Result

N/A

Allow populating boundary condition objects

The class StaticMeshBC (boundary-condition treatment) is only available in C++. We should make a way to populate the BC objects in StaticMesh from Python.

We may also consider to use polymorphism on the BC classes.

Columnar group of arrays

SimpleArray currently supports only fundamental types. Before supporting struct arrays, I would like to explore how it can support columnar groups of arrays.

The columnar groups organize arrays in the following way:

struct StructOfArray
{
    SimpleArray<int32_t> m_field1;
    SimpleArray<double> m_field2;
};

This is also the so-called structure of arrays. If we treat the fields as the "rows" in a 2D array, the data in the group are organized like the "column-major" format of 2D arrays. This is why we use "columnar" to describe this kinds of data structure.

We hope modmesh provides a nice way to support the columnar data structure in C++ and allow easy access in Python, while it is possible to manually write code to construct the above StructOfArray, but the code is ad hoc and convoluted.

References

Cmake setting for QT

for Linux, I always need to add the line manually to make QT work. Maybe have a variable to specify the QT path and also try to guess where is QT?

set(CMAKE_PREFIX_PATH "/home/user/Qt/6.3.2/gcc_64/lib/cmake")

Add profiling system for the shock tube problem

The shock tube problem (modmesh.onedim.euler1d.ShockTube) is a classical compressible flow problem. It uses a numerical solver along with an analytical solution.

The numerical solver is supposed to be high-performance but it is not yet optimized. Before optimization, profiling should be done. We do not yet have a useable profiling system in modmesh, but there is a prototype: https://github.com/solvcon/modmesh/blob/master/cpp/modmesh/profile.hpp .

This issue is to track the augmentation of the prototype to a useable profiling system. It does not need to be comprehensive, but should help understand the performance of the shock tube problem.

viewer crashes when loading app euler1d

Build Environment

modmesh: the latest codebase, commit hash 7cad02e
pybind11: 2.9.2
python = "3.9.13"
numpy = "1.23.5"
matplotlib = "3.6.2"
PySide6 = "6.4.1"
OS: ubuntu mate 20.04

Steps to Reproduce

  1. build the viewer with the above environment
  2. launch the viewer ./build/dbg39/cpp/binary/viewer/viewer
  3. click App of the viewer and load euler1d

Expected Result

The app is loaded, and some graphs are plotted.

Actual Result

The viewer exits immediately and gives you the trace:

(modmesh-venv-py3-9-13-py3.9) [^_^]─[~/work-my-projects/solvcon/modmesh] tai271828@syakaro: 221209-22:57:05 15 file 42Mb
$ gdb ./build/dbg39/cpp/binary/viewer/viewer
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./build/dbg39/cpp/binary/viewer/viewer...
(gdb) run
Starting program: /home/tai271828/work-my-projects/solvcon/modmesh/build/dbg39/cpp/binary/viewer/viewer 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffef4bf700 (LWP 1482905)]
[New Thread 0x7fffeecbe700 (LWP 1482906)]
[New Thread 0x7fffea4bd700 (LWP 1482907)]
[New Thread 0x7fffe9cbc700 (LWP 1482908)]
[New Thread 0x7fffe54bb700 (LWP 1482909)]
[New Thread 0x7fffe2cba700 (LWP 1482910)]
[New Thread 0x7fffe04b9700 (LWP 1482911)]
warning: Loadable section ".note.gnu.property" outside of ELF segments
[New Thread 0x7fffdc3dc700 (LWP 1482927)]
[New Thread 0x7fffda5f0700 (LWP 1482929)]
[New Thread 0x7fffd9def700 (LWP 1482930)]
[New Thread 0x7fffd95ee700 (LWP 1482931)]

(viewer:1482715): Gtk-WARNING **: 22:57:23.999: Theme parsing error: gtk-widgets.css:1425:21: Junk at end of value for border-width

(viewer:1482715): Gtk-WARNING **: 22:57:24.002: Theme parsing error: menu.css:31:57: Expected semicolon
[New Thread 0x7fffd8d73700 (LWP 1482932)]
[New Thread 0x7fffc3fff700 (LWP 1482933)]
[New Thread 0x7fffc1433700 (LWP 1482944)]
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
terminate called after throwing an instance of 'pybind11::error_already_set'
  what():  ImportError: Failed to import any of the following Qt binding modules: PyQt6, PySide6, PyQt5, PySide2

At:
  /home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/lib/python3.9/site-packages/matplotlib/backends/qt_compat.py(137): <module>
  <frozen importlib._bootstrap>(228): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(850): exec_module
  <frozen importlib._bootstrap>(695): _load_unlocked
  <frozen importlib._bootstrap>(986): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1007): _find_and_load
  /home/tai271828/work-my-projects/solvcon/modmesh/modmesh/app/euler1d.py(30): <module>
  <frozen importlib._bootstrap>(228): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(850): exec_module
  <frozen importlib._bootstrap>(695): _load_unlocked
  <frozen importlib._bootstrap>(986): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1007): _find_and_load
  /home/tai271828/work-my-projects/solvcon/modmesh/modmesh/view.py(91): launch
  /home/tai271828/work-my-projects/solvcon/modmesh/modmesh/system.py(81): _run_viewer
  /home/tai271828/work-my-projects/solvcon/modmesh/modmesh/system.py(106): enter_main


Thread 1 "viewer" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) where
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff5b15859 in __GI_abort () at abort.c:79
#2  0x00007ffff5f12911 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff5f1e38c in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff5f1e3f7 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff5f1e6a9 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x0000555555587782 in pybind11::detail::simple_collector<(pybind11::return_value_policy)1>::call(_object*) const (this=0x7fffffffac00, ptr=0x7fffdce6f160) at /home/tai271828/work-my-projects/solvcon/modmesh-installation/include/pybind11/cast.h:1465
#7  0x00005555557043de in pybind11::detail::object_api<pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr> >::operator()<(pybind11::return_value_policy)1, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&>(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const (this=0x7fffffffac60) at /home/tai271828/work-my-projects/solvcon/modmesh-installation/include/pybind11/detail/../cast.h:1631
#8  0x0000555555700d8b in modmesh::python::Interpreter::enter_main() (this=0x555555948bc0 <modmesh::python::Interpreter::instance()::o>) at /home/tai271828/work-my-projects/solvcon/modmesh/cpp/modmesh/python/common.cpp:127
#9  0x0000555555596237 in modmesh::python::program_entrance(int, char**) (argc=1, argv=0x7fffffffadf8) at /home/tai271828/work-my-projects/solvcon/modmesh/cpp/modmesh/python/module.cpp:72
#10 0x00005555555718d9 in main(int, char**) (argc=1, argv=0x7fffffffadf8) at /home/tai271828/work-my-projects/solvcon/modmesh/cpp/binary/viewer/viewer.cpp:39
(gdb) c
Continuing.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
(gdb) [Thread 0x7fffc1433700 (LWP 1482944) exited]
[Thread 0x7fffc3fff700 (LWP 1482933) exited]
[Thread 0x7fffd8d73700 (LWP 1482932) exited]
[Thread 0x7fffd95ee700 (LWP 1482931) exited]
[Thread 0x7fffd9def700 (LWP 1482930) exited]
[Thread 0x7fffda5f0700 (LWP 1482929) exited]
[Thread 0x7fffdc3dc700 (LWP 1482927) exited]
[Thread 0x7fffe04b9700 (LWP 1482911) exited]
[Thread 0x7fffe2cba700 (LWP 1482910) exited]
[Thread 0x7fffe54bb700 (LWP 1482909) exited]
[Thread 0x7fffe9cbc700 (LWP 1482908) exited]
[Thread 0x7fffea4bd700 (LWP 1482907) exited]
[Thread 0x7fffeecbe700 (LWP 1482906) exited]
[Thread 0x7fffef4bf700 (LWP 1482905) exited]

Program terminated with signal SIGABRT, Aborted.
The program no longer exists.

The program is not being run.
(gdb) 

Additional Result

  • Load sample_mesh works properly with the same build.
  • Seems similar to #115 (comment)

Linux viewer runtime crash

Latest master build in Linux. BTW, can we let CI run the executable to check if it is runnable?

#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
#1  0x00007ffff5d35581 in std::char_traits<char>::length(char const*) (__s=0x2 <error: Cannot access memory at address 0x2>)
    at /opt/rh/gcc-toolset-10/root/usr/include/c++/10/bits/char_traits.h:371
#2  QByteArrayView::lengthHelperPointer<char>(char const*) (data=0x2 <error: Cannot access memory at address 0x2>) at /home/qt/work/qt/qtbase/src/corelib/text/qbytearrayview.h:144
#3  QByteArrayView::QByteArrayView<char*, true>(char* const&) (data=@0x5555558dc060: 0x2 <error: Cannot access memory at address 0x2>, this=<optimized out>)
    at /home/qt/work/qt/qtbase/src/corelib/text/qbytearrayview.h:188
#4  QCoreApplication::arguments() () at /home/qt/work/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:2528
#5  0x00007fffdc9a88aa in argv0BaseName() () at /home/qt/work/qt/qtbase/src/plugins/platforms/xcb/qxcbintegration.cpp:504
#6  0x00007fffdc9a9798 in QXcbIntegration::wmClass() const (this=0x555555e0a200) at /home/qt/work/qt/qtbase/src/plugins/platforms/xcb/qxcbintegration.cpp:526
#7  0x00007fffdc9c30c9 in QXcbWindow::create() (this=0x5555561c0c40) at /home/qt/work/qt/qtbase/src/plugins/platforms/xcb/qxcbintegration.h:139
#8  0x00007fffdc9a9bad in QXcbIntegration::createPlatformWindow(QWindow*) const (this=<optimized out>, window=0x5555560ac5c0)
    at /home/qt/work/qt/qtbase/src/plugins/platforms/xcb/qxcbintegration.cpp:242
#9  0x00007ffff6607589 in QWindowPrivate::create(bool, unsigned long long) (this=0x5555561bb200, recursive=recursive@entry=false, nativeHandle=nativeHandle@entry=0)
    at /home/qt/work/qt/qtbase/src/gui/kernel/qwindow.cpp:556
#10 0x00007ffff660882d in QWindow::create() (this=this@entry=0x5555560ac5c0) at /home/qt/work/qt/qtbase/src/gui/kernel/qwindow.cpp:685
#11 0x00007ffff6608be7 in QWindowPrivate::setVisible(bool) (this=0x5555561bb200, visible=<optimized out>) at /home/qt/work/qt/qtbase/src/gui/kernel/qwindow.cpp:378
#12 0x00007ffff73e0c58 in QWindowContainer::event(QEvent*) (this=0x555556321640, e=0x7fffffffcc80) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwindowcontainer.cpp:342
#13 0x00007ffff73774d2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x555556321640, e=0x7fffffffcc80)
    at /home/qt/work/qt/qtbase/src/widgets/kernel/qapplication.cpp:3350
#14 0x00007ffff5d321ea in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x555556321640, event=0x7fffffffcc80)
--Type <RET> for more, q to quit, c to continue without paging--
    at /home/qt/work/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1067
#15 0x00007ffff73c8003 in QWidgetPrivate::show_helper() (this=this@entry=0x5555565dc5d0) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:7982
#16 0x00007ffff73ca983 in QWidgetPrivate::setVisible(bool) (this=0x5555565dc5d0, visible=<optimized out>) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:8280
#17 0x00007ffff73c7f48 in QWidgetPrivate::showChildren(bool) (this=<optimized out>, spontaneous=false) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:8352
#18 0x00007ffff73c7fdf in QWidgetPrivate::show_helper() (this=this@entry=0x5555560c09a0) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:7937
#19 0x00007ffff73ca983 in QWidgetPrivate::setVisible(bool) (this=0x5555560c09a0, visible=<optimized out>) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:8280
#20 0x00007ffff73c7f48 in QWidgetPrivate::showChildren(bool) (this=<optimized out>, spontaneous=false) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:8352
#21 0x00007ffff73c7fdf in QWidgetPrivate::show_helper() (this=this@entry=0x555556031800) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:7937
#22 0x00007ffff73ca983 in QWidgetPrivate::setVisible(bool) (this=0x555556031800, visible=<optimized out>) at /home/qt/work/qt/qtbase/src/widgets/kernel/qwidget.cpp:8280
#23 0x00005555555cd02d in pybind11::cpp_function::cpp_function<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}::operator()(modmesh::RMainWindow*) const (this=0x555555db4fb8, c=0x555555fcc250)
    at /usr/include/pybind11/pybind11.h:109
#24 0x00005555555db2b9 in pybind11::detail::argument_loader<modmesh::RMainWindow*>::call_impl<void, pybind11::cpp_function::cpp_function<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}&, 0ul, pybind11::detail::void_type>(pybind11::cpp_function::cpp_function<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}&, std::integer_sequence<unsigned long, 0ul>, pybind11::detail::void_type&&) &&
    (this=0x7fffffffcfe0, f=...) at /usr/include/pybind11/cast.h:1441
#25 0x00005555555d7979 in pybind11::detail::argument_loader<modmesh::RMainWindow*>::call<void, pybind11::detail::void_type, pybind11::cpp_function::cpp_function<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}&>(pybind11::cpp_function::cpp_function<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name con--Type <RET> for more, q to quit, c to continue without paging--
st&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}&) && (this=0x7fffffffcfe0, f=...) at /usr/include/pybind11/cast.h:1415
#26 0x00005555555d17de in pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}, void, modmesh::RMainWindow*, pybind11::name, pybind11::is_method, pybind11::sibling>(pybind11::cpp_function::initialize<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}&&, void (*)(modmesh::RMainWindow*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)#3}::operator()(pybind11::detail::function_call&) const (this=0x0, call=...)
    at /usr/include/pybind11/pybind11.h:249
#27 0x00005555555d18dd in pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}, void, modmesh::RMainWindow*, pybind11::name, pybind11::is_method, pybind11::sibling>(pybind11::cpp_function::initialize<void, modmesh::RMainWindow, , pybind11::name, pybind11::is_method, pybind11::sibling>(void (modmesh::RMainWindow::*)(), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(modmesh::RMainWindow*)#1}&&, void (*)(modmesh::RMainWindow*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call&) () at /usr/include/pybind11/pybind11.h:224
#28 0x000055555557d427 in pybind11::cpp_function::dispatcher(_object*, _object*, _object*) (self=0x7fffdd0a3c30, args_in=0x7ffff23561c0, kwargs_in=0x0)
    at /usr/include/pybind11/pybind11.h:934
#29 0x00007ffff7b0cc93 in  () at /lib/x86_64-linux-gnu/libpython3.9.so.1.0

#30 0x00007ffff7ac6a50 in _PyObject_MakeTpCall () at /lib/x86_64-linux-gnu/libpython3.9.so.1.0
#31 0x00007ffff7ac976a in  () at /lib/x86_64-linux-gnu/libpython3.9.so.1.0

#32 0x00007ffff7a77585 in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.9.so.1.0
#33 0x00007ffff7a6f033 in  () at /lib/x86_64-linux-gnu/libpython3.9.so.1.0
#34 0x00007ffff7a76116 in _PyEval_EvalFrameDefault () at /lib/x86_64-linux-gnu/libpython3.9.so.1.0
--Type <RET> for more, q to quit, c to continue without paging--
#35 0x00007ffff7a6f033 in  () at /lib/x86_64-linux-gnu/libpython3.9.so.1.0

#36 0x000055555558592d in pybind11::detail::simple_collector<(pybind11::return_value_policy)1>::call(_object*) const (this=0x7fffffffda58, ptr=0x7fffdcc40e50)
    at /usr/include/pybind11/cast.h:1463
#37 0x00005555555efd6f in pybind11::detail::object_api<pybind11::detail::accessor<pybind11::detail::accessor_policies::str_attr> >::operator()<(pybind11::return_value_policy)1, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&>(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const (this=0x7fffffffdab0) at /usr/include/pybind11/cast.h:1631
#38 0x00005555555ed754 in modmesh::python::Interpreter::enter_main() (this=0x5555558dc410 <modmesh::python::Interpreter::instance()::o>)
    at /home/mujin/modmesh/cpp/modmesh/python/common.cpp:125
#39 0x0000555555571fd1 in main(int, char**) (argc=1, argv=0x7fffffffdc28) at /home/mujin/modmesh/cpp/binary/viewer/viewer.cpp:70

viewer segmentation fault with the latest code (Ubuntu 20.04)

I built the viewer with the latest code (commit 2774f90) and get segmentation fault by running the viewer.

Build and execution environment:

  • Ubuntu 20.04
  • Qt 6.2.4

Build step:

export pybind11_DIR=${HOME}/work-my-projects/solvcon/modmesh-installation
export CMAKE_PREFIX_PATH=${HOME}/Qt/6.2.4/gcc_64

make buildext VERBOSE=1 BUILD_QT=ON CMAKE_BUILD_TYPE=Debug CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"
make pytest VERBOSE=1 BUILD_QT=ON CMAKE_BUILD_TYPE=Debug CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"
make viewer VERBOSE=1 BUILD_QT=ON CMAKE_BUILD_TYPE=Debug CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"

Execution result:

[O_o]─[~/work-my-projects/solvcon/modmesh] tai271828@syakaro: 221127-23:31:09 14 file 42Mb
$ ./build/dbg38/cpp/binary/viewer/viewer

(viewer:101538): Gtk-WARNING **: 23:35:00.817: Theme parsing error: gtk-widgets.css:1425:21: Junk at end of value for border-width

(viewer:101538): Gtk-WARNING **: 23:35:00.821: Theme parsing error: menu.css:31:57: Expected semicolon
Segmentation fault (core dumped)

Report the stack trace when Python exception is thrown from viewer

Some Python exceptions are not properly handled when they are thrown from the viewer, e.g., the stack trace shown in #132:

 	KernelBase.dll!00007ff9cb82428c()	Unknown
 	vcruntime140d.dll!00007ff901cab650()	Unknown
>	viewer.exe!pybind11::module_::import(const char * name) Line 1199	C++
 	viewer.exe!modmesh::RApplication::{ctor}::__l2::<lambda_3>::operator()() Line 96	C++
 	[External Code]	

I guess it's not the only place to have the issue.

viewer crash when loading app sample_mesh twice in a row

OS: Ubuntu 20.04.4 LTS

Expexted result

sample_mesh runs with no crash regardless of how many time it's executed.

Actual result

sample mesh crashes when its load twice in a row.

$ ./build/dev38/cpp/binary/viewer/viewer
Qt3D.Renderer.RHI.Backend: Initializing RHI with OpenGL backend
nedge: 6
position: (0.0, 0.0, 10.0)
up_vector: (0.0, 1.0, 0.0)
view_center: (0.0, 0.0, 0.0)
nedge: 6
position: (0.0, 0.0, 10.0)
up_vector: (0.0, 1.0, 0.0)
view_center: (0.0, 0.0, 0.0)
make: *** [Makefile:73: runviewer] Segmentation fault (core dumped)

Additional result

The viewer works properly loading linear_wave no matter how time in a row

Single Python wrapper for SimpleArray

At the time being, the (C++) SimpleArray class template is wrapped to Python by using distinct wrapper classes (template instantiations) for each of the fundamental value_type of interest:

WrapSimpleArray<bool>::commit(mod, "SimpleArrayBool", "SimpleArrayBool");
WrapSimpleArray<int8_t>::commit(mod, "SimpleArrayInt8", "SimpleArrayInt8");
WrapSimpleArray<int16_t>::commit(mod, "SimpleArrayInt16", "SimpleArrayInt16");
WrapSimpleArray<int32_t>::commit(mod, "SimpleArrayInt32", "SimpleArrayInt32");
WrapSimpleArray<int64_t>::commit(mod, "SimpleArrayInt64", "SimpleArrayInt64");
WrapSimpleArray<uint8_t>::commit(mod, "SimpleArrayUint8", "SimpleArrayUint8");
WrapSimpleArray<uint16_t>::commit(mod, "SimpleArrayUint16", "SimpleArrayUint16");
WrapSimpleArray<uint32_t>::commit(mod, "SimpleArrayUint32", "SimpleArrayUint32");
WrapSimpleArray<uint64_t>::commit(mod, "SimpleArrayUint64", "SimpleArrayUint64");
WrapSimpleArray<float>::commit(mod, "SimpleArrayFloat32", "SimpleArrayFloat32");
WrapSimpleArray<double>::commit(mod, "SimpleArrayFloat64", "SimpleArrayFloat64");

And in Python, the construction of SimpleArray needs to use the specific type names:

sarr = modmesh.SimpleArrayFloat64((2, 3, 4))
self.assertEqual(2*3*4*8, sarr.nbytes)
self.assertEqual((2, 3, 4), sarr.shape)
self.assertEqual((12, 4, 1), sarr.stride)

It will be desirable to avoid the fundamental type name (Float64) in the array type name, so that the Python code can be written as:

sarr = modmesh.SimpleArray((2, 3, 4), type='float64')  # or dtype='float64'
self.assertEqual(sarr.ndarray.dtype, np.float64)

We may choose to mimic the numpy API by using dtype or invent our own way.

Struct arrays are a different topic. This issue focuses on the arrays of the fundamental types.

References

Configuration file propsoal

This proposal suggests having a configuration file for turning on/off features in Modmesh.
Currently, we may use Python script to set up some configs during runtime, such as setting modmesh.view.app.pycon.python_redirect = False, but it's inconvenient to do it again and again when we are doing some testing.

The steps should be:

  1. have a new file config.{format} in json or ymal format.
  2. have an in-memory config object class Config
  3. when Modmesh starts, it loads the config file to Config and Modmesh initializes everything according to Config
  4. when Python scripts modify config later during runtime, just change Config

There should be no overhead for Modmesh with this proposed change. This change may also benefit the later web server feature since we can expect some configurations may be required.

Windows: viewer crashed when opening linear_wave

Windows11, VS2022, QT6.3.2, source code with the latest master

when loading an app except the sample_mesh, it will crash with:

Unhandled exception at 0x00007FF9CB82428C in viewer.exe: Microsoft C++ exception: pybind11::error_already_set at memory location 0x00000085989B7E68.
 	KernelBase.dll!00007ff9cb82428c()	Unknown
 	vcruntime140d.dll!00007ff901cab650()	Unknown
>	viewer.exe!pybind11::module_::import(const char * name) Line 1199	C++
 	viewer.exe!modmesh::RApplication::{ctor}::__l2::<lambda_3>::operator()() Line 96	C++
 	[External Code]	
 	viewer.exe!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,std::function<void __cdecl(void)>>::call(std::function<void __cdecl(void)> & f, void * * arg) Line 163	C++
 	viewer.exe!QtPrivate::Functor<std::function<void __cdecl(void)>,0>::call<QtPrivate::List<>,void>(std::function<void __cdecl(void)> & f, void * __formal, void * * arg) Line 278	C++
 	viewer.exe!QtPrivate::QFunctorSlotObject<std::function<void __cdecl(void)>,0,QtPrivate::List<>,void>::impl(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void * * a, bool * ret) Line 450	C++
 	Qt6Cored.dll!QtPrivate::QSlotObjectBase::call(QObject * r, void * * a) Line 399	C++
 	Qt6Cored.dll!doActivate<0>(QObject * sender, int signal_index, void * * argv) Line 3921	C++
 	Qt6Cored.dll!QMetaObject::activate(QObject * sender, const QMetaObject * m, int local_signal_index, void * * argv) Line 3982	C++
 	Qt6Guid.dll!QAction::triggered(bool _t1) Line 501	C++
 	Qt6Guid.dll!QAction::activate(QAction::ActionEvent event) Line 1133	C++
 	Qt6Widgetsd.dll!QMenuPrivate::activateCausedStack(const QList<QPointer<QWidget>> & causedStack, QAction * action, QAction::ActionEvent action_e, bool self) Line 1430	C++
 	Qt6Widgetsd.dll!QMenuPrivate::activateAction(QAction * action, QAction::ActionEvent action_e, bool self) Line 1508	C++
 	Qt6Widgetsd.dll!QMenu::mouseReleaseEvent(QMouseEvent * e) Line 2931	C++
 	Qt6Widgetsd.dll!QWidget::event(QEvent * event) Line 8834	C++
 	Qt6Widgetsd.dll!QMenu::event(QEvent * e) Line 3056	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3350	C++
 	Qt6Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 2839	C++
 	Qt6Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1067	C++
 	Qt6Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 1498	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver, QMouseEvent * event, QWidget * alienWidget, QWidget * nativeWidget, QWidget * * buttonDown, QPointer<QWidget> & lastMouseReceiver, bool spontaneous, bool onlyDispatchEnterLeave) Line 2423	C++
 	Qt6Widgetsd.dll!QWidgetWindow::handleMouseEvent(QMouseEvent * event) Line 564	C++
 	Qt6Widgetsd.dll!QWidgetWindow::event(QEvent * event) Line 286	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3350	C++
 	Qt6Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3301	C++
 	Qt6Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1067	C++
 	Qt6Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 1498	C++
 	Qt6Guid.dll!QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent * e) Line 2278	C++
 	Qt6Guid.dll!QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent * e) Line 2027	C++
 	Qt6Guid.dll!QWindowSystemInterface::sendWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 1143	C++
 	Qt6Guid.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 81	C++
 	Qt6Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 476	C++
 	Qt6Guid.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 72	C++
 	Qt6Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 137	C++
 	Qt6Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 218	C++
 	Qt6Cored.dll!QCoreApplication::exec() Line 1388	C++
 	Qt6Guid.dll!QGuiApplication::exec() Line 1888	C++
 	Qt6Widgetsd.dll!QApplication::exec() Line 2632	C++
 	viewer.exe!main(int argc, char * * argv) Line 63	C++
 	viewer.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 97	C++

Create a Python sub-package for application code

The project has C++ and Python parts. The C++ part plays the role of the computing engine, while the Python provides an easy-to-use platform for application.

A reasonably organized system has been developed in C++, but there is not a place to house Python code for application. A sub-package (under modmesh) should be created to house the application code.

Review the missing Q_OBJECT macros

I didn't include the Q_OBJECT macro in QObject sub-classes (the R-named classes). It is simply an overlook.

Before the macro is added to the QObject sub-classes, we should make sure we know how to correctly add it. This issue is filed to keep track of the fix.

Add a 3D example mesh

The unit test has a 2D example mesh:

def test_2d_trivial_triangles(self):
but it does not have a 3D mesh. A 3D example mesh should be created in the unit test.

The new prototype viewer should help creating and inspecting the mesh.

Set data from ndarray memory buffer to SimpleArray

Provide better support for the Python wrapper of the class template SimpleArray to get the data ndarray through the memory buffer.

>>> import modmesh as mm
>>> import numpy as np
>>> sarr = mm.SimpleArrayFloat64((2, 3, 4))
>>> ndarr = np.arange(2*3*4, dtype='float64').reshape((2, 3, 4))

Using Python ellipsis should copy the data in the memory buffer from ndarr to sarr, but it does not work yet:

>>> sarr[...] = ndarr[...]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __setitem__(): incompatible function arguments. The following argument types are supported:
    1. (self: modmesh._modmesh.SimpleArrayFloat64, arg0: int, arg1: float) -> None
    2. (self: modmesh._modmesh.SimpleArrayFloat64, arg0: List[int], arg1: float) -> None

Invoked with: <modmesh._modmesh.SimpleArrayFloat64 object at 0x104196bb0>, Ellipsis, array([[[ 0.,  1.,  2.,  3.],
        [ 4.,  5.,  6.,  7.],
        [ 8.,  9., 10., 11.]],

       [[12., 13., 14., 15.],
        [16., 17., 18., 19.],
        [20., 21., 22., 23.]]])

The range indexing (slice) should work in a similar way:

>>> sarr[:,:,:] = ndarr[:,:,:]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __setitem__(): incompatible function arguments. The following argument types are supported:
    1. (self: modmesh._modmesh.SimpleArrayFloat64, arg0: int, arg1: float) -> None
    2. (self: modmesh._modmesh.SimpleArrayFloat64, arg0: List[int], arg1: float) -> None

Invoked with: <modmesh._modmesh.SimpleArrayFloat64 object at 0x104196bb0>, (slice(None, None, None), slice(None, None, None), slice(None, None, None)), array([[[ 0.,  1.,  2.,  3.],
        [ 4.,  5.,  6.,  7.],
        [ 8.,  9., 10., 11.]],

       [[12., 13., 14., 15.],
        [16., 17., 18., 19.],
        [20., 21., 22., 23.]]])

Note that SimpleArray.ndarray returns an ndarray object sharing the same buffer of SimpleArray, but the API is considered as a workaround.

Improve camera control

The current camera control uses vanilla Qt3DExtras::QOrbitCameraController and should be improved. The camera control is a critical component in the viewer. It at least needs the following functions and more:

  • Resetting.
  • WSAD.
  • Change of origin.

CMake Error with the latest codebase which introduces gtest

I have no luck when building the latest codebase (commit 0a1f538 ) with my branch ( see PR #177 ) . I guess it may be my configuration since the CI of Ubuntu passed. I will check in more details later to see what's going on.

Environment:

  • Ubuntu mate 20.04
  • Python 3.9 venv

Error message:

(modmesh-venv-py3-9-13-py3.9) [O_o]─[~/work-my-projects/solvcon/modmesh] tai271828@syakaro: 221211-23:51:25 15 file 104Kb
$ ls; make clean; rm -rf build/; rm -f _modmesh.cpython-3*-x86_64-linux-gnu.so; make buildext VERBOSE=1 BUILD_QT=ON CMAKE_BUILD_TYPE=Debug CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)" | tee /tmp/build.log ; ls
build  cmake  CMakeLists.txt  contrib  COPYING  cpp  gtests  Makefile  modmesh  README.md  resources  setup.py  tai.py  tests  thirdparty
make: execvp: ./: Permission denied
rm -f /home/tai271828/work-my-projects/solvcon/modmesh/modmesh/_modmesh
make -C build/dev39 clean
make[1]: *** build/dev39: No such file or directory.  Stop.
make: *** [Makefile:156: clean] Error 2
make: execvp: ./: Permission denied
mkdir -p build/dbg39 ; \
cd build/dbg39 ; \
env PYTHONPATH=/home/tai271828/work-my-projects/solvcon/modmesh cmake /home/tai271828/work-my-projects/solvcon/modmesh -DCMAKE_PREFIX_PATH=/home/tai271828/Qt/6.2.4/gcc_64 -DCMAKE_INSTALL_PREFIX=/home/tai271828/work-my-projects/solvcon/modmesh/build/fakeinstall -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/tai271828/work-my-projects/solvcon/modmesh/modmesh -DCMAKE_BUILD_TYPE=Debug -DSKIP_PYTHON_EXECUTABLE=OFF -DHIDE_SYMBOL=ON -DDEBUG_SYMBOL=ON -DBUILD_METAL=OFF -DBUILD_QT=ON -DUSE_CLANG_TIDY=OFF -DLINT_AS_ERRORS=ON -DMODMESH_PROFILE=OFF -DPYTHON_EXECUTABLE=/home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/bin/python3
Re-run cmake no build system arguments
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- use PYTHON_EXECUTABLE=/home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/bin/python3
-- BUILD_QT: ON
-- BUILD_METAL: OFF
-- not use clang-tidy
-- using program '/usr/bin/flake8'
-- HIDE_SYMBOL: ON
-- DEBUG_SYMBOL: ON
-- MODMESH_PROFILE: OFF
-- Found PythonInterp: /home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/bin/python3 (found version "3.9.13") 
-- Found PythonLibs: /home/tai271828/.pyenv/versions/3.9.13/lib/libpython3.9.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Found pybind11: /home/tai271828/work-my-projects/solvcon/modmesh-installation/include (found version "2.9.2")
-- pybind11_INCLUDE_DIRS: /home/tai271828/work-my-projects/solvcon/modmesh-installation/include;/home/tai271828/.pyenv/versions/3.9.13/include/python3.9
-- Found NumPy: /home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/lib/python3.9/site-packages/numpy/core/include (found version "1.23.5") 
-- NUMPY_INCLUDE_DIR: /home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/lib/python3.9/site-packages/numpy/core/include
-- MODMESH_USE_PYSIDE: False
-- PYSIDE6_PYTHON_PACKAGE_PATH: /home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/lib/python3.9/site-packages/PySide6
-- SHIBOKEN6_PYTHON_PACKAGE_PATH: /home/tai271828/.cache/pypoetry/virtualenvs/modmesh-venv-py3-9-13-LgJ7FNfF-py3.9/lib/python3.9/site-packages/shiboken6
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'shiboken6_generator'
-- SHIBOKEN6_GENERATOR_PYTHON_PACKAGE_PATH: 
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Check if linker can resolve circular dependencies - FALSE
-- Found Threads: TRUE  
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found WrapOpenGL: TRUE  
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- Enable -Werror because clang-tidy (with lint as errors) is disabled
-- REALPATH_PYTHON="/home/tai271828/.pyenv/versions/3.9.13/bin/python3.9"
-- PYTHON_VENV_BIN="/home/tai271828/.pyenv/versions/3.9.13/bin"
-- CMAKE_INSTALL_INCLUDEDIR: include
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- USE_GOOGLETEST: True
Re-run cmake no build system arguments
CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2555 (message):
  At least one entry of URL is a path (invalid in a list)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/ExternalProject.cmake:3236 (_ep_add_download_command)
  CMakeLists.txt:13 (ExternalProject_Add)


-- Configuring incomplete, errors occurred!
See also "/home/tai271828/work-my-projects/solvcon/modmesh/build/dbg39/_deps/googletest-subbuild/CMakeFiles/CMakeOutput.log".

CMake Error at /usr/share/cmake-3.16/Modules/FetchContent.cmake:903 (message):
  CMake step for googletest failed: 1
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FetchContent.cmake:1006 (__FetchContent_directPopulate)
  /usr/share/cmake-3.16/Modules/FetchContent.cmake:1047 (FetchContent_Populate)
  gtests/CMakeLists.txt:16 (FetchContent_MakeAvailable)


-- Configuring incomplete, errors occurred!
See also "/home/tai271828/work-my-projects/solvcon/modmesh/build/dbg39/CMakeFiles/CMakeOutput.log".
See also "/home/tai271828/work-my-projects/solvcon/modmesh/build/dbg39/CMakeFiles/CMakeError.log".
make: *** [Makefile:88: build/dbg39/Makefile] Error 1
build  cmake  CMakeLists.txt  contrib  COPYING  cpp  gtests  Makefile  modmesh  README.md  resources  setup.py  tai.py  tests  thirdparty
(modmesh-venv-py3-9-13-py3.9) [^_^]─[~/work-my-projects/solvcon/modmesh] tai271828@syakaro: 221211-23:52:19 15 file 104Kb
$ 

Add global feature toggles

We are adding more and more features to the project and there is not yet a system to manage the settings of the features. A feature-toggling system should be implemented to house and control the features that were and will be added. Related discussions are in #165 .

The feature toggles should support two types of parameters:

  1. Set once and not change during the whole execution. This is for flags used in the tight loops.
  2. Being changed multiple or many times during the execution. This is for interactive features.

Tasks:

  • Develop the FixedToggle to house compile-time-named, runtime-initialized values. Addresses of the values are determined by the compiler/linker and it does not take table lookup. It does not use hierarchy.
  • Develop the DynamicToggleTable to house the key-value pairs determined only during runtime. Access requires table lookup. The keys are dynamic strings. It support hierarchical access.
  • Develop serialization by using json/yaml as the file format.

After this issue is done, update modmesh engine and apps to use the toggles (create new issues to track the follow-up work).

Add a feature to screenshot

The screenshot feature should allow:

  1. Shot the full or part of the window and/or 3D view.
  2. Copy the shot to clipboard. This helps paste online.
  3. Save the shot to a (compressed and uncompressed) bitmap file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.