Moderator: bernd
-1 in terms of maintainability of freecad and flexibility of the simulations;) Python is definitely the better way. Look how fast HarryvL shows new results...kkremitzki wrote: ↑Fri Feb 08, 2019 4:13 pmIn terms of an internal solver, libmesh seems very promising. It's LGPL-2.1 and in C++.
-1 here too, apart from someone pays my monthly salary for half a year and I can learn C++ as good as I know Python ...kkremitzki wrote: ↑Fri Feb 08, 2019 4:13 pmIn terms of an internal solver, libmesh seems very promising. It's LGPL-2.1 and in C++.
start with this one :p https://www.coursera.org/learn/finite-element-method
As said, slow parts can be ported to c++ if it makes sense. But for most parts python has fast ways (matrix solving, eigenvalues, and other matrix operations). I guess the slow part is the assembling of element entries in global matrices. If elements are defined by classes it should be possible to reimplement these classes in c++ and create python representations with pybind11.PrzemoF wrote: ↑Fri Feb 08, 2019 9:39 pmWhat about speed? I mean I don't like C++ (*), but the python flexibility comes at a huge speed penalty.
(*) the only language I wanted to learn and I gave up when I realised if feels like a bunch of workarounds one on top of another. And then one more to fix it.
I am planning to profile the code and report out on where time is spent. Clearly, solving the matrix equations is the most computationally intensive, but here is where NumPy/SciPy comes the rescue. Including smart use of preconditioning with classical techniques, like Cuthill McKee band optimization (also available as a routine in SciPy btw). Assembly of the global stiffness matrix is not normally the most intensive, but involves a lot of loops. Here I Need to focus on maximizing use of masking, matrix multiplication and list comprehension instead of dum loops. Suggestions on cutting out for loops are welcome.looo wrote: ↑Sat Feb 09, 2019 6:15 amI guess the slow part is the assembling of element entries in global matrices. If elements are defined by classes it should be possible to reimplement these classes in c++ and create python representations with pybind11.
Also with modern c++ and eigen c++ doesn't differ a lot from python and numpy. But in my eyes python is the right tool to create and design such a library.