← Back to team overview

dolfin team mailing list archive

Re: LA: [...]

 

> On Mon, Dec 05, 2005 at 06:34:35PM +0100, Garth N. Wells wrote:
>> Quoting Anders Logg <logg@xxxxxxxxx>:
>>
>> > Great work.
>> >
>> > I think we should avoid using the PETSc types KSPType/PCType and
>> > provide our own types to minimize the amount of PETSc that is visible
>> > and also be consistent with the rest of the code.
>>
>> I agree. PETSc provides something like this already. Instead of
>>
>> GMRES solver(PCILU);
>> KrylovSolver solver (KSPBCGS, PCICC);
>>
>> at the momenet we can write
>>
>> GMRES solver("ilu");
>> KrylovSolver solver ("bcgs", "icc");
>>
>> Is this OK, or should we use enum as suggested below? Using the strings
>> defined
>> by PETSc, we can refer users to the PETSc manual (or petscksp.h and
>> petscpc.h)
>> for the full range of possibilities.
>
> I'm not sure I like the strings, mostly since it's not consistent with
> the other enum types. The parameter system uses strings for identifiers,
> but that is more of an interface for users (of DOLFIN modules). I have
> a feeling we should use enums for the choice of type of Krylov method
> and preconditioner.
>
> If someone wants to use PETSc calls, they can always ask for the
> KSP pointer. Maybe one policy would be that the only thing from PETSc
> that is visible is that you can ask for the Mat pointer and Vec
> pointer etc, but nothing else?

I agree, it should be easy to add/change interface to other LA packages.


>> > In other cases, we have a nested enum type called Type in classes
>> > where a type is specified.
>> >
>> > I found the following type declarations in the current code:
>> >
>> > Function.h:  enum Type { user, functionpointer, discrete };
>> > File.h:      enum Type { xml, matlab, matrixmarket, octave, opendx,
>> gid,
>> > tecplot, vtk, python };
>> > Vector.h:    enum NormType { l1, l2, linf };
>> > Buffer.h:    enum Type { info, debug, warning, error };
>> > LogStream.h: enum Type {COUT, ENDL};
>> > Cell.h:      enum Type { triangle, tetrahedron, none };
>> > Mesh.h:      enum Type { triangles, tetrahedra };
>> > Method.h:    enum Type { cG, dG, none };
>> > Parameter.h: enum Type { REAL, INT, BOOL, STRING, NONE };
>> >
>> > As you see, we have not been very consistent with capitalization
>> > of the identifiers. Any thoughts on this? The current standard seems
>> > to be that we don't capitalize at all. We used to capitalize
>> > everything (XML, MATLAB, TRIANGLE) etc but I thought it was ugly so I
>> > changed.
>>
>> I don't like all caps. It's ugly and reminds me of old FORTRAN code.
>
> ok, so everything lower-case?

Fine by me.

/Johan






Follow ups

References