change to petsc-dev
Satish Balay
balay at mcs.anl.gov
Tue Jun 24 18:28:01 CDT 2008
On Tue, 24 Jun 2008, Lisandro Dalcin wrote:
> Well, that's not completelly true. What's wrong with building a type
> name from pieces in a temporary char[] (non-const) buffer, and pass it
> to XXXSetType() ?? Of course, PETSc internals will have to deal with
> the implementation detail of VecType, but the majority of USER code
> would be alleviated of such a detail.
You mean - instead of:
>>>>>>>>
MatType t;
PetscMalloc(256*sizeof(char),&t);
PetscStrcpy(t,"mytypenamepart1");
PetscStrcat(t,"someadditionalpart");
MatSetType(mat,t);
<<<<<<<<
do:
>>>>>>
char *t;
PetscMalloc(256*sizeof(char),&t);
PetscStrcpy(t,"mytypenamepart1");
PetscStrcat(t,"someadditionalpart");
MatSetType((MatType)mat,t);
>>>>>>>>
I think this would handle only part of the problem. I'm ok with this
impl. [to keep userinterface clean]
There is the other issue of who does the free() on this malloc() [but
I guess this issue exists in both of the above impls].
Satish
More information about the petsc-dev
mailing list