NGSolve / ngsolve

Netgen/NGSolve is a high performance multiphysics finite element software. It is widely used to analyze models from solid mechanics, fluid dynamics and electromagnetics. Due to its flexible Python interface new physical equations and solution algorithms can be implemented easily.
https://ngsolve.org/
GNU Lesser General Public License v2.1
436 stars 79 forks source link

Add VectorialVoxelCoefficientfunction #60

Closed j-zimmermann closed 1 year ago

j-zimmermann commented 1 year ago

I would like to contribute an interface that permits to read in vector- and matrix-valued data from NumPy ndarrays. This extends the VoxelCoefficient that can currently only handle scalar input values.

I closely followed the implementation of the VectorialCoefficientFunction interface. To check the implementation and highlight the Python interface, I added some pytests. As my C++ knowledge is a bit rusty, I would like to ask you to check the memory allocation and deallocation.

j-zimmermann commented 1 year ago

The functionality was already supported by wrapping VoxelCoefficient functions in a matrix-valued CoefficientFunction.