Rewritten code generation:

With this commit the generation of built in keywords is completely
changed. The most important changes include:

  1) We have autogenerated a class for each keyword in the new
     ParserKeywords { ... } namespace.

  2) The autogenerated classes derive from ParserKeyword, and the
     default constructor will build of a fully initialized
     ParserKeyword instance, i.e. the keyword used to parse the EQUIL
     keyword can be instantiated as simple as:

         ParserKeywords::EQUIL kw;

  3) The generated keywords have built in static constants for keyword
     and item names, and item default values. That way it should be
     possible for the compiler to catch trivial errors like trying to
     access the keyword "PoRO"; also the the access to default values
     means that properties can be initialized without actually
     insantiating a DeckKeyword.

  4) Two new classes Generator/KeywordLoader and
     Generator/KeywordGenerator have been created, with the help of
     these classes the keyword generation code is significantly
     simplified.
This commit is contained in:
Joakim Hove
2015-04-23 11:31:10 +02:00
parent 3e77c88f31
commit 1161e1098c
37 changed files with 1206 additions and 546 deletions

View File

@@ -0,0 +1,3 @@
{"name" : "PORO" , "sections" : ["GRID"], "data" : {"value_type" : "DOUBLE" , "default" : "XX" , "dimension":"1"}}

View File

@@ -0,0 +1,3 @@
{"name" : "PORO" , "sections" : ["GRID"], "data" : {"value_type" : "DOUBLE" , "default" : 0 , "dimension":"1"}}

View File

