change to petsc-dev

Satish Balay balay at mcs.anl.gov
Tue Jun 24 16:45:05 CDT 2008


On Tue, 24 Jun 2008, Barry Smith wrote:

> 
>  Absolutely NOT!
> 
>  It is perfectly reasonable to have the const in user code; WHENEVER
> a user uses a static string they should/must make it const

Expecting users to use 'const char*' is "perfectly reasonable" - but
expecting users to use 'const VecType' (which is a predefied type) is
a step below it. [esp when we don't have const Mat, const Vec etc...].

So the above expectation assumes the user knows the internal impl of
this type is 'char *' - etc.. - and its not 'const *' due to these
implemenation issues etc..

So I think the current expectation is a minor deviation - and what I
propose is also a minor hack.. [with a benifit of more consistant user
code]. So whatever option we choose - we do it by accepting the
limitation of that choice.



I guess part of the design issue is: we have a requirement for
'VecType' functionality.

Initially we choose 'enum' for this. This choice had limitations
[could not add new types].

Then we choose "char *" which evolved into "const char*" due to
compiler issues. But now we have new issues with the 'const' side of
things - limiting the extensibility of 'VecType'. [cannot dynamically
construct a string and assign is as a new type]

Perhaps we should get away from strings [and its implemetation
consequences] - and look for a better way to abstact out the impl
details from the interface requirements.  [I don't have any proposal
along these lines - so the above is just noisy thoughts with no
value..]

Satish




More information about the petsc-dev mailing list