# [PETSC] which method ?

1. Jul 14, 2009

### Heimdall

Hello,

I have to solve a linear equation as a part of a more global simulation. The equation is :

$$\mathbf{B} - \mu\Delta \mathbf{B} = \mathbf{S}$$

Where both $$\mathbf{B}$$ and $$\mathbf{S}$$ are 3 component vectors fields, depending on x and y (2D fields).

My grid is regular, and has a typical size of $$n_x=n_y=512$$ (nx can be different from ny).

Boundary conditions are periodic on x borders, but dirichlet or neuman on y borders (but are the same for both y borders). The choice of Dirichlet or Neumann depends on the Field component that is solved.

There are then 3 equations (one for each field component) that have to be solved 4 times per time step of the simulation.

Typical simulation is about 30000 time steps, thus the 3 equations must be solved 120000 times. I need an efficient and parallel method.

I've begun to learn the PETSC library, which is a high level and parallel library for this kind of problem. But I'm not mathematician, and a bit lost with all the non stationnary iterative methods.

I have made a sum up of my problem on the pdf here : http://nau.cetp.ipsl.fr/matrixinertia.pdf [Broken]

Can someone first tell me if the matrices I've calculated and written in this document are ok ? (I'm not used to do this...)

Then, I observe that, because of the boundary conditions, these two matrices are not symmetric... could someone tell me which method in Petsc should be the best for my problem ? (methods are presented here : http://www.mcs.anl.gov/petsc/petsc-as/documentation/linearsolvertable.html [Broken])

Thanks a lot

Last edited by a moderator: May 4, 2017