[petsc-dev] SNESGetSNESLineSearch and TSGetTSAdapt
Barry Smith
bsmith at mcs.anl.gov
Tue Apr 16 14:53:30 CDT 2013
On Apr 16, 2013, at 2:02 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> Barry Smith <bsmith at mcs.anl.gov> writes:
>
>> Jed,
>>
>> Please state what the "more established convention" is for these names?
You gave me a list. I need a rule! Is the rule for setting and getting a ABasenameXXXX from a BBasename object BBasenameGet/SetXXX() rather than BBasenameGet/SetABasenameXXX()? Where ABasename sometimes is the same as BBasename but need not be.
This is a reasonable rule to propose, appears to be mostly what we have done, it needs to be documented in the developers manual and any fixes made to the code. I am fine with it.
Barry
Note: There is a bit of difference between, for example, MatGetNullSpace() where the alternative is MatGetMatNullSpace() and MatGetLocalToGlobalMapping()
versuse MatGetISLocalToGlobalMapping() since the in first case ABasename == BBasename while in the second it does not. A part of me wants to keep the A/BBasename but in the usual case it is redundant and wordy and we haven't kept it anyways in the past. Note: if we had a really really good pretty printer I could have it always presented in my Emacs buffers with the wordiness :-)
>
> MatGetNullSpace returns the null space of a matrix inside a namespaced object MatNullSpace.
>
> MatGetColoring returns a coloring for a matrix inside a namespaced object MatColoring.
>
> MatGetInfo returns info about a matrix inside a namespaced object MatInfo.
>
> MatGetLocalToGlobalMapping returns a local-to-global mapping inside a namespaced object ISLocalToGlobalMapping.
>
> SNESGetConvergedReason gets the reason SNES converged/diverged inside a namespaced object SNESConvergedReason.
>
> TSGetAdapt returns an adaptive controller for TS inside a namespaced object TSAdapt.
>
> SNESGetLineSearch returns a line-search method for SNES inside a namespaced object SNESLineSearch.
>
>
> Is this really inconsistent? Surely saying SNESGetSNESLineSearch is
> inconsistent with the others, so if we choose that name, we're obliged
> to write MatGetMatNullSpace, MatGetMatColoring, MatGetMatInfo, ...
>
> I don't think repeating the namespace like that offers any value, and
> doing it only for TSGetTSAdapt and SNESGetSNESLineSearch is anomalous.
More information about the petsc-dev
mailing list