 # Partition matrices for a coupled problem

Hi,

I want to solve a coupled problem of vibro-acoustic. The variationnal formulation gives me 5 matrices, (K,M) for elasticity, (H,Q) for acoustic and C the coupled matrix. Then we obtain two global matrices :
Kglob = [K -C]
[0 H]
Mglob = [M 0]
[C’ Q]

And we solve :
Kglob -omega^2*Mglob = RHS

To solve that I tried to proceed as follows:

%----------------------------------------------------------------------------------
//Th is load from gmsh 3d

fespace VhS(Th, [P1,P1,P1]); // elasticity
VhS [u1,u2,u3], [v1,v2,v3];

fespace VhF(Th, P1); // acoustic
VhF p,v;

//Solid
varf k([u1,u2,u3], [v1,v2,v3]) = int3d(Th, 5)( … ); //5 refers to elastic medium
varf m(…) = …

varf h(p, v) = int3d(Th, 4)( … );
varf q(…) = …

matrix K = k(VhS, VhS);
matrix M = …

matrix H = h(VhF, VhF)
matrix Q = …
%----------------------------------------------------------------------------------

Then I export the matrices but the shape of each matrix is (n x ndof,n x ndof) (n = 3 for elasticity and n = 1 for acoustic). The problem is that ui = 0 in air medium, the same for pressure in elastic medium…which creates a singular LHS after assembly.

My question : Is there a way to build the matrices on their respective medium and only get interesting nodes values, not all the nodes of the mesh ? This way to proceed implies to extract the nodes of each medium by the way…

Maybe there’s an easier way to proceed ?

I hope this is clear enought…

Thank you,
Julien

It is possible. For example, you can use `trunc` to get only the mesh for the elastic medium, and assemble K and M there using another `fespace`. If you want help to run this in parallel, I can write this for you if you’re OK that I put the script on FreeFEM GitHub afterwards. Here is for example such a coupling done in parallel.

Thank you for this quick answer !

the function “trunc” can be difficult to use in my case given the fact that I could not be able to define the boolean function required.

Is it possible to define a boolean function just with a label (the one of the medium) ?

Concerning the parallelization, it would be really interesting given the fact that I will have to test some case with more than 1 000 000 dof. I will look at the script for the parallelization, thank you !

PS : the system will be solved with Matlab, only the matrices are calculated with FreeFem.

In case anyone need, the file is here : https://github.com/GrinCa/vibroacoustic

How do you solve your system? Why don’t you use FreeFEM to solve the linear system?
You can just do `trunc(ThS, region == 4)`, for example.

You problem is actually solved in this example. I thought you had a more difficult discretisation.

There a model reduction order implemented on Matlab, which implies to calculate symbolic derivatives, that’s why I use Matlab. This variationnal formulation aim to be more complex, with damping model for both elaticity and acousic…

Thank you for this precious help !

Dear prj,

I tried to trunc my mesh but I get this error at the compilation :

Assertion fail : (ie == nbe)
line :7364, in file msh3.cpp
Assertion fail : (ie == nbe)
line :7364, in file msh3.cpp
err code 6 , mpirank 0

The beggining of my code is :

int embedding = 1;
int coupling = 2;
int extpressure = 3;
int acoustic = 4;
int elastic = 5;

mesh3 Th3 = trunc(Th, region==acoustic);

I also tried to replace acoustic by its number 4, but it still doesn’t work. I check the label as well, FreeFem can calculate integrals with these labels.

Could you enlighten me please ?

Could you share your `.geo` or `.msh`, please?

Here you can find the .geo file : https://github.com/GrinCa/vibroacoustic/tree/master

Gmsh version : 3.0.6
FreeFem version : 4.1

You do not have a surface label for the `acoustic` volume so FreeFEM can’t process the mesh.

Thank you @prj for this precious help !

Best regards !
Julien