Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Ngsolve as form compiler

More
3 years 3 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 3 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.121 seconds