[petsc-dev] MatSetDA -> MatSetDM
Barry Smith
bsmith at mcs.anl.gov
Wed Mar 16 21:27:09 CDT 2011
On Mar 16, 2011, at 9:13 PM, Lisandro Dalcin wrote:
> On 16 March 2011 22:47, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>
>> On Mar 16, 2011, at 6:21 AM, Lisandro Dalcin wrote:
>>
>>> From petscdmda.h:
>>>
>>> extern PetscErrorCode MatSetDA(Mat,DM);
>>>
>>> Could you rename it? (sorry, I'm really busy with other stuff)
>>
>> Fixed.
>>
>
> Many thanks,
>
>>>
>>> BTW, we should have DMSetMatType() ...
>>
>> Actually my plan is to remove DMSetVecType() and change DMGetGlobalVector(), DMGGetLocalVector() and DMGetMatrix() to take an already created Vec or Mat and if the type is set inside that object then to use that type otherwise to use a default type. This will match the new style of VecLoad() and MatLoad().
>>
>> The rational for this change is I want to remove all the MatCreate()s and VecCreates() and setting of types inside other parts of PETSc. This allows new Vec and Mat types to be introduced without also adding into DMGetMatrxi() etc new code whenever a new type is introduced.
>>
>
> I like it, but... Could we have DMGetComm(dm,&comm) ?... the casting
> required for PetscObjectGetComm((PetscObject)dm,&comm) is a bit
> ugly...
No. Then we need VecGetComm(), KSPGetComm(), MonkeyGetComm() and it never ends
Perhaps
PetscErrorCode PetscObjectGetComm_(PetscObject,MPI_Comm*);
#define PetscObjectGetComm(A,B) PetscObjectGetComm_((PetscObject)A,B)
to hide the uglyness?
In fact, XXXXSetOptionsPrefix() could be all wrapped up in PetscObjectSetOptionsPrefix(). Heck even XXXSetFromOptions() and XXXSetUp() could be wrapped in PetscObjectSetFromOptions(), PetscObjectSetUp() but that may be going too far :-)
Barry
>
>
> --
> Lisandro Dalcin
> ---------------
> CIMEC (INTEC/CONICET-UNL)
> Predio CONICET-Santa Fe
> Colectora RN 168 Km 472, Paraje El Pozo
> 3000 Santa Fe, Argentina
> Tel: +54-342-4511594 (ext 1011)
> Tel/Fax: +54-342-4511169
More information about the petsc-dev
mailing list