Hello,

I have so far solved scalar field problems using finite elements on a given 
(unstructured) mesh. I made use of MATMPIAIJ to create matrixes, 
MatCreateVecs(A, &b, &x) to create vectors, and MatZeroRowsColumnsIS to set 
boundary conditions.

Now, I would like to solve a coupled system of equations for the quantities u1 
and u2 on the (unstructured)  mesh. I.e., the matrix should get the double 
number of rows and columns,

A = [A00  A01
        A10  A11]

the vectors contain twice the number of entries (e.g. first all u1s and then 
all u2s). I would like to be sure that the entries of u1 and u2, which are 
associated with the same element are located on the same processor.

Is a pre-defined structure already available within PETSc to enlarge such a 
single equation to store the entries of coupled equations?

-\Delta u_1+c_{11} u_1+c_{12} u_2=f_1
-\Delta u_2+c_{21} u_1+c_{22} u_2=f_2

Would I still be able to use MatZeroRowsColumnsIS u1 and u2 independently to 
enforce boundary conditions? MatZeroRowsColumnsIS(A, is, 1, x, b);

I don’t know where to begin. I have so far only been exposed to using MATMPIAIJ 
and MatSetValues to create and assign values to matrix entries respectively. I 
would be grateful if you could provide the stepwise guide.

Kind regards,
Karthik.

--
Karthik Chockalingam, Ph.D.
Senior Research Software Engineer
High Performance Systems Engineering Group
Hartree Centre | Science and Technology Facilities Council
[email protected]<mailto:[email protected]>

 [signature_3970890138]

  • [petsc-users] Coupled... Karthikeyan Chockalingam - STFC UKRI via petsc-users
    • Re: [petsc-users... Matthew Knepley
      • Re: [petsc-u... Karthikeyan Chockalingam - STFC UKRI via petsc-users
        • Re: [pet... Matthew Knepley
          • Re: ... Karthikeyan Chockalingam - STFC UKRI via petsc-users
            • ... Matthew Knepley
              • ... Karthikeyan Chockalingam - STFC UKRI via petsc-users
                • ... Matthew Knepley
                • ... Karthikeyan Chockalingam - STFC UKRI via petsc-users
                • ... Matthew Knepley
                • ... Karthikeyan Chockalingam - STFC UKRI via petsc-users

Reply via email to