@@ -0,0 +1,3 @@
{"name" : "PORO" , "sections" : ["GRID"], "data" : {"value_type" : "DOUBLE" , "default" : 0 , "dimension":"1"}

View File

@@ -0,0 +1,5 @@
{"name" : "ADDREG" , "sections" : ["GRID","EDIT","PROPS","REGIONS","SOLUTION"],
"items" :
[{"name" : "ARRAY" , "value_type" : "STRING" , "description" : "The 3D array we will update"},
{"name" : "SHIFT" , "value_type" : "DOUBLE" , "description" : "The value we will multiply with" , "default" : 0} ,
{"name" : "REGION_NAME" , "value_type" : "STRING" , "description" : "The name of the region we are interested in" , "default" : "M"}]}

View File

@@ -0,0 +1 @@
{"name" : "ACTNUM", "sections" : ["GRID"], "data" : {"value_type" : "INT" }}

View File

@@ -0,0 +1,5 @@
{"name" : "ADDREG" , "sections" : ["GRID","EDIT","PROPS","REGIONS","SOLUTION"],
"items" :
[{"name" : "ARRAY" , "value_type" : "STRING" , "description" : "The 3D array we will update"},
{"name" : "SHIFT" , "value_type" : "DOUBLE" , "description" : "The value we will multiply with" , "default" : 0} ,
{"name" : "REGION_NAME" , "value_type" : "STRING" , "description" : "The name of the region we are interested in" , "default" : "M"}]}

View File

@@ -0,0 +1,145 @@
{
"name" : "BLOCK_PROBE" ,
"sections" : ["SUMMARY"],
"comment": "E100 only",
"deck_names" : [
"BOSAT",
"BSOIL",
"BOIP",
"BOIPL",
"BOIPG",
"BPPO",
"BVOIL",
"BOVIS",
"BDENO",
"BODEN",
"BFLOOI",
"BFLOOJ",
"BFLOOK",
"BVELOI",
"BVELOJ",
"BVELOK",
"BWSAT",
"BSWAT",
"BWIP",
"BPPW",
"BVWAT",
"BWVIS",
"BDENW",
"BWDEN",
"BFLOWI",
"BVELWJ",
"BVELWK",
"BVELWI",
"BVELWJ",
"BVELWK",
"BGSAT",
"BSGAS",
"BGIP",
"BGIPL",
"BGIPG",
"BPPG",
"BVGAS",
"BGVIS",
"BDENG",
"BGDEN",
"BFLOGI",
"BFLOGJ",
"BFLOGK",
"BVELGI",
"BVELGJ",
"BVELGK",
"BPR",
"BWPR",
"BGPR",
"BRS",
"BRV",
"BPBUB",
"BPDEW",
"BRSSAT",
"BRVSAT",
"BSTATE",
"BPPC",
"BOKR",
"BWKR",
"BGKR",
"BKRO",
"BKRG",
"BKRW",
"BWPC",
"BGPC",
"BGTRP",
"BGTPD",
"BGSHY",
"BGSTRP",
"BWSHY",
"BWSMA",
"BHD",
"BHDF",
"BPR_X",
"BHD_X",
"BHDF_X",
"BSCN_X",
"BCTRA_X",
"LBPR_X",
"LBHD_X",
"LBHDF_X",
"LBSCN_X",
"LBCTRA_X",
"BRPV",
"BOPV",
"BWPV",
"BGPV",
"BHPV",
"BRTM",
"BPORVMOD",
"BPERMMOD",
"BAPI",
"BSCN",
"BSIP",
"BEWV_SAL",
"BTCNFANI",
"BTCNFCAT",
"BTRADCAT",
"BTSADCAT",
"BESALSUR",
"BESALPLY",
"BTCNFHEA",
"BTIPTHEA",
"BCGC",
"BCSC",
"BTCNFFOA",
"BTCNMFOA",
"BTIPTFOA",
"BTADSFOA",
"BTDCYFOA",
"BTMOBFOA",
"BTHLFFOA",
"BGI",
"BSIP",
"BNSAT",
"BNIP",
"BNKR",
"BTCNFSUR",
"BTIPTSUR",
"BTADSUR",
"BTCASUR",
"BTSTSUR",
"BEWV_SUR",
"BTCNFALK",
"BTADSALK",
"BTSTMALK",
"BTSADALK",
"BTPADALK"
],
"comment":"Some keywords need to be suffixed by a tracer name...",
"deck_name_regex":"BU.+|BTIPF.+|BTIPS.+|BTCNF.+|BTCNS.+|BTCN[1-9][0-9]*.+|BTIPT.+|BTIPF.+|BTIPS.+|BTIP[1-9][0-9]*.+|BTADS.+|BTDCY",
"items" : [
{"name": "I" , "value_type" : "INT"},
{"name": "J" , "value_type" : "INT"},
{"name": "K" , "value_type" : "INT"}
]
}

View File

@@ -0,0 +1,7 @@
{"name" : "BOX" , "sections" : ["GRID", "EDIT", "PROPS", "REGIONS", "SOLUTION", "SCHEDULE"], "size" : 1 , "items" : [
{"name" : "I1" , "value_type" : "INT"},
{"name" : "I2" , "value_type" : "INT"},
{"name" : "J1" , "value_type" : "INT"},
{"name" : "J2" , "value_type" : "INT"},
{"name" : "K1" , "value_type" : "INT"},
{"name" : "K2" , "value_type" : "INT"}]}

View File

@@ -0,0 +1,6 @@
{"name" : "ADDREG" , "sections" : ["GRID","EDIT","PROPS","REGIONS","SOLUTION"],
"items" :
[{"name" : "ARRAY" , "value_type" : "STRING" , "description" : "The 3D array we will update"},
{"name" : "SHIFT" , "value_type" : "DOUBLE" , "description" : "The value we will multiply with" , "default" : 0} ,
{"name" : "REGION_NUMBER" , "value_type" : "INT" , "description" : "The region number we are interested in"} ,
{"name" : "REGION_NAME" , "value_type" : "STRING" , "description" : "The name of the region we are interested in" , "default" : "M"}]}

View File

@@ -0,0 +1,13 @@
{"name" : "EQUIL" , "sections" : ["SOLUTION"], "size" : {"keyword":"EQLDIMS" , "item":"NTEQUL"},
"description": "The EQUIL item is used when equilibrationg the model. The item should consist of one record for each PVT region",
"items" :
[{"name" : "DATUM_DEPTH" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Length"},
{"name" : "DATUM_PRESSURE" , "value_type" : "DOUBLE" , "dimension" : "Pressure"} ,
{"name" : "OWC" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Length",
"description" : "The OWC item is depth of the OIL Water contact. This should ..."} ,
{"name" : "PC_OWC" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Pressure"} ,
{"name" : "GOC" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Length"} ,
{"name" : "PC_GOC" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Pressure"} ,
{"name" : "BLACK_OIL_INIT" , "value_type" : "INT" , "default" : 0} ,
{"name" : "BLACK_OIL_INIT_WG" , "value_type" : "INT" , "default" : 0} ,
{"name" : "OIP_INIT" , "value_type" : "INT" , "default" : -5 , "comment":"The default is a state variable"}]}

View File

@@ -0,0 +1 @@
{"name" : "ZCORN", "sections" : ["GRID"], "data" : {"value_type" : "DOUBLE", "dimension" : "Length" }}