Thread Previous • Date Previous • Date Next • Thread Next |
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. > > 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. Garth
Thread Previous • Date Previous • Date Next • Thread Next |