Matthew Knepley <[email protected]> writes:
> If you want symmetry, you can do MatZeroRowColumns(). I said is generally
> not a good idea because it is more complicated to eliminate
> them in the FD case.

I don't agree.

> You can definitely do what you propose. With FEM, it makes more sense. You
> eliminate constrained variables from the system, but
> keep the values in the local vector. Then when you do an element integral,
> you get the correct answer including the boundary
> conditions, and everything is natural.

Assuming you are working with a nonlinear problem in defect correction
form (e.g., Newton).  This simple procedure works fine for FD and FE, to
evaluate the residual F(U) and the "Jacobian" or Picard matrix J(U):

  Scatter UGlobal to ULocal
  Write correct Dirichlet values into ULocal

  Evaluate local residual FLocal(ULocal) and scatter to global if applicable
  Set Dirichlet nodes of FGlobal to UGlobal - UDesired

  Assemble J at ULocal, ignoring Dirichlet rows and columns
  Insert 1 on diagonal of Dirichlet rows and columns

Attachment: pgpMzvuELPK9J.pgp
Description: PGP signature

Reply via email to