[petsc-dev] Runtime selection of MatType for DMGetMatrix

Barry Smith bsmith at mcs.anl.gov
Thu Nov 25 14:04:53 CST 2010


     Take a look at the current model for DM/DA for vectors I'd like to update the model for matrices to match this.

  1) remove the MatType argument from DMGetMatrix()

   2) add DMSetMatType()  (mirrors DMSetVecType())

   3) have DMSetFromOptions() handle the two options -dm_vec_type and -dm_mat_type 
       3a) Note that currently DMSetFromOptions_DA() handles the -da_vec_type, that should be removed/moved up to the DMSetFromOptions().

    Sound like the right approach?


On Nov 25, 2010, at 11:38 AM, Jed Brown wrote:

> DMGetMatrix_DA currently looks at -da_mat_type, I would like to move the logic to DMGetMatrix, and I think, rename to -dm_mat_type.  The latter change would hit a lot of users in a subtle way, since their options files will still work, but will ignore the -da_mat_type arguments.  It would not be difficult to keep the old behavior around, but mark it deprecated.  Opinions?
> Along these lines, is the MatType argument to DMGetMatrix() the right way to handle this?  I think that it should at least be valid to pass NULL instead of a string, thus having the DM pick a suitable default.
> Jed

More information about the petsc-dev mailing list