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.

Assembling with a vector-valued FE space with 5 components

More
2 years 2 weeks ago #4304 by walker_tr9
So I have a finite element space like this:

fes_V = H1(Om_mesh, order=1, dim=5)

where the mesh is a 3-D cube, but the number of components of the functions in H^1 is 5.

Eventually, I try to do this:

a_form = BilinearForm (fes_V, symmetric=False)

and I get this error:

netgen.libngpy._meshing.NgException: Could not create BilinearForm, space-dimension is 5
either define MAX_SYS_DIM with higher value and recompile,
or set flag 'nonassemble'

I understand what it is saying, but where do I set this parameter?  Also, am I going to run into issues when I try to do a solve with multi-grid?  I'm trying to solve an elliptic *system*, which has 5 coupled equations, and is "very strongly elliptic".

Any advice would be helpful.
More
2 years 2 weeks ago #4305 by joachim
Quick answer: Use

es_V = H1(Om_mesh, order=1) ** 5


BilinearForms on finite element spaces with space(..., dim=5) allocate sparse matrices, where the entries are 5x5 matrices, with 5 being a compile time constant. This requires to compile ngsolve for bock-sizes up to at least 5. Smoothers and direct solvers with block-entries up to that size are compiled as well.
Default compilation is for block-sizes up to 3, what is typically used for 3D elasticity.
Adding block-matrices with run-time blocksizes is on the todo list.


H1(...) ** 5
builds matrices with double entries, the matrix dimensions are 5 times larger. No specific compile for larger block-sizes is needed.
You can use u for a 5-dimensional trial-function, Grad(u) is a 5x3 matrix.

Joachim


PS: you provide the  MAX_SYS_DIM to cmake 






 
More
2 years 2 weeks ago #4309 by walker_tr9
Thanks for the response.  Will this alternative way be slower?  It sounds like changing the block size would lead to more efficient implementation, but I am guessing.

I'll try this of course.
More
2 years 1 week ago #4325 by joachim
We can now define BilineaForms an spaces with arbitrary dimension, the block dimensions of the Sparse-block-matrix is a run-time variable. 

At the moment we only have the matrix-vector product, timings are comparable to compile-time fixed block-sizes.
More operations will come.
Time to create page: 0.118 seconds