Defining multiple local meshes using buildDmesh

Hello all,

I am using the macro_ddm.idp to use buildDmesh and createMat with macro def(i) [i, i#B, i#C] // to solve the 3D elasticity equation in parallel using PETSc. I also need to solve a 1D and 2D varf in the same parallel script - how can I solve the varf of different dimension using the same local mesh, or how can I define another local mesh with different dimension (ex. def(i) i// ) using buildDmesh?

Thank you.

Are your 1D and 2D meshes somehow related to the 3D mesh?

Yes - they use the same 3D global mesh.

Could you please share a minimalist sequential script with your various global meshes so that it’s better to see how they interact one with another?

I’ve attached a simplified sequential version (ie. no mesh decomposition). The solver doesn’t work in this sequential case, but this is just so you can see what I intend to do/solve.

Example.edp (6.0 KB)

I just see a single 3D mesh Omega in this script, is this alright?

Yes - that is the single domain over which the integrals in both varfs are applied.

But both varf are defined on Omega, your single 3D mesh. You said initially that you have “1D and 2D varf”, but I don’t see any varf using either a mesh or meshL.

If the “only” issue is mixing vectorial and scalar finite element spaces, you can just do the following.

load "PETSc"
macro dimension()3//
include "macro_ddm.idp"

mesh3 Omega = cube(10, 10, 10);

Mat A, B;
    macro def(i)[i, i#B, i#C]//
    macro init(i)[i, i, i]//
    createMat(Omega, A, [P2, P2, P2]);
    macro def(i)i// not mandatory
    macro init(i)i// not mandatory
    createMat(Omega, B, P1);

This is what I was trying to explain - thank you! My apologies for doing such a poor job at explaining, but this is exactly what I was trying to figure out.

Thank you again!

OK, good then! No problem at all :smile: