[petsc-users] non-homogenous Dirichlet bc using MatZeroRowsColumns

Karthikeyan Chockalingam - STFC UKRI karthikeyan.chockalingam at stfc.ac.uk
Thu Apr 13 08:40:01 CDT 2023


Hi,

I am trying to solve the below parabolic system for a constant time interval dt

(M + dt * K) x = M * x^(old)

Where,
M – Mass matrix
K – Stiffness matrix
A = M + dt * K  (remains constant)

I apply the boundary condition using  MatZeroRowsColumns. For homogenous boundary conditions, I notice that the A matrix remains unmodified from one-time step to the next.

For the non-homogenous boundary condition, I supply ‘x’ with the prescribed boundary value and pass it to MatZeroRowsColumns as follows


MatZeroRowsColumnsIS(A, is, 1, x, b);

After the linear solve, I find that A is modified. So I have to reassemble A again for every time step. Is it MatZeroRowsColumns or the solve itself that modifies A and why?

Kind regards,
Karthik.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230413/1d3a263a/attachment.html>


More information about the petsc-users mailing list