Ngsolve as form compiler

More
3 years 9 months ago #3444 by SS636
Hello,

I am only beginning to explore NGsolve, and wondering if NGSolve can be used in a similar capacity as Fenics/FormCompiler, to generate c++ code for element matrices and shape function evaluation for a given variational form?

Is there an alternative way to do this in Ngsolve?

thanks,
More
3 years 9 months ago #3450 by joachim
Replied by joachim on topic Ngsolve as form compiler
Hello,

we cannot give you a self-contained C++ function for the element matrices, you need the ngsolve fem library at runtime.

We do (optional) code generation for the integration point, but shape functions are in the runtime.

The element function your are looking for is in
github.com/NGSolve/ngsolve/blob/master/f...mbolicintegrator.hpp ,
line 668:

NGS_DLL_HEADER virtual void
CalcElementMatrix (const FiniteElement & fel,
const ElementTransformation & trafo,
FlatMatrix<double> elmat,
LocalHeap & lh) const override;

It could be called from an extern fem code.

Joachim
Time to create page: 0.096 seconds