WIP: Implementation of a grid reader interface
I have implemented a proposal for the grid-reader interface (see issue #23) , using a CRTP abstract base class implementation, i.e. concrete file readers have to implement at least (2) of
template <class... Args> // (1)
static std::unique_ptr<Grid> readImp(const std::string &filename, Args&&... args);
template <class... Args> // (2)
static void readFactoryImp(GridFactory<Grid> &factory, const std::string &filename, Args&&... args);
The static method (1) redirects to (2) in its default implementation by creating a GridFactory
internally. The additional arguments are here just for illustrational purposes. They are forwarded to the concrete implementation.
Several readers are adopted to this interface, i.e. gmshreader
, starcdreader
, amirameshreader
, dgfparser
(a new reader classes is added), albertareader
. The amirareader could not yet be tested, due to lack of a the amira-code.
A small test is added that currently just calls the two read
methods for the grid implementations UGGrid
and AlbertaGrid
for dim=dimworld=3
. Therefore it was necessary to provide mesh-files that can be read by all the tested readers, i.e. simplicial-meshes in dimension 3.
Merge request reports
Activity
mentioned in issue #23
Added 1 commit:
- ead70423 - test of grid-readers corrected, i.e. created grids are deleted after creation
Added 1 commit:
- 5b40b739 - Implementation of accessor pattern in gridreader interface to allow to hide the …
- Using an object instead of a static implementation can probably be done easily. I was just thinking, I see rarely any data that should be stored in the object, so that it is not necessary to really have an instance of the class. But maybe this changes when some data readers are added (?). Maybe one could add some flags to decide what to read or about verbosity in a constructor.
mentioned in merge request !312 (merged)
mentioned in issue #133