Barry Smith wrote: > > My eventual goal is to remove all "hidden" MatCreate()'s and > instead have Mat's passed in as arguments. So MatLoad() would take a > Mat as an argument, as would DAGetMatrix() One could then set as much > or a as little as a Mat as they like before passing it in. They could > set the type, they could set the sizes, they could set the prefix.
Right, though setting sizes before DAGetMatrix() wouldn't be meaningful. > I think this is the direction you want? Will it satisfy all your needs? > > MatCreate(). > MatSetOptionsPrefix() > MatSetFromOptions() > DAGetMatrix() This will work at present, but it's not perfect (without Mat adjustments). Some options would be set as a consequence of the MatSetSizes() which occurs within DMGetMatrix() (ops->create() is saved until the sizes are known). If a matrix type implements MatSetFromOptions (currently just SchurComplement), that function would never get called in this scheme (because that operation won't be set until the sizes are known). This could be handled by modifying the matrix types so that MatCreate_XXX() could be called before MatSetSizes(), but this is nontrivial. Jed -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20090722/1bfbe283/attachment.pgp>