On Sat, 2013-03-02 at 15:33 +0100, Andreas Lauser wrote:

> IMO the "dumb" part of the parser should just represent this structure
>  using a convenient C++ API, i.e., the data structure could be
>  basically a map of stringlists, e.g.
> 
> std::map<std::string, std::vector<string> >

That's not nearly enough.  By a long shot.  First of all, keywords can
be repeated, can specify parts of the data in one instance and the rest
in another.  Or overwrite existing data.  Second, keyword data for
anything other than mere block properties have (very) specialised
formats so teasing it into a list of strings requires at least *some*
intelligence.  There is also the 'INCLUDE' (and IMPORT) keyword as well
as 'PATHS'.

Parsing a deck is quite a bit more involved than mere '.GRDECL' files.

I personally think a fixed-size buffer (e.g., one megabyte) which is
filled through fread() and then separately tokenised is a much better
choice for the lowest level of a deck parser.


Bård


_______________________________________________
Opm mailing list
[email protected]
http://www.opm-project.org/mailman/listinfo/opm

Reply via email to