I disagree. Assigning a name to a grid might be quite helpful when working with different grids. Optimally, that name could be set in the grid file. I just added that possibility to the GridParameterBlock of the DGF parser and made AlbertaGrid use it. This make the use of different names possible.
But I guess the real question is: What is the gain of making it static? The method is only used during user interaction anyway...
The real question is: what is the precise meaning of this method? The way it is implemented now, all it does is give you the type of the grid in string form. That is static information, hence the method should be static.
If on the other hand, you want to assign names to grid objects, then of course the method should not be static.
However, actually, I don't really see why a grid object handle such a thing as a 'name' at all. Object names are easily added as external data (e.g., std:map<MyGridType*,std::string>).
Type names as well.
Well, Oli, let me ask a very stupid question then: What is the gain of the method name anyway? The name of the type is of little interest.
And you're right: The grid's name could always be attached by a map. The question is: If the underlying grid supports attaching a name to a grid, should be ignore such information or should we return it. AlbertaGrid, for example, returns this information by now.
I think this information is most useful when saving grids (for example to implement checkpointing). It is a similar information to the name of a function when using a VTKWriter.
I guess 2 is:
make the method dynamic and have a method to set a grid name, e.g., the dgf or gmesh or amira file
name? (The type is static and I can not ''set'' it...)
At a certain point i wanted to write some data structures (grid, function space, function,...) to a file and have them loaded at some point later. Therefore i wanted to save the grid type as well. I would just like to obtain some information from the grid at run time to identify the grid (e.g. check, whether i've created a grid out of some dgf file with the right grid type), and i thought this would be the method to get that information.
I will wait for people to vote until at least next wednesday, Dec. 23rd. Then the issue will be settled by simple majority. In case of a tie I will break it as the owner of this task.
It is Dec. 29. today, and there have not been further reactions. A majority of votes cast has been for the removal of the method. I will hence mark it as deprecated in grid.hh and the implementations and the method will be removed after the release of 2.0.