[petsc-dev] why does this inanity exist?

Jed Brown jed at jedbrown.org
Sun Apr 30 16:05:10 CDT 2017

Lisandro Dalcin <dalcinl at gmail.com> writes:

> On 30 April 2017 at 23:27, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>> On Apr 30, 2017, at 3:19 PM, Jed Brown <jed at jedbrown.org> wrote:
>>> Proposal: add ts->default_adapt_type.  TSCreate_* sets this.  Remove
>>> TSGetAdapt from TSCreate and move it to TSSetUp and TSSetFromOptions.
>>> Make TSGetAdapt call TSAdaptSetType(adapt,ts->default_adapt_type).  Now
>>> there is no "setbyuser", but TS implementations can select their
>>> preferences and those will be ignored if the user calls TSGetAdapt and
>>> changes it themselves.  And -ts_adapt_type none always works.
>>   I don't see any immediate flaws in this approach.
> I like it, too. I'll go for it. Unless there is any objection, the
> default_adapt_type will point to a string literal set in TSCreate_XXX,
> so I'll not malloc/free it.

Why not PetscStrallocpy like in PetscObjectChangeTypeName.  Seems easier
to do that than to explain in the documentation that the string cannot
be constructed dynamically.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170430/26234899/attachment.sig>

More information about the petsc-dev mailing list