Compare commits
1111 Commits
testing/20
...
release/20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69a0a31309 | ||
|
|
3be35ec286 | ||
|
|
0469d28fa2 | ||
|
|
7cd7c7a158 | ||
|
|
7bc1fc8362 | ||
|
|
b573c28594 | ||
|
|
693c4607c8 | ||
|
|
1c17a5daed | ||
|
|
edee59df30 | ||
|
|
c5fcbf2084 | ||
|
|
8e860c4b7a | ||
|
|
ad9fbfe4ea | ||
|
|
53fff6bb3f | ||
|
|
8e23316eba | ||
|
|
d4e6c9ec44 | ||
|
|
ae9712232e | ||
|
|
d376ee9ed4 | ||
|
|
1067b66696 | ||
|
|
ac43482944 | ||
|
|
3ca39f2e62 | ||
|
|
aaaa22e279 | ||
|
|
646d263883 | ||
|
|
f1e0dcea81 | ||
|
|
7b3b26c452 | ||
|
|
5f9d67a6eb | ||
|
|
8e44ca1b2c | ||
|
|
89e2ebd5f9 | ||
|
|
06287e8631 | ||
|
|
4cd26c5f9a | ||
|
|
d4ce9fe909 | ||
|
|
7ee05a9ceb | ||
|
|
8a9814ad16 | ||
|
|
96b7bb65e2 | ||
|
|
4761fe724b | ||
|
|
8488efde1f | ||
|
|
3a89d05646 | ||
|
|
0d3037383a | ||
|
|
de67ce4083 | ||
|
|
0fadb026af | ||
|
|
fe275a55fd | ||
|
|
a44febc314 | ||
|
|
895c43dff0 | ||
|
|
e2ca798005 | ||
|
|
8fa07537fc | ||
|
|
7f9d250fd3 | ||
|
|
5eab9b003f | ||
|
|
14625b3279 | ||
|
|
3cb23e6857 | ||
|
|
f8f1efc0ac | ||
|
|
6d92c1f5de | ||
|
|
c68ec9c28b | ||
|
|
2dd6400d06 | ||
|
|
aa10ded01a | ||
|
|
edaa5ae561 | ||
|
|
aa56a40e8d | ||
|
|
2d7ba6a3c9 | ||
|
|
6c397ff2a8 | ||
|
|
c83feddb28 | ||
|
|
6d9deefb29 | ||
|
|
afaa99d3f4 | ||
|
|
c69a111e7a | ||
|
|
112e698d0a | ||
|
|
7dffd9f2e7 | ||
|
|
a3f2c115f1 | ||
|
|
32ac0034a7 | ||
|
|
17f246c1a7 | ||
|
|
d66f0a664c | ||
|
|
9af248f889 | ||
|
|
3c26314475 | ||
|
|
12e2c9c545 | ||
|
|
79d3f236c2 | ||
|
|
5c280ed72a | ||
|
|
73cc9cff3a | ||
|
|
c736e71e46 | ||
|
|
92f69d7648 | ||
|
|
bad1b1d3fb | ||
|
|
0e1339e648 | ||
|
|
3cc205ee93 | ||
|
|
ad564ad651 | ||
|
|
39c1056c87 | ||
|
|
9f1858265a | ||
|
|
5a9f5c0999 | ||
|
|
a5d943fd8f | ||
|
|
e598aa8cae | ||
|
|
359558536e | ||
|
|
e6e8b070d7 | ||
|
|
278f4ff3c9 | ||
|
|
2f6160ec17 | ||
|
|
a319d7be4f | ||
|
|
8101591277 | ||
|
|
223fe5e7df | ||
|
|
b6824af640 | ||
|
|
3bce48586a | ||
|
|
d1d651a70d | ||
|
|
4de3391fda | ||
|
|
90d0deeafb | ||
|
|
2fa017b29b | ||
|
|
e495207e9f | ||
|
|
5d9a9880ec | ||
|
|
390b6c6f5c | ||
|
|
b7543d4bc9 | ||
|
|
967954fc4b | ||
|
|
d99791d442 | ||
|
|
20523b46cc | ||
|
|
202651c34d | ||
|
|
16a8f4040c | ||
|
|
f2bc961bd4 | ||
|
|
7555c00ac3 | ||
|
|
68ff2f08a7 | ||
|
|
7bac89429e | ||
|
|
032de6c289 | ||
|
|
aa9471dff1 | ||
|
|
5a5a87d602 | ||
|
|
cefdd86f1b | ||
|
|
6865278ac5 | ||
|
|
204ea1a1a2 | ||
|
|
b4908c6fa0 | ||
|
|
2991ce0aea | ||
|
|
b9ded4433a | ||
|
|
7199e1ede4 | ||
|
|
3280f26f10 | ||
|
|
fbe1d211b2 | ||
|
|
9167359570 | ||
|
|
07a998f3c2 | ||
|
|
080225d8e5 | ||
|
|
37203833b3 | ||
|
|
c01dae67f9 | ||
|
|
b8cfa8be68 | ||
|
|
b28540c57f | ||
|
|
1aa4685b62 | ||
|
|
0d31e87072 | ||
|
|
c1cb489106 | ||
|
|
c60032e227 | ||
|
|
d9916d6e50 | ||
|
|
19d12e7ba2 | ||
|
|
ab14d99f0a | ||
|
|
3db106dd5c | ||
|
|
adebeba784 | ||
|
|
44ae1fd574 | ||
|
|
04eb33771c | ||
|
|
78820654c7 | ||
|
|
c51842d65b | ||
|
|
51b3d14851 | ||
|
|
650dd32274 | ||
|
|
809177af03 | ||
|
|
6c34aee00e | ||
|
|
25f8ec6641 | ||
|
|
c55c1799f6 | ||
|
|
6cdd4fd76f | ||
|
|
3f83f2ed56 | ||
|
|
f7b611afec | ||
|
|
a55f691581 | ||
|
|
e738712ad5 | ||
|
|
70daf0f2c8 | ||
|
|
dff62946dd | ||
|
|
0a6dda5d6d | ||
|
|
d2db04ec13 | ||
|
|
f799d7c6b9 | ||
|
|
ce95cd5721 | ||
|
|
4416721686 | ||
|
|
9c4ccd0ff6 | ||
|
|
4ca993400b | ||
|
|
1b63b8193b | ||
|
|
584f7ed5ca | ||
|
|
dc636e244c | ||
|
|
7af66a6eab | ||
|
|
7b2a7aa419 | ||
|
|
3d3f315b0a | ||
|
|
fe99293f33 | ||
|
|
c312c05732 | ||
|
|
b9fa2ec10d | ||
|
|
82a28a29bf | ||
|
|
41a350ad23 | ||
|
|
fd986cb397 | ||
|
|
af878ba229 | ||
|
|
8c5ef89bd3 | ||
|
|
0edd5c2207 | ||
|
|
3f8a8f9de8 | ||
|
|
11d1c7d634 | ||
|
|
3229c343f7 | ||
|
|
9c96588f36 | ||
|
|
69ddffc966 | ||
|
|
604c476554 | ||
|
|
060fb59c57 | ||
|
|
d4ab231124 | ||
|
|
c429a8a800 | ||
|
|
40570f1aba | ||
|
|
a5e897bdc7 | ||
|
|
6100a90e49 | ||
|
|
b41865d268 | ||
|
|
a4c9b05000 | ||
|
|
230c4494ed | ||
|
|
883fb1a337 | ||
|
|
ca744afa27 | ||
|
|
9eb0a01c7b | ||
|
|
17c6d7dbad | ||
|
|
622a093315 | ||
|
|
388d0e99c3 | ||
|
|
f3c065a899 | ||
|
|
dd4cce4e9a | ||
|
|
0bc150794d | ||
|
|
f7a434f274 | ||
|
|
34410cbe41 | ||
|
|
c3b0dab6e5 | ||
|
|
b5ba3405af | ||
|
|
882ce83e91 | ||
|
|
a91c755194 | ||
|
|
727abd0907 | ||
|
|
f214c2cf0f | ||
|
|
ff69737b99 | ||
|
|
ed5b8d0620 | ||
|
|
b1974db82c | ||
|
|
ae75aa3255 | ||
|
|
4f276b896c | ||
|
|
6c47cdb22f | ||
|
|
a281a3c6f4 | ||
|
|
4388c9d72f | ||
|
|
897edca773 | ||
|
|
7d32890d99 | ||
|
|
4bed60df0f | ||
|
|
93e4c2ffec | ||
|
|
6bbf1fcde2 | ||
|
|
93439cf41e | ||
|
|
8c874bf741 | ||
|
|
0e108311e3 | ||
|
|
d2aaff46e0 | ||
|
|
8a88d64bd1 | ||
|
|
d1fd6359af | ||
|
|
2b75ff1c19 | ||
|
|
b7459231d2 | ||
|
|
143d0d097a | ||
|
|
efe7a97b1d | ||
|
|
18ead60ccc | ||
|
|
f9a2c02c5e | ||
|
|
f375213d4b | ||
|
|
a1f35584a9 | ||
|
|
dd609e857a | ||
|
|
8664ce4af7 | ||
|
|
0c526b39f5 | ||
|
|
de7752b3e5 | ||
|
|
48aba21941 | ||
|
|
3070bf4a31 | ||
|
|
c8919ba088 | ||
|
|
4078451840 | ||
|
|
1a23df1e2f | ||
|
|
8efe3cf6a6 | ||
|
|
546cd46926 | ||
|
|
74291cc57f | ||
|
|
fd0cb01957 | ||
|
|
f3bd813f46 | ||
|
|
b957ca6a69 | ||
|
|
b68fe2e63a | ||
|
|
c826e24607 | ||
|
|
41a05a7a98 | ||
|
|
4504b8812f | ||
|
|
365fbd355b | ||
|
|
78ab86e2a3 | ||
|
|
0ae8c4b235 | ||
|
|
3ecb446c20 | ||
|
|
97728e9fda | ||
|
|
af096fddf9 | ||
|
|
0257528ea9 | ||
|
|
fcca1fa823 | ||
|
|
7fc7a8f0ba | ||
|
|
15d70c446f | ||
|
|
b97503d34d | ||
|
|
c01d3b0139 | ||
|
|
7811054029 | ||
|
|
e1bffe7b3d | ||
|
|
525dfdcd69 | ||
|
|
369a99a64a | ||
|
|
d5e0d72f0f | ||
|
|
6dee117f55 | ||
|
|
d2ff536cf3 | ||
|
|
f264c358e7 | ||
|
|
edf6440113 | ||
|
|
ab51fce599 | ||
|
|
f7d4ba037d | ||
|
|
77d6cb24ad | ||
|
|
4000b3226b | ||
|
|
1e10398b52 | ||
|
|
b07632ee50 | ||
|
|
bd18a82ae3 | ||
|
|
a0f05b380b | ||
|
|
b15b0bbec7 | ||
|
|
832a3222fb | ||
|
|
377513fec9 | ||
|
|
7ad764f92f | ||
|
|
6676eb9953 | ||
|
|
7dce180581 | ||
|
|
a88c1d0513 | ||
|
|
58bca59892 | ||
|
|
5267c07444 | ||
|
|
ad96affbbf | ||
|
|
c8e09ff751 | ||
|
|
16d38c3245 | ||
|
|
97ad4baa99 | ||
|
|
690cf8c43b | ||
|
|
15c2e69e9f | ||
|
|
058cefeafa | ||
|
|
e7639f77d0 | ||
|
|
ab2ea1acf3 | ||
|
|
1edf46ffd1 | ||
|
|
1c6e5f5099 | ||
|
|
5ad0c66f55 | ||
|
|
04239afc03 | ||
|
|
6683ac1be6 | ||
|
|
49d61cb4f6 | ||
|
|
318d396adc | ||
|
|
5455bc8425 | ||
|
|
ff79a404be | ||
|
|
1c988dc721 | ||
|
|
7577e6d851 | ||
|
|
7c2a2e574d | ||
|
|
752a9e2501 | ||
|
|
2c8d827945 | ||
|
|
cf9744ff1f | ||
|
|
132fc1ff1b | ||
|
|
6dfab9c621 | ||
|
|
dedc74f299 | ||
|
|
11eb0049da | ||
|
|
753d6dcb92 | ||
|
|
db6b5d2502 | ||
|
|
ad50a22ed7 | ||
|
|
e0ff18ee09 | ||
|
|
1588f3227e | ||
|
|
f813a04269 | ||
|
|
705be62be6 | ||
|
|
7a3b693471 | ||
|
|
08c5e342b2 | ||
|
|
7984d2a0f4 | ||
|
|
1d8f07fe62 | ||
|
|
723113b3b9 | ||
|
|
922afa26c4 | ||
|
|
41bd1eb449 | ||
|
|
17e6599749 | ||
|
|
c54639fc34 | ||
|
|
74baa18cd9 | ||
|
|
807fa9ecdb | ||
|
|
4073722771 | ||
|
|
8553bbf326 | ||
|
|
7bdd294ec5 | ||
|
|
ee26316f92 | ||
|
|
af72086db8 | ||
|
|
e026660c80 | ||
|
|
0296759ad0 | ||
|
|
9d442d3d4f | ||
|
|
5d5bcf6f24 | ||
|
|
9690588dd4 | ||
|
|
7021669758 | ||
|
|
3c22559849 | ||
|
|
5965b194df | ||
|
|
a449636dde | ||
|
|
9e6f8bd1c1 | ||
|
|
a2fc480e16 | ||
|
|
15e192876e | ||
|
|
dcf4347aee | ||
|
|
82accba45b | ||
|
|
22a9ffa7d9 | ||
|
|
a7c5483b0f | ||
|
|
be795af931 | ||
|
|
4cce5f5f1c | ||
|
|
3e1822770d | ||
|
|
f124fc692f | ||
|
|
dc26fd6364 | ||
|
|
80afcd852f | ||
|
|
17e5e3fec3 | ||
|
|
ab235a1eae | ||
|
|
974fef2c44 | ||
|
|
440049ab6c | ||
|
|
6cdae955d2 | ||
|
|
af2a09bde5 | ||
|
|
2aa10a0435 | ||
|
|
208c1a7143 | ||
|
|
12a8656647 | ||
|
|
de5246c701 | ||
|
|
c0c6f35099 | ||
|
|
8d858903f1 | ||
|
|
fa964b5820 | ||
|
|
dad13d2633 | ||
|
|
6b2aadaef7 | ||
|
|
ec36c227d7 | ||
|
|
d097660fcc | ||
|
|
09b445f69d | ||
|
|
8ef902bee5 | ||
|
|
38b6451c73 | ||
|
|
ec250f19f8 | ||
|
|
f0adb01941 | ||
|
|
a69b0bd06f | ||
|
|
07b2f47c7d | ||
|
|
a7956bcf31 | ||
|
|
aa9ed7a995 | ||
|
|
d06c0bfebb | ||
|
|
c516f868e4 | ||
|
|
a9cff8f7a1 | ||
|
|
8e8abee556 | ||
|
|
c0d95e01db | ||
|
|
b00615d21f | ||
|
|
16daa52fbc | ||
|
|
41f18d718c | ||
|
|
00661d6767 | ||
|
|
44bedf0f23 | ||
|
|
65f9fdec5c | ||
|
|
611dc0b565 | ||
|
|
eb30af2b11 | ||
|
|
31357cf40d | ||
|
|
3a15a16848 | ||
|
|
19ca93f227 | ||
|
|
ba34a9fed0 | ||
|
|
7f484b736d | ||
|
|
30b44ef233 | ||
|
|
c7497497f6 | ||
|
|
df4e94e351 | ||
|
|
f7b50a97f7 | ||
|
|
6f7d45750f | ||
|
|
e5013125f1 | ||
|
|
9a6065509b | ||
|
|
441b065b3d | ||
|
|
6d79ab4715 | ||
|
|
86b7d4406e | ||
|
|
7e775ecd17 | ||
|
|
6e93c5ee1f | ||
|
|
d6cbf47e38 | ||
|
|
079cb5fd0b | ||
|
|
6f7a6d47f2 | ||
|
|
a6eef07c76 | ||
|
|
a961f38c63 | ||
|
|
bc2e5f7d00 | ||
|
|
3846c8c7ab | ||
|
|
e186761f4a | ||
|
|
8efaa4dc66 | ||
|
|
bb6fb37ea1 | ||
|
|
97a73ea5a5 | ||
|
|
eee75da9ef | ||
|
|
cb165fb418 | ||
|
|
c9420d1883 | ||
|
|
01f0beb8ca | ||
|
|
7e62206481 | ||
|
|
3aefa3a953 | ||
|
|
e32853808f | ||
|
|
10142b482e | ||
|
|
522dee0a47 | ||
|
|
659fb45d04 | ||
|
|
cf6161ecfe | ||
|
|
03b81d116f | ||
|
|
554ceb87dd | ||
|
|
7e3ad77329 | ||
|
|
31bb6a0164 | ||
|
|
4eb9d5d46a | ||
|
|
4258bce6c5 | ||
|
|
1d5326f664 | ||
|
|
79a2c1bd4d | ||
|
|
e3ade4dff9 | ||
|
|
36338c8a71 | ||
|
|
c94ed2f643 | ||
|
|
5cd93cd702 | ||
|
|
6dc4804a57 | ||
|
|
d0634114c7 | ||
|
|
ee482b9a5f | ||
|
|
e25416c236 | ||
|
|
c40eed027b | ||
|
|
bef36f6c0d | ||
|
|
1ff60496c6 | ||
|
|
b0ad018a74 | ||
|
|
f898d33e65 | ||
|
|
e79b546544 | ||
|
|
1903b9517b | ||
|
|
d12426b9e8 | ||
|
|
d51c31634a | ||
|
|
cbf477e502 | ||
|
|
51517ec6a3 | ||
|
|
50902686b5 | ||
|
|
2002be13e2 | ||
|
|
5103e7b604 | ||
|
|
de107379a1 | ||
|
|
b70140dd4e | ||
|
|
ae27c8a9c6 | ||
|
|
1936f12356 | ||
|
|
de19aca322 | ||
|
|
f51420c6c6 | ||
|
|
27ffc41361 | ||
|
|
ca42ca5968 | ||
|
|
86b1a93b0e | ||
|
|
84116a7d70 | ||
|
|
7c15d79a93 | ||
|
|
eb1d00f9dc | ||
|
|
d20c58da07 | ||
|
|
a1edb0a1f7 | ||
|
|
ff956e7aff | ||
|
|
377294316e | ||
|
|
1715565920 | ||
|
|
f467d05035 | ||
|
|
02278912d6 | ||
|
|
3f773b956f | ||
|
|
4334256c5b | ||
|
|
a3f74c19c4 | ||
|
|
d6d1dbd38b | ||
|
|
1a02bb105a | ||
|
|
e3dc5e07d7 | ||
|
|
af811d2eaf | ||
|
|
083742c368 | ||
|
|
2bfad7ae37 | ||
|
|
c8cd730d5c | ||
|
|
4cde3e7e44 | ||
|
|
8416680368 | ||
|
|
44ddd382a3 | ||
|
|
79da1ba5eb | ||
|
|
a218a1c936 | ||
|
|
e00a32f75c | ||
|
|
29c3310671 | ||
|
|
e02fa5d04f | ||
|
|
9eda0ee1b8 | ||
|
|
0fb287b789 | ||
|
|
858e0b84cf | ||
|
|
39346c3b97 | ||
|
|
bcfc8b4966 | ||
|
|
98338e3326 | ||
|
|
fadcddbc92 | ||
|
|
1a79e811dd | ||
|
|
1caca2df4a | ||
|
|
5e751bb26c | ||
|
|
520df29bd8 | ||
|
|
354c20786d | ||
|
|
9e309375b6 | ||
|
|
74d0703dc2 | ||
|
|
5064519e83 | ||
|
|
1a62ceff7d | ||
|
|
4d1b747b42 | ||
|
|
28c2e7024c | ||
|
|
9ff301625b | ||
|
|
49d32a02fb | ||
|
|
9d9099a8fc | ||
|
|
ef91e18586 | ||
|
|
31176bacbb | ||
|
|
d1052d2034 | ||
|
|
cf9aa917dc | ||
|
|
de641d83d6 | ||
|
|
359955efc3 | ||
|
|
2747f20e24 | ||
|
|
27e1cc654a | ||
|
|
f0c5b914ad | ||
|
|
37b49cabf6 | ||
|
|
b0ad3a2b26 | ||
|
|
c208a59597 | ||
|
|
b55e073182 | ||
|
|
e013066040 | ||
|
|
f63c408ba4 | ||
|
|
bd28038327 | ||
|
|
02c43b7a09 | ||
|
|
3852c5224e | ||
|
|
692edfbf5c | ||
|
|
887a567869 | ||
|
|
8ff8d23146 | ||
|
|
0bfe490609 | ||
|
|
0f7062ef2a | ||
|
|
6016cd43b3 | ||
|
|
93b53df02a | ||
|
|
a06194ecae | ||
|
|
8a57e491c2 | ||
|
|
9516fdd3e6 | ||
|
|
7c856f681d | ||
|
|
9875d5fbd8 | ||
|
|
b9cdb9fb78 | ||
|
|
8c9674856a | ||
|
|
8633f07018 | ||
|
|
22ef5a4cd2 | ||
|
|
ed4bf054fa | ||
|
|
5bb56ff4a8 | ||
|
|
bab637ab67 | ||
|
|
658dc20f36 | ||
|
|
7d26cf44e1 | ||
|
|
7dfc20a4cc | ||
|
|
119cbc33f7 | ||
|
|
24393cc2ef | ||
|
|
9e6666357b | ||
|
|
2d66d15d96 | ||
|
|
dc4aa882be | ||
|
|
12294cb637 | ||
|
|
8a52da5851 | ||
|
|
b48f0affea | ||
|
|
cc14a83ecf | ||
|
|
ad9448c87d | ||
|
|
3655aeb579 | ||
|
|
57c27d603a | ||
|
|
d35a321214 | ||
|
|
c7532005b2 | ||
|
|
c24e220626 | ||
|
|
bb8cfc2e60 | ||
|
|
a304f560d5 | ||
|
|
1073ef3d55 | ||
|
|
787d9d3948 | ||
|
|
8873eb29e4 | ||
|
|
03b2a5c946 | ||
|
|
729948b712 | ||
|
|
d9fea19c5b | ||
|
|
7639dd7e5f | ||
|
|
43a5a153b1 | ||
|
|
a06a49b4d8 | ||
|
|
cd48199c1e | ||
|
|
5bcb80ba70 | ||
|
|
ccefe04230 | ||
|
|
65c4d91b19 | ||
|
|
f386404408 | ||
|
|
28e0b1cc3a | ||
|
|
5b1020151b | ||
|
|
3c77d66cd7 | ||
|
|
fd49cb7787 | ||
|
|
e14b938fde | ||
|
|
11fe1d6e03 | ||
|
|
2fb64e21d9 | ||
|
|
370ce5de1f | ||
|
|
5a39b0e249 | ||
|
|
2e1ef048df | ||
|
|
2ff8816bb7 | ||
|
|
eede6b05b5 | ||
|
|
a23c87be94 | ||
|
|
693395e78d | ||
|
|
6324d5d6c8 | ||
|
|
bc1403e1c6 | ||
|
|
f509c3e236 | ||
|
|
f2fe00b819 | ||
|
|
a886a2334b | ||
|
|
e79d1396df | ||
|
|
63c6eeb30e | ||
|
|
10890cc793 | ||
|
|
7494990611 | ||
|
|
9bb64df26e | ||
|
|
ceb9f01571 | ||
|
|
430cc9d7b2 | ||
|
|
ffba2b114b | ||
|
|
160f0f83e1 | ||
|
|
7559c31e43 | ||
|
|
6426644ce4 | ||
|
|
3d07072f08 | ||
|
|
2248a1133d | ||
|
|
2c8e4cb6b0 | ||
|
|
492fba07fc | ||
|
|
c87acf6571 | ||
|
|
c720dfe8a8 | ||
|
|
b860fdbccc | ||
|
|
4dbb33cce6 | ||
|
|
6a7191c376 | ||
|
|
6039cfa7ed | ||
|
|
3e078e76b1 | ||
|
|
43c504593f | ||
|
|
3e576b6332 | ||
|
|
748fd20e57 | ||
|
|
8d59054112 | ||
|
|
8d439e6260 | ||
|
|
085d7d23b6 | ||
|
|
83e2029af4 | ||
|
|
88afb50d09 | ||
|
|
f0215f1a3d | ||
|
|
2b41c40c58 | ||
|
|
1c777c5ba5 | ||
|
|
011666b3f9 | ||
|
|
6aabb6958d | ||
|
|
0694515c69 | ||
|
|
7f521652f4 | ||
|
|
8740a8dc1a | ||
|
|
3f5f4c1b40 | ||
|
|
54c8e107b7 | ||
|
|
c3dcedc392 | ||
|
|
e877de94bb | ||
|
|
5144456aa4 | ||
|
|
5f8d24c431 | ||
|
|
13bd564edf | ||
|
|
0aaf9823c1 | ||
|
|
a64745193d | ||
|
|
fe83324746 | ||
|
|
f48462841f | ||
|
|
89acca0fd7 | ||
|
|
c41ea17ba6 | ||
|
|
1cd6ebb403 | ||
|
|
522db6d093 | ||
|
|
a7aa78b7e9 | ||
|
|
33783b1e9f | ||
|
|
d61d9c920b | ||
|
|
17a2e5d334 | ||
|
|
8f7e6ccd94 | ||
|
|
51adb23728 | ||
|
|
7245598952 | ||
|
|
ba462d67cf | ||
|
|
62a3b7334d | ||
|
|
c314464ef3 | ||
|
|
57cc97af47 | ||
|
|
34d1918a2d | ||
|
|
39f8eb18c7 | ||
|
|
597bbde151 | ||
|
|
28ba27184a | ||
|
|
4baff64d63 | ||
|
|
0cf83567eb | ||
|
|
034488c902 | ||
|
|
fb8de64487 | ||
|
|
7c0b2df272 | ||
|
|
290123bc33 | ||
|
|
11bc26d28d | ||
|
|
a68db0a857 | ||
|
|
563c6317d4 | ||
|
|
8dbb8d70fc | ||
|
|
90ebc66c0b | ||
|
|
d32e0f6eaf | ||
|
|
dba43a4a5e | ||
|
|
82535a9136 | ||
|
|
ad9c818574 | ||
|
|
143c73cdd0 | ||
|
|
ef936afeaa | ||
|
|
5bed559f96 | ||
|
|
c26538f433 | ||
|
|
0d5cd70536 | ||
|
|
7475636610 | ||
|
|
cd43bb7a5f | ||
|
|
b116eda8bc | ||
|
|
29697a0906 | ||
|
|
28110584a3 | ||
|
|
c0c9d70dcf | ||
|
|
fbfdf5c244 | ||
|
|
c63e23c140 | ||
|
|
465ab091e0 | ||
|
|
189e84d40e | ||
|
|
b0d180b409 | ||
|
|
a8396de668 | ||
|
|
ae7ea2a286 | ||
|
|
694d17a228 | ||
|
|
a84771013b | ||
|
|
31415679f7 | ||
|
|
ecc653cce4 | ||
|
|
bb292365ff | ||
|
|
95070310f3 | ||
|
|
6efe981234 | ||
|
|
2fbf3c4fc9 | ||
|
|
ca7fe55934 | ||
|
|
a3d411279f | ||
|
|
4de0a7e9e3 | ||
|
|
ffecc035c0 | ||
|
|
763702fd0f | ||
|
|
6eea66a332 | ||
|
|
a4eeb57a58 | ||
|
|
4a08b57b23 | ||
|
|
65f8812e46 | ||
|
|
b14bd5acce | ||
|
|
677009317e | ||
|
|
e487dc1da5 | ||
|
|
281f701f27 | ||
|
|
fa37250446 | ||
|
|
323e9903b4 | ||
|
|
a4b9b0d460 | ||
|
|
cbc7394d60 | ||
|
|
9ed68a9f1f | ||
|
|
ab6ea86eac | ||
|
|
747a643288 | ||
|
|
41a74beb3e | ||
|
|
886e90c770 | ||
|
|
6bbfd66744 | ||
|
|
0f52c6a0ee | ||
|
|
fe6fdf4589 | ||
|
|
0631d4ad01 | ||
|
|
746a62b149 | ||
|
|
e4d030c891 | ||
|
|
bf6a0335b0 | ||
|
|
96b7797c4e | ||
|
|
f8aa13f6e8 | ||
|
|
ead8cfc1e9 | ||
|
|
98aafa4a9e | ||
|
|
260365870a | ||
|
|
df74ac102e | ||
|
|
2ecfa6e7b2 | ||
|
|
5604c4c3ba | ||
|
|
3d7bcb19ee | ||
|
|
63c802666d | ||
|
|
036951444c | ||
|
|
217e63b1fd | ||
|
|
c9ca9717bc | ||
|
|
4018e4b70b | ||
|
|
b72439387e | ||
|
|
5395add039 | ||
|
|
f71dec426a | ||
|
|
bf752c81a5 | ||
|
|
fcdca4a4d7 | ||
|
|
acfa281f77 | ||
|
|
1da4bd2ea4 | ||
|
|
729dc8dbd9 | ||
|
|
7a8d092c8b | ||
|
|
1c8d0bb0ab | ||
|
|
36651b803c | ||
|
|
e360b4b34e | ||
|
|
af2e3190a2 | ||
|
|
73839c43d2 | ||
|
|
3f2eefc638 | ||
|
|
da1fb0b744 | ||
|
|
7394a654bb | ||
|
|
7e5c9dee67 | ||
|
|
c638e5d1a0 | ||
|
|
2da74c7d80 | ||
|
|
5e88782e51 | ||
|
|
24f44c1c64 | ||
|
|
4161a1339a | ||
|
|
7d0b6f1bf6 | ||
|
|
212150e7b8 | ||
|
|
a1d4fe13af | ||
|
|
55f9c8c24f | ||
|
|
599ed7136f | ||
|
|
93256637af | ||
|
|
fc4fa45b69 | ||
|
|
faff634bab | ||
|
|
b259c807fd | ||
|
|
ef949aef7e | ||
|
|
52881467d6 | ||
|
|
d2f692ebae | ||
|
|
e6d299c726 | ||
|
|
a2817325fd | ||
|
|
ea208bbd56 | ||
|
|
79a5ba09e2 | ||
|
|
2c82787ee9 | ||
|
|
1bc47ca8a2 | ||
|
|
d73d0ccc99 | ||
|
|
5bc282d60e | ||
|
|
c09bc36c03 | ||
|
|
87d13c24f1 | ||
|
|
f01ed130af | ||
|
|
51b484d930 | ||
|
|
cc5b74fa94 | ||
|
|
53c1e07edf | ||
|
|
542353b118 | ||
|
|
2c5d0af37a | ||
|
|
51a779df67 | ||
|
|
7a1ed147f4 | ||
|
|
141aa41e30 | ||
|
|
5748d06914 | ||
|
|
8d2398612b | ||
|
|
327e6c3a5c | ||
|
|
d45731a205 | ||
|
|
772bd3cee5 | ||
|
|
83cb209ad8 | ||
|
|
49ac8e85d6 | ||
|
|
a19d253aa7 | ||
|
|
eb05c5b6aa | ||
|
|
9087323265 | ||
|
|
fac74432d4 | ||
|
|
6376e4dcc6 | ||
|
|
b630ecfb5b | ||
|
|
8cdc72549d | ||
|
|
6aea354ff4 | ||
|
|
66e8068494 | ||
|
|
193eeca5ff | ||
|
|
d1ec2e151c | ||
|
|
3d6ace0f97 | ||
|
|
71c046bef4 | ||
|
|
0a3d26e9be | ||
|
|
edbc9d2af7 | ||
|
|
44e21101bc | ||
|
|
f3abbf4981 | ||
|
|
ba2a12e876 | ||
|
|
1c14c0d921 | ||
|
|
3961f724db | ||
|
|
0c43f49f13 | ||
|
|
08305b6e30 | ||
|
|
51bd7a197d | ||
|
|
498a1bb677 | ||
|
|
bab231287e | ||
|
|
ebcac44715 | ||
|
|
edfacf2af8 | ||
|
|
40b556112f | ||
|
|
7413ce5a40 | ||
|
|
66fee23319 | ||
|
|
dff91dd742 | ||
|
|
82f88ce973 | ||
|
|
b1067dbc98 | ||
|
|
4cde0ac8a8 | ||
|
|
a3074d12b5 | ||
|
|
6af9b00bee | ||
|
|
ec20274fa3 | ||
|
|
8d65ba4e49 | ||
|
|
16e49a0223 | ||
|
|
c98bf7d4c8 | ||
|
|
725ac521ba | ||
|
|
82b0a2d82b | ||
|
|
cb106240bf | ||
|
|
89c8cb886b | ||
|
|
9aee2bee71 | ||
|
|
0757bd97cf | ||
|
|
add1a96d99 | ||
|
|
8eda3aaa15 | ||
|
|
32a1c3b5da | ||
|
|
7ec2ee9bff | ||
|
|
c9d1c50986 | ||
|
|
48c363dafa | ||
|
|
a2ec7d7f6d | ||
|
|
df1a011b78 | ||
|
|
992d3b0ce5 | ||
|
|
c71f57f635 | ||
|
|
2580a273f4 | ||
|
|
b9aeeab005 | ||
|
|
0dfe6ce7da | ||
|
|
2682eef9b3 | ||
|
|
8189dd8c9f | ||
|
|
5c65299c0a | ||
|
|
35a70310c6 | ||
|
|
54af290cc0 | ||
|
|
c8b0988191 | ||
|
|
e6b8e53d0a | ||
|
|
779a2b8d89 | ||
|
|
0c23aafc34 | ||
|
|
4439882402 | ||
|
|
8e87ffc7da | ||
|
|
418241137c | ||
|
|
01db100439 | ||
|
|
e3d9ef07eb | ||
|
|
51aee6e8cb | ||
|
|
73667596fc | ||
|
|
9dacc42c8a | ||
|
|
8fdb08b0ad | ||
|
|
0942e2dce1 | ||
|
|
01c0820d4c | ||
|
|
d11d26a2f1 | ||
|
|
584defebe0 | ||
|
|
43c5d3509a | ||
|
|
1caf9ecff0 | ||
|
|
51c805d280 | ||
|
|
eb24f72e5e | ||
|
|
e654915069 | ||
|
|
464bc4b795 | ||
|
|
94b160258e | ||
|
|
1d31de03c7 | ||
|
|
ad9cc20258 | ||
|
|
c0ccd06250 | ||
|
|
eb2c0b7441 | ||
|
|
c986c49113 | ||
|
|
5a31ae874b | ||
|
|
cd55d69ef7 | ||
|
|
76acb98c67 | ||
|
|
30a1a0b26e | ||
|
|
16dabd5dc4 | ||
|
|
272d0fc9a1 | ||
|
|
8231b84a11 | ||
|
|
c1f60b769c | ||
|
|
d42e86426f | ||
|
|
50f907f608 | ||
|
|
77795b5005 | ||
|
|
2783737034 | ||
|
|
a6587b3f68 | ||
|
|
6ab8c9611c | ||
|
|
249cee7766 | ||
|
|
70ba4fbc81 | ||
|
|
93485e2aec | ||
|
|
e3e67874dd | ||
|
|
b7fc40078b | ||
|
|
70cb7f0084 | ||
|
|
cf7c2ee537 | ||
|
|
c4b9378245 | ||
|
|
55eeb620ac | ||
|
|
dcb4528e71 | ||
|
|
0a378bd49d | ||
|
|
6d2a4b5daa | ||
|
|
e46f3bf48a | ||
|
|
f3f702e503 | ||
|
|
eed1309b7a | ||
|
|
d6147c386f | ||
|
|
514df9c289 | ||
|
|
b50da115b9 | ||
|
|
d22ba5b19a | ||
|
|
7ab73165be | ||
|
|
800a4221ec | ||
|
|
ef2384baf7 | ||
|
|
ca4400224f | ||
|
|
7dc82a43e3 | ||
|
|
9f802a30ee | ||
|
|
1f9de9be02 | ||
|
|
4591353f68 | ||
|
|
2252a7bd33 | ||
|
|
23153f32ab | ||
|
|
83428bd716 | ||
|
|
0ae305fc5d | ||
|
|
cc82c1241e | ||
|
|
86625ee014 | ||
|
|
d33a5a39b6 | ||
|
|
371f8fe59e | ||
|
|
60f1ac8c67 | ||
|
|
baa4524a56 | ||
|
|
66cf592e8d | ||
|
|
83f2714766 | ||
|
|
c61218c496 | ||
|
|
f22e884eb4 | ||
|
|
491c1461f2 | ||
|
|
4f26da6e20 | ||
|
|
ee0bbb70bb | ||
|
|
86215b69a1 | ||
|
|
c708381f52 | ||
|
|
5eed642924 | ||
|
|
67b30fe715 | ||
|
|
1566cd4e37 | ||
|
|
2318c7cea4 | ||
|
|
b5336fb128 | ||
|
|
54f66af2bd | ||
|
|
6f6cdbc1dc | ||
|
|
ffe2babdd9 | ||
|
|
5d13eddfc8 | ||
|
|
e2a66f2bfe | ||
|
|
524af0dcf0 | ||
|
|
69f74c858a | ||
|
|
d89412e238 | ||
|
|
c5fc5a0120 | ||
|
|
02f41b0524 | ||
|
|
2b9691e62c | ||
|
|
800a06c253 | ||
|
|
490a0ac15c | ||
|
|
2823c0672a | ||
|
|
a1424cc2fa | ||
|
|
b21d3e84c4 | ||
|
|
501235485f | ||
|
|
b15ab2dd01 | ||
|
|
eaee5429df | ||
|
|
2cfdfc8b98 | ||
|
|
56f326eec8 | ||
|
|
fc594faaa4 | ||
|
|
4be3d3ccd2 | ||
|
|
0ab722902d | ||
|
|
e1d860506a | ||
|
|
11fe32df4f | ||
|
|
9acb937361 | ||
|
|
8f89b598f4 | ||
|
|
79b9f66609 | ||
|
|
e92bd4bd36 | ||
|
|
4f2a8f8651 | ||
|
|
132ed34fa3 | ||
|
|
287834134c | ||
|
|
4982f0fd61 | ||
|
|
4607224642 | ||
|
|
163af49d18 | ||
|
|
d5efa529ab | ||
|
|
1959bce335 | ||
|
|
875c4efa8c | ||
|
|
1615417bd6 | ||
|
|
0e5fb1e0e0 | ||
|
|
836098e6a8 | ||
|
|
dd56505825 | ||
|
|
68a3df64c2 | ||
|
|
a4ff0e1114 | ||
|
|
c66cf7e159 | ||
|
|
e1f64e83e0 | ||
|
|
1ed4517d65 | ||
|
|
d966376562 | ||
|
|
7a6fff51ca | ||
|
|
0d8610ad04 | ||
|
|
a30de369f9 | ||
|
|
8e5d3149c0 | ||
|
|
e2485b0c22 | ||
|
|
af518e8908 | ||
|
|
7bdb0c7250 | ||
|
|
62de76c8f3 | ||
|
|
d52da78ecc | ||
|
|
42fc9b27d1 | ||
|
|
70a9ef173e | ||
|
|
38e483fa5f | ||
|
|
39fa96b02f | ||
|
|
afb28c00c2 | ||
|
|
cd75e134d5 | ||
|
|
c606a2cc6e | ||
|
|
1a419c88b6 | ||
|
|
4f89ed02af | ||
|
|
2d1b96d908 | ||
|
|
dc293f9ec6 | ||
|
|
bdb579b8db | ||
|
|
f6a6afa998 | ||
|
|
f26bc01f54 | ||
|
|
82e18c5147 | ||
|
|
2408611fb8 | ||
|
|
f70793129d | ||
|
|
2eab759227 | ||
|
|
a4d61d3493 | ||
|
|
435d0d3a2e | ||
|
|
8ac3570255 | ||
|
|
60f1c983c6 | ||
|
|
1903790bbe | ||
|
|
0edb093b41 | ||
|
|
15362a145e | ||
|
|
793f0b7be7 | ||
|
|
c2d4372a1e | ||
|
|
3876d67a96 | ||
|
|
a96a1317b0 | ||
|
|
c1bfade15f | ||
|
|
d3618225f0 | ||
|
|
b655f2d178 | ||
|
|
0f59ab1755 | ||
|
|
bd5fa1e335 | ||
|
|
b33190d30c | ||
|
|
6426407d9b | ||
|
|
9110164aa1 | ||
|
|
d669187eea | ||
|
|
bd3fae1b83 | ||
|
|
b2b5c471c1 | ||
|
|
f82990404f | ||
|
|
25bd997ffd | ||
|
|
19fcb1f6b8 | ||
|
|
b2748596ca | ||
|
|
a324a008fd | ||
|
|
96892ec07a | ||
|
|
463659047e | ||
|
|
fa7a3029d3 | ||
|
|
321ef1d194 | ||
|
|
25a3007a1e | ||
|
|
a9b537f5e8 | ||
|
|
c156eea300 | ||
|
|
ba06217321 | ||
|
|
79a61ac3c7 | ||
|
|
76ae686880 | ||
|
|
848978c155 | ||
|
|
c4c8eaf887 | ||
|
|
0186739c13 | ||
|
|
769a0eef8a | ||
|
|
823b4e4faf |
20
.clang-format
Normal file
20
.clang-format
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
BasedOnStyle: WebKit,
|
||||
AlignAfterOpenBracket: AlwaysBreak,
|
||||
AlignConsecutiveAssignments: false,
|
||||
AlignConsecutiveDeclarations: false,
|
||||
AlignAfterOpenBracket: Align,
|
||||
AllowShortBlocksOnASingleLine: false,
|
||||
AllowShortFunctionsOnASingleLine: None,
|
||||
AlwaysBreakAfterReturnType: TopLevelDefinitions,
|
||||
AlwaysBreakTemplateDeclarations: Yes,
|
||||
BinPackArguments: false,
|
||||
BinPackParameters: false,
|
||||
BreakBeforeBraces: Linux,
|
||||
BreakConstructorInitializers: BeforeComma,
|
||||
ColumnLimit: 120,
|
||||
Cpp11BracedListStyle: true,
|
||||
FixNamespaceComments: true,
|
||||
MaxEmptyLinesToKeep: 5,
|
||||
NamespaceIndentation: Inner,
|
||||
}
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -69,3 +69,7 @@ install
|
||||
|
||||
# emacs directory setting:
|
||||
.dir-locals.el
|
||||
|
||||
*.pyc
|
||||
*.eggs
|
||||
*.egg-info
|
||||
|
||||
0
.gitmodules
vendored
Normal file
0
.gitmodules
vendored
Normal file
151
CMakeLists.txt
151
CMakeLists.txt
@@ -8,11 +8,9 @@ set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR})
|
||||
option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON)
|
||||
option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
|
||||
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
|
||||
option(ENABLE_WELL_TEST "Enable testing of well code when building Schedule object" OFF)
|
||||
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
|
||||
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable python bindings?" OFF)
|
||||
|
||||
if (ENABLE_WELL_TEST)
|
||||
add_definitions(-DWELL_TEST)
|
||||
endif()
|
||||
|
||||
# Output implies input
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
@@ -114,6 +112,8 @@ macro (sources_hook)
|
||||
# Append generated sources
|
||||
list(APPEND opm-common_SOURCES ${PROJECT_BINARY_DIR}/ParserKeywords.cpp)
|
||||
endif()
|
||||
set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
|
||||
PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
||||
endmacro (sources_hook)
|
||||
|
||||
macro (fortran_hook)
|
||||
@@ -149,7 +149,7 @@ if (ENABLE_MOCKSIM)
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
||||
|
||||
foreach( test test_msim test_msim_ACTIONX )
|
||||
opm_add_test(${test} SOURCES tests/msim/${test}
|
||||
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
|
||||
LIBRARIES ${_libs}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
|
||||
endforeach()
|
||||
@@ -157,27 +157,51 @@ endif()
|
||||
|
||||
# Build the compare utilities
|
||||
if(ENABLE_ECL_INPUT)
|
||||
add_library(testutil STATIC
|
||||
examples/test_util/EclFile.cpp
|
||||
examples/test_util/EclFilesComparator.cpp
|
||||
examples/test_util/EclOutput.cpp
|
||||
examples/test_util/EclRegressionTest.cpp
|
||||
examples/test_util/EclUtil.cpp
|
||||
examples/test_util/EGrid.cpp
|
||||
examples/test_util/ERft.cpp
|
||||
examples/test_util/ERst.cpp
|
||||
examples/test_util/ESmry.cpp)
|
||||
add_executable(compareECL
|
||||
test_util/EclFilesComparator.cpp
|
||||
test_util/EclRegressionTest.cpp
|
||||
test_util/compareECL.cpp
|
||||
)
|
||||
|
||||
add_executable(convertECL
|
||||
test_util/convertECL.cpp
|
||||
)
|
||||
|
||||
foreach(target compareECL convertECL)
|
||||
add_executable(${target} examples/test_util/${target}.cpp)
|
||||
target_link_libraries(${target} testutil opmcommon)
|
||||
target_link_libraries(${target} opmcommon)
|
||||
install(TARGETS ${target} DESTINATION bin)
|
||||
endforeach()
|
||||
|
||||
# Add the tests
|
||||
set(_libs testutil opmcommon
|
||||
set(_libs opmcommon
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
||||
foreach(test test_EclFilesComparator test_EclIO test_EclRegressionTest
|
||||
test_EGrid test_ERft test_ERst test_ESmry)
|
||||
|
||||
opm_add_test(test_EclFilesComparator
|
||||
CONDITION
|
||||
ENABLE_ECL_INPUT
|
||||
SOURCES
|
||||
tests/test_EclFilesComparator.cpp
|
||||
test_util/EclFilesComparator.cpp
|
||||
LIBRARIES
|
||||
${_libs}
|
||||
WORKING_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/tests
|
||||
)
|
||||
|
||||
opm_add_test(test_EclRegressionTest
|
||||
CONDITION
|
||||
ENABLE_ECL_INPUT
|
||||
SOURCES
|
||||
tests/test_EclRegressionTest.cpp
|
||||
test_util/EclFilesComparator.cpp
|
||||
test_util/EclRegressionTest.cpp
|
||||
LIBRARIES
|
||||
${_libs}
|
||||
WORKING_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/tests
|
||||
)
|
||||
|
||||
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry)
|
||||
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT
|
||||
LIBRARIES ${_libs}
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
|
||||
@@ -189,3 +213,90 @@ install(DIRECTORY cmake DESTINATION share/opm)
|
||||
|
||||
# Install tab completion skeleton
|
||||
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
|
||||
|
||||
if (OPM_ENABLE_PYTHON)
|
||||
# -------------------------------------------------------------------------
|
||||
# 1: Wrap C++ functionality in Python
|
||||
find_package(PythonInterp REQUIRED)
|
||||
include(FindPythonInterp)
|
||||
|
||||
make_directory(${CMAKE_BINARY_DIR}/python)
|
||||
set(PYTHON_PACKAGE_PATH "site-packages")
|
||||
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||
|
||||
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
|
||||
list(APPEND _opmcommon_include_dirs ${_ecl_include_dirs})
|
||||
string(REPLACE ";" ":" _setup_include_dirs "${_opmcommon_include_dirs}")
|
||||
|
||||
set(_opmcommon_lib_dirs ${CMAKE_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/lib)
|
||||
string(REPLACE ";" ":" _setup_lib_dirs "${_opmcommon_lib_dirs}")
|
||||
|
||||
add_custom_command(OUTPUT python/python/opm/libopmcommon_python.so
|
||||
DEPENDS
|
||||
python/cxx/connection.cpp
|
||||
python/cxx/converters.hpp
|
||||
python/cxx/deck.cpp
|
||||
python/cxx/deck_keyword.cpp
|
||||
python/cxx/eclipse_3d_properties.cpp
|
||||
python/cxx/eclipse_config.cpp
|
||||
python/cxx/eclipse_grid.cpp
|
||||
python/cxx/eclipse_state.cpp
|
||||
python/cxx/group.cpp
|
||||
python/cxx/log.cpp
|
||||
python/cxx/parsecontext.cpp
|
||||
python/cxx/parser.cpp
|
||||
python/cxx/schedule.cpp
|
||||
python/cxx/export.cpp
|
||||
python/cxx/export.hpp
|
||||
python/cxx/common_state.cpp
|
||||
python/cxx/common_state.hpp
|
||||
python/cxx/table_manager.cpp
|
||||
python/cxx/well.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/python/ ${CMAKE_BINARY_DIR}/python
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python/setup.py
|
||||
build
|
||||
build_ext
|
||||
--build-lib=${CMAKE_BINARY_DIR}/python/python/opm
|
||||
--library-dirs=${_setup_lib_dirs}
|
||||
--include-dirs=${_setup_include_dirs}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python
|
||||
COMMENT "Building python bindings")
|
||||
add_custom_target(opmcommon_python ALL DEPENDS python/python/opm/libopmcommon_python.so)
|
||||
add_dependencies(opmcommon_python opmcommon)
|
||||
|
||||
install( CODE "execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} )" )
|
||||
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} python/setup.py build_ext --dry-run install --prefix=${CMAKE_INSTALL_PREFIX} )" )
|
||||
|
||||
add_test(NAME python_tests
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python
|
||||
COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${CMAKE_BINARY_DIR}/python/python/opm test
|
||||
)
|
||||
|
||||
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/python/python)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Let cmake configure some small shell scripts which can be used to simplify
|
||||
# building and testing of the Python extensions.
|
||||
configure_file(python/setup-build.sh.in tmp/setup-build.sh)
|
||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-build.sh
|
||||
DESTINATION ${PROJECT_BINARY_DIR}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
||||
|
||||
configure_file(python/setup-test.sh.in tmp/setup-test.sh)
|
||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-test.sh
|
||||
DESTINATION ${PROJECT_BINARY_DIR}
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
||||
|
||||
configure_file(python/enable-python.sh.in enable-python.sh)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
|
||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
||||
add_subdirectory(python/pybind11)
|
||||
target_include_directories(opmcommon PRIVATE "python/pybind11/include;${PYTHON_INCLUDE_DIRS}")
|
||||
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
|
||||
|
||||
add_definitions(-DEMBEDDED_PYTHON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# This file sets up five lists:
|
||||
# MAIN_SOURCE_FILES List of compilation units which will be included in
|
||||
# MAIN_SOURCE_FILES List of compilation units which will be included in
|
||||
# the library. If it isn't on this list, it won't be
|
||||
# part of the library. Please try to keep it sorted to
|
||||
# maintain sanity.
|
||||
@@ -35,17 +35,20 @@ list (APPEND MAIN_SOURCE_FILES
|
||||
src/opm/common/utility/parameters/ParameterGroup.cpp
|
||||
src/opm/common/utility/parameters/ParameterTools.cpp
|
||||
src/opm/common/utility/numeric/calculateCellVol.cpp
|
||||
src/opm/common/utility/TimeService.cpp
|
||||
)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list(APPEND MAIN_SOURCE_FILES
|
||||
src/opm/json/JsonObject.cpp
|
||||
src/opm/parser/eclipse/Deck/Deck.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckItem.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckValue.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckRecord.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckOutput.cpp
|
||||
src/opm/parser/eclipse/Deck/Section.cpp
|
||||
src/opm/parser/eclipse/Deck/UDAValue.cpp
|
||||
src/opm/parser/eclipse/Python/Python.cpp
|
||||
src/opm/parser/eclipse/EclipseState/AquiferCT.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Aquifetp.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Aquancon.cpp
|
||||
@@ -72,22 +75,29 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Grid/setKeywordBox.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Grid/TransMult.cpp
|
||||
src/opm/parser/eclipse/EclipseState/InitConfig/Equil.cpp
|
||||
src/opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/InitConfig/InitConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Runspec.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionParser.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/injection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group2.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
|
||||
@@ -96,17 +106,17 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/SummaryState.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/TimeMap.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Tuning.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.cpp
|
||||
@@ -133,14 +143,15 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQWellSet.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp
|
||||
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
|
||||
@@ -150,33 +161,68 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/Parser/ParserItem.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserRecord.cpp
|
||||
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
|
||||
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
|
||||
src/opm/parser/eclipse/RawDeck/StarToken.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
|
||||
src/opm/parser/eclipse/Units/Dimension.cpp
|
||||
src/opm/parser/eclipse/Units/UnitSystem.cpp
|
||||
src/opm/parser/eclipse/Utility/Functional.cpp
|
||||
src/opm/parser/eclipse/Utility/Stringview.cpp
|
||||
)
|
||||
|
||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
||||
list( APPEND PYTHON_SOURCE_FILES
|
||||
src/opm/parser/eclipse/Python/PythonInterp.cpp
|
||||
python/cxx/connection.cpp
|
||||
python/cxx/deck.cpp
|
||||
python/cxx/deck_keyword.cpp
|
||||
python/cxx/eclipse_3d_properties.cpp
|
||||
python/cxx/eclipse_config.cpp
|
||||
python/cxx/eclipse_grid.cpp
|
||||
python/cxx/eclipse_state.cpp
|
||||
python/cxx/group.cpp
|
||||
python/cxx/parsecontext.cpp
|
||||
python/cxx/parser.cpp
|
||||
python/cxx/schedule.cpp
|
||||
python/cxx/export.cpp
|
||||
python/cxx/common_state.cpp
|
||||
python/cxx/table_manager.cpp
|
||||
python/cxx/well.cpp
|
||||
python/cxx/log.cpp
|
||||
)
|
||||
set_source_files_properties(${PYTHON_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
||||
list( APPEND MAIN_SOURCE_FILES ${PYTHON_SOURCE_FILES})
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(NOT cjson_FOUND)
|
||||
list(APPEND MAIN_SOURCE_FILES external/cjson/cJSON.c)
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
list( APPEND MAIN_SOURCE_FILES
|
||||
src/opm/io/eclipse/EclFile.cpp
|
||||
src/opm/io/eclipse/EclOutput.cpp
|
||||
src/opm/io/eclipse/EclUtil.cpp
|
||||
src/opm/io/eclipse/EGrid.cpp
|
||||
src/opm/io/eclipse/ERft.cpp
|
||||
src/opm/io/eclipse/ERst.cpp
|
||||
src/opm/io/eclipse/ESmry.cpp
|
||||
src/opm/io/eclipse/OutputStream.cpp
|
||||
src/opm/output/eclipse/AggregateConnectionData.cpp
|
||||
src/opm/output/eclipse/AggregateGroupData.cpp
|
||||
src/opm/output/eclipse/AggregateMSWData.cpp
|
||||
src/opm/output/eclipse/AggregateUDQData.cpp
|
||||
src/opm/output/eclipse/AggregateWellData.cpp
|
||||
src/opm/output/eclipse/CreateDoubHead.cpp
|
||||
src/opm/output/eclipse/CreateInteHead.cpp
|
||||
src/opm/output/eclipse/CreateLogiHead.cpp
|
||||
src/opm/output/eclipse/CreateUdqDims.cpp
|
||||
src/opm/output/eclipse/DoubHEAD.cpp
|
||||
src/opm/output/eclipse/EclipseGridInspector.cpp
|
||||
src/opm/output/eclipse/EclipseIO.cpp
|
||||
src/opm/output/eclipse/InteHEAD.cpp
|
||||
src/opm/output/eclipse/libECLRestart.cpp
|
||||
src/opm/output/eclipse/LinearisedOutputTable.cpp
|
||||
src/opm/output/eclipse/LoadRestart.cpp
|
||||
src/opm/output/eclipse/LogiHEAD.cpp
|
||||
@@ -185,6 +231,8 @@ if(ENABLE_ECL_OUTPUT)
|
||||
src/opm/output/eclipse/Tables.cpp
|
||||
src/opm/output/eclipse/RegionCache.cpp
|
||||
src/opm/output/eclipse/RestartValue.cpp
|
||||
src/opm/output/eclipse/WriteInit.cpp
|
||||
src/opm/output/eclipse/WriteRFT.cpp
|
||||
src/opm/output/data/Solution.cpp
|
||||
)
|
||||
endif()
|
||||
@@ -214,15 +262,18 @@ if(ENABLE_ECL_INPUT)
|
||||
tests/parser/ConnectionTests.cpp
|
||||
tests/parser/COMPSEGUnits.cpp
|
||||
tests/parser/CopyRegTests.cpp
|
||||
tests/parser/DeckValueTests.cpp
|
||||
tests/parser/DeckTests.cpp
|
||||
tests/parser/DynamicStateTests.cpp
|
||||
tests/parser/DynamicVectorTests.cpp
|
||||
tests/parser/Eclipse3DPropertiesTests.cpp
|
||||
tests/parser/EclipseGridTests.cpp
|
||||
tests/parser/EmbeddedPython.cpp
|
||||
tests/parser/EqualRegTests.cpp
|
||||
tests/parser/EventTests.cpp
|
||||
tests/parser/FaceDirTests.cpp
|
||||
tests/parser/FaultTests.cpp
|
||||
tests/parser/FoamTests.cpp
|
||||
tests/parser/FunctionalTests.cpp
|
||||
tests/parser/GeomodifierTests.cpp
|
||||
tests/parser/GridPropertyTests.cpp
|
||||
@@ -236,8 +287,11 @@ if(ENABLE_ECL_INPUT)
|
||||
tests/parser/OrderedMapTests.cpp
|
||||
tests/parser/ParseContextTests.cpp
|
||||
tests/parser/ParseContext_EXIT1.cpp
|
||||
tests/parser/ParseDATAWithDefault.cpp
|
||||
tests/parser/PYACTION.cpp
|
||||
tests/parser/PORVTests.cpp
|
||||
tests/parser/RawKeywordTests.cpp
|
||||
tests/parser/ResinsightTest.cpp
|
||||
tests/parser/RestartConfigTests.cpp
|
||||
tests/parser/RockTableTests.cpp
|
||||
tests/parser/RunspecTests.cpp
|
||||
@@ -273,14 +327,16 @@ if(ENABLE_ECL_OUTPUT)
|
||||
tests/test_AggregateGroupData.cpp
|
||||
tests/test_AggregateMSWData.cpp
|
||||
tests/test_AggregateConnectionData.cpp
|
||||
tests/test_AggregateUDQData.cpp
|
||||
tests/test_ArrayDimChecker.cpp
|
||||
tests/test_CharArrayNullTerm.cpp
|
||||
tests/test_EclipseIO.cpp
|
||||
tests/test_DoubHEAD.cpp
|
||||
tests/test_InteHEAD.cpp
|
||||
tests/test_LinearisedOutputTable.cpp
|
||||
tests/test_LogiHEAD.cpp
|
||||
tests/test_OutputStream.cpp
|
||||
tests/test_regionCache.cpp
|
||||
tests/test_PaddedOutputString.cpp
|
||||
tests/test_Restart.cpp
|
||||
tests/test_RFT.cpp
|
||||
tests/test_Solution.cpp
|
||||
@@ -288,7 +344,7 @@ if(ENABLE_ECL_OUTPUT)
|
||||
tests/test_Tables.cpp
|
||||
tests/test_Wells.cpp
|
||||
tests/test_WindowedArray.cpp
|
||||
tests/test_writenumwells.cpp
|
||||
tests/test_restartwellinfo.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -297,6 +353,7 @@ list (APPEND TEST_DATA_FILES
|
||||
)
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
list (APPEND TEST_DATA_FILES
|
||||
tests/expect-wdims.chldg.err.out
|
||||
tests/expect-wdims.err.out
|
||||
tests/FIRST_SIM.DATA
|
||||
tests/FIRST_SIM_THPRES.DATA
|
||||
@@ -309,8 +366,10 @@ if(ENABLE_ECL_OUTPUT)
|
||||
tests/SUMMARY_EFF_FAC.DATA
|
||||
tests/SPE1CASE1.DATA
|
||||
tests/SPE1CASE1.SMSPEC
|
||||
tests/SPE1CASE1A.SMSPEC
|
||||
tests/SPE9_CP_PACKED.DATA
|
||||
tests/SOFR_TEST.DATA
|
||||
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -324,7 +383,10 @@ if(ENABLE_ECL_INPUT)
|
||||
tests/SPE1CASE1.RFT
|
||||
tests/SPE1_TESTCASE.UNRST
|
||||
tests/SPE1_TESTCASE.FUNRST
|
||||
tests/SPE1_TESTCASE.F0025
|
||||
tests/SPE1_TESTCASE.X0025
|
||||
tests/SPE1CASE1.UNSMRY
|
||||
tests/SPE1CASE1A.UNSMRY
|
||||
tests/SPE1CASE1_RST60.SMSPEC
|
||||
tests/SPE1CASE1_RST60.UNSMRY
|
||||
)
|
||||
@@ -380,6 +442,7 @@ list( APPEND PUBLIC_HEADER_FILES
|
||||
opm/common/utility/parameters/ParameterStrings.hpp
|
||||
opm/common/utility/parameters/ParameterTools.hpp
|
||||
opm/common/utility/numeric/calculateCellVol.hpp
|
||||
opm/common/utility/TimeService.hpp
|
||||
)
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list(APPEND PUBLIC_HEADER_FILES
|
||||
@@ -404,7 +467,9 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/Parser/ParserConst.hpp
|
||||
opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp
|
||||
opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Util/Value.hpp
|
||||
opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp
|
||||
opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp
|
||||
opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp
|
||||
@@ -466,6 +531,8 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/AqutabTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlyadsTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PbvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp
|
||||
@@ -498,22 +565,27 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Aquifetp.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Action/Condition.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp
|
||||
@@ -522,12 +594,14 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Events.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
|
||||
@@ -541,11 +615,11 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQWellSet.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp
|
||||
@@ -553,17 +627,24 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/Deck/Deck.hpp
|
||||
opm/parser/eclipse/Deck/Section.hpp
|
||||
opm/parser/eclipse/Deck/DeckOutput.hpp
|
||||
opm/parser/eclipse/Deck/DeckValue.hpp
|
||||
opm/parser/eclipse/Deck/DeckKeyword.hpp
|
||||
opm/parser/eclipse/Deck/DeckRecord.hpp
|
||||
opm/parser/eclipse/Deck/UDAValue.hpp
|
||||
opm/parser/eclipse/RawDeck/StarToken.hpp
|
||||
opm/parser/eclipse/RawDeck/RawEnums.hpp
|
||||
opm/parser/eclipse/RawDeck/RawRecord.hpp
|
||||
opm/parser/eclipse/RawDeck/RawKeyword.hpp
|
||||
opm/parser/eclipse/RawDeck/RawConsts.hpp)
|
||||
opm/parser/eclipse/Python/Python.hpp)
|
||||
endif()
|
||||
if(ENABLE_ECL_OUTPUT)
|
||||
list(APPEND PUBLIC_HEADER_FILES
|
||||
opm/io/eclipse/EclFile.hpp
|
||||
opm/io/eclipse/EclIOdata.hpp
|
||||
opm/io/eclipse/EclOutput.hpp
|
||||
opm/io/eclipse/EclUtil.hpp
|
||||
opm/io/eclipse/EGrid.hpp
|
||||
opm/io/eclipse/ERft.hpp
|
||||
opm/io/eclipse/ERst.hpp
|
||||
opm/io/eclipse/ESmry.hpp
|
||||
opm/io/eclipse/PaddedOutputString.hpp
|
||||
opm/io/eclipse/OutputStream.hpp
|
||||
opm/output/data/Cells.hpp
|
||||
opm/output/data/Solution.hpp
|
||||
opm/output/data/Wells.hpp
|
||||
@@ -572,18 +653,18 @@ if(ENABLE_ECL_OUTPUT)
|
||||
opm/output/eclipse/VectorItems/intehead.hpp
|
||||
opm/output/eclipse/VectorItems/logihead.hpp
|
||||
opm/output/eclipse/VectorItems/msw.hpp
|
||||
opm/output/eclipse/VectorItems/tabdims.hpp
|
||||
opm/output/eclipse/VectorItems/well.hpp
|
||||
opm/output/eclipse/AggregateGroupData.hpp
|
||||
opm/output/eclipse/AggregateConnectionData.hpp
|
||||
opm/output/eclipse/AggregateMSWData.hpp
|
||||
opm/output/eclipse/AggregateUDQData.hpp
|
||||
opm/output/eclipse/AggregateWellData.hpp
|
||||
opm/output/eclipse/CharArrayNullTerm.hpp
|
||||
opm/output/eclipse/DoubHEAD.hpp
|
||||
opm/output/eclipse/EclipseGridInspector.hpp
|
||||
opm/output/eclipse/EclipseIO.hpp
|
||||
opm/output/eclipse/EclipseIOUtil.hpp
|
||||
opm/output/eclipse/InteHEAD.hpp
|
||||
opm/output/eclipse/libECLRestart.hpp
|
||||
opm/output/eclipse/LinearisedOutputTable.hpp
|
||||
opm/output/eclipse/LogiHEAD.hpp
|
||||
opm/output/eclipse/RegionCache.hpp
|
||||
@@ -592,6 +673,8 @@ if(ENABLE_ECL_OUTPUT)
|
||||
opm/output/eclipse/Summary.hpp
|
||||
opm/output/eclipse/Tables.hpp
|
||||
opm/output/eclipse/WindowedArray.hpp
|
||||
opm/output/eclipse/WriteInit.hpp
|
||||
opm/output/eclipse/WriteRFT.hpp
|
||||
opm/output/eclipse/WriteRestartHelpers.hpp
|
||||
opm/output/OutputWriter.hpp
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Libs to link tests against
|
||||
set(TEST_LIBS opmcommon ecl Boost::unit_test_framework)
|
||||
set(TEST_LIBS opmcommon Boost::unit_test_framework)
|
||||
set(EXTRA_TESTS)
|
||||
|
||||
# Generated source, needs to be here
|
||||
@@ -49,15 +49,13 @@ list(APPEND EXTRA_TESTS EclipseStateTests)
|
||||
foreach (test BoxTest
|
||||
CheckDeckValidity
|
||||
EclipseGridCreateFromDeck
|
||||
EDITNNCTests
|
||||
EDITNNCTests
|
||||
IncludeTest
|
||||
IntegrationTests
|
||||
IOConfigIntegrationTest
|
||||
NNCTests
|
||||
ParseKEYWORD
|
||||
ParseDATAWithDefault
|
||||
Polymer
|
||||
ResinsightTest
|
||||
ScheduleCreateFromDeck
|
||||
TransMultIntegrationTests)
|
||||
|
||||
@@ -87,6 +85,8 @@ if(HAVE_OPM_TESTS)
|
||||
${OPM_TESTS_ROOT}/spe3/SPE3CASE2.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT_RESTART.DATA
|
||||
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
|
||||
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
|
||||
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
|
||||
@@ -96,6 +96,7 @@ if(HAVE_OPM_TESTS)
|
||||
EXE_NAME parse_write
|
||||
TEST_ARGS ${deck})
|
||||
endforeach()
|
||||
opm_add_test("SPE9_CP_GROUP2" NO_COMPILE EXE_NAME parse_write TEST_ARGS "${OPM_TESTS_ROOT}/spe9group/SPE9_CP_GROUP.DATA")
|
||||
set_property(TEST NORNE_ATW2013
|
||||
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
|
||||
endif()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
set(genkw_SOURCES src/opm/json/JsonObject.cpp
|
||||
src/opm/parser/eclipse/Parser/createDefaultKeywordList.cpp
|
||||
src/opm/parser/eclipse/Deck/UDAValue.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckValue.cpp
|
||||
src/opm/parser/eclipse/Deck/Deck.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckItem.cpp
|
||||
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
|
||||
@@ -14,9 +15,9 @@ set(genkw_SOURCES src/opm/json/JsonObject.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserItem.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/ParserRecord.cpp
|
||||
src/opm/parser/eclipse/RawDeck/RawKeyword.cpp
|
||||
src/opm/parser/eclipse/RawDeck/RawRecord.cpp
|
||||
src/opm/parser/eclipse/RawDeck/StarToken.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
|
||||
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
|
||||
src/opm/parser/eclipse/Units/Dimension.cpp
|
||||
src/opm/parser/eclipse/Units/UnitSystem.cpp
|
||||
src/opm/parser/eclipse/Utility/Stringview.cpp
|
||||
@@ -31,7 +32,7 @@ if(NOT cjson_FOUND)
|
||||
endif()
|
||||
add_executable(genkw ${genkw_SOURCES})
|
||||
|
||||
target_link_libraries(genkw ecl Boost::regex Boost::filesystem Boost::system)
|
||||
target_link_libraries(genkw Boost::regex Boost::filesystem Boost::system)
|
||||
|
||||
# Generate keyword list
|
||||
include(src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
|
||||
|
||||
18
changelog.md
18
changelog.md
@@ -3,6 +3,24 @@
|
||||
A short month-by-month synopsis of change highlights. Most bugfixes won't make
|
||||
it in here, only the bigger features and interface changes.
|
||||
|
||||
# Important changes between release 2019.04 and 2019.10
|
||||
|
||||
* opm-common and the rest of OPM does not use libecl anymore and
|
||||
supports reading and writing Eclipse files directly
|
||||
* Improved Eclipse compatible restart, support for unified and non unified
|
||||
files, and formatted and unformatted files
|
||||
* Support for reading and checking various additional keywords was introduced (those
|
||||
starting with A - M, R, T, V, W, Z).
|
||||
* ACTIONX support implemented
|
||||
* NUPCOL support implemented
|
||||
* UDA, UDQ support implemented
|
||||
* Implemented writing saturation function scaled end-point arrays (e.g., SWL, SGU,
|
||||
SOWCR, KRORW, PCG) to INIT file
|
||||
* Fixes concerning interaction of WELOPEN and WCON* with WECON and
|
||||
WTEST
|
||||
* Added support for FOAM keywords (FOAMMOB, FOAMROCK, WFOAM)
|
||||
* Refactored and reimplemented Well representation in deck
|
||||
|
||||
# 2016.12
|
||||
* ZCORN adjustments improved, considers cell-cell relations
|
||||
* Slightly more robust compilation - won't crash if locales are broken
|
||||
|
||||
@@ -1,287 +0,0 @@
|
||||
# - Find the Ensemble-based Reservoir Tool (ERT)
|
||||
#
|
||||
# Set the cache variable ERT_ROOT to the install location of the ERT
|
||||
# libraries and header files.
|
||||
#
|
||||
# If found, it sets these variables:
|
||||
#
|
||||
# ERT_INCLUDE_DIRS Header file directories
|
||||
# ERT_LIBRARIES Archives and shared objects
|
||||
# ERT_CONFIG_VARS Definitions that goes in config.h
|
||||
# ERT_LINKER_FLAGS Options that must be passed to linker
|
||||
#
|
||||
# It will also add to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if necessary to
|
||||
# link with the ERT libraries.
|
||||
|
||||
# variables to pass on to other packages
|
||||
if (FIND_QUIETLY)
|
||||
set (ERT_QUIET "QUIET")
|
||||
else (FIND_QUIETLY)
|
||||
set (ERT_QUIET "")
|
||||
endif (FIND_QUIETLY)
|
||||
|
||||
# if a directory has been specified by the user, then don't go look
|
||||
# in the system directories as well
|
||||
if (ERT_ROOT)
|
||||
set (_no_default_path "NO_DEFAULT_PATH")
|
||||
else (ERT_ROOT)
|
||||
set (_no_default_path "")
|
||||
endif (ERT_ROOT)
|
||||
|
||||
# ERT doesn't have any config-mode file, so we need to specify the root
|
||||
# directory in its own variable
|
||||
find_path (ERT_ECL_INCLUDE_DIR
|
||||
NAMES "ert/ecl/ecl_util.h"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||
PATH_SUFFIXES "libecl/include/" "include"
|
||||
DOC "Path to ERT Eclipse library header files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_path (ERT_ECL_WELL_INCLUDE_DIR
|
||||
NAMES "ert/ecl_well/well_const.h"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||
PATH_SUFFIXES "libecl_well/include/" "include"
|
||||
DOC "Path to ERT Eclipse library header files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_path (ERT_ECLXX_INCLUDE_DIR
|
||||
NAMES "ert/ecl/EclKW.hpp"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||
PATH_SUFFIXES "libeclxx/include/" "include"
|
||||
DOC "Path to ERT Eclipse C++ library header files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_path (ERT_UTIL_INCLUDE_DIR
|
||||
NAMES "ert/util/stringlist.h"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||
PATH_SUFFIXES "libert_util/include/" "include"
|
||||
DOC "Path to ERT Eclipse library header files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_path (ERT_UTILXX_INCLUDE_DIR
|
||||
NAMES "ert/util/ert_unique_ptr.hpp"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||
PATH_SUFFIXES "libert_utilxx/include/" "include"
|
||||
DOC "Path to ERT Eclipse C++ library header files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_path (ERT_GEN_INCLUDE_DIR
|
||||
NAMES "ert/util/int_vector.h"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||
PATH_SUFFIXES "libert_util/include"
|
||||
"include" "build/libert_util/include" "build/libert_util/include"
|
||||
DOC "Path to ERT generated library header files"
|
||||
${_no_default_path}
|
||||
)
|
||||
|
||||
|
||||
# need all of these libraries
|
||||
if (CMAKE_SIZEOF_VOID_P)
|
||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif (CMAKE_SIZEOF_VOID_P)
|
||||
find_library (ERT_LIBRARY_ECL
|
||||
NAMES "ecl"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||
"${PROJECT_BINARY_DIR}/../ert"
|
||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
DOC "Path to ERT Eclipse library archive/shared object files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_library (ERT_LIBRARY_ECLXX
|
||||
NAMES "eclxx"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||
"${PROJECT_BINARY_DIR}/../ert"
|
||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
DOC "Path to ERT Eclipse C++ library archive/shared object files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_library (ERT_LIBRARY_ECL_WELL
|
||||
NAMES "ecl_well"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||
"${PROJECT_BINARY_DIR}/../ert"
|
||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
DOC "Path to ERT Eclipse library archive/shared object files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_library (ERT_LIBRARY_GEOMETRY
|
||||
NAMES "ert_geometry"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||
"${PROJECT_BINARY_DIR}/../ert"
|
||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
DOC "Path to ERT Geometry library archive/shared object files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_library (ERT_LIBRARY_UTIL
|
||||
NAMES "ert_util"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||
"${PROJECT_BINARY_DIR}/../ert"
|
||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
DOC "Path to ERT Utilities library archive/shared object files"
|
||||
${_no_default_path}
|
||||
)
|
||||
find_library (ERT_LIBRARY_UTILXX
|
||||
NAMES "ert_utilxx"
|
||||
HINTS "${ERT_ROOT}"
|
||||
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||
"${PROJECT_BINARY_DIR}/../ert"
|
||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||
DOC "Path to ERT Utilities library archive/shared object files"
|
||||
${_no_default_path}
|
||||
)
|
||||
# the "library" found here is actually a list of several files
|
||||
list (APPEND ERT_INCLUDE_DIR
|
||||
${ERT_ECL_INCLUDE_DIR}
|
||||
${ERT_ECL_WELL_INCLUDE_DIR}
|
||||
${ERT_ECLXX_INCLUDE_DIR}
|
||||
${ERT_UTIL_INCLUDE_DIR}
|
||||
${ERT_UTILXX_INCLUDE_DIR}
|
||||
${ERT_GEN_INCLUDE_DIR}
|
||||
)
|
||||
list (APPEND ERT_LIBRARY
|
||||
${ERT_LIBRARY_ECL}
|
||||
${ERT_LIBRARY_ECLXX}
|
||||
${ERT_LIBRARY_ECL_WELL}
|
||||
${ERT_LIBRARY_GEOMETRY}
|
||||
${ERT_LIBRARY_UTIL}
|
||||
${ERT_LIBRARY_UTILXX}
|
||||
)
|
||||
list (APPEND ERT_LIBRARIES ${ERT_LIBRARY})
|
||||
list (APPEND ERT_INCLUDE_DIRS ${ERT_INCLUDE_DIR})
|
||||
|
||||
# if we didn't find any files, then don't proceed through the entire dependency list
|
||||
include (FindPackageHandleStandardArgs)
|
||||
if (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")
|
||||
find_package_handle_standard_args (ERT
|
||||
DEFAULT_MSG
|
||||
ERT_INCLUDE_DIR ERT_LIBRARY
|
||||
)
|
||||
# clear the cache so the find probe is attempted again if files becomes
|
||||
# available (only upon a unsuccessful *compile* should we disable further
|
||||
# probing)
|
||||
set (HAVE_ERT)
|
||||
unset (HAVE_ERT CACHE)
|
||||
return ()
|
||||
endif (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")
|
||||
|
||||
|
||||
# dependencies
|
||||
|
||||
# parallel programming
|
||||
include (UseOpenMP)
|
||||
find_openmp (ERT)
|
||||
|
||||
# compression library
|
||||
find_package (ZLIB ${ERT_QUIET})
|
||||
if (ZLIB_FOUND)
|
||||
list (APPEND ERT_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
|
||||
list (APPEND ERT_LIBRARIES ${ZLIB_LIBRARIES})
|
||||
endif (ZLIB_FOUND)
|
||||
|
||||
# numerics
|
||||
find_package (BLAS ${ERT_QUIET})
|
||||
if (BLAS_FOUND)
|
||||
list (APPEND ERT_INCLUDE_DIRS ${BLAS_INCLUDE_DIRS})
|
||||
list (APPEND ERT_LIBRARIES ${BLAS_LIBRARIES})
|
||||
list (APPEND ERT_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
|
||||
endif (BLAS_FOUND)
|
||||
|
||||
find_package (LAPACK ${ERT_QUIET})
|
||||
if (LAPACK_FOUND)
|
||||
list (APPEND ERT_INCLUDE_DIRS ${LAPACK_INCLUDE_DIRS})
|
||||
list (APPEND ERT_LIBRARIES ${LAPACK_LIBRARIES})
|
||||
list (APPEND ERT_LINKER_FLAGS ${LAPACK_LINKER_FLAGS})
|
||||
endif (LAPACK_FOUND)
|
||||
|
||||
# math library (should exist on all unices; automatically linked on Windows)
|
||||
if (UNIX)
|
||||
find_library (MATH_LIBRARY
|
||||
NAMES "m"
|
||||
)
|
||||
list (APPEND ERT_LIBRARIES ${MATH_LIBRARY})
|
||||
endif (UNIX)
|
||||
|
||||
# if shared libraries are disabled on linux, explcitly linking to the
|
||||
# pthreads library is required by ERT
|
||||
find_package(Threads ${ERT_QUIET})
|
||||
if (CMAKE_THREAD_LIBS_INIT)
|
||||
list (APPEND ERT_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
# Platform specific library where dlopen with friends lives
|
||||
list (APPEND ERT_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
|
||||
# since OpenMP often implies pthreads, we need to tidy up
|
||||
# (last instance of library must be left standing, thus reversing that
|
||||
# list before removing duplicates)
|
||||
include (Duplicates)
|
||||
remove_dup_deps (ERT)
|
||||
|
||||
# see if we can compile a minimum example
|
||||
# CMake logical test doesn't handle lists (sic)
|
||||
if (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
|
||||
include (CMakePushCheckState)
|
||||
include (CheckCSourceCompiles)
|
||||
cmake_push_check_state ()
|
||||
set (CMAKE_REQUIRED_INCLUDES ${ERT_INCLUDE_DIR})
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${ERT_LIBRARIES})
|
||||
check_cxx_source_compiles (
|
||||
"#include <ert/ecl/ecl_grid.h>
|
||||
int main ( ) {
|
||||
ecl_grid_type * grid = ecl_grid_alloc_rectangular( 10,10,10,1,1,1, NULL);
|
||||
ecl_grid_free( grid );
|
||||
return 0;
|
||||
}" HAVE_ERT)
|
||||
cmake_pop_check_state ()
|
||||
else (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
|
||||
# clear the cache so the find probe is attempted again if files becomes
|
||||
# available (only upon a unsuccessful *compile* should we disable further
|
||||
# probing)
|
||||
set (HAVE_ERT)
|
||||
unset (HAVE_ERT CACHE)
|
||||
endif (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
|
||||
|
||||
# if the test program didn't compile, but was required to do so, bail
|
||||
# out now and display an error; otherwise limp on
|
||||
find_package_handle_standard_args (ERT
|
||||
DEFAULT_MSG
|
||||
ERT_INCLUDE_DIR ERT_LIBRARY HAVE_ERT
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# - Find the Python wrappers for Ensemble-based Reservoir Tool (ERT)
|
||||
#
|
||||
# Set the cache variable ERT_PYTHON_PATH to the install location of
|
||||
# the root ert package.
|
||||
|
||||
find_package(PythonInterp)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
|
||||
# We try to find the ert Python distribution. This is done by running
|
||||
# Python code which tries to 'import ert' and prints out the path to
|
||||
# the module if the import succeeds.
|
||||
#
|
||||
# The normal Python import machinery is employed, so if you have
|
||||
# installed ert python in a default location, or alternatively set the
|
||||
# PYTHONPATH variable the ert Python distribution will eventually be
|
||||
# found there, independently of the alternatives which are tested with
|
||||
# the ${PATH_LIST} variable.
|
||||
|
||||
if (EXISTS "/etc/debian_version")
|
||||
set( PYTHON_PACKAGE_PATH "dist-packages")
|
||||
else()
|
||||
set( PYTHON_PACKAGE_PATH "site-packages")
|
||||
endif()
|
||||
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||
|
||||
set(PATH_LIST)
|
||||
if (ERT_ROOT)
|
||||
list(APPEND PATH_LIST ${ERT_ROOT})
|
||||
endif()
|
||||
list(APPEND PATH_LIST ${CMAKE_PREFIX_PATH})
|
||||
|
||||
# Add various popular sibling alternatives.
|
||||
list(APPEND PATH_LIST "${PROJECT_SOURCE_DIR}/../ert/build"
|
||||
"${PROJECT_BINARY_DIR}/../ert-build")
|
||||
|
||||
foreach( PATH ${PATH_LIST})
|
||||
set( python_code "import sys; sys.path.insert(0 , '${PATH}/${PYTHON_INSTALL_PREFIX}'); import os.path; import inspect; import ert; print os.path.dirname(os.path.dirname(inspect.getfile(ert))); from ert.ecl import EclSum")
|
||||
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
|
||||
RESULT_VARIABLE import_result
|
||||
OUTPUT_VARIABLE stdout_output
|
||||
ERROR_VARIABLE stderr_output
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
|
||||
if (${import_result} EQUAL 0)
|
||||
set( ERT_PYTHON_PATH ${stdout_output} CACHE PATH "Python path for ERT Python" )
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
find_package_handle_standard_args("ERTPython" DEFAULT_MSG ERT_PYTHON_PATH)
|
||||
|
||||
|
||||
|
||||
@@ -66,10 +66,6 @@ set (_opm_proj_exemptions
|
||||
dune-fem
|
||||
)
|
||||
|
||||
# although a DUNE module, it is delivered in the OPM suite
|
||||
set (opm-core_SUITE "opm")
|
||||
set (ewoms_SUITE "opm")
|
||||
|
||||
# insert this boilerplate whenever we are going to find a new package
|
||||
macro (find_and_append_package_to prefix name)
|
||||
# special handling for Boost to avoid inadvertedly picking up system
|
||||
@@ -156,25 +152,7 @@ macro (find_and_append_package_to prefix name)
|
||||
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
|
||||
OR _search_components GREATER -1)
|
||||
string(REGEX MATCH "(dune|opm)-.*" _is_opm ${name})
|
||||
if(NOT _is_opm)
|
||||
string(REGEX MATCH "ewoms" _is_opm ${name})
|
||||
endif()
|
||||
if(${name} STREQUAL "ecl")
|
||||
# Give us a chance to find ecl installed to CMAKE_INSTALL_PREFIX.
|
||||
# We need to deactivate the package registry for this.
|
||||
create_module_dir_var(ecl)
|
||||
set(ARGN_NO_REQUIRED ${ARGN})
|
||||
if(ARGN)
|
||||
list(REMOVE_ITEM ARGN_NO_REQUIRED "REQUIRED")
|
||||
endif()
|
||||
find_package (${name} ${ARGN_NO_REQUIRED} NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_PACKAGE_REGISTRY)
|
||||
if(TARGET ecl)
|
||||
# Need to grab from target to enable transitional depends
|
||||
#get_target_property(ecl_INCLUDE_DIRS ecl INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(ecl_LIBRARIES ecl)
|
||||
set(HAVE_ERT 1)
|
||||
endif()
|
||||
elseif(_${name}_exempted LESS 0 AND NOT _is_opm)
|
||||
if(_${name}_exempted LESS 0 AND NOT _is_opm)
|
||||
find_package (${name} ${ARGN})
|
||||
elseif(_${name}_exempted GREATER -1)
|
||||
find_package (${name} ${ARGN})
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
# - CMP0026 to allow access to the LOCATION target property
|
||||
# - CMP0048 to indicate that we want to deal with the *VERSION*
|
||||
# variables ourselves
|
||||
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
|
||||
if (POLICY CMP0026)
|
||||
cmake_policy(SET CMP0026 OLD)
|
||||
endif()
|
||||
@@ -28,6 +29,10 @@ if (POLICY CMP0048)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
endif()
|
||||
|
||||
if(POLICY CMP0064)
|
||||
cmake_policy(SET CMP0064 NEW)
|
||||
endif()
|
||||
|
||||
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
|
||||
# expand variables in if statements)
|
||||
if (POLICY CMP0054)
|
||||
@@ -256,9 +261,13 @@ macro (cond_disable_test name)
|
||||
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
|
||||
endmacro (cond_disable_test name)
|
||||
|
||||
# use this target to run all tests
|
||||
# use this target to run all tests, with parallel execution
|
||||
cmake_host_system_information(RESULT TESTJOBS QUERY NUMBER_OF_PHYSICAL_CORES)
|
||||
if(TESTJOBS EQUAL 0)
|
||||
set(TESTJOBS 1)
|
||||
endif()
|
||||
add_custom_target (check
|
||||
COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -j${TESTJOBS}
|
||||
DEPENDS test-suite
|
||||
COMMENT "Checking if library is functional"
|
||||
VERBATIM
|
||||
|
||||
@@ -162,7 +162,7 @@ macro (find_package_deps module)
|
||||
# (i.e. if an optional package requests a package to be required,
|
||||
# the build will fail if it's not found)
|
||||
string (REPLACE "REQUIRED" "${_${module}_required}" _args_req "${_${module}_args}")
|
||||
if(_dep MATCHES "opm-" OR _dep MATCHES "ewoms")
|
||||
if(_dep MATCHES "opm-")
|
||||
set(deplist ${_dep})
|
||||
string(STRIP "${_dep}" _dep)
|
||||
string(REPLACE " " ";" deplist "${_dep}")
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# - Build satellites that are dependent of main library
|
||||
|
||||
option(ADD_DISABLED_CTESTS "Add the tests which are disabled due to failed preconditions to the ctest output (this makes ctest return an error if such a test is present)" ON)
|
||||
mark_as_advanced(ADD_DISABLED_CTESTS)
|
||||
|
||||
#
|
||||
# Enumerate all source code in a "satellite" directory such as tests/,
|
||||
# compile each of them and optionally set them as a test for CTest to
|
||||
@@ -11,144 +8,136 @@ mark_as_advanced(ADD_DISABLED_CTESTS)
|
||||
# The following suffices must be defined for the opm prefix passed as
|
||||
# parameter:
|
||||
#
|
||||
# _LINKER_FLAGS Necessary flags to link with this library
|
||||
# _TARGET CMake target which creates the library
|
||||
# _LIBRARIES Other dependencies that must also be linked
|
||||
# _LINKER_FLAGS Necessary flags to link with this library
|
||||
# _TARGET CMake target which creates the library
|
||||
# _LIBRARIES Other dependencies that must also be linked
|
||||
|
||||
# Synopsis:
|
||||
# opm_compile_satellites (opm satellite excl_all test_regexp)
|
||||
# opm_compile_satellites (opm satellite excl_all test_regexp)
|
||||
#
|
||||
# Parameters:
|
||||
# opm Prefix of the variable which contain information
|
||||
# about the library these satellites depends on, e.g.
|
||||
# pass "opm-core" if opm-core_TARGET is the name of
|
||||
# the target the builds this library. Variables with
|
||||
# suffixes _TARGET and _LIBRARIES must exist.
|
||||
# opm Prefix of the variable which contain information
|
||||
# about the library these satellites depends on, e.g.
|
||||
# pass "opm-core" if opm-core_TARGET is the name of
|
||||
# the target the builds this library. Variables with
|
||||
# suffixes _TARGET and _LIBRARIES must exist.
|
||||
#
|
||||
# satellite Prefix of variable which contain the names of the
|
||||
# files, e.g. pass "tests" if the files are in the
|
||||
# variable tests_SOURCES. Variables with suffixes
|
||||
# _DATAFILES, _SOURCES and _DIR should exist. This
|
||||
# name is also used as name of the target that builds
|
||||
# all these files.
|
||||
# satellite Prefix of variable which contain the names of the
|
||||
# files, e.g. pass "tests" if the files are in the
|
||||
# variable tests_SOURCES. Variables with suffixes
|
||||
# _DATAFILES, _SOURCES and _DIR should exist. This
|
||||
# name is also used as name of the target that builds
|
||||
# all these files.
|
||||
#
|
||||
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
|
||||
# default, otherwise empty string.
|
||||
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
|
||||
# default, otherwise empty string.
|
||||
#
|
||||
# test_regexp Regular expression which picks the name of a test
|
||||
# out of the filename, or blank if no test should be
|
||||
# setup.
|
||||
# test_regexp Regular expression which picks the name of a test
|
||||
# out of the filename, or blank if no test should be
|
||||
# setup.
|
||||
#
|
||||
# Example:
|
||||
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
|
||||
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
|
||||
#
|
||||
macro (opm_compile_satellites opm satellite excl_all test_regexp)
|
||||
# if we are going to build the tests always, then make sure that
|
||||
# the datafiles are present too
|
||||
if (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||
set (_incl_all "ALL")
|
||||
set (_incl_all "ALL")
|
||||
else (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||
set (_incl_all "")
|
||||
set (_incl_all "")
|
||||
endif (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||
|
||||
# if a set of datafiles has been setup, pull those in
|
||||
add_custom_target (${satellite} ${_incl_all})
|
||||
if (${satellite}_DATAFILES)
|
||||
add_dependencies (${satellite} ${${satellite}_DATAFILES})
|
||||
add_dependencies (${satellite} ${${satellite}_DATAFILES})
|
||||
endif (${satellite}_DATAFILES)
|
||||
|
||||
# compile each of these separately
|
||||
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
|
||||
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
|
||||
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
|
||||
add_dependencies (${satellite} ${_sat_NAME})
|
||||
set_target_properties (${_sat_NAME} PROPERTIES
|
||||
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
|
||||
)
|
||||
if(HAVE_DYNAMIC_BOOST_TEST)
|
||||
set_target_properties (${_sat_NAME} PROPERTIES
|
||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK
|
||||
)
|
||||
endif()
|
||||
# are we building a test? luckily, the testing framework doesn't
|
||||
# require anything else, so we don't have to figure out where it
|
||||
# should go in the library list
|
||||
if (NOT "${test_regexp}" STREQUAL "")
|
||||
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
||||
else (NOT "${test_regexp}" STREQUAL "")
|
||||
set (_test_lib "")
|
||||
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
|
||||
endif (NOT "${test_regexp}" STREQUAL "")
|
||||
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
|
||||
if (STRIP_DEBUGGING_SYMBOLS)
|
||||
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
|
||||
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
|
||||
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
|
||||
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
|
||||
add_dependencies (${satellite} ${_sat_NAME})
|
||||
set_target_properties (${_sat_NAME} PROPERTIES
|
||||
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}")
|
||||
if(HAVE_DYNAMIC_BOOST_TEST)
|
||||
set_target_properties (${_sat_NAME} PROPERTIES
|
||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
# are we building a test? luckily, the testing framework doesn't
|
||||
# require anything else, so we don't have to figure out where it
|
||||
# should go in the library list
|
||||
if (NOT "${test_regexp}" STREQUAL "")
|
||||
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
||||
else (NOT "${test_regexp}" STREQUAL "")
|
||||
set (_test_lib "")
|
||||
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
|
||||
endif (NOT "${test_regexp}" STREQUAL "")
|
||||
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
|
||||
if (STRIP_DEBUGGING_SYMBOLS)
|
||||
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
|
||||
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
|
||||
endif()
|
||||
|
||||
# variable with regular expression doubles as a flag for
|
||||
# whether tests should be setup or not
|
||||
set(_sat_FANCY)
|
||||
if (NOT "${test_regexp}" STREQUAL "")
|
||||
foreach (_regexp IN ITEMS ${test_regexp})
|
||||
if ("${_sat_NAME}" MATCHES "${_regexp}")
|
||||
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
|
||||
elseif(NOT _sat_FANCY)
|
||||
set(_sat_FANCY ${_sat_NAME})
|
||||
endif()
|
||||
endforeach (_regexp)
|
||||
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
|
||||
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
|
||||
# in the MPI_Finalize() call otherwise.
|
||||
if(MPI_FOUND)
|
||||
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
|
||||
endif()
|
||||
if (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
add_test (NAME ${_sat_FANCY}
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC})
|
||||
else (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
add_test (${_sat_FANCY} ${_sat_LOC})
|
||||
# run the test in the directory where the data files are
|
||||
set_tests_properties (${_sat_FANCY} PROPERTIES
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR})
|
||||
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
if(NOT TARGET test-suite)
|
||||
add_custom_target(test-suite)
|
||||
endif()
|
||||
add_dependencies(test-suite "${_sat_NAME}")
|
||||
endif(NOT "${test_regexp}" STREQUAL "")
|
||||
|
||||
# variable with regular expression doubles as a flag for
|
||||
# whether tests should be setup or not
|
||||
set(_sat_FANCY)
|
||||
if (NOT "${test_regexp}" STREQUAL "")
|
||||
foreach (_regexp IN ITEMS ${test_regexp})
|
||||
if ("${_sat_NAME}" MATCHES "${_regexp}")
|
||||
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
|
||||
elseif(NOT _sat_FANCY)
|
||||
set(_sat_FANCY ${_sat_NAME})
|
||||
endif()
|
||||
endforeach (_regexp)
|
||||
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
|
||||
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
|
||||
# in the MPI_Finalize() call otherwise.
|
||||
if(MPI_FOUND)
|
||||
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
|
||||
endif()
|
||||
if (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
add_test (
|
||||
NAME ${_sat_FANCY}
|
||||
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC}
|
||||
)
|
||||
else (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
add_test (${_sat_FANCY} ${_sat_LOC})
|
||||
# run the test in the directory where the data files are
|
||||
set_tests_properties (${_sat_FANCY} PROPERTIES
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR}
|
||||
)
|
||||
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||
if(NOT TARGET test-suite)
|
||||
add_custom_target(test-suite)
|
||||
endif()
|
||||
add_dependencies(test-suite "${_sat_NAME}")
|
||||
endif(NOT "${test_regexp}" STREQUAL "")
|
||||
|
||||
# if this program on the list of files that should be distributed?
|
||||
# we check by the name of the source file
|
||||
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
|
||||
if (NOT (_is_util EQUAL -1))
|
||||
install (TARGETS ${_sat_NAME} RUNTIME
|
||||
DESTINATION bin${${opm}_VER_DIR}/
|
||||
)
|
||||
endif (NOT (_is_util EQUAL -1))
|
||||
# if this program on the list of files that should be distributed?
|
||||
# we check by the name of the source file
|
||||
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
|
||||
if (NOT (_is_util EQUAL -1))
|
||||
install (TARGETS ${_sat_NAME} RUNTIME
|
||||
DESTINATION bin${${opm}_VER_DIR}/)
|
||||
endif (NOT (_is_util EQUAL -1))
|
||||
endforeach (_sat_FILE)
|
||||
endmacro (opm_compile_satellites opm prefix)
|
||||
|
||||
# Synopsis:
|
||||
# opm_data (satellite target dirname files)
|
||||
# opm_data (satellite target dirname files)
|
||||
#
|
||||
# provides these output variables:
|
||||
#
|
||||
# ${satellite}_INPUT_FILES List of all files that are copied
|
||||
# ${satellite}_DATAFILES Name of target which copies these files
|
||||
# ${satellite}_INPUT_FILES List of all files that are copied
|
||||
# ${satellite}_DATAFILES Name of target which copies these files
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# opm_data (tests datafiles "tests/")
|
||||
# opm_data (tests datafiles "tests/")
|
||||
#
|
||||
macro (opm_data satellite target dirname)
|
||||
# even if there are no datafiles, create the directory so the
|
||||
# satellite programs have a homedir to run in
|
||||
execute_process (
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname}
|
||||
)
|
||||
execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname})
|
||||
|
||||
# if ever huge test datafiles are necessary, then change this
|
||||
# into "create_symlink" (on UNIX only, apparently)
|
||||
@@ -158,26 +147,27 @@ macro (opm_data satellite target dirname)
|
||||
# to a tests/ directory in the output tree (if different)
|
||||
set (${satellite}_INPUT_FILES)
|
||||
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
foreach (input_datafile IN LISTS ${satellite}_DATA)
|
||||
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
|
||||
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
|
||||
add_custom_command (
|
||||
OUTPUT ${output_datafile}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
|
||||
DEPENDS ${input_datafile}
|
||||
VERBATIM
|
||||
)
|
||||
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
|
||||
endforeach (input_datafile)
|
||||
foreach (input_datafile IN LISTS ${satellite}_DATA)
|
||||
if (IS_ABSOLUTE ${input_datafile})
|
||||
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
|
||||
else()
|
||||
set(rel_datafile ${input_datafile})
|
||||
endif()
|
||||
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
|
||||
add_custom_command (OUTPUT ${output_datafile}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
|
||||
DEPENDS ${input_datafile}
|
||||
VERBATIM)
|
||||
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
|
||||
endforeach (input_datafile)
|
||||
endif(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||
|
||||
# setup a target which does all the copying
|
||||
set (${satellite}_DATAFILES "${target}")
|
||||
add_custom_target (${${satellite}_DATAFILES}
|
||||
DEPENDS ${${satellite}_INPUT_FILES}
|
||||
COMMENT "Making \"${satellite}\" data available in output tree"
|
||||
)
|
||||
DEPENDS ${${satellite}_INPUT_FILES}
|
||||
COMMENT "Making \"${satellite}\" data available in output tree")
|
||||
if(NOT TARGET test-suite)
|
||||
add_custom_target(test-suite)
|
||||
endif()
|
||||
@@ -309,6 +299,8 @@ macro(opm_add_test TestName)
|
||||
# only compile the binary but do not run it as a test
|
||||
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
||||
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
||||
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
||||
add_static_analysis_tests(CURTEST_SOURCES dirs)
|
||||
|
||||
if(TARGET ${project}_prepare)
|
||||
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
|
||||
@@ -324,10 +316,11 @@ macro(opm_add_test TestName)
|
||||
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
||||
if(HAVE_DYNAMIC_BOOST_TEST)
|
||||
set_target_properties (${CURTEST_EXE_NAME} PROPERTIES
|
||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK
|
||||
)
|
||||
endif()
|
||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
|
||||
endif()
|
||||
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
||||
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
||||
add_static_analysis_tests(CURTEST_SOURCES dirs)
|
||||
|
||||
if(CURTEST_DEPENDS)
|
||||
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
||||
@@ -370,15 +363,6 @@ macro(opm_add_test TestName)
|
||||
endif()
|
||||
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
|
||||
endif()
|
||||
|
||||
else() # test is skipped
|
||||
|
||||
# the following causes the test to appear as 'skipped' in the
|
||||
# CDash dashboard. it this is removed, the test is just silently
|
||||
# ignored.
|
||||
if (NOT CURTEST_ONLY_COMPILE AND ADD_DISABLED_CTESTS)
|
||||
add_test(${_FANCY} skip_test_dummy)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
@@ -9,12 +9,7 @@ macro(create_module_dir_var module)
|
||||
get_filename_component(_parent_dir_name ${_parent_full_dir} NAME)
|
||||
#Try if <module-name>/<build-dir> is used
|
||||
get_filename_component(_modules_dir ${_parent_full_dir} DIRECTORY)
|
||||
if ("${module}" STREQUAL "ecl")
|
||||
#use clone directory libecl
|
||||
set(_clone_dir "libecl")
|
||||
else()
|
||||
set(_clone_dir "${module}")
|
||||
endif()
|
||||
set(_clone_dir "${module}")
|
||||
if(IS_DIRECTORY ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
|
||||
set(${module}_DIR ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
|
||||
else()
|
||||
@@ -23,7 +18,8 @@ macro(create_module_dir_var module)
|
||||
AND IS_DIRECTORY ${_parent_full_dir}/${_module_leaf})
|
||||
# We are using build directories named <prefix><module-name><postfix>
|
||||
set(${module}_DIR ${_parent_full_dir}/${_module_leaf})
|
||||
elseif(IS_DIRECTORY ${_parent_full_dir}/${_clone_dir})
|
||||
elseif(IS_DIRECTORY ${_parent_full_dir}/${_clone_dir} AND
|
||||
EXISTS ${_parent_full_dir}/${_clone_dir}/CMakeCache.txt)
|
||||
# All modules are in a common build dir
|
||||
set(${module}_DIR "${_parent_full_dir}/${_clone_dir}")
|
||||
endif()
|
||||
|
||||
@@ -34,16 +34,29 @@ function(add_static_analysis_tests sources includes)
|
||||
list(APPEND IPATHS -I ${dep})
|
||||
endforeach()
|
||||
foreach(src ${${sources}})
|
||||
file(RELATIVE_PATH name ${PROJECT_SOURCE_DIR} ${src})
|
||||
if(src MATCHES "TARGET_OBJECTS:")
|
||||
string(REGEX REPLACE "\\$<TARGET_OBJECTS:(.*)>" "\\1" TGT ${src})
|
||||
get_target_property(src ${TGT} SOURCES)
|
||||
endif()
|
||||
if(IS_ABSOLUTE ${src})
|
||||
file(RELATIVE_PATH name ${PROJECT_SOURCE_DIR} ${src})
|
||||
else()
|
||||
set(name ${src})
|
||||
set(src ${PROJECT_SOURCE_DIR}/${src})
|
||||
endif()
|
||||
if(CPPCHECK_FOUND)
|
||||
add_test(NAME cppcheck+${name}
|
||||
COMMAND bin/cppcheck-test.sh ${CPPCHECK_PROGRAM} ${src} ${IPATHS}
|
||||
CONFIGURATIONS analyze cppcheck)
|
||||
if(NOT TEST cppcheck+${name})
|
||||
add_test(NAME cppcheck+${name}
|
||||
COMMAND bin/cppcheck-test.sh ${CPPCHECK_PROGRAM} ${src} ${IPATHS}
|
||||
CONFIGURATIONS analyze cppcheck)
|
||||
endif()
|
||||
endif()
|
||||
if(CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
add_test(NAME clang-check+${name}
|
||||
COMMAND bin/clang-check-test.sh ${CLANGCHECK_PROGRAM} ${src}
|
||||
CONFIGURATIONS analyze clang-check)
|
||||
if(NOT TEST clang-check+${name})
|
||||
add_test(NAME clang-check+${name}
|
||||
COMMAND bin/clang-check-test.sh ${CLANGCHECK_PROGRAM} ${src}
|
||||
CONFIGURATIONS analyze clang-check)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -6,7 +6,7 @@ is_compiler_gcc_compatible ()
|
||||
|
||||
if (CXX_COMPAT_GCC)
|
||||
# default warnings flags, if not set by user
|
||||
set_default_option (CXX _warn_flag "-Wall" "(^|\ )-W")
|
||||
set_default_option (CXX _warn_flag "-Wall -Wextra -Wshadow" "(^|\ )-W")
|
||||
if (_warn_flag)
|
||||
message (STATUS "All warnings enabled: ${_warn_flag}")
|
||||
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")
|
||||
|
||||
@@ -31,30 +31,15 @@ if(NOT check_target)
|
||||
endif()
|
||||
|
||||
# Build threads
|
||||
include(ProcessorCount)
|
||||
set(build_threads $ENV{CHECK_THREADS})
|
||||
if(NOT build_threads)
|
||||
if(UNIX)
|
||||
if(APPLE)
|
||||
execute_process(COMMAND sysctl hw.ncpu
|
||||
OUTPUT_VARIABLE build_threads)
|
||||
string(REPLACE " " ";" build_threads_list ${build_threads)
|
||||
list(GET build_threads_list 1 build_threads)
|
||||
else()
|
||||
find_program(NPROC_COMMAND nproc)
|
||||
if(NPROC_COMMAND)
|
||||
execute_process(COMMAND ${NPROC_COMMAND}
|
||||
OUTPUT_VARIABLE build_threads)
|
||||
string(REGEX REPLACE "(\r?\n)+$" "" build_threads "${build_threads}")
|
||||
endif()
|
||||
endif()
|
||||
ProcessorCount(build_threads)
|
||||
if(build_threads EQUAL 0)
|
||||
set(build_threads 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If for some reason we could not find the info - e.g. centos5 where nproc is missing
|
||||
if(NOT build_threads)
|
||||
set(build_threads 1)
|
||||
endif()
|
||||
|
||||
# Record current HEAD
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE current_branch
|
||||
|
||||
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -1,4 +1,4 @@
|
||||
opm-common (2019.04-pre~xenial) xenial; urgency=medium
|
||||
opm-common (2019.10-rc2-1~xenial) xenial; urgency=medium
|
||||
|
||||
* New release
|
||||
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@@ -5,7 +5,7 @@ Build-Depends: build-essential, debhelper (>= 9),
|
||||
pkg-config, cmake, git, libtool, doxygen,
|
||||
texlive-latex-extra, texlive-latex-recommended,
|
||||
ghostscript, libboost-system-dev, libboost-test-dev,
|
||||
libecl-dev, libboost-regex-dev, libboost-filesystem-dev,
|
||||
libboost-regex-dev, libboost-filesystem-dev,
|
||||
zlib1g-dev
|
||||
Standards-Version: 3.9.2
|
||||
Section: libs
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
Module: opm-common
|
||||
Description: Open Porous Media Initiative shared infrastructure
|
||||
Version: 2019.10-pre
|
||||
Label: 2019.10-pre
|
||||
Version: 2019.10-rc2
|
||||
Label: 2019.10-rc2
|
||||
Maintainer: opm@opm-project.org
|
||||
MaintainerName: OPM community
|
||||
Url: http://opm-project.org
|
||||
|
||||
@@ -48,6 +48,6 @@ int main(int /* argc */, char** argv) {
|
||||
|
||||
Opm::msim msim(state);
|
||||
Opm::EclipseIO io(state, state.getInputGrid(), schedule, summary_config);
|
||||
msim.run(schedule, io);
|
||||
msim.run(schedule, io, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,12 @@
|
||||
|
||||
|
||||
struct keyword {
|
||||
keyword(const std::string& name, const std::string& filename, std::size_t line_number, std::size_t content_hash) :
|
||||
name(name),
|
||||
filename(filename),
|
||||
line_number(line_number),
|
||||
content_hash(content_hash)
|
||||
keyword(const std::string& name_arg, const std::string& filename_arg,
|
||||
std::size_t line_number_arg, std::size_t content_hash_arg) :
|
||||
name(name_arg),
|
||||
filename(filename_arg),
|
||||
line_number(line_number_arg),
|
||||
content_hash(content_hash_arg)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,15 @@
|
||||
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/common/OpmLog/StreamLog.hpp>
|
||||
#include <opm/common/OpmLog/LogUtil.hpp>
|
||||
|
||||
|
||||
void initLogging() {
|
||||
std::shared_ptr<Opm::StreamLog> cout_log = std::make_shared<Opm::StreamLog>(std::cout, Opm::Log::DefaultMessageTypes);
|
||||
Opm::OpmLog::addBackend( "COUT" , cout_log);
|
||||
}
|
||||
|
||||
inline void loadDeck( const char * deck_file) {
|
||||
Opm::ParseContext parseContext;
|
||||
@@ -45,6 +54,7 @@ inline void loadDeck( const char * deck_file) {
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
initLogging();
|
||||
for (int iarg = 1; iarg < argc; iarg++)
|
||||
loadDeck( argv[iarg] );
|
||||
}
|
||||
|
||||
@@ -1,431 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <sstream>
|
||||
#include <iterator>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include <unistd.h>
|
||||
#include <limits>
|
||||
#include <set>
|
||||
|
||||
#include "EclFile.hpp"
|
||||
#include "ESmry.hpp"
|
||||
|
||||
/*
|
||||
|
||||
KEYWORDS WGNAMES NUMS | PARAM index Corresponding ERT key
|
||||
------------------------------------------------+--------------------------------------------------
|
||||
WGOR OP_1 0 | 0 WGOR:OP_1
|
||||
FOPT +-+-+-+- 0 | 1 FOPT
|
||||
WWCT OP_1 0 | 2 WWCT:OP_1
|
||||
WIR OP_1 0 | 3 WIR:OP_1
|
||||
WGOR WI_1 0 | 4 WWCT:OP_1
|
||||
WWCT W1_1 0 | 5 WWCT:WI_1
|
||||
BPR +-+-+- 12675 | 6 BPR:12675, BPR:i,j,k
|
||||
RPR +-+-+- 1 | 7 RPR:1
|
||||
FOPT +-+-+- 0 | 8 FOPT
|
||||
GGPR NORTH 0 | 9 GGPR:NORTH
|
||||
COPR OP_1 5628 | 10 COPR:OP_1:56286, COPR:OP_1:i,j,k
|
||||
RXF +-+-+- 32768*R1(R2 + 10) | 11 RXF:2-3
|
||||
SOFX OP_1 12675 | 12 SOFX:OP_1:12675, SOFX:OP_1:i,j,jk
|
||||
|
||||
*/
|
||||
|
||||
ESmry::ESmry(const std::string &filename, bool loadBaseRunData)
|
||||
{
|
||||
std::string rootN;
|
||||
std::vector<int> actInd;
|
||||
bool formatted=false;
|
||||
|
||||
char buff[1000];
|
||||
getcwd( buff, 1000 );
|
||||
|
||||
std::string currentWorkingDir(buff);
|
||||
std::string currentDir=currentWorkingDir;
|
||||
|
||||
std::string smspec_filen;
|
||||
std::string unsmry_filen;
|
||||
|
||||
if (filename.substr(filename.length() - 7, 7) == ".SMSPEC") {
|
||||
rootN = filename.substr(0,filename.length() -7);
|
||||
} else if (filename.substr(filename.length() -8, 8) == ".FSMSPEC") {
|
||||
rootN=filename.substr(0,filename.length() -8);
|
||||
formatted = true;
|
||||
} else {
|
||||
rootN = filename;
|
||||
}
|
||||
|
||||
path = currentWorkingDir;
|
||||
updatePathAndRootName(path, rootN);
|
||||
|
||||
if (formatted) {
|
||||
smspec_filen = path + "/" + rootN + ".FSMSPEC";
|
||||
unsmry_filen = path + "/" + rootN + ".FUNSMRY";
|
||||
} else {
|
||||
smspec_filen = path + "/" + rootN + ".SMSPEC";
|
||||
unsmry_filen = path + "/" + rootN + ".UNSMRY";
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string,int>> smryArray;
|
||||
|
||||
EclFile smspec1(smspec_filen);
|
||||
|
||||
smspec1.loadData(); // loading all data
|
||||
|
||||
std::set<std::string> keywList;
|
||||
|
||||
std::vector<int> dimens = smspec1.get<int>("DIMENS");
|
||||
|
||||
nI = dimens[1];
|
||||
nJ = dimens[2];
|
||||
nK = dimens[3];
|
||||
|
||||
std::vector<std::string> restartArray = smspec1.get<std::string>("RESTART");
|
||||
std::vector<std::string> keywords = smspec1.get<std::string>("KEYWORDS");
|
||||
std::vector<std::string> wgnames = smspec1.get<std::string>("WGNAMES");
|
||||
std::vector<int> nums = smspec1.get<int>("NUMS");
|
||||
|
||||
for (unsigned int i=0; i<keywords.size(); i++) {
|
||||
std::string str1 = makeKeyString(keywords[i], wgnames[i], nums[i]);
|
||||
if (str1.length() > 0) {
|
||||
keywList.insert(str1);
|
||||
}
|
||||
}
|
||||
|
||||
std::string rstRootN = "";
|
||||
std::string pathRstFile = path;
|
||||
|
||||
getRstString(restartArray, pathRstFile, rstRootN);
|
||||
|
||||
smryArray.push_back({smspec_filen, dimens[5]});
|
||||
|
||||
// checking if this is a restart run. Supporting nested restarts (restart, from restart, ...)
|
||||
// std::set keywList is storing keywords from all runs involved
|
||||
|
||||
while ((rstRootN != "") && (loadBaseRunData)) {
|
||||
|
||||
std::string rstFile=pathRstFile+"/"+rstRootN+".SMSPEC";
|
||||
|
||||
EclFile smspec_rst(rstFile);
|
||||
smspec_rst.loadData();
|
||||
|
||||
std::vector<int> dimens = smspec_rst.get<int>("DIMENS");
|
||||
std::vector<std::string> restartArray = smspec_rst.get<std::string>("RESTART");
|
||||
std::vector<std::string> keywords = smspec_rst.get<std::string>("KEYWORDS");
|
||||
std::vector<std::string> wgnames = smspec_rst.get<std::string>("WGNAMES");
|
||||
std::vector<int> nums = smspec_rst.get<int>("NUMS");
|
||||
std::vector<std::string> units = smspec_rst.get<std::string>("UNITS");
|
||||
|
||||
for (size_t i = 0; i < keywords.size(); i++) {
|
||||
std::string str1 = makeKeyString(keywords[i], wgnames[i], nums[i]);
|
||||
if (str1.length() > 0) {
|
||||
keywList.insert(str1);
|
||||
}
|
||||
}
|
||||
|
||||
smryArray.push_back({rstFile,dimens[5]});
|
||||
|
||||
getRstString(restartArray, pathRstFile, rstRootN);
|
||||
}
|
||||
|
||||
int nFiles = static_cast<int>(smryArray.size());
|
||||
|
||||
// arrayInd should hold indices for each vector and runs
|
||||
// n=file number, i = position in param array in file n (one array pr time step), example arrayInd[n][i] = position in keyword list (std::set)
|
||||
|
||||
std::vector<std::vector<int>> arrayInd;
|
||||
|
||||
for (int i = 0; i < nFiles; i++){
|
||||
arrayInd.push_back({});
|
||||
}
|
||||
|
||||
int n = nFiles - 1;
|
||||
|
||||
while (n >= 0){
|
||||
|
||||
auto smry = smryArray[n];
|
||||
|
||||
EclFile smspec(std::get<0>(smry));
|
||||
smspec.loadData();
|
||||
|
||||
std::vector<int> dimens = smspec.get<int>("DIMENS");
|
||||
|
||||
nI = dimens[1];
|
||||
nJ = dimens[2];
|
||||
nK = dimens[3];
|
||||
|
||||
std::vector<std::string> keywords = smspec.get<std::string>("KEYWORDS");
|
||||
std::vector<std::string> wgnames = smspec.get<std::string>("WGNAMES");
|
||||
std::vector<int> nums = smspec.get<int>("NUMS");
|
||||
|
||||
std::vector<int> tmpVect(keywords.size(), -1);
|
||||
arrayInd[n]=tmpVect;
|
||||
|
||||
std::set<std::string>::iterator it;
|
||||
|
||||
for (size_t i=0; i < keywords.size(); i++) {
|
||||
std::string keyw = makeKeyString(keywords[i], wgnames[i], nums[i]);
|
||||
it = std::find(keywList.begin(), keywList.end(), keyw);
|
||||
|
||||
if (it != keywList.end()){
|
||||
arrayInd[n][i] = distance(keywList.begin(), it);
|
||||
}
|
||||
}
|
||||
|
||||
n--;
|
||||
}
|
||||
|
||||
// param array used to stor data for the object, defined in the private section of the class
|
||||
param.assign(keywList.size(), {});
|
||||
|
||||
int fromReportStepNumber = 0;
|
||||
int reportStepNumber = 0;
|
||||
int toReportStepNumber;
|
||||
|
||||
float time = 0.0;
|
||||
int step = 0;
|
||||
|
||||
n = nFiles - 1;
|
||||
|
||||
while (n >= 0){
|
||||
|
||||
reportStepNumber = fromReportStepNumber;
|
||||
|
||||
if (n > 0) {
|
||||
auto rstFrom = smryArray[n-1];
|
||||
toReportStepNumber = std::get<1>(rstFrom);
|
||||
} else {
|
||||
toReportStepNumber = std::numeric_limits<int>::max();
|
||||
}
|
||||
|
||||
std::string smspecFile = std::get<0>(smryArray[n]);
|
||||
std::string unsmryFile = smspecFile.substr(0, smspecFile.size() - 6) + "UNSMRY";
|
||||
|
||||
EclFile unsmry(unsmryFile);
|
||||
unsmry.loadData();
|
||||
|
||||
std::vector<EclFile::EclEntry> list1 = unsmry.getList();
|
||||
|
||||
// 2 or 3 arrays pr time step.
|
||||
// If timestep is a report step: MINISTEP, PARAMS and SEQHDR
|
||||
// else : MINISTEP and PARAMS
|
||||
|
||||
// if summary file starts with a SEQHDR, this will be ignored
|
||||
|
||||
int i = 0;
|
||||
|
||||
if (std::get<0>(list1[0]) == "SEQHDR") {
|
||||
i = 1;
|
||||
}
|
||||
|
||||
while (i < static_cast<int>(list1.size())){
|
||||
|
||||
if (std::get<0>(list1[i]) != "MINISTEP"){
|
||||
std::string message="Reading summary file, expecting keyword MINISTEP, found '" + std::get<0>(list1[i]) + "'";
|
||||
throw std::invalid_argument(message);
|
||||
}
|
||||
|
||||
std::vector<int> ministep = unsmry.get<int>(i);
|
||||
|
||||
i++;
|
||||
|
||||
if (std::get<0>(list1[i]) != "PARAMS") {
|
||||
std::string message="Reading summary file, expecting keyword PARAMS, found '" + std::get<0>(list1[i]) + "'";
|
||||
throw std::invalid_argument(message);
|
||||
}
|
||||
|
||||
std::vector<float> tmpData = unsmry.get<float>(i);
|
||||
|
||||
time = tmpData[0];
|
||||
|
||||
if (time == 0.0) {
|
||||
seqTime.push_back(time);
|
||||
seqIndex.push_back(step);
|
||||
}
|
||||
|
||||
i++;
|
||||
|
||||
if (i < static_cast<int>(list1.size())){
|
||||
if (std::get<0>(list1[i]) == "SEQHDR") {
|
||||
i++;
|
||||
reportStepNumber++;
|
||||
seqTime.push_back(time);
|
||||
seqIndex.push_back(step);
|
||||
}
|
||||
} else {
|
||||
reportStepNumber++;
|
||||
seqTime.push_back(time);
|
||||
seqIndex.push_back(step);
|
||||
}
|
||||
|
||||
// adding defaut values (0.0) in case vector not found in this particular summary file
|
||||
|
||||
for (size_t i = 0; i < param.size(); i++){
|
||||
param[i].push_back(0.0);
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < tmpData.size(); j++) {
|
||||
int ind = arrayInd[n][j];
|
||||
|
||||
if (ind > -1) {
|
||||
param[ind][step] = tmpData[j];
|
||||
}
|
||||
}
|
||||
|
||||
if (reportStepNumber >= toReportStepNumber) {
|
||||
i = static_cast<int>(list1.size());
|
||||
}
|
||||
|
||||
step++;
|
||||
}
|
||||
|
||||
fromReportStepNumber = toReportStepNumber;
|
||||
|
||||
n--;
|
||||
}
|
||||
|
||||
nVect = keywList.size();
|
||||
|
||||
for (auto keyw : keywList){
|
||||
keyword.push_back(keyw);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void ESmry::getRstString(const std::vector<std::string>& restartArray, std::string& pathRst, std::string& rootN) const {
|
||||
|
||||
rootN = "";
|
||||
|
||||
for (auto str : restartArray) {
|
||||
rootN = rootN + str;
|
||||
}
|
||||
|
||||
updatePathAndRootName(pathRst, rootN);
|
||||
}
|
||||
|
||||
void ESmry::updatePathAndRootName(std::string& dir, std::string& rootN) const {
|
||||
|
||||
if (rootN.substr(0,2) == "./") {
|
||||
rootN = rootN.substr(2, rootN.size() - 2);
|
||||
}
|
||||
|
||||
if (rootN.substr(0,1) == "/") {
|
||||
int p = rootN.find_last_of("/");
|
||||
dir = rootN.substr(0, p);
|
||||
rootN = rootN.substr(p + 1, rootN.size() - p - 1);
|
||||
} else if (rootN.find_first_of("/") != std::string::npos) {
|
||||
int p = rootN.find_last_of("/");
|
||||
dir = dir + "/" + rootN.substr(0, p);
|
||||
rootN = rootN.substr(p + 1, rootN.size() - p - 1);
|
||||
};
|
||||
}
|
||||
|
||||
bool ESmry::hasKey(const std::string &key) const
|
||||
{
|
||||
return std::find(keyword.begin(), keyword.end(), key) != keyword.end();
|
||||
}
|
||||
|
||||
|
||||
void ESmry::ijk_from_global_index(int glob,int &i,int &j,int &k)
|
||||
{
|
||||
int tmpGlob = glob - 1;
|
||||
|
||||
k = 1 + tmpGlob / (nI * nJ);
|
||||
int rest = tmpGlob % (nI * nJ);
|
||||
|
||||
j = 1 + rest / nI;
|
||||
i = 1 + rest % nI;
|
||||
}
|
||||
|
||||
|
||||
std::string ESmry::makeKeyString(const std::string &keyword, const std::string &wgname, int num)
|
||||
{
|
||||
std::string keyStr;
|
||||
std::vector<std::string> segmExcep= {"STEPTYPE", "SEPARATE", "SUMTHIN"};
|
||||
|
||||
if (keyword.substr(0, 1) == "A") {
|
||||
keyStr = keyword + ":" + std::to_string(num);
|
||||
} else if (keyword.substr(0, 1) == "B") {
|
||||
int _i,_j,_k;
|
||||
ijk_from_global_index(num, _i, _j, _k);
|
||||
|
||||
keyStr = keyword + ":" + std::to_string(_i) + "," + std::to_string(_j) + "," + std::to_string(_k);
|
||||
|
||||
} else if (keyword.substr(0, 1) == "C") {
|
||||
int _i,_j,_k;
|
||||
|
||||
if (num > 0) {
|
||||
ijk_from_global_index(num, _i, _j, _k);
|
||||
keyStr = keyword + ":" + wgname+ ":" + std::to_string(_i) + "," + std::to_string(_j) + "," + std::to_string(_k);
|
||||
}
|
||||
} else if (keyword.substr(0, 1) == "G") {
|
||||
if ( wgname != ":+:+:+:+") {
|
||||
keyStr = keyword + ":" + wgname;
|
||||
}
|
||||
} else if (keyword.substr(0, 1) == "R" && keyword.substr(2, 1) == "F") {
|
||||
// NUMS = R1 + 32768*(R2 + 10)
|
||||
int r2 = 0;
|
||||
int y = 32768 * (r2 + 10) - num;
|
||||
|
||||
while (y <0 ) {
|
||||
r2++;
|
||||
y = 32768 * (r2 + 10) - num;
|
||||
}
|
||||
|
||||
r2--;
|
||||
int r1 = num - 32768 * (r2 + 10);
|
||||
|
||||
keyStr = keyword + ":" + std::to_string(r1) + "-" + std::to_string(r2);
|
||||
} else if (keyword.substr(0, 1) == "R") {
|
||||
keyStr = keyword + ":" + std::to_string(num);
|
||||
} else if (keyword.substr(0, 1) == "S") {
|
||||
auto it = std::find(segmExcep.begin(), segmExcep.end(), keyword);
|
||||
if (it != segmExcep.end()) {
|
||||
keyStr = keyword;
|
||||
} else {
|
||||
keyStr = keyword + ":" + wgname + ":" + std::to_string(num);
|
||||
}
|
||||
} else if (keyword.substr(0,1) == "W") {
|
||||
if (wgname != ":+:+:+:+") {
|
||||
keyStr = keyword + ":" + wgname;
|
||||
}
|
||||
} else {
|
||||
keyStr = keyword;
|
||||
}
|
||||
|
||||
return keyStr;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<float>& ESmry::get(const std::string& name) const
|
||||
{
|
||||
auto it = std::find(keyword.begin(), keyword.end(), name);
|
||||
|
||||
if (it == keyword.end()) {
|
||||
std::string message="keyword " + name + " not found ";
|
||||
OPM_THROW(std::invalid_argument, message);
|
||||
}
|
||||
|
||||
int ind = std::distance(keyword.begin(), it);
|
||||
|
||||
return param[ind];
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <tuple>
|
||||
#include <iomanip>
|
||||
|
||||
#include <examples/test_util/EclFile.hpp>
|
||||
#include <examples/test_util/EclOutput.hpp>
|
||||
|
||||
|
||||
template<typename T>
|
||||
void write(EclOutput& outFile, EclFile& file1,
|
||||
const std::string& name, int index)
|
||||
{
|
||||
auto vect = file1.get<T>(index);
|
||||
outFile.write(name, vect);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
if (argc != 2) {
|
||||
std::cout << "\nInvalid input, need 1 argument which should be the eclipse output file to be converted \n" << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// start reading
|
||||
auto start = std::chrono::system_clock::now();
|
||||
std::string filename = argv[1];
|
||||
|
||||
EclFile file1(filename);
|
||||
|
||||
file1.loadData();
|
||||
|
||||
auto end1 = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> elapsed_seconds1 = end1 - start;
|
||||
|
||||
bool formattedOutput = file1.formattedInput() ? false : true;
|
||||
|
||||
int p = filename.find_last_of(".");
|
||||
int l = filename.length();
|
||||
|
||||
std::string rootN = filename.substr(0,p);
|
||||
std::string extension = filename.substr(p,l-p);
|
||||
std::string resFile;
|
||||
|
||||
if (formattedOutput) {
|
||||
resFile = rootN + ".F" + extension.substr(1, extension.length() - 1);
|
||||
} else {
|
||||
resFile = rootN + "." + extension.substr(2, extension.length() - 2);
|
||||
}
|
||||
|
||||
std::cout << "\033[1;31m" << "\nconverting " << argv[1] << " -> " << resFile << "\033[0m\n" << std::endl;
|
||||
|
||||
EclOutput outFile(resFile, formattedOutput);
|
||||
|
||||
auto arrayList = file1.getList();
|
||||
|
||||
for (size_t index = 0; index < arrayList.size(); index++) {
|
||||
std::string name = std::get<0>(arrayList[index]);
|
||||
EIOD::eclArrType arrType = std::get<1>(arrayList[index]);
|
||||
|
||||
if (arrType == EIOD::INTE) {
|
||||
write<int>(outFile, file1, name, index);
|
||||
} else if (arrType == EIOD::REAL) {
|
||||
write<float>(outFile, file1, name,index);
|
||||
} else if (arrType == EIOD::DOUB) {
|
||||
write<double>(outFile, file1, name, index);
|
||||
} else if (arrType == EIOD::LOGI) {
|
||||
write<bool>(outFile, file1, name, index);
|
||||
} else if (arrType == EIOD::CHAR) {
|
||||
write<std::string>(outFile, file1, name, index);
|
||||
} else if (arrType == EIOD::MESS) {
|
||||
// shold not be any associated data
|
||||
outFile.write(name,std::vector<char>());
|
||||
} else {
|
||||
std::cout << "unknown array type " << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
auto end2 = std::chrono::system_clock::now();
|
||||
std::chrono::duration<double> elapsed_seconds2 = end2-end1;
|
||||
|
||||
std::cout << "\ntime to load from file : " << argv[1] << ": " << elapsed_seconds1.count() << " seconds" << std::endl;
|
||||
std::cout << "time to write to file : " << resFile << ": " << elapsed_seconds2.count() << " seconds\n" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
declare -A configurations
|
||||
|
||||
declare -A EXTRA_MODULE_FLAGS
|
||||
EXTRA_MODULE_FLAGS[opm-common]="-DENABLE_WELL_TEST=ON"
|
||||
EXTRA_MODULE_FLAGS[opm-simulators]="-DBUILD_EBOS_EXTENSIONS=ON -DBUILD_EBOS_DEBUG_EXTENSIONS=ON"
|
||||
EXTRA_MODULE_FLAGS[opm-common]="-DOPM_ENABLE_PYTHON=ON -DOPM_ENABLE_EMBEDDED_PYTHON=ON"
|
||||
|
||||
# Parse revisions from trigger comment and setup arrays
|
||||
# Depends on: 'upstreams', upstreamRev',
|
||||
@@ -110,11 +110,12 @@ function build_module {
|
||||
cmake --build .
|
||||
fi
|
||||
test $? -eq 0 || exit 2
|
||||
TESTTHREADS=${TESTTHREADS:-1}
|
||||
if test -z "$CTEST_CONFIGURATION"
|
||||
then
|
||||
ctest -T Test --no-compress-output
|
||||
ctest -T Test --no-compress-output -j$TESTTHREADS
|
||||
else
|
||||
ctest -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
|
||||
ctest -j$TESTTHREADS -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
|
||||
fi
|
||||
|
||||
# Convert to junit format
|
||||
@@ -145,12 +146,7 @@ function clone_module {
|
||||
mkdir -p $WORKSPACE/deps/$1
|
||||
cd $WORKSPACE/deps/$1
|
||||
git init .
|
||||
if [ "$1" == "libecl" ]
|
||||
then
|
||||
git remote add origin https://github.com/Statoil/$1
|
||||
else
|
||||
git remote add origin https://github.com/OPM/$1
|
||||
fi
|
||||
git remote add origin https://github.com/OPM/$1
|
||||
git fetch --depth 1 origin $2:branch_to_build
|
||||
git checkout branch_to_build
|
||||
git log HEAD -1 | cat
|
||||
|
||||
@@ -6,17 +6,15 @@ source `dirname $0`/build-opm-module.sh
|
||||
mkdir deps
|
||||
ln -sf $WORKSPACE deps/opm-common
|
||||
|
||||
# No upstreams
|
||||
declare -a upstreams
|
||||
upstreams=(libecl)
|
||||
|
||||
declare -A upstreamRev
|
||||
upstreamRev[libecl]=master
|
||||
|
||||
# Downstreams and revisions
|
||||
declare -a downstreams
|
||||
downstreams=(opm-material
|
||||
opm-grid
|
||||
ewoms
|
||||
opm-models
|
||||
opm-simulators
|
||||
opm-upscaling
|
||||
)
|
||||
@@ -24,7 +22,7 @@ downstreams=(opm-material
|
||||
declare -A downstreamRev
|
||||
downstreamRev[opm-material]=master
|
||||
downstreamRev[opm-grid]=master
|
||||
downstreamRev[ewoms]=master
|
||||
downstreamRev[opm-models]=master
|
||||
downstreamRev[opm-simulators]=master
|
||||
downstreamRev[opm-upscaling]=master
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ upstreams=(libecl
|
||||
opm-common
|
||||
opm-material
|
||||
opm-grid
|
||||
ewoms
|
||||
opm-models
|
||||
opm-simulators
|
||||
opm-upscaling
|
||||
)
|
||||
@@ -19,7 +19,7 @@ upstreamRev[libecl]=master
|
||||
upstreamRev[opm-common]=master
|
||||
upstreamRev[opm-material]=master
|
||||
upstreamRev[opm-grid]=master
|
||||
upstreamRev[ewoms]=master
|
||||
upstreamRev[opm-models]=master
|
||||
upstreamRev[opm-simulators]=master
|
||||
upstreamRev[opm-upscaling]=master
|
||||
|
||||
|
||||
@@ -21,28 +21,27 @@ namespace Opm {
|
||||
class EclipseIO;
|
||||
class ParseContext;
|
||||
class Parser;
|
||||
|
||||
class SummaryState;
|
||||
class msim {
|
||||
|
||||
public:
|
||||
using well_rate_function = double(const EclipseState&, const Schedule&, const data::Solution&, size_t report_step, double seconds_elapsed);
|
||||
using well_rate_function = double(const EclipseState&, const Schedule&, const SummaryState& st, const data::Solution&, size_t report_step, double seconds_elapsed);
|
||||
using solution_function = void(const EclipseState&, const Schedule&, data::Solution&, size_t report_step, double seconds_elapsed);
|
||||
|
||||
msim(const EclipseState& state);
|
||||
|
||||
void well_rate(const std::string& well, data::Rates::opt rate, std::function<well_rate_function> func);
|
||||
void solution(const std::string& field, std::function<solution_function> func);
|
||||
void run(Schedule& schedule, EclipseIO& io);
|
||||
void post_step(Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;
|
||||
void run(Schedule& schedule, EclipseIO& io, bool report_only);
|
||||
void post_step(Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step) const;
|
||||
private:
|
||||
|
||||
void run_step(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;
|
||||
void run_step(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const;
|
||||
void output(size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const;
|
||||
void simulate(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const;
|
||||
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const;
|
||||
void run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const;
|
||||
void output(SummaryState& st, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const;
|
||||
void simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const;
|
||||
|
||||
EclipseState state;
|
||||
|
||||
std::map<std::string, std::map<data::Rates::opt, std::function<well_rate_function>>> well_rates;
|
||||
std::map<std::string, std::function<solution_function>> solutions;
|
||||
};
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <opm/output/eclipse/EclipseIO.hpp>
|
||||
#include <opm/output/eclipse/RestartValue.hpp>
|
||||
#include <opm/output/eclipse/Summary.hpp>
|
||||
#include <opm/output/data/Solution.hpp>
|
||||
#include <opm/output/data/Wells.hpp>
|
||||
|
||||
@@ -33,48 +34,52 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
msim::msim(const EclipseState& state) :
|
||||
state(state)
|
||||
msim::msim(const EclipseState& state_arg) :
|
||||
state(state_arg)
|
||||
{}
|
||||
|
||||
void msim::run(Schedule& schedule, EclipseIO& io) {
|
||||
void msim::run(Schedule& schedule, EclipseIO& io, bool report_only) {
|
||||
const double week = 7 * 86400;
|
||||
data::Solution sol;
|
||||
data::Wells well_data;
|
||||
SummaryState st(std::chrono::system_clock::from_time_t(schedule.getStartTime()));
|
||||
|
||||
io.writeInitial();
|
||||
for (size_t report_step = 1; report_step < schedule.size(); report_step++) {
|
||||
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
|
||||
run_step(schedule, sol, well_data, report_step, time_step, io);
|
||||
post_step(schedule, sol, well_data, report_step, io);
|
||||
if (report_only)
|
||||
run_step(schedule, st, sol, well_data, report_step, io);
|
||||
else {
|
||||
double time_step = std::min(week, 0.5*schedule.stepLength(report_step - 1));
|
||||
run_step(schedule, st, sol, well_data, report_step, time_step, io);
|
||||
}
|
||||
post_step(schedule, st, sol, well_data, report_step);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void msim::post_step(Schedule& schedule, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step, EclipseIO& io) const {
|
||||
const auto& actions = schedule.actions();
|
||||
void msim::post_step(Schedule& schedule, const SummaryState& st, data::Solution& /* sol */, data::Wells& /* well_data */, size_t report_step) const {
|
||||
const auto& actions = schedule.actions(report_step);
|
||||
if (actions.empty())
|
||||
return;
|
||||
|
||||
const SummaryState& summary_state = io.summaryState();
|
||||
ActionContext context( summary_state );
|
||||
std::vector<std::string> matching_wells;
|
||||
Action::Context context( st );
|
||||
|
||||
auto sim_time = schedule.simTime(report_step);
|
||||
for (const auto& action : actions.pending(sim_time)) {
|
||||
if (action->eval(sim_time, context, matching_wells))
|
||||
schedule.applyAction(report_step, *action, matching_wells);
|
||||
auto result = action->eval(sim_time, context);
|
||||
if (result)
|
||||
schedule.applyAction(report_step, *action, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void msim::run_step(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const {
|
||||
this->run_step(schedule, sol, well_data, report_step, schedule.stepLength(report_step - 1), io);
|
||||
void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, EclipseIO& io) const {
|
||||
this->run_step(schedule, st, sol, well_data, report_step, schedule.stepLength(report_step - 1), io);
|
||||
}
|
||||
|
||||
|
||||
void msim::run_step(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const {
|
||||
void msim::run_step(const Schedule& schedule, SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double dt, EclipseIO& io) const {
|
||||
double start_time = schedule.seconds(report_step - 1);
|
||||
double end_time = schedule.seconds(report_step);
|
||||
double seconds_elapsed = start_time;
|
||||
@@ -84,10 +89,20 @@ void msim::run_step(const Schedule& schedule, data::Solution& sol, data::Wells&
|
||||
if ((seconds_elapsed + time_step) > end_time)
|
||||
time_step = end_time - seconds_elapsed;
|
||||
|
||||
this->simulate(schedule, sol, well_data, report_step, seconds_elapsed, time_step);
|
||||
this->simulate(schedule, st, sol, well_data, report_step, seconds_elapsed, time_step);
|
||||
|
||||
seconds_elapsed += time_step;
|
||||
this->output(report_step,
|
||||
|
||||
io.summary().eval(st,
|
||||
report_step,
|
||||
seconds_elapsed,
|
||||
this->state,
|
||||
schedule,
|
||||
well_data,
|
||||
{});
|
||||
|
||||
this->output(st,
|
||||
report_step,
|
||||
(seconds_elapsed < end_time),
|
||||
seconds_elapsed,
|
||||
sol,
|
||||
@@ -98,19 +113,17 @@ void msim::run_step(const Schedule& schedule, data::Solution& sol, data::Wells&
|
||||
|
||||
|
||||
|
||||
void msim::output(size_t report_step, bool /* substep */, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
|
||||
void msim::output(SummaryState& st, size_t report_step, bool /* substep */, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, EclipseIO& io) const {
|
||||
RestartValue value(sol, well_data);
|
||||
io.writeTimeStep(report_step,
|
||||
io.writeTimeStep(st,
|
||||
report_step,
|
||||
false,
|
||||
seconds_elapsed,
|
||||
value,
|
||||
{},
|
||||
{},
|
||||
{});
|
||||
value);
|
||||
}
|
||||
|
||||
|
||||
void msim::simulate(const Schedule& schedule, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const {
|
||||
void msim::simulate(const Schedule& schedule, const SummaryState& st, data::Solution& sol, data::Wells& well_data, size_t report_step, double seconds_elapsed, double time_step) const {
|
||||
for (const auto& sol_pair : this->solutions) {
|
||||
auto func = sol_pair.second;
|
||||
func(this->state, schedule, sol, report_step, seconds_elapsed + time_step);
|
||||
@@ -123,7 +136,7 @@ void msim::simulate(const Schedule& schedule, data::Solution& sol, data::Wells&
|
||||
auto rate = rate_pair.first;
|
||||
auto func = rate_pair.second;
|
||||
|
||||
well.rates.set(rate, func(this->state, schedule, sol, report_step, seconds_elapsed + time_step));
|
||||
well.rates.set(rate, func(this->state, schedule, st, sol, report_step, seconds_elapsed + time_step));
|
||||
}
|
||||
|
||||
// This is complete bogus; a temporary fix to pass an assert() in the
|
||||
|
||||
@@ -15,7 +15,6 @@ set (opm-common_DEPS
|
||||
|
||||
if(ENABLE_ECL_INPUT)
|
||||
list(APPEND opm-common_DEPS
|
||||
"ecl REQUIRED"
|
||||
# various runtime library enhancements
|
||||
"Boost 1.44.0
|
||||
COMPONENTS system filesystem unit_test_framework regex REQUIRED")
|
||||
|
||||
68
opm/common/utility/TimeService.hpp
Normal file
68
opm/common/utility/TimeService.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media Project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_TIMESERVICE_HEADER_INCLUDED
|
||||
#define OPM_TIMESERVICE_HEADER_INCLUDED
|
||||
|
||||
#include <ctime>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class TimeStampUTC
|
||||
{
|
||||
public:
|
||||
struct YMD {
|
||||
int year{0};
|
||||
int month{0};
|
||||
int day{0};
|
||||
};
|
||||
|
||||
TimeStampUTC() = default;
|
||||
|
||||
explicit TimeStampUTC(const std::time_t tp);
|
||||
explicit TimeStampUTC(const YMD& ymd);
|
||||
|
||||
TimeStampUTC& operator=(const std::time_t tp);
|
||||
|
||||
TimeStampUTC& hour(const int h);
|
||||
TimeStampUTC& minutes(const int m);
|
||||
TimeStampUTC& seconds(const int s);
|
||||
TimeStampUTC& microseconds(const int us);
|
||||
|
||||
int year() const { return this->ymd_.year; }
|
||||
int month() const { return this->ymd_.month; }
|
||||
int day() const { return this->ymd_.day; }
|
||||
int hour() const { return this->hour_; }
|
||||
int minutes() const { return this->minutes_; }
|
||||
int seconds() const { return this->seconds_; }
|
||||
int microseconds() const { return this->usec_; }
|
||||
|
||||
private:
|
||||
YMD ymd_{};
|
||||
int hour_{0};
|
||||
int minutes_{0};
|
||||
int seconds_{0};
|
||||
int usec_{0};
|
||||
};
|
||||
|
||||
std::time_t asTimeT(const TimeStampUTC& tp);
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPM_TIMESERVICE_HEADER_INCLUDED
|
||||
@@ -16,9 +16,10 @@
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
double calculateCellVol(const std::vector<double>& X, const std::vector<double>& Y, const std::vector<double>& Z);
|
||||
double calculateCellVol(const std::array<double,8>& X, const std::array<double,8>& Y, const std::array<double,8>& Z);
|
||||
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EGRID_HPP
|
||||
#define EGRID_HPP
|
||||
#ifndef OPM_IO_EGRID_HPP
|
||||
#define OPM_IO_EGRID_HPP
|
||||
|
||||
#include "EclFile.hpp"
|
||||
#include <opm/io/eclipse/EclFile.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <ctime>
|
||||
#include <map>
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
class EGrid : public EclFile
|
||||
{
|
||||
@@ -43,15 +44,15 @@ public:
|
||||
std::array<int, 3> ijk_from_active_index(int actInd) const;
|
||||
std::array<int, 3> ijk_from_global_index(int globInd) const;
|
||||
|
||||
void getCellCorners(int globindex, std::vector<double>& X, std::vector<double>& Y, std::vector<double>& Z) const;
|
||||
void getCellCorners(const std::array<int, 3>& ijk, std::vector<double>& X, std::vector<double>& Y, std::vector<double>& Z) const;
|
||||
void getCellCorners(int globindex, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
|
||||
void getCellCorners(const std::array<int, 3>& ijk, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
|
||||
|
||||
int activeCells() const { return nactive; }
|
||||
int totalNumberOfCells() const { return nijk[0] * nijk[1] * nijk[2]; }
|
||||
|
||||
private:
|
||||
std::array<int, 3> nijk;
|
||||
int nNNC, nactive;
|
||||
int nactive;
|
||||
|
||||
std::vector<int> act_index;
|
||||
std::vector<int> glob_index;
|
||||
@@ -59,4 +60,6 @@ private:
|
||||
std::vector<float> zcorn_array;
|
||||
};
|
||||
|
||||
#endif
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_EGRID_HPP
|
||||
@@ -16,20 +16,20 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ERFT_HPP
|
||||
#define ERFT_HPP
|
||||
#ifndef OPM_IO_ERFT_HPP
|
||||
#define OPM_IO_ERFT_HPP
|
||||
|
||||
#include <opm/io/eclipse/EclFile.hpp>
|
||||
|
||||
#include "EclFile.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
class ERft : public EclFile
|
||||
{
|
||||
@@ -79,5 +79,6 @@ private:
|
||||
const RftDate& date) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_ERFT_HPP
|
||||
@@ -16,19 +16,22 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ERST_HPP
|
||||
#define ERST_HPP
|
||||
#ifndef OPM_IO_ERST_HPP
|
||||
#define OPM_IO_ERST_HPP
|
||||
|
||||
#include <opm/io/eclipse/EclFile.hpp>
|
||||
|
||||
#include "EclFile.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <ios>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm { namespace EclIO { namespace OutputStream {
|
||||
class Restart;
|
||||
}}}
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
class ERst : public EclFile
|
||||
{
|
||||
@@ -45,13 +48,23 @@ public:
|
||||
|
||||
std::vector<EclEntry> listOfRstArrays(int reportStepNumber);
|
||||
|
||||
friend class OutputStream::Restart;
|
||||
|
||||
private:
|
||||
int nReports;
|
||||
std::vector<int> seqnum; // report step numbers, from SEQNUM array in restart file
|
||||
std::unordered_map<int,bool> reportLoaded;
|
||||
std::map<int, std::pair<int,int>> arrIndexRange; // mapping report step number to array indeces (start and end)
|
||||
|
||||
void initUnified();
|
||||
void initSeparate(const int number);
|
||||
|
||||
int getArrayIndex(const std::string& name, int seqnum) const;
|
||||
|
||||
std::streampos
|
||||
restartStepWritePosition(const int seqnumValue) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_ERST_HPP
|
||||
@@ -16,45 +16,55 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ESMRY_HPP
|
||||
#define ESMRY_HPP
|
||||
#ifndef OPM_IO_ESMRY_HPP
|
||||
#define OPM_IO_ESMRY_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <map>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
class ESmry
|
||||
{
|
||||
public:
|
||||
explicit ESmry(const std::string& filename, bool loadBaseRunData=false); // filename (smspec file) or file root name
|
||||
|
||||
const int numberOfVectors() const { return nVect; }
|
||||
// input is smspec (or fsmspec file)
|
||||
explicit ESmry(const std::string& filename, bool loadBaseRunData=false);
|
||||
|
||||
int numberOfVectors() const { return nVect; }
|
||||
|
||||
bool hasKey(const std::string& key) const;
|
||||
|
||||
const std::vector<float>& get(const std::string& name) const;
|
||||
|
||||
std::vector<float> get_at_rstep(const std::string& name) const;
|
||||
|
||||
const std::vector<std::string>& keywordList() const { return keyword; }
|
||||
|
||||
int timestepIdxAtReportstepStart(const int reportStep) const;
|
||||
|
||||
private:
|
||||
int nVect, nI, nJ, nK;
|
||||
std::string path="";
|
||||
|
||||
void ijk_from_global_index(int glob, int &i, int &j, int &k);
|
||||
void ijk_from_global_index(int glob, int &i, int &j, int &k) const;
|
||||
std::vector<std::vector<float>> param;
|
||||
std::vector<std::string> keyword;
|
||||
|
||||
std::vector<int> seqIndex;
|
||||
std::vector<float> seqTime;
|
||||
|
||||
std::vector<std::string> checkForMultipleResultFiles(const boost::filesystem::path& rootN, bool formatted) const;
|
||||
|
||||
void getRstString(const std::vector<std::string>& restartArray,
|
||||
boost::filesystem::path& pathRst,
|
||||
boost::filesystem::path& rootN) const;
|
||||
|
||||
void getRstString(const std::vector<std::string> &restartArray, std::string &path, std::string &rootN) const;
|
||||
void updatePathAndRootName(std::string &path, std::string &rootN) const;
|
||||
void updatePathAndRootName(boost::filesystem::path& dir, boost::filesystem::path& rootN) const;
|
||||
|
||||
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num);
|
||||
std::string makeKeyString(const std::string& keyword, const std::string& wgname, int num) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_ESMRY_HPP
|
||||
@@ -16,22 +16,21 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ECLFILE_HPP
|
||||
#define ECLFILE_HPP
|
||||
#ifndef OPM_IO_ECLFILE_HPP
|
||||
#define OPM_IO_ECLFILE_HPP
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
#include <examples/test_util/data/EclIOdata.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <opm/io/eclipse/EclIOdata.hpp>
|
||||
|
||||
#include <ios>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <map>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
#include <stdio.h>
|
||||
#include <vector>
|
||||
|
||||
namespace EIOD = Opm::ecl;
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
class EclFile
|
||||
{
|
||||
@@ -53,7 +52,7 @@ public:
|
||||
char_array.clear();
|
||||
}
|
||||
|
||||
using EclEntry = std::tuple<std::string, EIOD::eclArrType, int>;
|
||||
using EclEntry = std::tuple<std::string, eclArrType, int>;
|
||||
std::vector<EclEntry> getList() const;
|
||||
|
||||
template <typename T>
|
||||
@@ -77,7 +76,7 @@ protected:
|
||||
std::unordered_map<int, std::vector<std::string>> char_array;
|
||||
|
||||
std::vector<std::string> array_name;
|
||||
std::vector<EIOD::eclArrType> array_type;
|
||||
std::vector<eclArrType> array_type;
|
||||
std::vector<int> array_size;
|
||||
|
||||
std::vector<unsigned long int> ifStreamPos;
|
||||
@@ -85,7 +84,7 @@ protected:
|
||||
std::map<std::string, int> array_index;
|
||||
|
||||
template<class T>
|
||||
const std::vector<T>& getImpl(int arrIndex, EIOD::eclArrType type,
|
||||
const std::vector<T>& getImpl(int arrIndex, eclArrType type,
|
||||
const std::unordered_map<int, std::vector<T>>& array,
|
||||
const std::string& typeStr)
|
||||
{
|
||||
@@ -98,13 +97,20 @@ protected:
|
||||
loadData(arrIndex);
|
||||
}
|
||||
|
||||
return array.find(arrIndex)->second;
|
||||
return array.at(arrIndex);
|
||||
}
|
||||
|
||||
std::streampos
|
||||
seekPosition(const std::vector<std::string>::size_type arrIndex) const;
|
||||
|
||||
private:
|
||||
std::vector<bool> arrayLoaded;
|
||||
|
||||
void loadArray(std::fstream& fileH, int arrIndex);
|
||||
void loadBinaryArray(std::fstream& fileH, std::size_t arrIndex);
|
||||
void loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, long int fromPos);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_ECLFILE_HPP
|
||||
@@ -17,24 +17,19 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_ECLIO_DATA_HPP
|
||||
#define OPM_ECLIO_DATA_HPP
|
||||
#ifndef OPM_IO_ECLIODATA_HPP
|
||||
#define OPM_IO_ECLIODATA_HPP
|
||||
|
||||
#include <tuple>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
|
||||
namespace ecl {
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
// type MESS have no assisiated data
|
||||
|
||||
enum eclArrType {
|
||||
INTE, REAL, DOUB, CHAR, LOGI, MESS
|
||||
};
|
||||
|
||||
// named constants related to binary file format
|
||||
|
||||
const unsigned int true_value = 0xffffffff;
|
||||
const unsigned int false_value = 0x00000000;
|
||||
|
||||
@@ -51,7 +46,6 @@ namespace Opm {
|
||||
const int MaxBlockSizeChar = 840; // Maximum block size for CHAR arrays in binary files
|
||||
|
||||
// named constants related to formatted file file format
|
||||
|
||||
const int MaxNumBlockInte = 1000; // maximum number of Inte values in block => hard line shift
|
||||
const int MaxNumBlockReal = 1000; // maximum number of Real values in block => hard line shift
|
||||
const int MaxNumBlockDoub = 1000; // maximum number of Doub values in block => hard line shift
|
||||
@@ -69,8 +63,7 @@ namespace Opm {
|
||||
const int columnWidthDoub = 23; // number of characters fore each Inte Element
|
||||
const int columnWidthLogi = 3; // number of characters fore each Inte Element
|
||||
const int columnWidthChar = 11; // number of characters fore each Inte Element
|
||||
|
||||
} // ecl
|
||||
} // Opm
|
||||
|
||||
#endif // OPM_ECLIO_DATA_HPP
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_ECLIODATA_HPP
|
||||
@@ -15,75 +15,90 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef ECL_OUTPUT_HPP
|
||||
#define ECL_OUTPUT_HPP
|
||||
#ifndef OPM_IO_ECLOUTPUT_HPP
|
||||
#define OPM_IO_ECLOUTPUT_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <iomanip>
|
||||
#include <ios>
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
#include <vector>
|
||||
|
||||
#include <examples/test_util/data/EclIOdata.hpp>
|
||||
#include <opm/io/eclipse/EclIOdata.hpp>
|
||||
#include <opm/io/eclipse/PaddedOutputString.hpp>
|
||||
|
||||
namespace EIOD = Opm::ecl;
|
||||
namespace Opm { namespace EclIO { namespace OutputStream {
|
||||
class Restart;
|
||||
class SummarySpecification;
|
||||
}}}
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
class EclOutput
|
||||
{
|
||||
public:
|
||||
EclOutput(const std::string& inputFile, bool formatted);
|
||||
EclOutput(const std::string& filename,
|
||||
const bool formatted,
|
||||
const std::ios_base::openmode mode = std::ios::out);
|
||||
|
||||
template<typename T>
|
||||
void write(const std::string& name,
|
||||
const std::vector<T>& data)
|
||||
{
|
||||
EIOD::eclArrType arrType = EIOD::MESS;
|
||||
eclArrType arrType = MESS;
|
||||
if (typeid(T) == typeid(int))
|
||||
arrType = EIOD::INTE;
|
||||
arrType = INTE;
|
||||
else if (typeid(T) == typeid(float))
|
||||
arrType = EIOD::REAL;
|
||||
arrType = REAL;
|
||||
else if (typeid(T) == typeid(double))
|
||||
arrType = EIOD::DOUB;
|
||||
arrType = DOUB;
|
||||
else if (typeid(T) == typeid(bool))
|
||||
arrType = EIOD::LOGI;
|
||||
arrType = LOGI;
|
||||
else if (typeid(T) == typeid(char))
|
||||
arrType = EIOD::MESS;
|
||||
arrType = MESS;
|
||||
|
||||
if (isFormatted)
|
||||
{
|
||||
writeFormattedHeader(name, data.size(), arrType);
|
||||
if (arrType != EIOD::MESS)
|
||||
if (arrType != MESS)
|
||||
writeFormattedArray(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
writeBinaryHeader(name, data.size(), arrType);
|
||||
if (arrType != EIOD::MESS)
|
||||
if (arrType != MESS)
|
||||
writeBinaryArray(data);
|
||||
}
|
||||
}
|
||||
|
||||
void message(const std::string& msg);
|
||||
void flushStream();
|
||||
|
||||
friend class OutputStream::Restart;
|
||||
friend class OutputStream::SummarySpecification;
|
||||
|
||||
private:
|
||||
void writeBinaryHeader(const std::string& arrName, int size, EIOD::eclArrType arrType);
|
||||
void writeBinaryHeader(const std::string& arrName, int size, eclArrType arrType);
|
||||
|
||||
template <typename T>
|
||||
void writeBinaryArray(const std::vector<T>& data);
|
||||
|
||||
void writeBinaryCharArray(const std::vector<std::string>& data);
|
||||
void writeBinaryCharArray(const std::vector<PaddedOutputString<8>>& data);
|
||||
|
||||
void writeFormattedHeader(const std::string& arrName, int size, EIOD::eclArrType arrType);
|
||||
void writeFormattedHeader(const std::string& arrName, int size, eclArrType arrType);
|
||||
|
||||
template <typename T>
|
||||
void writeFormattedArray(const std::vector<T>& data);
|
||||
|
||||
void writeFormattedCharArray(const std::vector<std::string>& data);
|
||||
void writeFormattedCharArray(const std::vector<PaddedOutputString<8>>& data);
|
||||
|
||||
std::string make_real_string(float value) const;
|
||||
std::string make_doub_string(double value) const;
|
||||
|
||||
std::ofstream ofileH;
|
||||
bool isFormatted;
|
||||
std::ofstream ofileH;
|
||||
};
|
||||
|
||||
|
||||
@@ -91,4 +106,11 @@ template<>
|
||||
void EclOutput::write<std::string>(const std::string& name,
|
||||
const std::vector<std::string>& data);
|
||||
|
||||
#endif
|
||||
template <>
|
||||
void EclOutput::write<PaddedOutputString<8>>
|
||||
(const std::string& name,
|
||||
const std::vector<PaddedOutputString<8>>& data);
|
||||
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_ECLOUTPUT_HPP
|
||||
@@ -16,25 +16,25 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ECL_UTIL_HPP
|
||||
#define ECL_UTIL_HPP
|
||||
#ifndef OPM_IO_ECLUTIL_HPP
|
||||
#define OPM_IO_ECLUTIL_HPP
|
||||
|
||||
#include <opm/io/eclipse/EclIOdata.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <examples/test_util/data/EclIOdata.hpp>
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
namespace Opm {
|
||||
namespace ecl {
|
||||
int flipEndianInt(int num);
|
||||
float flipEndianFloat(float num);
|
||||
double flipEndianDouble(double num);
|
||||
int flipEndianInt(int num);
|
||||
float flipEndianFloat(float num);
|
||||
double flipEndianDouble(double num);
|
||||
|
||||
std::tuple<int, int> block_size_data_binary(eclArrType arrType);
|
||||
std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
|
||||
std::tuple<int, int> block_size_data_binary(eclArrType arrType);
|
||||
std::tuple<int, int, int> block_size_data_formatted(eclArrType arrType);
|
||||
|
||||
std::string trimr(const std::string &str1);
|
||||
}
|
||||
}
|
||||
std::string trimr(const std::string &str1);
|
||||
|
||||
#endif
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
#endif // OPM_IO_ECLUTIL_HPP
|
||||
455
opm/io/eclipse/OutputStream.hpp
Normal file
455
opm/io/eclipse/OutputStream.hpp
Normal file
@@ -0,0 +1,455 @@
|
||||
/*
|
||||
Copyright (c) 2019 Equinor ASA
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
|
||||
#define OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
|
||||
|
||||
#include <opm/io/eclipse/PaddedOutputString.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <ios>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
class EclOutput;
|
||||
|
||||
}} // namespace Opm::EclIO
|
||||
|
||||
namespace Opm { namespace EclIO { namespace OutputStream {
|
||||
|
||||
struct Formatted { bool set; };
|
||||
struct Unified { bool set; };
|
||||
|
||||
/// Abstract representation of an ECLIPSE-style result set.
|
||||
struct ResultSet
|
||||
{
|
||||
/// Output directory. Commonly "." or location of run's .DATA file.
|
||||
std::string outputDir;
|
||||
|
||||
/// Base name of simulation run.
|
||||
std::string baseName;
|
||||
};
|
||||
|
||||
/// File manager for "init" output streams.
|
||||
class Init
|
||||
{
|
||||
public:
|
||||
/// Constructor.
|
||||
///
|
||||
/// Opens file stream for writing.
|
||||
///
|
||||
/// \param[in] rset Output directory and base name of output stream.
|
||||
///
|
||||
/// \param[in] fmt Whether or not to create formatted output files.
|
||||
explicit Init(const ResultSet& rset,
|
||||
const Formatted& fmt);
|
||||
|
||||
~Init();
|
||||
|
||||
Init(const Init& rhs) = delete;
|
||||
Init(Init&& rhs);
|
||||
|
||||
Init& operator=(const Init& rhs) = delete;
|
||||
Init& operator=(Init&& rhs);
|
||||
|
||||
/// Write integer data to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<int>& data);
|
||||
|
||||
/// Write boolean data to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<bool>& data);
|
||||
|
||||
/// Write single precision floating point data to underlying
|
||||
/// output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<float>& data);
|
||||
|
||||
/// Write double precision floating point data to underlying
|
||||
/// output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<double>& data);
|
||||
|
||||
private:
|
||||
/// Init file output stream.
|
||||
std::unique_ptr<EclOutput> stream_;
|
||||
|
||||
/// Open output stream.
|
||||
///
|
||||
/// Writes to \c stream_.
|
||||
///
|
||||
/// \param[in] fname Filename of new output stream.
|
||||
///
|
||||
/// \param[in] formatted Whether or not to create a
|
||||
/// formatted output file.
|
||||
void open(const std::string& fname,
|
||||
const bool formatted);
|
||||
|
||||
/// Access writable output stream.
|
||||
EclOutput& stream();
|
||||
|
||||
/// Implementation function for public \c write overload set.
|
||||
template <typename T>
|
||||
void writeImpl(const std::string& kw,
|
||||
const std::vector<T>& data);
|
||||
};
|
||||
|
||||
/// File manager for restart output streams.
|
||||
class Restart
|
||||
{
|
||||
public:
|
||||
/// Constructor.
|
||||
///
|
||||
/// Opens file stream pertaining to restart of particular report
|
||||
/// step and also outputs a SEQNUM record in the case of a unified
|
||||
/// output stream.
|
||||
///
|
||||
/// Must be called before accessing the stream object through the
|
||||
/// stream() member function.
|
||||
///
|
||||
/// \param[in] rset Output directory and base name of output stream.
|
||||
///
|
||||
/// \param[in] seqnum Sequence number of new report. One-based
|
||||
/// report step ID.
|
||||
///
|
||||
/// \param[in] fmt Whether or not to create formatted output files.
|
||||
///
|
||||
/// \param[in] unif Whether or not to create unified output files.
|
||||
explicit Restart(const ResultSet& rset,
|
||||
const int seqnum,
|
||||
const Formatted& fmt,
|
||||
const Unified& unif);
|
||||
|
||||
~Restart();
|
||||
|
||||
Restart(const Restart& rhs) = delete;
|
||||
Restart(Restart&& rhs);
|
||||
|
||||
Restart& operator=(const Restart& rhs) = delete;
|
||||
Restart& operator=(Restart&& rhs);
|
||||
|
||||
/// Generate a message string (keyword type 'MESS') in underlying
|
||||
/// output stream.
|
||||
///
|
||||
/// \param[in] msg Message string (e.g., "STARTSOL").
|
||||
void message(const std::string& msg);
|
||||
|
||||
/// Write integer data to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<int>& data);
|
||||
|
||||
/// Write boolean data to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<bool>& data);
|
||||
|
||||
/// Write single precision floating point data to underlying
|
||||
/// output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<float>& data);
|
||||
|
||||
/// Write double precision floating point data to underlying
|
||||
/// output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<double>& data);
|
||||
|
||||
/// Write unpadded string data to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<std::string>& data);
|
||||
|
||||
/// Write padded character data (8 characters per string)
|
||||
/// to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<PaddedOutputString<8>>& data);
|
||||
|
||||
private:
|
||||
/// Restart output stream.
|
||||
std::unique_ptr<EclOutput> stream_;
|
||||
|
||||
/// Open unified output file and place stream's output indicator
|
||||
/// in appropriate location.
|
||||
///
|
||||
/// Writes to \c stream_.
|
||||
///
|
||||
/// \param[in] fname Filename of output stream.
|
||||
///
|
||||
/// \param[in] formatted Whether or not to create a
|
||||
/// formatted output file.
|
||||
///
|
||||
/// \param[in] seqnum Sequence number of new report. One-based
|
||||
/// report step ID.
|
||||
void openUnified(const std::string& fname,
|
||||
const bool formatted,
|
||||
const int seqnum);
|
||||
|
||||
/// Open new output stream.
|
||||
///
|
||||
/// Handles the case of separate output files or unified output file
|
||||
/// that does not already exist. Writes to \c stream_.
|
||||
///
|
||||
/// \param[in] fname Filename of new output stream.
|
||||
///
|
||||
/// \param[in] formatted Whether or not to create a
|
||||
/// formatted output file.
|
||||
void openNew(const std::string& fname,
|
||||
const bool formatted);
|
||||
|
||||
/// Open existing output file and place stream's output indicator
|
||||
/// in appropriate location.
|
||||
///
|
||||
/// Writes to \c stream_.
|
||||
///
|
||||
/// \param[in] fname Filename of output stream.
|
||||
///
|
||||
/// \param[in] writePos Position at which to place stream's output
|
||||
/// indicator. Use \code streampos{ streamoff{-1} } \endcode to
|
||||
/// place output indicator at end of file (i.e, simple append).
|
||||
void openExisting(const std::string& fname,
|
||||
const bool formatted,
|
||||
const std::streampos writePos);
|
||||
|
||||
/// Access writable output stream.
|
||||
///
|
||||
/// Must not be called prior to \c prepareStep.
|
||||
EclOutput& stream();
|
||||
|
||||
/// Implementation function for public \c write overload set.
|
||||
template <typename T>
|
||||
void writeImpl(const std::string& kw,
|
||||
const std::vector<T>& data);
|
||||
};
|
||||
|
||||
/// File manager for RFT output streams
|
||||
class RFT
|
||||
{
|
||||
public:
|
||||
struct OpenExisting { bool set; };
|
||||
|
||||
/// Constructor.
|
||||
///
|
||||
/// Opens file stream for writing.
|
||||
///
|
||||
/// \param[in] rset Output directory and base name of output stream.
|
||||
///
|
||||
/// \param[in] fmt Whether or not to create formatted output files.
|
||||
///
|
||||
/// \param[in] existing Whether or not to open an existing output file.
|
||||
explicit RFT(const ResultSet& rset,
|
||||
const Formatted& fmt,
|
||||
const OpenExisting& existing);
|
||||
|
||||
~RFT();
|
||||
|
||||
RFT(const RFT& rhs) = delete;
|
||||
RFT(RFT&& rhs);
|
||||
|
||||
RFT& operator=(const RFT& rhs) = delete;
|
||||
RFT& operator=(RFT&& rhs);
|
||||
|
||||
/// Write integer data to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<int>& data);
|
||||
|
||||
/// Write single precision floating point data to underlying
|
||||
/// output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<float>& data);
|
||||
|
||||
/// Write padded character data (8 characters per string)
|
||||
/// to underlying output stream.
|
||||
///
|
||||
/// \param[in] kw Name of output vector (keyword).
|
||||
///
|
||||
/// \param[in] data Output values.
|
||||
void write(const std::string& kw,
|
||||
const std::vector<PaddedOutputString<8>>& data);
|
||||
|
||||
private:
|
||||
/// Init file output stream.
|
||||
std::unique_ptr<EclOutput> stream_;
|
||||
|
||||
/// Open output stream.
|
||||
///
|
||||
/// Writes to \c stream_.
|
||||
///
|
||||
/// \param[in] fname Filename of new output stream.
|
||||
///
|
||||
/// \param[in] formatted Whether or not to create a
|
||||
/// formatted output file.
|
||||
///
|
||||
/// \param[in] existing Whether or not to open an
|
||||
/// existing output file (mode ios_base::app).
|
||||
void open(const std::string& fname,
|
||||
const bool formatted,
|
||||
const bool existing);
|
||||
|
||||
/// Access writable output stream.
|
||||
EclOutput& stream();
|
||||
|
||||
/// Implementation function for public \c write overload set.
|
||||
template <typename T>
|
||||
void writeImpl(const std::string& kw,
|
||||
const std::vector<T>& data);
|
||||
};
|
||||
|
||||
class SummarySpecification
|
||||
{
|
||||
public:
|
||||
using StartTime = std::chrono::system_clock::time_point;
|
||||
|
||||
enum class UnitConvention
|
||||
{
|
||||
Metric = 1,
|
||||
Field = 2,
|
||||
Lab = 3,
|
||||
Pvt_M = 4,
|
||||
};
|
||||
|
||||
struct RestartSpecification
|
||||
{
|
||||
std::string root;
|
||||
int step;
|
||||
};
|
||||
|
||||
class Parameters
|
||||
{
|
||||
public:
|
||||
void add(const std::string& keyword,
|
||||
const std::string& wgname,
|
||||
const int num,
|
||||
const std::string& unit);
|
||||
|
||||
friend class SummarySpecification;
|
||||
|
||||
private:
|
||||
std::vector<PaddedOutputString<8>> keywords{};
|
||||
std::vector<PaddedOutputString<8>> wgnames{};
|
||||
std::vector<int> nums{};
|
||||
std::vector<PaddedOutputString<8>> units{};
|
||||
};
|
||||
|
||||
explicit SummarySpecification(const ResultSet& rset,
|
||||
const Formatted& fmt,
|
||||
const UnitConvention uconv,
|
||||
const std::array<int,3>& cartDims,
|
||||
const RestartSpecification& restart,
|
||||
const StartTime start);
|
||||
|
||||
~SummarySpecification();
|
||||
|
||||
SummarySpecification(const SummarySpecification& rhs) = delete;
|
||||
SummarySpecification(SummarySpecification&& rhs);
|
||||
|
||||
SummarySpecification& operator=(const SummarySpecification& rhs) = delete;
|
||||
SummarySpecification& operator=(SummarySpecification&& rhs);
|
||||
|
||||
void write(const Parameters& params);
|
||||
|
||||
private:
|
||||
int unit_;
|
||||
int restartStep_;
|
||||
std::array<int,3> cartDims_;
|
||||
StartTime startDate_;
|
||||
std::vector<PaddedOutputString<8>> restart_;
|
||||
|
||||
/// Summary specification (SMSPEC) file output stream.
|
||||
std::unique_ptr<EclOutput> stream_;
|
||||
|
||||
void rewindStream();
|
||||
void flushStream();
|
||||
|
||||
EclOutput& stream();
|
||||
};
|
||||
|
||||
std::unique_ptr<EclOutput>
|
||||
createSummaryFile(const ResultSet& rset,
|
||||
const int seqnum,
|
||||
const Formatted& fmt,
|
||||
const Unified& unif);
|
||||
|
||||
/// Derive filename corresponding to output stream of particular result
|
||||
/// set, with user-specified file extension.
|
||||
///
|
||||
/// Low-level string concatenation routine that does not know specific
|
||||
/// relations between base names and file extensions. Handles details
|
||||
/// of base name ending in a period (full stop) or having a name that
|
||||
/// might otherwise appear to contain a file extension (e.g., CASE.01).
|
||||
///
|
||||
/// \param[in] rsetDescriptor Output directory and base name of result set.
|
||||
///
|
||||
/// \param[in] ext Filename extension.
|
||||
///
|
||||
/// \return outputDir/baseName.ext
|
||||
std::string outputFileName(const ResultSet& rsetDescriptor,
|
||||
const std::string& ext);
|
||||
|
||||
}}} // namespace Opm::EclIO::OutputStream
|
||||
|
||||
#endif // OPM_IO_OUTPUTSTREAM_HPP_INCLUDED
|
||||
@@ -17,8 +17,8 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_CHARARRAY_HEADER_HPP
|
||||
#define OPM_CHARARRAY_HEADER_HPP
|
||||
#ifndef OPM_PADDEDOUTPUTSTRING_HEADER_HPP
|
||||
#define OPM_PADDEDOUTPUTSTRING_HEADER_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
namespace Opm { namespace EclIO {
|
||||
|
||||
/// Null-terminated, left adjusted, space padded array of N characters.
|
||||
///
|
||||
@@ -36,30 +36,30 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
///
|
||||
/// \tparam N Number of characters.
|
||||
template <std::size_t N>
|
||||
class CharArrayNullTerm
|
||||
class PaddedOutputString
|
||||
{
|
||||
public:
|
||||
CharArrayNullTerm()
|
||||
PaddedOutputString()
|
||||
{
|
||||
this->clear();
|
||||
}
|
||||
|
||||
explicit CharArrayNullTerm(const std::string& s)
|
||||
: CharArrayNullTerm()
|
||||
explicit PaddedOutputString(const std::string& s)
|
||||
: PaddedOutputString()
|
||||
{
|
||||
this->copy_in(s.c_str(), s.size());
|
||||
}
|
||||
|
||||
~CharArrayNullTerm() = default;
|
||||
~PaddedOutputString() = default;
|
||||
|
||||
CharArrayNullTerm(const CharArrayNullTerm& rhs) = default;
|
||||
CharArrayNullTerm(CharArrayNullTerm&& rhs) = default;
|
||||
PaddedOutputString(const PaddedOutputString& rhs) = default;
|
||||
PaddedOutputString(PaddedOutputString&& rhs) = default;
|
||||
|
||||
CharArrayNullTerm& operator=(const CharArrayNullTerm& rhs) = default;
|
||||
CharArrayNullTerm& operator=(CharArrayNullTerm&& rhs) = default;
|
||||
PaddedOutputString& operator=(const PaddedOutputString& rhs) = default;
|
||||
PaddedOutputString& operator=(PaddedOutputString&& rhs) = default;
|
||||
|
||||
/// Assign from \code std::string \endcode.
|
||||
CharArrayNullTerm& operator=(const std::string& s)
|
||||
PaddedOutputString& operator=(const std::string& s)
|
||||
{
|
||||
this->clear();
|
||||
this->copy_in(s.data(), s.size());
|
||||
@@ -99,5 +99,5 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
}
|
||||
};
|
||||
|
||||
}}} // Opm::RestartIO::Helpers
|
||||
#endif // CHARARRAY_HEADER
|
||||
}} // Opm::EclIO
|
||||
#endif // OPM_PADDEDOUTPUTSTRING_HEADER_HPP
|
||||
@@ -20,153 +20,135 @@
|
||||
#ifndef OPM_AGGREGATE_GROUP_DATA_HPP
|
||||
#define OPM_AGGREGATE_GROUP_DATA_HPP
|
||||
|
||||
#include <opm/output/eclipse/CharArrayNullTerm.hpp>
|
||||
#include <opm/output/eclipse/WindowedArray.hpp>
|
||||
|
||||
#include <opm/io/eclipse/PaddedOutputString.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace Opm {
|
||||
class Schedule;
|
||||
class SummaryState;
|
||||
class Group;
|
||||
class Schedule;
|
||||
class SummaryState;
|
||||
class Group2;
|
||||
} // Opm
|
||||
|
||||
namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
|
||||
class groupMaps {
|
||||
public:
|
||||
const std::map <size_t, const Opm::Group*>& indexGroupMap() const;
|
||||
const std::map <const std::string, size_t>& groupNameIndexMap() const;
|
||||
class AggregateGroupData
|
||||
{
|
||||
public:
|
||||
explicit AggregateGroupData(const std::vector<int>& inteHead);
|
||||
|
||||
void currentGrpTreeNameSeqIndMap(const Opm::Schedule& sched,
|
||||
const size_t simStep,
|
||||
const std::map<const std::string , size_t>& GnIMap,
|
||||
const std::map<size_t, const Opm::Group*>& IGMap);
|
||||
void captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
const std::size_t simStep,
|
||||
const Opm::SummaryState& sumState,
|
||||
const std::vector<int>& inteHead);
|
||||
|
||||
private:
|
||||
std::map <size_t, const Opm::Group*> m_indexGroupMap;
|
||||
std::map <const std::string, size_t> m_groupNameIndexMap;
|
||||
};
|
||||
|
||||
class AggregateGroupData
|
||||
const std::vector<int>& getIGroup() const
|
||||
{
|
||||
public:
|
||||
explicit AggregateGroupData(const std::vector<int>& inteHead);
|
||||
return this->iGroup_.data();
|
||||
}
|
||||
|
||||
void captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
const std::vector<std::string>& restart_group_keys,
|
||||
const std::vector<std::string>& restart_field_keys,
|
||||
const std::map<std::string, size_t>& groupKeyToIndex,
|
||||
const std::map<std::string, size_t>& fieldKeyToIndex,
|
||||
const std::size_t simStep,
|
||||
const Opm::SummaryState& sumState,
|
||||
const std::vector<int>& inteHead);
|
||||
const std::vector<float>& getSGroup() const
|
||||
{
|
||||
return this->sGroup_.data();
|
||||
}
|
||||
|
||||
const std::vector<int>& getIGroup() const
|
||||
{
|
||||
return this->iGroup_.data();
|
||||
}
|
||||
const std::vector<double>& getXGroup() const
|
||||
{
|
||||
return this->xGroup_.data();
|
||||
}
|
||||
|
||||
const std::vector<float>& getSGroup() const
|
||||
{
|
||||
return this->sGroup_.data();
|
||||
}
|
||||
const std::vector<EclIO::PaddedOutputString<8>>& getZGroup() const
|
||||
{
|
||||
return this->zGroup_.data();
|
||||
}
|
||||
|
||||
const std::vector<double>& getXGroup() const
|
||||
{
|
||||
return this->xGroup_.data();
|
||||
}
|
||||
const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
|
||||
"GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
|
||||
"GOPT", "GWPT", "GGPT", "GVPT", "GWIT",
|
||||
"GGIT",
|
||||
"GOPTH", "GWPTH", "GGPTH",
|
||||
"GWITH", "GGITH"};
|
||||
|
||||
const std::vector<CharArrayNullTerm<8>>& getZGroup() const
|
||||
{
|
||||
return this->zGroup_.data();
|
||||
}
|
||||
const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
|
||||
"FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
|
||||
"FOPT", "FWPT", "FGPT", "FVPT", "FWIT",
|
||||
"FGIT",
|
||||
"FOPTH", "FWPTH", "FGPTH",
|
||||
"FWITH", "FGITH"};
|
||||
|
||||
const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
|
||||
"GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
|
||||
"GOPT", "GWPT", "GGPT", "GVPT", "GWIT",
|
||||
"GGIT",
|
||||
"GOPTH", "GWPTH", "GGPTH",
|
||||
"GWITH", "GGITH"};
|
||||
|
||||
const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
|
||||
"FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
|
||||
"FOPT", "FWPT", "FGPT", "FVPT", "FWIT",
|
||||
"FGIT",
|
||||
"FOPTH", "FWPTH", "FGPTH",
|
||||
"FWITH", "FGITH"};
|
||||
|
||||
const std::map<std::string, size_t> groupKeyToIndex = {
|
||||
{"GOPR", 0},
|
||||
{"GWPR", 1},
|
||||
{"GGPR", 2},
|
||||
{"GVPR", 3},
|
||||
{"GWIR", 5},
|
||||
{"GGIR", 6},
|
||||
{"GWCT", 8},
|
||||
{"GGOR", 9},
|
||||
{"GOPT", 10},
|
||||
{"GWPT", 11},
|
||||
{"GGPT", 12},
|
||||
{"GVPT", 13},
|
||||
{"GWIT", 15},
|
||||
{"GGIT", 16},
|
||||
{"GOPP", 22},
|
||||
{"GWPP", 23},
|
||||
{"GOPTH", 135},
|
||||
{"GWPTH", 139},
|
||||
{"GWITH", 140},
|
||||
{"GGPTH", 143},
|
||||
{"GGITH", 144},
|
||||
};
|
||||
|
||||
const std::map<std::string, size_t> fieldKeyToIndex = {
|
||||
{"FOPR", 0},
|
||||
{"FWPR", 1},
|
||||
{"FGPR", 2},
|
||||
{"FVPR", 3},
|
||||
{"FWIR", 5},
|
||||
{"FGIR", 6},
|
||||
{"FWCT", 8},
|
||||
{"FGOR", 9},
|
||||
{"FOPT", 10},
|
||||
{"FWPT", 11},
|
||||
{"FGPT", 12},
|
||||
{"FVPT", 13},
|
||||
{"FWIT", 15},
|
||||
{"FGIT", 16},
|
||||
{"FOPP", 22},
|
||||
{"FWPP", 23},
|
||||
{"FOPTH", 135},
|
||||
{"FWPTH", 139},
|
||||
{"FWITH", 140},
|
||||
{"FGPTH", 143},
|
||||
{"FGITH", 144},
|
||||
};
|
||||
|
||||
private:
|
||||
/// Aggregate 'IWEL' array (Integer) for all wells.
|
||||
WindowedArray<int> iGroup_;
|
||||
|
||||
/// Aggregate 'SWEL' array (Real) for all wells.
|
||||
WindowedArray<float> sGroup_;
|
||||
|
||||
/// Aggregate 'XWEL' array (Double Precision) for all wells.
|
||||
WindowedArray<double> xGroup_;
|
||||
|
||||
/// Aggregate 'ZWEL' array (Character) for all wells.
|
||||
WindowedArray<CharArrayNullTerm<8>> zGroup_;
|
||||
|
||||
/// Maximum number of wells in a group.
|
||||
int nWGMax_;
|
||||
|
||||
/// Maximum number of groups
|
||||
int nGMaxz_;
|
||||
const std::map<std::string, size_t> groupKeyToIndex = {
|
||||
{"GOPR", 0},
|
||||
{"GWPR", 1},
|
||||
{"GGPR", 2},
|
||||
{"GVPR", 3},
|
||||
{"GWIR", 5},
|
||||
{"GGIR", 6},
|
||||
{"GWCT", 8},
|
||||
{"GGOR", 9},
|
||||
{"GOPT", 10},
|
||||
{"GWPT", 11},
|
||||
{"GGPT", 12},
|
||||
{"GVPT", 13},
|
||||
{"GWIT", 15},
|
||||
{"GGIT", 16},
|
||||
{"GOPP", 22},
|
||||
{"GWPP", 23},
|
||||
{"GOPTH", 135},
|
||||
{"GWPTH", 139},
|
||||
{"GWITH", 140},
|
||||
{"GGPTH", 143},
|
||||
{"GGITH", 144},
|
||||
};
|
||||
|
||||
const std::map<std::string, size_t> fieldKeyToIndex = {
|
||||
{"FOPR", 0},
|
||||
{"FWPR", 1},
|
||||
{"FGPR", 2},
|
||||
{"FVPR", 3},
|
||||
{"FWIR", 5},
|
||||
{"FGIR", 6},
|
||||
{"FWCT", 8},
|
||||
{"FGOR", 9},
|
||||
{"FOPT", 10},
|
||||
{"FWPT", 11},
|
||||
{"FGPT", 12},
|
||||
{"FVPT", 13},
|
||||
{"FWIT", 15},
|
||||
{"FGIT", 16},
|
||||
{"FOPP", 22},
|
||||
{"FWPP", 23},
|
||||
{"FOPTH", 135},
|
||||
{"FWPTH", 139},
|
||||
{"FWITH", 140},
|
||||
{"FGPTH", 143},
|
||||
{"FGITH", 144},
|
||||
};
|
||||
|
||||
private:
|
||||
/// Aggregate 'IWEL' array (Integer) for all wells.
|
||||
WindowedArray<int> iGroup_;
|
||||
|
||||
/// Aggregate 'SWEL' array (Real) for all wells.
|
||||
WindowedArray<float> sGroup_;
|
||||
|
||||
/// Aggregate 'XWEL' array (Double Precision) for all wells.
|
||||
WindowedArray<double> xGroup_;
|
||||
|
||||
/// Aggregate 'ZWEL' array (Character) for all wells.
|
||||
WindowedArray<EclIO::PaddedOutputString<8>> zGroup_;
|
||||
|
||||
/// Maximum number of wells in a group.
|
||||
int nWGMax_;
|
||||
|
||||
/// Maximum number of groups
|
||||
int nGMaxz_;
|
||||
};
|
||||
|
||||
}}} // Opm::RestartIO::Helpers
|
||||
|
||||
#endif // OPM_AGGREGATE_WELL_DATA_HPP
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define OPM_AGGREGATE_MSW_DATA_HPP
|
||||
|
||||
#include <opm/output/data/Wells.hpp>
|
||||
#include <opm/output/eclipse/CharArrayNullTerm.hpp>
|
||||
#include <opm/output/eclipse/WindowedArray.hpp>
|
||||
|
||||
#include <string>
|
||||
@@ -55,13 +54,13 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
std::vector<double> sofr;
|
||||
std::vector<double> swfr;
|
||||
std::vector<double> sgfr;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class AggregateMSWData
|
||||
{
|
||||
public:
|
||||
explicit AggregateMSWData(const std::vector<int>& inteHead);
|
||||
|
||||
|
||||
void captureDeclaredMSWData(const Opm::Schedule& sched,
|
||||
const std::size_t rptStep,
|
||||
const Opm::UnitSystem& units,
|
||||
|
||||
142
opm/output/eclipse/AggregateUDQData.hpp
Normal file
142
opm/output/eclipse/AggregateUDQData.hpp
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
Copyright (c) 2018 Statoil ASA
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_AGGREGATE_UDQ_DATA_HPP
|
||||
#define OPM_AGGREGATE_UDQ_DATA_HPP
|
||||
|
||||
#include <opm/output/eclipse/WindowedArray.hpp>
|
||||
#include <opm/io/eclipse/PaddedOutputString.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace Opm {
|
||||
class Schedule;
|
||||
class UDQInput;
|
||||
class UDQActive;
|
||||
} // Opm
|
||||
|
||||
namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
|
||||
class igphData {
|
||||
public:
|
||||
const std::vector<int> ig_phase(const Opm::Schedule& sched, const std::size_t simStep, const std::vector<int>& inteHead);
|
||||
};
|
||||
|
||||
class AggregateUDQData
|
||||
{
|
||||
public:
|
||||
explicit AggregateUDQData(const std::vector<int>& udqDims);
|
||||
|
||||
void captureDeclaredUDQData(const Opm::Schedule& sched,
|
||||
const std::size_t simStep,
|
||||
const Opm::SummaryState& st,
|
||||
const std::vector<int>& inteHead);
|
||||
|
||||
const std::vector<int>& getIUDQ() const
|
||||
{
|
||||
return this->iUDQ_.data();
|
||||
}
|
||||
|
||||
const std::vector<int>& getIUAD() const
|
||||
{
|
||||
return this->iUAD_.data();
|
||||
}
|
||||
|
||||
const std::vector<EclIO::PaddedOutputString<8>>& getZUDN() const
|
||||
{
|
||||
return this->zUDN_.data();
|
||||
}
|
||||
|
||||
const std::vector<EclIO::PaddedOutputString<8>>& getZUDL() const
|
||||
{
|
||||
return this->zUDL_.data();
|
||||
}
|
||||
|
||||
const std::vector<int>& getIGPH() const
|
||||
{
|
||||
return this->iGPH_.data();
|
||||
}
|
||||
|
||||
const std::vector<int>& getIUAP() const
|
||||
{
|
||||
return this->iUAP_.data();
|
||||
}
|
||||
|
||||
const std::vector<double>& getDUDW() const
|
||||
{
|
||||
return this->dUDW_.data();
|
||||
}
|
||||
|
||||
const std::vector<double>& getDUDG() const
|
||||
{
|
||||
return this->dUDG_.data();
|
||||
}
|
||||
|
||||
const std::vector<double>& getDUDF() const
|
||||
{
|
||||
return this->dUDF_.data();
|
||||
}
|
||||
|
||||
private:
|
||||
/// Aggregate 'IUDQ' array (Integer) for all UDQ data (3 integers pr UDQ)
|
||||
WindowedArray<int> iUDQ_;
|
||||
|
||||
/// Aggregate 'IUAD' array (Integer) for all UDQ data (5 integers pr UDQ that is used for various well and group controls)
|
||||
WindowedArray<int> iUAD_;
|
||||
|
||||
|
||||
/// Aggregate 'ZUDN' array (Character) for all UDQ data. (2 * 8 chars pr UDQ -> UNIT keyword)
|
||||
WindowedArray<EclIO::PaddedOutputString<8>> zUDN_;
|
||||
|
||||
/// Aggregate 'ZUDL' array (Character) for all UDQ data. (16 * 8 chars pr UDQ DEFINE "Data for operation - Msth Expression)
|
||||
WindowedArray<EclIO::PaddedOutputString<8>> zUDL_;
|
||||
|
||||
/// Aggregate 'IGPH' array (Integer) for all UDQ data (3 - zeroes - as of current understanding)
|
||||
WindowedArray<int> iGPH_;
|
||||
|
||||
/// Aggregate 'IUAP' array (ICharArrayNullTermnteger) for all UDQ data (1 integer pr UDQ constraint used)
|
||||
WindowedArray<int> iUAP_;
|
||||
|
||||
/// Aggregate 'DUDW' array (Double Precision) for all UDQ data. (Dimension = max no wells * noOfUDQ's)
|
||||
WindowedArray<double> dUDW_;
|
||||
|
||||
/// Aggregate 'DUDG' array (Double Precision) for all UDQ data. (Dimension = (max no groups + 1) * noOfUDQ's)
|
||||
WindowedArray<double> dUDG_;
|
||||
|
||||
/// Aggregate 'DUDF' array (Double Precision) for all UDQ data. (Dimension = Number of FU - UDQ's, with value equal to the actual constraint)
|
||||
WindowedArray<double> dUDF_;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}}} // Opm::RestartIO::Helpers
|
||||
|
||||
#endif //OPM_AGGREGATE_WELL_DATA_HPP
|
||||
@@ -20,9 +20,10 @@
|
||||
#ifndef OPM_AGGREGATE_WELL_DATA_HPP
|
||||
#define OPM_AGGREGATE_WELL_DATA_HPP
|
||||
|
||||
#include <opm/output/eclipse/CharArrayNullTerm.hpp>
|
||||
#include <opm/output/eclipse/WindowedArray.hpp>
|
||||
|
||||
#include <opm/io/eclipse/PaddedOutputString.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -74,7 +75,7 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
}
|
||||
|
||||
/// Retrieve Character Well Data Array.
|
||||
const std::vector<CharArrayNullTerm<8>>& getZWell() const
|
||||
const std::vector<EclIO::PaddedOutputString<8>>& getZWell() const
|
||||
{
|
||||
return this->zWell_.data();
|
||||
}
|
||||
@@ -92,7 +93,7 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
WindowedArray<double> xWell_;
|
||||
|
||||
/// Aggregate 'ZWEL' array (Character) for all wells.
|
||||
WindowedArray<CharArrayNullTerm<8>> zWell_;
|
||||
WindowedArray<EclIO::PaddedOutputString<8>> zWell_;
|
||||
|
||||
/// Maximum number of groups in model.
|
||||
int nWGMax_;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
namespace Opm {
|
||||
class Tuning;
|
||||
class Schedule;
|
||||
class UDQParams;
|
||||
}
|
||||
|
||||
namespace Opm { namespace RestartIO {
|
||||
@@ -38,7 +39,7 @@ namespace Opm { namespace RestartIO {
|
||||
std::chrono::time_point<std::chrono::system_clock> start;
|
||||
std::chrono::duration<double, std::chrono::seconds::period> elapsed;
|
||||
};
|
||||
|
||||
|
||||
DoubHEAD();
|
||||
|
||||
~DoubHEAD() = default;
|
||||
@@ -57,7 +58,9 @@ namespace Opm { namespace RestartIO {
|
||||
|
||||
DoubHEAD& drsdt(const Schedule& sched,
|
||||
const std::size_t lookup_step,
|
||||
const double cnvT);
|
||||
const double cnvT);
|
||||
|
||||
DoubHEAD& udq_param(const UDQParams& udqPar);
|
||||
|
||||
const std::vector<double>& data() const
|
||||
{
|
||||
|
||||
@@ -23,10 +23,9 @@
|
||||
#define OPM_ECLIPSE_WRITER_HPP
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
|
||||
@@ -36,11 +35,15 @@
|
||||
#include <opm/output/data/Wells.hpp>
|
||||
#include <opm/output/eclipse/RestartValue.hpp>
|
||||
|
||||
namespace Opm { namespace out {
|
||||
class Summary;
|
||||
}} // namespace Opm::out
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class EclipseState;
|
||||
class SummaryConfig;
|
||||
class Schedule;
|
||||
class SummaryConfig;
|
||||
class SummaryState;
|
||||
|
||||
/*!
|
||||
@@ -171,13 +174,11 @@ public:
|
||||
* hardcoded static map misc_units in Summary.cpp.
|
||||
*/
|
||||
|
||||
void writeTimeStep( int report_step,
|
||||
void writeTimeStep( const SummaryState& st,
|
||||
int report_step,
|
||||
bool isSubstep,
|
||||
double seconds_elapsed,
|
||||
RestartValue value,
|
||||
const std::map<std::string, double>& single_summary_values,
|
||||
const std::map<std::string, std::vector<double>>& region_summary_values,
|
||||
const std::map<std::pair<std::string, int>, double>& block_summary_values,
|
||||
const bool write_double = false);
|
||||
|
||||
|
||||
@@ -219,14 +220,12 @@ public:
|
||||
missing, if the bool is false missing keywords will be ignored
|
||||
(there will *not* be an empty vector in the return value).
|
||||
*/
|
||||
RestartValue loadRestart(const std::vector<RestartKey>& solution_keys, const std::vector<RestartKey>& extra_keys = {}) const;
|
||||
|
||||
RestartValue loadRestart(SummaryState& summary_state, const std::vector<RestartKey>& solution_keys, const std::vector<RestartKey>& extra_keys = {}) const;
|
||||
const out::Summary& summary();
|
||||
|
||||
EclipseIO( const EclipseIO& ) = delete;
|
||||
~EclipseIO();
|
||||
|
||||
const SummaryState& summaryState() const;
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr< Impl > impl;
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace Opm { namespace RestartIO {
|
||||
int maxPerf;
|
||||
int maxWellInGroup;
|
||||
int maxGroupInField;
|
||||
int maxWellsInField;
|
||||
};
|
||||
|
||||
struct WellSegDims {
|
||||
@@ -89,6 +90,10 @@ namespace Opm { namespace RestartIO {
|
||||
struct Group {
|
||||
int ngroups;
|
||||
};
|
||||
|
||||
struct UdqParam {
|
||||
int udqParam_1;
|
||||
};
|
||||
|
||||
InteHEAD();
|
||||
~InteHEAD() = default;
|
||||
@@ -117,6 +122,7 @@ namespace Opm { namespace RestartIO {
|
||||
InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
|
||||
InteHEAD& regionDimensions(const RegDims& rdim);
|
||||
InteHEAD& ngroups(const Group& gr);
|
||||
InteHEAD& udqParam_1(const UdqParam& udqpar);
|
||||
|
||||
const std::vector<int>& data() const
|
||||
{
|
||||
|
||||
@@ -24,23 +24,11 @@
|
||||
#ifndef RESTART_IO_HPP
|
||||
#define RESTART_IO_HPP
|
||||
|
||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
#include <opm/output/data/Cells.hpp>
|
||||
#include <opm/output/data/Solution.hpp>
|
||||
#include <opm/output/data/Wells.hpp>
|
||||
#include <opm/output/eclipse/RestartValue.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
|
||||
#include <ert/ecl/EclKW.hpp>
|
||||
#include <ert/ecl/ecl_rsthead.h>
|
||||
#include <ert/ecl/ecl_rst_file.h>
|
||||
#include <ert/util/util.h>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -48,11 +36,15 @@ namespace Opm {
|
||||
|
||||
class EclipseGrid;
|
||||
class EclipseState;
|
||||
class Phases;
|
||||
class Schedule;
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
namespace Opm { namespace EclIO { namespace OutputStream {
|
||||
|
||||
class Restart;
|
||||
|
||||
}}}
|
||||
|
||||
/*
|
||||
The two free functions RestartIO::save() and RestartIO::load() can
|
||||
@@ -77,24 +69,25 @@ namespace Opm {
|
||||
*/
|
||||
namespace Opm { namespace RestartIO {
|
||||
|
||||
void save(const std::string& filename,
|
||||
int report_step,
|
||||
double seconds_elapsed,
|
||||
RestartValue value,
|
||||
const EclipseState& es,
|
||||
const EclipseGrid& grid,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& sumState,
|
||||
bool write_double = false);
|
||||
void save(EclIO::OutputStream::Restart& rstFile,
|
||||
int report_step,
|
||||
double seconds_elapsed,
|
||||
RestartValue value,
|
||||
const EclipseState& es,
|
||||
const EclipseGrid& grid,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& sumState,
|
||||
bool write_double = false);
|
||||
|
||||
std::pair<RestartValue, SummaryState>
|
||||
load(const std::string& filename,
|
||||
int report_step,
|
||||
const std::vector<RestartKey>& solution_keys,
|
||||
const EclipseState& es,
|
||||
const EclipseGrid& grid,
|
||||
const Schedule& schedule,
|
||||
const std::vector<RestartKey>& extra_keys = {});
|
||||
|
||||
RestartValue load(const std::string& filename,
|
||||
int report_step,
|
||||
SummaryState& summary_state,
|
||||
const std::vector<RestartKey>& solution_keys,
|
||||
const EclipseState& es,
|
||||
const EclipseGrid& grid,
|
||||
const Schedule& schedule,
|
||||
const std::vector<RestartKey>& extra_keys = {});
|
||||
|
||||
}} // namespace Opm::RestartIO
|
||||
|
||||
|
||||
@@ -34,7 +34,9 @@ namespace Opm {
|
||||
|
||||
std::string key;
|
||||
UnitSystem::measure dim;
|
||||
bool required;
|
||||
bool required = false;
|
||||
|
||||
RestartKey() = default;
|
||||
|
||||
RestartKey( const std::string& _key, UnitSystem::measure _dim)
|
||||
: key(_key),
|
||||
|
||||
@@ -21,77 +21,58 @@
|
||||
#define OPM_OUTPUT_SUMMARY_HPP
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <ert/ecl/ecl_sum.h>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
|
||||
#include <opm/output/data/Wells.hpp>
|
||||
#include <opm/output/eclipse/RegionCache.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class EclipseGrid;
|
||||
class EclipseState;
|
||||
class Schedule;
|
||||
class SummaryConfig;
|
||||
class EclipseGrid;
|
||||
class Schedule;
|
||||
class SummaryState;
|
||||
} // namespace Opm
|
||||
|
||||
namespace out {
|
||||
namespace Opm { namespace data {
|
||||
class WellRates;
|
||||
}} // namespace Opm::data
|
||||
|
||||
namespace Opm { namespace out {
|
||||
|
||||
class Summary {
|
||||
public:
|
||||
Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const Schedule& );
|
||||
Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const Schedule&, const std::string& );
|
||||
Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const Schedule&, const char* basename );
|
||||
|
||||
void add_timestep(int report_step,
|
||||
double secs_elapsed,
|
||||
const EclipseState& es,
|
||||
const Schedule& schedule,
|
||||
const data::Wells&,
|
||||
const std::map<std::string, double>& single_values,
|
||||
const std::map<std::string, std::vector<double>>& region_values = {},
|
||||
const std::map<std::pair<std::string, int>, double>& block_values = {});
|
||||
|
||||
|
||||
void eval(SummaryState& summary_state,
|
||||
int report_step,
|
||||
double secs_elapsed,
|
||||
const EclipseState& es,
|
||||
const Schedule& schedule,
|
||||
const data::Wells&,
|
||||
const std::map<std::string, double>& single_values,
|
||||
const std::map<std::string, std::vector<double>>& region_values = {},
|
||||
const std::map<std::pair<std::string, int>, double>& block_values = {}) const;
|
||||
|
||||
using GlobalProcessParameters = std::map<std::string, double>;
|
||||
using RegionParameters = std::map<std::string, std::vector<double>>;
|
||||
using BlockValues = std::map<std::pair<std::string, int>, double>;
|
||||
|
||||
Summary(const EclipseState& es,
|
||||
const SummaryConfig& sumcfg,
|
||||
const EclipseGrid& grid,
|
||||
const Schedule& sched,
|
||||
const std::string& basename = "");
|
||||
|
||||
~Summary();
|
||||
|
||||
const SummaryState& get_restart_vectors() const;
|
||||
void add_timestep(const SummaryState& st, const int report_step);
|
||||
|
||||
void eval(SummaryState& summary_state,
|
||||
const int report_step,
|
||||
const double secs_elapsed,
|
||||
const EclipseState& es,
|
||||
const Schedule& schedule,
|
||||
const data::WellRates& well_solution,
|
||||
const GlobalProcessParameters& single_values,
|
||||
const RegionParameters& region_values = {},
|
||||
const BlockValues& block_values = {}) const;
|
||||
|
||||
void reset_cumulative_quantities(const SummaryState& rstrt);
|
||||
void write() const;
|
||||
|
||||
private:
|
||||
void internal_store(const SummaryState& summary_state, int report_step, double seconds_elapsed);
|
||||
|
||||
|
||||
class keyword_handlers;
|
||||
|
||||
const EclipseGrid& grid;
|
||||
out::RegionCache regionCache;
|
||||
ERT::ert_unique_ptr< ecl_sum_type, ecl_sum_free > ecl_sum;
|
||||
std::unique_ptr< keyword_handlers > handlers;
|
||||
double prev_time_elapsed = 0;
|
||||
SummaryState prev_state;
|
||||
class SummaryImplementation;
|
||||
std::unique_ptr<SummaryImplementation> pImpl_;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}} // namespace Opm::out
|
||||
|
||||
#endif //OPM_OUTPUT_SUMMARY_HPP
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <ert/ecl/FortIO.hpp>
|
||||
#include <ert/ecl/EclKW.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
|
||||
|
||||
namespace Opm {
|
||||
@@ -39,9 +34,6 @@ namespace Opm {
|
||||
public:
|
||||
explicit Tables( const UnitSystem& units);
|
||||
|
||||
void addPVTO(const std::vector<PvtoTable>& pvtoTables);
|
||||
void addPVTG(const std::vector<PvtgTable>& pvtgTables);
|
||||
void addPVTW(const PvtwTable& pvtwTable);
|
||||
void addDensity(const DensityTable& density);
|
||||
|
||||
/// Add normalised PVT function tables to INIT file's TAB vector.
|
||||
@@ -137,20 +129,6 @@ namespace Opm {
|
||||
/// TableManager sub-object.
|
||||
void addWaterPVTTables(const EclipseState& es);
|
||||
};
|
||||
|
||||
/// Emit normalised tabular information (TABDIMS and TAB vectors) to
|
||||
/// ECL-like result set file (typically INIT file).
|
||||
///
|
||||
/// \param[in] tables Collection of normalised tables. Its \code
|
||||
/// tabdims() \endcode and \code tab() \endcode vectors will be
|
||||
/// emitted to \p fortio as ECL keywords "TABDIMS" and "TAB",
|
||||
/// respectively.
|
||||
///
|
||||
/// \param[in,out] fortio ECL-like result set file. Typically
|
||||
/// corresponds to a preopened stream attached to the INIT file.
|
||||
void fwrite(const Tables& tables,
|
||||
ERT::FortIO& fortio);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif // OUTPUT_TABLES_HPP
|
||||
|
||||
@@ -30,6 +30,9 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
|
||||
TsInit = 1, // Maximum Length of Next Timestep
|
||||
TsMaxz = 2, // Maximum Length of Timestep After Next
|
||||
TsMinz = 3, // Minumum Length of All Timesteps
|
||||
UdqPar_2 = 212, // UDQPARAM item number 2 (Permitted range (+/-) of user-defined quantities)
|
||||
UdqPar_3 = 213, // UDQPARAM item number 3 (Value given to undefined elements when outputting data)
|
||||
UdqPar_4 = 214, // UDQPARAM item number 4 (fractional equality tolerance used in ==, <= etc. functions)
|
||||
};
|
||||
|
||||
}}}} // Opm::RestartIO::Helpers::VectorItems
|
||||
|
||||
@@ -76,6 +76,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
|
||||
NSCAQZ = 46, // Number of data elements per aquifer connection in SCAQ array
|
||||
NACAQZ = 47, // Number of data elements per aquifer connection in ACAQ array
|
||||
|
||||
NWMAXZ = 163, // Maximum number of wells in the model
|
||||
|
||||
NSEGWL = 174, // Number of multisegment wells defined with WELSEG
|
||||
NSWLMX = 175, // Maximum number of segmented wells (item 1 ofWSEGDIMS)
|
||||
NSEGMX = 176, // Maximum number of segments per well (item 2 of WSEGDIMS)
|
||||
@@ -84,6 +86,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
|
||||
NISEGZ = 178, // Number of entries per segment in ISEG array
|
||||
NRSEGZ = 179, // Number of entries per segment in RSEG array
|
||||
NILBRZ = 180, // Number of entries per segment in ILBR array
|
||||
UDQPAR_1 = 267, // Integer seed value for the RAND /
|
||||
};
|
||||
}}}} // Opm::RestartIO::Helpers::VectorItems
|
||||
|
||||
|
||||
76
opm/output/eclipse/VectorItems/tabdims.hpp
Normal file
76
opm/output/eclipse/VectorItems/tabdims.hpp
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
Copyright (c) 2019 Equinor ASA
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP
|
||||
#define OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems {
|
||||
|
||||
namespace TabDims {
|
||||
enum index : std::vector<int>::size_type {
|
||||
// Number of elements in 'TAB' array
|
||||
TabSize = 0,
|
||||
|
||||
// Oil PVT table
|
||||
PvtoMainStart = 6,
|
||||
PvtoCompStart = 7,
|
||||
NumPvtoCompNodes = 8,
|
||||
NumPvtoPressNodes = 9,
|
||||
NumPvtoTables = 10,
|
||||
|
||||
// Water PVT table
|
||||
PvtwStart = 11,
|
||||
NumPvtwTables = 12,
|
||||
|
||||
// Gas PVT tables
|
||||
PvtgMainStart = 13,
|
||||
PvtgPressStart = 14,
|
||||
NumPvtgCompNodes = 15,
|
||||
NumPvtgPressNodes = 16,
|
||||
NumPvtgTables = 17,
|
||||
|
||||
// Density tables
|
||||
DensityTableStart = 18,
|
||||
DensityNumTables = 19,
|
||||
|
||||
// SWFN tables
|
||||
SwfnTableStart = 20,
|
||||
SwfnNumSatNodes = 21,
|
||||
SwfnNumTables = 22,
|
||||
|
||||
// SGFN tables
|
||||
SgfnTableStart = 23,
|
||||
SgfnNumSatNodes = 24,
|
||||
SgfnNumTables = 25,
|
||||
|
||||
// SOFN tables
|
||||
SofnTableStart = 26,
|
||||
SofnNumSatNodes = 28,
|
||||
SofnNumTables = 29,
|
||||
|
||||
// Size of TABDIMS array
|
||||
TabDimsNumElems = 100,
|
||||
};
|
||||
} // namespace TabDims
|
||||
|
||||
}}}} // namespace Opm::RestartIO::Helpers::VectorItems
|
||||
|
||||
#endif // OPM_OUTPUT_ECLIPSE_VECTOR_TABDIMS_HPP
|
||||
@@ -21,7 +21,9 @@
|
||||
#define OPM_WINDOWED_ARRAY_HPP
|
||||
|
||||
#include <cassert>
|
||||
#include <exception>
|
||||
#include <iterator>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
@@ -72,7 +74,10 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
explicit WindowedArray(const NumWindows n, const WindowSize sz)
|
||||
: x_ (n.value * sz.value)
|
||||
, windowSize_(sz.value)
|
||||
{}
|
||||
{
|
||||
if (sz.value == 0)
|
||||
throw std::invalid_argument("Window array with windowsize==0 is not permitted");
|
||||
}
|
||||
|
||||
/// Retrieve number of windows allocated for this array.
|
||||
Idx numWindows() const
|
||||
@@ -179,7 +184,10 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
const WindowSize& sz)
|
||||
: data_ (NumWindows{ nRows.value * nCols.value }, sz)
|
||||
, numCols_(nCols.value)
|
||||
{}
|
||||
{
|
||||
if (nCols.value == 0)
|
||||
throw std::invalid_argument("Window matrix with columns==0 is not permitted");
|
||||
}
|
||||
|
||||
/// Retrieve number of columns allocated for this matrix.
|
||||
Idx numCols() const
|
||||
|
||||
60
opm/output/eclipse/WriteInit.hpp
Normal file
60
opm/output/eclipse/WriteInit.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright (c) 2019 Equinor ASA
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_WRITE_INIT_HPP
|
||||
#define OPM_WRITE_INIT_HPP
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class EclipseGrid;
|
||||
class EclipseState;
|
||||
class NNC;
|
||||
class Schedule;
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
namespace Opm { namespace data {
|
||||
|
||||
class Solution;
|
||||
|
||||
}} // namespace Opm::data
|
||||
|
||||
namespace Opm { namespace EclIO { namespace OutputStream {
|
||||
|
||||
class Init;
|
||||
|
||||
}}} // namespace Opm::EclIO::OutputStream
|
||||
|
||||
namespace Opm { namespace InitIO {
|
||||
|
||||
void write(const ::Opm::EclipseState& es,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
const ::Opm::Schedule& schedule,
|
||||
const ::Opm::data::Solution& simProps,
|
||||
std::map<std::string, std::vector<int>> int_data,
|
||||
const ::Opm::NNC& nnc,
|
||||
::Opm::EclIO::OutputStream::Init& initFile);
|
||||
|
||||
}} // namespace Opm::InitIO
|
||||
|
||||
#endif // OPM_WRITE_INIT_HPP
|
||||
89
opm/output/eclipse/WriteRFT.hpp
Normal file
89
opm/output/eclipse/WriteRFT.hpp
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright (c) 2019 Equinor ASA
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_WRITE_RFT_HPP
|
||||
#define OPM_WRITE_RFT_HPP
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class EclipseGrid;
|
||||
class Schedule;
|
||||
class UnitSystem;
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
namespace Opm { namespace data {
|
||||
|
||||
class WellRates;
|
||||
|
||||
}} // namespace Opm::data
|
||||
|
||||
namespace Opm { namespace EclIO { namespace OutputStream {
|
||||
|
||||
class RFT;
|
||||
|
||||
}}} // namespace Opm::EclIO::OutputStream
|
||||
|
||||
namespace Opm { namespace RftIO {
|
||||
|
||||
/// Collect RFT data and output to pre-opened output stream.
|
||||
///
|
||||
/// RFT data is output for all affected wells at a given timestep,
|
||||
/// and consists of
|
||||
///
|
||||
/// 1) Time stamp (elapsed and date)
|
||||
/// 2) Metadata about the output (units of measure, well types,
|
||||
/// data type identifier)
|
||||
/// 3) Depth, pressure, Sw, Sg, (I,J,K), and hostgrid for each
|
||||
/// reservoir connection of the affected well.
|
||||
///
|
||||
/// If no RFT output is requested at given timestep, then this
|
||||
/// function returns with no output written to the RFT file.
|
||||
///
|
||||
/// \param[in] reportStep Report step time point for which to output
|
||||
/// RFT data.
|
||||
///
|
||||
/// \param[in] elapsed Number of seconds of simulated time until
|
||||
/// this report step (\p reportStep).
|
||||
///
|
||||
/// \param[in] usys Unit system conventions for output. Typically
|
||||
/// corresponds to run's active unit system (i.e., \code
|
||||
/// EclipseState::getUnits() \endcode).
|
||||
///
|
||||
/// \param[in] grid Run's active grid. Used to determine which
|
||||
/// reservoir connections are in active grid cells.
|
||||
///
|
||||
/// \param[in] schedule Run's SCHEDULE section from which to access
|
||||
/// the active wells and the RFT configuration.
|
||||
///
|
||||
/// \param[in,out] rftFile RFT output stream. On input, appropriately
|
||||
/// positioned for new content (i.e., at end-of-file). On output,
|
||||
/// containing new RFT output (if applicable) and positioned after
|
||||
/// new contents.
|
||||
void write(const int reportStep,
|
||||
const double elapsed,
|
||||
const ::Opm::UnitSystem& usys,
|
||||
const ::Opm::EclipseGrid& grid,
|
||||
const ::Opm::Schedule& schedule,
|
||||
const ::Opm::data::WellRates& wellSol,
|
||||
::Opm::EclIO::OutputStream::RFT& rftFile);
|
||||
|
||||
}} // namespace Opm::RftIO
|
||||
|
||||
#endif // OPM_WRITE_RFT_HPP
|
||||
@@ -36,6 +36,7 @@ namespace Opm {
|
||||
class Schedule;
|
||||
class Well;
|
||||
class UnitSystem;
|
||||
class UDQActive;
|
||||
|
||||
} // Opm
|
||||
|
||||
@@ -63,6 +64,11 @@ namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
std::vector<bool>
|
||||
createLogiHead(const EclipseState& es);
|
||||
|
||||
std::vector<int>
|
||||
createUdqDims(const Schedule& sched,
|
||||
const std::size_t lookup_step,
|
||||
const std::vector<int>& inteHead);
|
||||
|
||||
|
||||
}}} // Opm::RestartIO::Helpers
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -124,10 +124,6 @@ namespace Opm {
|
||||
using iterator = std::vector< DeckKeyword >::iterator;
|
||||
|
||||
Deck();
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
Deck( std::initializer_list< DeckKeyword > );
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
Deck( std::initializer_list< std::string > );
|
||||
|
||||
Deck( const Deck& );
|
||||
|
||||
|
||||
@@ -35,12 +35,10 @@ namespace Opm {
|
||||
class DeckItem {
|
||||
public:
|
||||
DeckItem() = default;
|
||||
explicit DeckItem( const std::string& );
|
||||
|
||||
DeckItem( const std::string&, int, size_t size_hint = 8 );
|
||||
DeckItem( const std::string&, double, size_t size_hint = 8 );
|
||||
DeckItem( const std::string&, std::string, size_t size_hint = 8 );
|
||||
DeckItem( const std::string&, UDAValue, size_t size_hint = 8 );
|
||||
DeckItem( const std::string&, int);
|
||||
DeckItem( const std::string&, double);
|
||||
DeckItem( const std::string&, std::string);
|
||||
DeckItem( const std::string&, UDAValue);
|
||||
|
||||
const std::string& name() const;
|
||||
|
||||
@@ -61,7 +59,7 @@ namespace Opm {
|
||||
size_t out_size() const;
|
||||
|
||||
//template< typename T > T& get( size_t ) ;
|
||||
template< typename T > const T& get( size_t ) const;
|
||||
template< typename T > T get( size_t ) const;
|
||||
double getSIDouble( size_t ) const;
|
||||
std::string getTrimmedString( size_t ) const;
|
||||
|
||||
@@ -123,8 +121,12 @@ namespace Opm {
|
||||
std::string item_name;
|
||||
std::vector< bool > defaulted;
|
||||
std::vector< Dimension > dimensions;
|
||||
mutable std::vector< double > SIdata;
|
||||
|
||||
/*
|
||||
To save space we mutate the dval object in place when asking for SI
|
||||
data; the current state of of the dval member is tracked with the
|
||||
raw_data bool member.
|
||||
*/
|
||||
mutable bool raw_data = true;
|
||||
template< typename T > std::vector< T >& value_ref();
|
||||
template< typename T > const std::vector< T >& value_ref() const;
|
||||
template< typename T > void push( T );
|
||||
|
||||
@@ -23,25 +23,36 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <opm/parser/eclipse/Parser/ParserKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckValue.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
|
||||
namespace Opm {
|
||||
class ParserKeyword;
|
||||
class DeckOutput;
|
||||
class ParserKeyword;
|
||||
|
||||
class DeckKeyword {
|
||||
public:
|
||||
typedef std::vector< DeckRecord >::const_iterator const_iterator;
|
||||
|
||||
explicit DeckKeyword(const std::string& keywordName);
|
||||
DeckKeyword(const std::string& keywordName, bool knownKeyword);
|
||||
explicit DeckKeyword(const ParserKeyword& parserKeyword);
|
||||
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::string& keywordName);
|
||||
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<std::vector<DeckValue>>& record_list);
|
||||
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<int>& data);
|
||||
DeckKeyword(const ParserKeyword& parserKeyword, const std::vector<double>& data);
|
||||
|
||||
const std::string& name() const;
|
||||
void setFixedSize();
|
||||
void setLocation(const std::string& fileName, int lineNumber);
|
||||
void setLocation(const std::pair<const std::string&, std::size_t>& location);
|
||||
const std::string& getFileName() const;
|
||||
int getLineNumber() const;
|
||||
std::pair<std::string, std::size_t> location() const;
|
||||
|
||||
|
||||
size_t size() const;
|
||||
void addRecord(DeckRecord&& record);
|
||||
@@ -49,13 +60,13 @@ namespace Opm {
|
||||
DeckRecord& getRecord(size_t index);
|
||||
const DeckRecord& getDataRecord() const;
|
||||
void setDataKeyword(bool isDataKeyword = true);
|
||||
bool isKnown() const;
|
||||
bool isDataKeyword() const;
|
||||
|
||||
const std::vector<int>& getIntData() const;
|
||||
const std::vector<double>& getRawDoubleData() const;
|
||||
const std::vector<double>& getSIDoubleData() const;
|
||||
const std::vector<std::string>& getStringData() const;
|
||||
const ParserKeyword& parserKeyword() const;
|
||||
size_t getDataSize() const;
|
||||
void write( DeckOutput& output ) const;
|
||||
void write_data( DeckOutput& output ) const;
|
||||
@@ -83,9 +94,9 @@ namespace Opm {
|
||||
int m_lineNumber;
|
||||
|
||||
std::vector< DeckRecord > m_recordList;
|
||||
bool m_knownKeyword;
|
||||
bool m_isDataKeyword;
|
||||
bool m_slashTerminated;
|
||||
ParserKeyword parser_keyword;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
58
opm/parser/eclipse/Deck/DeckValue.hpp
Normal file
58
opm/parser/eclipse/Deck/DeckValue.hpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DECK_VALUE_HPP
|
||||
#define DECK_VALUE_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <opm/parser/eclipse/Utility/Typetools.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class DeckValue {
|
||||
|
||||
public:
|
||||
DeckValue();
|
||||
explicit DeckValue(int);
|
||||
explicit DeckValue(double);
|
||||
explicit DeckValue(const std::string&);
|
||||
|
||||
bool is_default() const;
|
||||
|
||||
template<typename T>
|
||||
T get() const;
|
||||
|
||||
template<typename T>
|
||||
bool is_compatible() const;
|
||||
|
||||
private:
|
||||
|
||||
bool default_value;
|
||||
type_tag value_enum;
|
||||
int int_value;
|
||||
double double_value;
|
||||
std::string string_value;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <iosfwd>
|
||||
|
||||
#include <opm/parser/eclipse/Units/Dimension.hpp>
|
||||
|
||||
@@ -40,6 +41,11 @@ public:
|
||||
template<typename T>
|
||||
bool is() const;
|
||||
|
||||
void reset(double value);
|
||||
void reset(const std::string& value);
|
||||
|
||||
void assert_numeric() const;
|
||||
void assert_numeric(const std::string& error_msg) const;
|
||||
void set_dim(const Dimension& dim) const;
|
||||
const Dimension& get_dim() const;
|
||||
|
||||
@@ -54,6 +60,8 @@ private:
|
||||
const-ness of the data in a deck item. */
|
||||
mutable Dimension dim;
|
||||
};
|
||||
|
||||
std::ostream& operator<<( std::ostream& stream, const UDAValue& uda_value );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,8 @@ namespace Opm {
|
||||
const EclipseGrid& eclipseGrid);
|
||||
|
||||
void scanSection(const Section& section,
|
||||
const EclipseGrid& eclipseGrid);
|
||||
const EclipseGrid& eclipseGrid,
|
||||
bool edit_section);
|
||||
|
||||
void handleADDKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
|
||||
void handleBOXKeyword( const DeckKeyword& deckKeyword, BoxManager& boxManager);
|
||||
@@ -96,7 +97,10 @@ namespace Opm {
|
||||
void handleOPERATERKeyword( const DeckKeyword& deckKeyword);
|
||||
|
||||
void loadGridPropertyFromDeckKeyword(const Box& inputBox,
|
||||
const DeckKeyword& deckKeyword);
|
||||
const DeckKeyword& deckKeyword,
|
||||
bool edity_section);
|
||||
|
||||
void adjustSOGCRwithSWL();
|
||||
|
||||
std::string m_defaultRegion;
|
||||
UnitSystem m_deckUnitSystem;
|
||||
|
||||
@@ -25,23 +25,24 @@
|
||||
#include <cstddef>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class EclipseGrid;
|
||||
class Box {
|
||||
public:
|
||||
Box() = default;
|
||||
Box(int nx , int ny , int nz);
|
||||
Box(const Box& globalBox , int i1 , int i2 , int j1 , int j2 , int k1 , int k2); // Zero offset coordinates.
|
||||
Box(int nx, int ny, int nz, int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
|
||||
|
||||
struct index_pair {
|
||||
std::size_t global;
|
||||
std::size_t active;
|
||||
};
|
||||
|
||||
Box(const EclipseGrid& grid);
|
||||
Box(const EclipseGrid& grid , int i1 , int i2 , int j1 , int j2 , int k1 , int k2);
|
||||
size_t size() const;
|
||||
bool isGlobal() const;
|
||||
size_t getDim(size_t idim) const;
|
||||
const std::vector<index_pair>& index_list() const;
|
||||
const std::vector<size_t>& getIndexList() const;
|
||||
bool equal(const Box& other) const;
|
||||
|
||||
explicit operator bool() const;
|
||||
std::vector<size_t>::const_iterator begin() const;
|
||||
std::vector<size_t>::const_iterator end() const;
|
||||
|
||||
|
||||
int I1() const;
|
||||
int I2() const;
|
||||
@@ -52,12 +53,14 @@ namespace Opm {
|
||||
|
||||
private:
|
||||
void initIndexList();
|
||||
const EclipseGrid& grid;
|
||||
size_t m_dims[3] = { 0, 0, 0 };
|
||||
size_t m_offset[3];
|
||||
size_t m_stride[3];
|
||||
|
||||
bool m_isGlobal;
|
||||
std::vector<size_t> m_indexList;
|
||||
std::vector<size_t> global_index_list;
|
||||
std::vector<index_pair> m_index_list;
|
||||
|
||||
int lower(int dim) const;
|
||||
int upper(int dim) const;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/Box.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
|
||||
/*
|
||||
This class implements a simple book keeping system for the current
|
||||
@@ -53,7 +54,7 @@ namespace Opm {
|
||||
|
||||
class BoxManager {
|
||||
public:
|
||||
BoxManager(int nx , int ny , int nz);
|
||||
BoxManager(const EclipseGrid& grid);
|
||||
|
||||
void setInputBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
|
||||
void setKeywordBox( int i1,int i2 , int j1 , int j2 , int k1 , int k2);
|
||||
@@ -63,14 +64,12 @@ namespace Opm {
|
||||
void endKeyword();
|
||||
|
||||
const Box& getActiveBox() const;
|
||||
const Box& getGlobalBox() const;
|
||||
const Box& getInputBox() const;
|
||||
const Box& getKeywordBox() const;
|
||||
|
||||
private:
|
||||
Box m_globalBox;
|
||||
Box m_inputBox;
|
||||
Box m_keywordBox;
|
||||
const EclipseGrid& grid;
|
||||
std::unique_ptr<Box> m_globalBox;
|
||||
std::unique_ptr<Box> m_inputBox;
|
||||
std::unique_ptr<Box> m_keywordBox;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
|
||||
|
||||
#include <ert/ecl/ecl_grid.h>
|
||||
#include <ert/util/ert_unique_ptr.hpp>
|
||||
#include <opm/io/eclipse/EclFile.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
@@ -59,9 +59,9 @@ namespace Opm {
|
||||
These constructors will make a copy of the src grid, with
|
||||
zcorn and or actnum have been adjustments.
|
||||
*/
|
||||
EclipseGrid(const EclipseGrid& src, const double* zcorn , const std::vector<int>& actnum);
|
||||
EclipseGrid(const EclipseGrid& src, const std::vector<double>& zcorn , const std::vector<int>& actnum);
|
||||
EclipseGrid(const EclipseGrid& src) = default;
|
||||
EclipseGrid(const EclipseGrid& src, const std::vector<int>& actnum);
|
||||
EclipseGrid(const EclipseGrid& src, const double* zcorn, const std::vector<int>& actnum);
|
||||
|
||||
EclipseGrid(size_t nx, size_t ny, size_t nz,
|
||||
double dx = 1.0, double dy = 1.0, double dz = 1.0);
|
||||
@@ -77,7 +77,6 @@ namespace Opm {
|
||||
/// explicitly. If a null pointer is passed, every cell is active.
|
||||
EclipseGrid(const Deck& deck, const int * actnum = nullptr);
|
||||
|
||||
|
||||
static bool hasGDFILE(const Deck& deck);
|
||||
static bool hasCylindricalKeywords(const Deck& deck);
|
||||
static bool hasCornerPointKeywords(const Deck&);
|
||||
@@ -88,8 +87,7 @@ namespace Opm {
|
||||
size_t activeIndex(size_t i, size_t j, size_t k) const;
|
||||
size_t activeIndex(size_t globalIndex) const;
|
||||
|
||||
void save(const std::string& filename, UnitSystem::UnitType output_units) const;
|
||||
void addNNC(const NNC& nnc);
|
||||
void save(const std::string& filename, bool formatted, const Opm::NNC& nnc, const Opm::UnitSystem& units) const;
|
||||
/*
|
||||
Observe that the there is a getGlobalIndex(i,j,k)
|
||||
implementation in the base class. This method - translating
|
||||
@@ -105,6 +103,7 @@ namespace Opm {
|
||||
applied in the 'THETA' direction; this will only apply if
|
||||
the theta keywords entered sum up to exactly 360 degrees!
|
||||
*/
|
||||
|
||||
bool circle( ) const;
|
||||
bool isPinchActive( ) const;
|
||||
double getPinchThresholdThickness( ) const;
|
||||
@@ -114,7 +113,6 @@ namespace Opm {
|
||||
MinpvMode::ModeEnum getMinpvMode() const;
|
||||
const std::vector<double>& getMinpvVector( ) const;
|
||||
|
||||
|
||||
/*
|
||||
Will return a vector of nactive elements. The method will
|
||||
behave differently depending on the lenght of the
|
||||
@@ -127,6 +125,7 @@ namespace Opm {
|
||||
|
||||
??? : Exception.
|
||||
*/
|
||||
|
||||
template<typename T>
|
||||
std::vector<T> compressedVector(const std::vector<T>& input_vector) const {
|
||||
if( input_vector.size() == this->getNumActive() ) {
|
||||
@@ -151,13 +150,13 @@ namespace Opm {
|
||||
/// Will return a vector a length num_active; where the value
|
||||
/// of each element is the corresponding global index.
|
||||
const std::vector<int>& getActiveMap() const;
|
||||
std::array<double, 3> getCellCenter(size_t i,size_t j, size_t k) const;
|
||||
std::array<double, 3> getCellCenter(size_t globalIndex) const;
|
||||
const std::array<double, 3>& getCellCenter(size_t i,size_t j, size_t k) const;
|
||||
const std::array<double, 3>& getCellCenter(size_t globalIndex) const;
|
||||
std::array<double, 3> getCornerPos(size_t i,size_t j, size_t k, size_t corner_index) const;
|
||||
double getCellVolume(size_t globalIndex) const;
|
||||
double getCellVolume(size_t i , size_t j , size_t k) const;
|
||||
double getCellThicknes(size_t globalIndex) const;
|
||||
double getCellThicknes(size_t i , size_t j , size_t k) const;
|
||||
double getCellThickness(size_t globalIndex) const;
|
||||
double getCellThickness(size_t i , size_t j , size_t k) const;
|
||||
std::array<double, 3> getCellDims(size_t i,size_t j, size_t k) const;
|
||||
std::array<double, 3> getCellDims(size_t globalIndex) const;
|
||||
bool cellActive( size_t globalIndex ) const;
|
||||
@@ -166,19 +165,28 @@ namespace Opm {
|
||||
double getCellDepth(size_t globalIndex) const;
|
||||
ZcornMapper zcornMapper() const;
|
||||
|
||||
const std::vector<double>& getCOORD() const;
|
||||
const std::vector<double>& getZCORN() const;
|
||||
const std::vector<int>& getACTNUM( ) const;
|
||||
const std::vector<double>& getMAPAXES() const;
|
||||
const std::string& getMAPUNITS() const { return m_mapunits; } ;
|
||||
|
||||
/*
|
||||
The exportZCORN method will adjust the z coordinates to ensure that cells do not
|
||||
overlap. The return value is the number of points which have been adjusted.
|
||||
The fixupZCORN method is run as part of constructiong the grid. This will adjust the
|
||||
z-coordinates to ensure that cells do not overlap. The return value is the number of
|
||||
points which have been adjusted. The number of zcorn nodes that has ben fixed is
|
||||
stored in private member zcorn_fixed.
|
||||
*/
|
||||
size_t exportZCORN( std::vector<double>& zcorn) const;
|
||||
|
||||
size_t fixupZCORN();
|
||||
size_t getZcornFixed() { return zcorn_fixed; };
|
||||
|
||||
// resetACTNUM with no arguments will make all cells in the grid active.
|
||||
|
||||
void resetACTNUM();
|
||||
void resetACTNUM( const std::vector<int>& actnum);
|
||||
|
||||
void exportMAPAXES( std::vector<double>& mapaxes) const;
|
||||
void exportCOORD( std::vector<double>& coord) const;
|
||||
void exportACTNUM( std::vector<int>& actnum) const;
|
||||
void resetACTNUM( const int * actnum);
|
||||
bool equal(const EclipseGrid& other) const;
|
||||
const ecl_grid_type * c_ptr() const;
|
||||
|
||||
private:
|
||||
std::vector<double> m_minpvVector;
|
||||
@@ -186,25 +194,35 @@ namespace Opm {
|
||||
Value<double> m_pinch;
|
||||
PinchMode::ModeEnum m_pinchoutMode;
|
||||
PinchMode::ModeEnum m_multzMode;
|
||||
mutable std::vector<double> volume_cache;
|
||||
|
||||
mutable std::vector< int > activeMap;
|
||||
bool m_circle = false;
|
||||
/*
|
||||
The internal class grid_ptr is a a std::unique_ptr with
|
||||
special copy semantics. The purpose of implementing this is
|
||||
that the EclipseGrid class can now use the default
|
||||
implementation for the copy and move constructors.
|
||||
*/
|
||||
using ert_ptr = ERT::ert_unique_ptr<ecl_grid_type , ecl_grid_free>;
|
||||
class grid_ptr : public ert_ptr {
|
||||
public:
|
||||
using ert_ptr::unique_ptr;
|
||||
grid_ptr() = default;
|
||||
grid_ptr(grid_ptr&&) = default;
|
||||
grid_ptr(const grid_ptr& src) :
|
||||
ert_ptr( ecl_grid_alloc_copy( src.get() ) ) {}
|
||||
};
|
||||
grid_ptr m_grid;
|
||||
|
||||
size_t zcorn_fixed = 0;
|
||||
bool m_useActnumFromGdfile = false;
|
||||
|
||||
// Input grid data.
|
||||
std::vector<double> m_zcorn;
|
||||
std::vector<double> m_coord;
|
||||
std::vector<double> m_mapaxes;
|
||||
std::vector<int> m_actnum;
|
||||
std::string m_mapunits;
|
||||
|
||||
// Mapping to/from active cells.
|
||||
int m_nactive;
|
||||
std::vector<int> m_active_to_global;
|
||||
std::vector<int> m_global_to_active;
|
||||
|
||||
// Geometry data.
|
||||
std::vector<double> m_volume;
|
||||
std::vector<double> m_depth;
|
||||
std::vector<double> m_dx;
|
||||
std::vector<double> m_dy;
|
||||
std::vector<double> m_dz;
|
||||
std::vector<std::array<double, 3>> m_cellCenter;
|
||||
|
||||
void initGridFromEGridFile(Opm::EclIO::EclFile& egridfile, std::string fileName);
|
||||
|
||||
void initBinaryGrid(const Deck& deck);
|
||||
|
||||
void initCornerPointGrid(const std::array<int,3>& dims ,
|
||||
@@ -213,6 +231,8 @@ namespace Opm {
|
||||
const int * actnum,
|
||||
const double * mapaxes);
|
||||
|
||||
bool keywInputBeforeGdfile(const Deck& deck, const std::string keyword) const;
|
||||
|
||||
void initCylindricalGrid( const std::array<int, 3>&, const Deck&);
|
||||
void initCartesianGrid( const std::array<int, 3>&, const Deck&);
|
||||
void initCornerPointGrid( const std::array<int, 3>&, const Deck&);
|
||||
@@ -229,6 +249,20 @@ namespace Opm {
|
||||
static std::vector<double> createDVector(const std::array<int, 3>& dims, size_t dim, const std::string& DKey,
|
||||
const std::string& DVKey, const Deck&);
|
||||
static void scatterDim(const std::array<int, 3>& dims , size_t dim , const std::vector<double>& DV , std::vector<double>& D);
|
||||
|
||||
|
||||
std::vector<double> makeCoordDxDyDzTops(const std::array<int, 3>& dims, const std::vector<double>& dx, const std::vector<double>& dy, const std::vector<double>& dz, const std::vector<double>& tops) const;
|
||||
std::vector<double> makeZcornDzTops(const std::array<int, 3>& dims, const std::vector<double>& dz, const std::vector<double>& tops) const ;
|
||||
std::vector<double> makeZcornDzvDepthz(const std::array<int, 3>& dims, const std::vector<double>& dzv, const std::vector<double>& depthz) const;
|
||||
std::vector<double> makeCoordDxvDyvDzvDepthz(const std::array<int, 3>& dims, const std::vector<double>& dxv, const std::vector<double>& dyv, const std::vector<double>& dzv, const std::vector<double>& depthz) const;
|
||||
|
||||
double sumIdir(int j, int k, int i1, const std::array<int, 3>& dims, const std::vector<double>& dx) const;
|
||||
double sumJdir(int i, int k, int j1, const std::array<int, 3>& dims, const std::vector<double>& dy) const;
|
||||
double sumKdir(int i, int j, const std::array<int, 3>& dims, const std::vector<double>& dz) const;
|
||||
|
||||
void calculateGeometryData();
|
||||
|
||||
void getCellCorners(const std::array<int, 3>& ijk, const std::array<int, 3>& dims, std::array<double,8>& X, std::array<double,8>& Y, std::array<double,8>& Z) const;
|
||||
};
|
||||
|
||||
class CoordMapper {
|
||||
|
||||
@@ -54,9 +54,6 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
void setKeywordBox( const DeckRecord& deckRecord,
|
||||
BoxManager& boxManager);
|
||||
|
||||
class Eclipse3DProperties;
|
||||
|
||||
template <typename T>
|
||||
@@ -181,7 +178,7 @@ namespace Opm {
|
||||
/// this method exists for (friend) Eclipse3DProperties to be allowed initializing PORV and ACTNUM keyword
|
||||
void postAddKeyword(const std::string& name,
|
||||
const T defaultValue,
|
||||
std::function< void( std::vector< T >& ) > postProcessor,
|
||||
std::function< void( const std::vector<bool>& defaulted, std::vector< T >& ) > postProcessor,
|
||||
const std::string& dimString,
|
||||
const bool defaultInitializable );
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
/*
|
||||
@@ -45,7 +46,18 @@ class GridPropertySupportedKeywordInfo {
|
||||
GridPropertySupportedKeywordInfo() = default;
|
||||
|
||||
using init = std::function< std::vector< T >( size_t ) >;
|
||||
using post = std::function< void( std::vector< T >& ) >;
|
||||
|
||||
/**
|
||||
* Property post-processor function type.
|
||||
*
|
||||
* Defaulted flag (one element for each Cartesian cell/data element)
|
||||
* identifies whether the property value was defaulted in that cell
|
||||
* (true) or assigned through a deck mechanism (false).
|
||||
*/
|
||||
using post = std::function<
|
||||
void(const std::vector<bool>& defaulted,
|
||||
std::vector< T >&)
|
||||
>;
|
||||
|
||||
GridPropertySupportedKeywordInfo(
|
||||
const std::string& name,
|
||||
@@ -82,6 +94,37 @@ class GridPropertySupportedKeywordInfo {
|
||||
const post& postProcessor() const;
|
||||
bool isDefaultInitializable() const;
|
||||
|
||||
/**
|
||||
* Replace post-processor after object is created.
|
||||
*
|
||||
* XXX: This is essentially a hack, but it enables using
|
||||
* post-processors that can't be created at construction time.
|
||||
*
|
||||
* One example of this use case is the post-processor for SOGCR in
|
||||
* a run using Family I (SWOF/SGOF) saturation function tables.
|
||||
* The SGOF table is implicitly defined in terms of the connate
|
||||
* water saturation, and the critical oil-in-gas saturation
|
||||
* post-processor needs to take this fact into account. That, in
|
||||
* turn, means that the post-processor must have a way of
|
||||
* accessing SWL data (defaulted or assigned) which means that the
|
||||
* post-processor needs to be aware of the collection of grid
|
||||
* properties, not just a single property in isolation.
|
||||
*
|
||||
* In our current system, the GridPropertySupportedKeywordInfo
|
||||
* objects are constructor arguments to that collection and so
|
||||
* have no way of referring to the collection itself. This method
|
||||
* provides a mechanism for creating the post-processor once the
|
||||
* collection is formed.
|
||||
*
|
||||
* \param[in] processor New post-processor function. Replaces
|
||||
* existing post-processor, typically created at construction
|
||||
* time.
|
||||
*/
|
||||
void setPostProcessor(post processor)
|
||||
{
|
||||
this->m_postProcessor = std::move(processor);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
std::string m_keywordName;
|
||||
@@ -110,6 +153,7 @@ public:
|
||||
void iset(size_t i , size_t j , size_t k , T value);
|
||||
|
||||
|
||||
const std::vector<bool>& wasDefaulted() const;
|
||||
const std::vector<T>& getData() const;
|
||||
std::vector<T>& getData();
|
||||
|
||||
@@ -131,8 +175,8 @@ public:
|
||||
DeckKeyword equals nx*ny*nz.
|
||||
*/
|
||||
|
||||
void loadFromDeckKeyword( const DeckKeyword& );
|
||||
void loadFromDeckKeyword( const Box&, const DeckKeyword& );
|
||||
void loadFromDeckKeyword( const DeckKeyword& , bool);
|
||||
void loadFromDeckKeyword( const Box&, const DeckKeyword& , bool);
|
||||
|
||||
void copyFrom( const GridProperty< T >&, const Box& );
|
||||
void scale( T scaleFactor, const Box& );
|
||||
@@ -265,10 +309,15 @@ public:
|
||||
private:
|
||||
const DeckItem& getDeckItem( const DeckKeyword& );
|
||||
void setDataPoint(size_t sourceIdx, size_t targetIdx, const DeckItem& deckItem);
|
||||
void mulDataPoint(size_t sourceIdx, size_t targetIdx, const DeckItem& deckItem);
|
||||
void setElement(const typename std::vector<T>::size_type i,
|
||||
const T value,
|
||||
const bool defaulted = false);
|
||||
|
||||
size_t m_nx, m_ny, m_nz;
|
||||
SupportedKeywordInfo m_kwInfo;
|
||||
std::vector<T> m_data;
|
||||
std::vector<bool> m_defaulted;
|
||||
bool m_hasRunPostProcessor = false;
|
||||
bool assigned = false;
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef OPM_IO_CONFIG_HPP
|
||||
#define OPM_IO_CONFIG_HPP
|
||||
|
||||
#include <boost/date_time/gregorian/gregorian_types.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
#ifndef OPM_EQUIL_HPP
|
||||
#define OPM_EQUIL_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class DeckKeyword;
|
||||
class DeckRecord;
|
||||
|
||||
class EquilRecord {
|
||||
public:
|
||||
explicit EquilRecord( const DeckRecord& );
|
||||
|
||||
double datumDepth() const;
|
||||
double datumDepthPressure() const;
|
||||
double waterOilContactDepth() const;
|
||||
@@ -23,7 +19,9 @@ namespace Opm {
|
||||
bool wetGasInitConstantRv() const;
|
||||
int initializationTargetAccuracy() const;
|
||||
|
||||
EquilRecord( double datum_depth_arg, double datum_depth_pc_arg, double woc_depth, double woc_pc, double goc_depth, double goc_pc, bool live_oil_init, bool wet_gas_init, int target_accuracy);
|
||||
private:
|
||||
|
||||
double datum_depth;
|
||||
double datum_depth_ps;
|
||||
double water_oil_contact_depth;
|
||||
|
||||
76
opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp
Normal file
76
opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
Copyright 2019 SINTEF Digital, Mathematics and Cybernetics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_FOAMCONFIG_HPP
|
||||
#define OPM_FOAMCONFIG_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
class Deck;
|
||||
class DeckRecord;
|
||||
|
||||
/// Foam behaviour data for a single SATNUM region.
|
||||
class FoamData
|
||||
{
|
||||
public:
|
||||
FoamData(const DeckRecord& FOAMFSC_record, const DeckRecord& FOAMROCK_record);
|
||||
explicit FoamData(const DeckRecord& FOAMROCK_record);
|
||||
|
||||
double referenceSurfactantConcentration() const;
|
||||
double exponent() const;
|
||||
double minimumSurfactantConcentration() const;
|
||||
|
||||
bool allowDesorption() const;
|
||||
double rockDensity() const;
|
||||
|
||||
private:
|
||||
double reference_surfactant_concentration_;
|
||||
double exponent_;
|
||||
double minimum_surfactant_concentration_;
|
||||
bool allow_desorption_;
|
||||
double rock_density_;
|
||||
};
|
||||
|
||||
/// Foam behaviour data for all SATNUM regions.
|
||||
class FoamConfig
|
||||
{
|
||||
public:
|
||||
FoamConfig() = default;
|
||||
explicit FoamConfig(const Deck&);
|
||||
|
||||
const FoamData& getRecord(std::size_t index) const;
|
||||
|
||||
std::size_t size() const;
|
||||
bool empty() const;
|
||||
|
||||
using const_iterator = std::vector<FoamData>::const_iterator;
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
|
||||
private:
|
||||
std::vector<FoamData> data_;
|
||||
};
|
||||
|
||||
} // end namespace Opm
|
||||
|
||||
#endif // OPM_FOAMCONFIG_HPP
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -41,12 +42,22 @@ namespace Opm {
|
||||
bool hasEquil() const;
|
||||
const Equil& getEquil() const;
|
||||
|
||||
bool hasFoamConfig() const;
|
||||
const FoamConfig& getFoamConfig() const;
|
||||
|
||||
bool filleps() const
|
||||
{
|
||||
return this->m_filleps;
|
||||
}
|
||||
|
||||
private:
|
||||
Equil equil;
|
||||
FoamConfig foamconfig;
|
||||
bool m_filleps;
|
||||
|
||||
bool m_restartRequested = false;
|
||||
int m_restartStep = 0;
|
||||
std::string m_restartRootName;
|
||||
|
||||
Equil equil;
|
||||
};
|
||||
|
||||
} //namespace Opm
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EndpointScaling.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp>
|
||||
|
||||
namespace Opm {
|
||||
class Deck;
|
||||
@@ -37,9 +38,13 @@ enum class Phase {
|
||||
SOLVENT = 3,
|
||||
POLYMER = 4,
|
||||
ENERGY = 5,
|
||||
POLYMW = 6
|
||||
POLYMW = 6,
|
||||
FOAM = 7
|
||||
// If you add more entries to this enum, remember to update NUM_PHASES_IN_ENUM below.
|
||||
};
|
||||
|
||||
constexpr int NUM_PHASES_IN_ENUM = static_cast<int>(Phase::FOAM) + 1; // Used to get correct size of the bitset in class Phases.
|
||||
|
||||
Phase get_phase( const std::string& );
|
||||
std::ostream& operator<<( std::ostream&, const Phase& );
|
||||
|
||||
@@ -47,12 +52,12 @@ class Phases {
|
||||
public:
|
||||
Phases() noexcept = default;
|
||||
Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false,
|
||||
bool polymw = false ) noexcept;
|
||||
bool polymw = false, bool foam = false ) noexcept;
|
||||
|
||||
bool active( Phase ) const noexcept;
|
||||
size_t size() const noexcept;
|
||||
private:
|
||||
std::bitset< 7 > bits;
|
||||
std::bitset< NUM_PHASES_IN_ENUM > bits;
|
||||
};
|
||||
|
||||
|
||||
@@ -167,6 +172,7 @@ public:
|
||||
const WellSegmentDims& wellSegmentDimensions() const noexcept;
|
||||
int eclPhaseMask( ) const noexcept;
|
||||
const EclHysterConfig& hysterPar() const noexcept;
|
||||
const Actdims& actdims() const noexcept;
|
||||
|
||||
private:
|
||||
Phases active_phases;
|
||||
@@ -176,6 +182,7 @@ private:
|
||||
WellSegmentDims wsegdims;
|
||||
UDQParams udq_params;
|
||||
EclHysterConfig hystpar;
|
||||
Actdims m_actdims;
|
||||
};
|
||||
|
||||
|
||||
|
||||
46
opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp
Normal file
46
opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ACTDIMS_HPP_
|
||||
#define ACTDIMS_HPP_
|
||||
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
namespace Opm {
|
||||
class Actdims {
|
||||
public:
|
||||
Actdims();
|
||||
explicit Actdims(const Deck& deck);
|
||||
|
||||
std::size_t max_keywords() const;
|
||||
std::size_t max_line_count() const;
|
||||
std::size_t max_characters() const;
|
||||
std::size_t max_conditions() const;
|
||||
|
||||
private:
|
||||
std::size_t keywords;
|
||||
std::size_t line_count;
|
||||
std::size_t characters;
|
||||
std::size_t conditions;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -25,26 +25,35 @@
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace Opm {
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
|
||||
|
||||
class ActionContext;
|
||||
namespace Opm {
|
||||
namespace Action {
|
||||
|
||||
class Context;
|
||||
class ASTNode;
|
||||
|
||||
|
||||
/*
|
||||
The Action::AST class implements a tree with the result of the parsing of the
|
||||
ACTIONX condition. The AST does not contain any context, that is supplied with
|
||||
a Action::Context instace when calling the eval() methoid is called.
|
||||
*/
|
||||
|
||||
class ActionAST{
|
||||
class AST{
|
||||
public:
|
||||
ActionAST() = default;
|
||||
explicit ActionAST(const std::vector<std::string>& tokens);
|
||||
bool eval(const ActionContext& context, std::vector<std::string>& matching_wells) const;
|
||||
AST() = default;
|
||||
explicit AST(const std::vector<std::string>& tokens);
|
||||
Result eval(const Context& context) const;
|
||||
private:
|
||||
/*
|
||||
The use of a pointer here is to be able to create this class with only a
|
||||
forward declaration of the ASTNode class. Would have prefered to use a
|
||||
unique_ptr, but that requires writing custom destructors - the use of a
|
||||
shared_ptr does not imply any shared ownership.
|
||||
shared_ptr does not imply any shared ownership of the ASTNode.
|
||||
*/
|
||||
std::shared_ptr<ASTNode> condition;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -27,13 +27,17 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
|
||||
namespace Opm {
|
||||
namespace Action {
|
||||
|
||||
class ActionContext {
|
||||
/*
|
||||
The Action::Context class is used as context when the ACTIONX condition is
|
||||
evaluated. The Action::Context class is mainly just a thin wrapper around the
|
||||
SummaryState class.
|
||||
*/
|
||||
|
||||
class Context {
|
||||
public:
|
||||
/*
|
||||
Observe that the ActionContext takes a copy of the SummaryState object.
|
||||
*/
|
||||
explicit ActionContext(const SummaryState& summary_state);
|
||||
explicit Context(const SummaryState& summary_state);
|
||||
|
||||
/*
|
||||
The get methods will first check the internal storage in the 'values' map
|
||||
@@ -48,8 +52,9 @@ public:
|
||||
std::vector<std::string> wells(const std::string& func) const;
|
||||
|
||||
private:
|
||||
SummaryState summary_state;
|
||||
const SummaryState& summary_state;
|
||||
std::map<std::string, double> values;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
110
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
Normal file
110
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
but eliminates the memory saving DynamicState is intended to enable. You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ACTION_RESULT_HPP
|
||||
#define ACTION_RESULT_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace Opm {
|
||||
namespace Action {
|
||||
|
||||
/*
|
||||
The Action::Result class is used to hold the boolean result of a ACTIONX
|
||||
condition like:
|
||||
|
||||
WWCT > 0.75
|
||||
|
||||
and also the final evaluation of an ACTIONX condition comes as a
|
||||
Action::Result instance.
|
||||
|
||||
|
||||
In addition to the overall truthness of the expression an Action::Result
|
||||
instance can optionally have a set of matching wells. For instance the
|
||||
the result of:
|
||||
|
||||
FWCT > 0.75
|
||||
|
||||
Will not contain any wells, whereas the result of:
|
||||
|
||||
WWCT > 0.75
|
||||
|
||||
will contain a set of all the wells matching the condition. The set of
|
||||
matching wells can be queries with the wells() method. When a result with
|
||||
wells and a result without wells are combined as:
|
||||
|
||||
WWCT > 0.50 AND FPR > 1000
|
||||
|
||||
The result will have all the wells corresponding to the first condition, when
|
||||
several results with wells are combined with logical operators AND and OR the
|
||||
set of matching wells are combined correspondingly. It is actually possible
|
||||
to have a result which evaluates to true and still have and zero matching
|
||||
wells - e.g.
|
||||
|
||||
WWCT > 1.25 OR FOPT > 1
|
||||
|
||||
If the condition evaluates to true the set of matching wells will be passed
|
||||
to the Schedule::applyAction() method, and will be used in place of '?' in
|
||||
keywords like WELOPEN.
|
||||
*/
|
||||
|
||||
|
||||
class WellSet {
|
||||
public:
|
||||
WellSet() = default;
|
||||
explicit WellSet(const std::vector<std::string>& wells);
|
||||
void add(const std::string& well);
|
||||
|
||||
std::size_t size() const;
|
||||
std::vector<std::string> wells() const;
|
||||
bool contains(const std::string& well) const;
|
||||
|
||||
WellSet& intersect(const WellSet& other);
|
||||
WellSet& add(const WellSet& other);
|
||||
private:
|
||||
std::unordered_set<std::string> well_set;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class Result {
|
||||
public:
|
||||
explicit Result(bool result_arg);
|
||||
Result(bool result_arg, const std::vector<std::string>& wells);
|
||||
Result(bool result_arg, const WellSet& wells);
|
||||
|
||||
explicit operator bool() const;
|
||||
std::vector<std::string> wells() const;
|
||||
|
||||
void add_well(const std::string& well);
|
||||
|
||||
Result& operator|=(const Result& other);
|
||||
Result& operator&=(const Result& other);
|
||||
private:
|
||||
void assign(bool value);
|
||||
bool result;
|
||||
std::unique_ptr<WellSet> matching_wells;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -27,8 +27,16 @@
|
||||
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/Condition.hpp>
|
||||
|
||||
|
||||
|
||||
namespace Opm {
|
||||
class DeckKeyword;
|
||||
|
||||
namespace Action {
|
||||
|
||||
/*
|
||||
The ActionX class internalizes the ACTIONX keyword. This keyword represents a
|
||||
small in-deck programming language for the SCHEDULE section. In the deck the
|
||||
@@ -53,9 +61,6 @@ namespace Opm {
|
||||
|
||||
*/
|
||||
|
||||
class DeckKeyword;
|
||||
class ActionContext;
|
||||
|
||||
class ActionX {
|
||||
public:
|
||||
ActionX(const std::string& name, size_t max_run, double max_wait, std::time_t start_time);
|
||||
@@ -64,7 +69,7 @@ public:
|
||||
|
||||
void addKeyword(const DeckKeyword& kw);
|
||||
bool ready(std::time_t sim_time) const;
|
||||
bool eval(std::time_t sim_time, const ActionContext& context, std::vector<std::string>& wells) const;
|
||||
Action::Result eval(std::time_t sim_time, const Action::Context& context) const;
|
||||
|
||||
|
||||
std::string name() const { return this->m_name; }
|
||||
@@ -74,6 +79,13 @@ public:
|
||||
std::vector<DeckKeyword>::const_iterator begin() const;
|
||||
std::vector<DeckKeyword>::const_iterator end() const;
|
||||
static bool valid_keyword(const std::string& keyword);
|
||||
|
||||
/*
|
||||
The conditions() and keyword_strings() methods, and their underlying data
|
||||
members are only present to support writing formatted restart files.
|
||||
*/
|
||||
const std::vector<Condition>& conditions() const;
|
||||
std::vector<std::string> keyword_strings() const;
|
||||
private:
|
||||
std::string m_name;
|
||||
size_t m_max_run = 0;
|
||||
@@ -81,10 +93,12 @@ private:
|
||||
std::time_t m_start_time;
|
||||
|
||||
std::vector<DeckKeyword> keywords;
|
||||
ActionAST condition;
|
||||
Action::AST condition;
|
||||
std::vector<Condition> m_conditions;
|
||||
mutable size_t run_count = 0;
|
||||
mutable std::time_t last_run = 0;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
#endif /* WELL_HPP_ */
|
||||
|
||||
@@ -23,11 +23,17 @@
|
||||
|
||||
#include <string>
|
||||
#include <ctime>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp>
|
||||
|
||||
namespace Opm {
|
||||
namespace Action {
|
||||
|
||||
/*
|
||||
The Actions class is a container of ACTIONX keywords. The main functionality
|
||||
is to provide a list of ACTIONX keywords which are ready to be evaluated.
|
||||
*/
|
||||
|
||||
class Actions {
|
||||
public:
|
||||
@@ -36,10 +42,15 @@ public:
|
||||
bool empty() const;
|
||||
void add(const ActionX& action);
|
||||
bool ready(std::time_t sim_time) const;
|
||||
ActionX& at(const std::string& name);
|
||||
const ActionX& get(const std::string& name) const;
|
||||
const ActionX& get(std::size_t index) const;
|
||||
std::vector<const ActionX *> pending(std::time_t sim_time) const;
|
||||
|
||||
std::vector<ActionX>::const_iterator begin() const;
|
||||
std::vector<ActionX>::const_iterator end() const;
|
||||
private:
|
||||
std::map<std::string, ActionX> actions;
|
||||
std::vector<ActionX> actions;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -17,34 +17,63 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef UDQWELLSET_HPP
|
||||
#define UDQWELLSET_HPP
|
||||
#ifndef ACTIONX_CONDITION_HPP
|
||||
#define ACTIONX_CONDITION_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class UDQWellSet : public UDQSet {
|
||||
namespace Action {
|
||||
|
||||
|
||||
class Quantity {
|
||||
public:
|
||||
UDQWellSet(const std::string& name, const std::vector<std::string>& wells);
|
||||
UDQWellSet(const std::string& name, const std::vector<std::string>& wells, const UDQSet& values);
|
||||
UDQWellSet(const std::string& name, const std::vector<std::string>& wells, double scalar_value);
|
||||
void assign(const std::string& well, double value);
|
||||
void assign(double value);
|
||||
const UDQScalar& operator[](const std::string& well) const;
|
||||
private:
|
||||
std::size_t wellIndex(const std::string& well) const;
|
||||
std::unordered_map<std::string, std::size_t> well_index;
|
||||
Quantity() = default;
|
||||
|
||||
Quantity(const std::string& arg) :
|
||||
quantity(arg)
|
||||
{}
|
||||
|
||||
void add_arg(const std::string& arg);
|
||||
std::string quantity;
|
||||
std::vector<std::string> args;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class Condition {
|
||||
public:
|
||||
|
||||
enum class Logical {
|
||||
AND,
|
||||
OR,
|
||||
END
|
||||
};
|
||||
|
||||
enum class Comparator {
|
||||
EQUAL,
|
||||
GREATER,
|
||||
LESS,
|
||||
GREATER_EQUAL,
|
||||
LESS_EQUAL,
|
||||
INVALID
|
||||
};
|
||||
|
||||
|
||||
Condition(const std::vector<std::string>& tokens, const std::pair<std::string, std::size_t>& location);
|
||||
|
||||
|
||||
Quantity lhs;
|
||||
Quantity rhs;
|
||||
Logical logic = Logical::END;
|
||||
Comparator cmp = Comparator::INVALID;
|
||||
std::string cmp_string;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -90,17 +90,17 @@ class DynamicState {
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::pair<std::size_t, T>> unique() {
|
||||
std::vector<std::pair<std::size_t, T>> unique() const {
|
||||
if (this->m_data.empty())
|
||||
return {};
|
||||
|
||||
auto& current_value = this->m_data[0];
|
||||
const auto * current_value = std::addressof(this->m_data[0]);
|
||||
std::size_t current_index = 0;
|
||||
std::vector<std::pair<std::size_t, T>> result{{current_index, current_value}};
|
||||
std::vector<std::pair<std::size_t, T>> result{{current_index, *current_value}};
|
||||
while (true) {
|
||||
if (this->m_data[current_index] != current_value) {
|
||||
current_value = this->m_data[current_index];
|
||||
result.emplace_back(current_index, current_value);
|
||||
if (this->m_data[current_index] != *current_value) {
|
||||
current_value = std::addressof(this->m_data[current_index]);
|
||||
result.emplace_back(current_index, *current_value);
|
||||
}
|
||||
|
||||
current_index++;
|
||||
@@ -203,6 +203,10 @@ class DynamicState {
|
||||
}
|
||||
|
||||
|
||||
std::size_t size() const {
|
||||
return this->m_data.size();
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector< T > m_data;
|
||||
size_t initial_range;
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
Copyright 2013 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GROUP_HPP_
|
||||
#define GROUP_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
class TimeMap;
|
||||
|
||||
namespace GroupInjection {
|
||||
struct InjectionData {
|
||||
explicit InjectionData( const TimeMap& );
|
||||
|
||||
DynamicState< Phase > phase;
|
||||
DynamicState< GroupInjection::ControlEnum > controlMode;
|
||||
DynamicState< double > rate;
|
||||
DynamicState< double > surfaceFlowMaxRate;
|
||||
DynamicState< double > reservoirFlowMaxRate;
|
||||
DynamicState< double > targetReinjectFraction;
|
||||
DynamicState< double > targetVoidReplacementFraction;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace GroupProduction {
|
||||
struct ProductionData {
|
||||
explicit ProductionData( const TimeMap& );
|
||||
|
||||
DynamicState< GroupProduction::ControlEnum > controlMode;
|
||||
DynamicState< GroupProductionExceedLimit::ActionEnum > exceedAction;
|
||||
DynamicState< double > oilTarget;
|
||||
DynamicState< double > waterTarget;
|
||||
DynamicState< double > gasTarget;
|
||||
DynamicState< double > liquidTarget;
|
||||
DynamicState< double > reservoirVolumeTarget;
|
||||
};
|
||||
}
|
||||
|
||||
class Group {
|
||||
public:
|
||||
Group(const std::string& name, const size_t& seqIndex, const TimeMap& timeMap , size_t creationTimeStep);
|
||||
bool hasBeenDefined(size_t timeStep) const;
|
||||
const std::string& name() const;
|
||||
const size_t& seqIndex() const;
|
||||
bool isProductionGroup(size_t timeStep) const;
|
||||
bool isInjectionGroup(size_t timeStep) const;
|
||||
void setProductionGroup(size_t timeStep, bool isProductionGroup);
|
||||
void setInjectionGroup(size_t timeStep, bool isInjectionGroup_);
|
||||
|
||||
/******************************************************************/
|
||||
void setInjectionPhase(size_t time_step, Phase);
|
||||
Phase getInjectionPhase(size_t time_step) const;
|
||||
|
||||
void setInjectionControlMode(size_t time_step , GroupInjection::ControlEnum ControlMode);
|
||||
GroupInjection::ControlEnum getInjectionControlMode( size_t time_step) const;
|
||||
|
||||
void setInjectionRate(size_t time_step , double rate);
|
||||
double getInjectionRate( size_t time_step) const;
|
||||
|
||||
void setSurfaceMaxRate( size_t time_step , double rate);
|
||||
double getSurfaceMaxRate( size_t time_step ) const;
|
||||
|
||||
void setReservoirMaxRate( size_t time_step , double rate);
|
||||
double getReservoirMaxRate( size_t time_step ) const;
|
||||
|
||||
void setTargetReinjectFraction( size_t time_step , double rate);
|
||||
double getTargetReinjectFraction( size_t time_step ) const;
|
||||
|
||||
void setTargetVoidReplacementFraction( size_t time_step , double rate);
|
||||
double getTargetVoidReplacementFraction( size_t time_step ) const;
|
||||
|
||||
/******************************************************************/
|
||||
|
||||
void setProductionControlMode( size_t time_step , GroupProduction::ControlEnum controlMode);
|
||||
GroupProduction::ControlEnum getProductionControlMode( size_t time_step ) const;
|
||||
|
||||
GroupProductionExceedLimit::ActionEnum getProductionExceedLimitAction(size_t time_step) const;
|
||||
void setProductionExceedLimitAction(size_t time_step , GroupProductionExceedLimit::ActionEnum action);
|
||||
|
||||
void setOilTargetRate(size_t time_step , double oilTargetRate);
|
||||
double getOilTargetRate(size_t time_step) const;
|
||||
void setGasTargetRate(size_t time_step , double gasTargetRate);
|
||||
double getGasTargetRate(size_t time_step) const;
|
||||
void setWaterTargetRate(size_t time_step , double waterTargetRate);
|
||||
double getWaterTargetRate(size_t time_step) const;
|
||||
void setLiquidTargetRate(size_t time_step , double liquidTargetRate);
|
||||
double getLiquidTargetRate(size_t time_step) const;
|
||||
void setReservoirVolumeTargetRate(size_t time_step , double reservoirVolumeTargetRate);
|
||||
double getReservoirVolumeTargetRate(size_t time_step) const;
|
||||
void setGroupEfficiencyFactor(size_t time_step, double factor);
|
||||
double getGroupEfficiencyFactor(size_t time_step) const;
|
||||
void setTransferGroupEfficiencyFactor(size_t time_step, bool transfer);
|
||||
bool getTransferGroupEfficiencyFactor(size_t time_step) const;
|
||||
void setGroupNetVFPTable(size_t time_step, int table);
|
||||
int getGroupNetVFPTable(size_t time_step) const;
|
||||
static bool groupNameInGroupNamePattern(const std::string& groupName, const std::string& groupNamePattern);
|
||||
|
||||
/*****************************************************************/
|
||||
|
||||
bool hasWell(const std::string& wellName , size_t time_step) const;
|
||||
const std::set< std::string >& getWells( size_t time_step ) const;
|
||||
size_t numWells(size_t time_step) const;
|
||||
void addWell(size_t time_step, const std::string& well_name);
|
||||
void delWell(size_t time_step, const std::string& wellName );
|
||||
|
||||
private:
|
||||
size_t m_creationTimeStep;
|
||||
std::string m_name;
|
||||
size_t m_seqIndex;
|
||||
GroupInjection::InjectionData m_injection;
|
||||
GroupProduction::ProductionData m_production;
|
||||
DynamicState< std::set< std::string > > m_wells;
|
||||
DynamicState<int> m_isProductionGroup;
|
||||
DynamicState<int> m_isInjectionGroup;
|
||||
DynamicState<double> m_efficiencyFactor;
|
||||
DynamicState<int> m_transferEfficiencyFactor;
|
||||
DynamicState<int> m_groupNetVFPTable;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* GROUP_HPP_ */
|
||||
56
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
Normal file
56
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
|
||||
#ifndef GROUPTREE2
|
||||
#define GROUPTREE2
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class GTNode {
|
||||
public:
|
||||
GTNode(const Group2& group, const GTNode* parent);
|
||||
|
||||
void add_group(const GTNode& child_group);
|
||||
void add_well(const Well2& well);
|
||||
|
||||
const std::vector<Well2>& wells() const;
|
||||
const std::vector<GTNode>& groups() const;
|
||||
const std::string& name() const;
|
||||
const GTNode& parent() const;
|
||||
const Group2& group() const;
|
||||
private:
|
||||
const Group2 m_group;
|
||||
const GTNode * m_parent;
|
||||
/*
|
||||
Class T with a stl container <T> - supposedly undefined behavior before
|
||||
C++17 - but it compiles without warnings.
|
||||
*/
|
||||
std::vector<GTNode> m_child_groups;
|
||||
std::vector<Well2> m_wells;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
227
opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp
Normal file
227
opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp
Normal file
@@ -0,0 +1,227 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GROUP2_HPP
|
||||
#define GROUP2_HPP
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class SummaryState;
|
||||
class Group2 {
|
||||
public:
|
||||
|
||||
// A group can have both injection controls and production controls set at
|
||||
// the same time, i.e. this enum is used as a bitmask.
|
||||
enum class GroupType : unsigned {
|
||||
NONE = 0,
|
||||
PRODUCTION = 1,
|
||||
INJECTION = 2,
|
||||
MIXED = 3
|
||||
};
|
||||
|
||||
|
||||
|
||||
enum class ExceedAction {
|
||||
NONE = 0,
|
||||
CON = 1,
|
||||
CON_PLUS = 2, // String: "+CON"
|
||||
WELL = 3,
|
||||
PLUG = 4,
|
||||
RATE = 5
|
||||
};
|
||||
static const std::string ExceedAction2String( ExceedAction enumValue );
|
||||
static ExceedAction ExceedActionFromString( const std::string& stringValue );
|
||||
|
||||
|
||||
enum class InjectionCMode : int {
|
||||
NONE = 0,
|
||||
RATE = 1,
|
||||
RESV = 2,
|
||||
REIN = 4,
|
||||
VREP = 8,
|
||||
FLD = 16
|
||||
};
|
||||
static const std::string InjectionCMode2String( InjectionCMode enumValue );
|
||||
static InjectionCMode InjectionCModeFromString( const std::string& stringValue );
|
||||
|
||||
|
||||
enum class ProductionCMode : int {
|
||||
NONE = 0,
|
||||
ORAT = 1,
|
||||
WRAT = 2,
|
||||
GRAT = 4,
|
||||
LRAT = 8,
|
||||
CRAT = 16,
|
||||
RESV = 32,
|
||||
PRBL = 64,
|
||||
FLD = 128
|
||||
};
|
||||
static const std::string ProductionCMode2String( ProductionCMode enumValue );
|
||||
static ProductionCMode ProductionCModeFromString( const std::string& stringValue );
|
||||
|
||||
|
||||
enum class GuideRateTarget {
|
||||
OIL = 0,
|
||||
WAT = 1,
|
||||
GAS = 2,
|
||||
LIQ = 3,
|
||||
RES = 4,
|
||||
COMB = 5,
|
||||
WGA = 6,
|
||||
CVAL = 7,
|
||||
INJV = 8,
|
||||
POTN = 9,
|
||||
FORM = 10,
|
||||
NO_GUIDE_RATE = 11
|
||||
};
|
||||
static GuideRateTarget GuideRateTargetFromString( const std::string& stringValue );
|
||||
|
||||
|
||||
|
||||
struct GroupInjectionProperties {
|
||||
Phase phase = Phase::WATER;
|
||||
InjectionCMode cmode = InjectionCMode::NONE;
|
||||
UDAValue surface_max_rate;
|
||||
UDAValue resv_max_rate;
|
||||
UDAValue target_reinj_fraction;
|
||||
UDAValue target_void_fraction;
|
||||
|
||||
int injection_controls = 0;
|
||||
bool operator==(const GroupInjectionProperties& other) const;
|
||||
bool operator!=(const GroupInjectionProperties& other) const;
|
||||
};
|
||||
|
||||
struct InjectionControls {
|
||||
Phase phase;
|
||||
InjectionCMode cmode;
|
||||
double surface_max_rate;
|
||||
double resv_max_rate;
|
||||
double target_reinj_fraction;
|
||||
double target_void_fraction;
|
||||
int injection_controls = 0;
|
||||
bool has_control(InjectionCMode control) const;
|
||||
};
|
||||
|
||||
struct GroupProductionProperties {
|
||||
ProductionCMode cmode = ProductionCMode::NONE;
|
||||
ExceedAction exceed_action = ExceedAction::NONE;
|
||||
UDAValue oil_target;
|
||||
UDAValue water_target;
|
||||
UDAValue gas_target;
|
||||
UDAValue liquid_target;
|
||||
double guide_rate;
|
||||
GuideRateTarget guide_rate_def;
|
||||
double resv_target = 0;
|
||||
|
||||
int production_controls = 0;
|
||||
bool operator==(const GroupProductionProperties& other) const;
|
||||
bool operator!=(const GroupProductionProperties& other) const;
|
||||
};
|
||||
|
||||
struct ProductionControls {
|
||||
ProductionCMode cmode;
|
||||
ExceedAction exceed_action;
|
||||
double oil_target;
|
||||
double water_target;
|
||||
double gas_target;
|
||||
double liquid_target;
|
||||
double guide_rate;
|
||||
GuideRateTarget guide_rate_def;
|
||||
double resv_target = 0;
|
||||
int production_controls = 0;
|
||||
bool has_control(ProductionCMode control) const;
|
||||
};
|
||||
|
||||
|
||||
Group2(const std::string& group_name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
|
||||
bool defined(std::size_t timeStep) const;
|
||||
std::size_t insert_index() const;
|
||||
const std::string& name() const;
|
||||
int getGroupNetVFPTable() const;
|
||||
bool updateNetVFPTable(int vfp_arg);
|
||||
bool update_gefac(double gefac, bool transfer_gefac);
|
||||
|
||||
const std::string& parent() const;
|
||||
bool updateParent(const std::string& parent);
|
||||
bool updateInjection(const GroupInjectionProperties& injection);
|
||||
bool updateProduction(const GroupProductionProperties& production);
|
||||
bool isProductionGroup() const;
|
||||
bool isInjectionGroup() const;
|
||||
void setProductionGroup();
|
||||
void setInjectionGroup();
|
||||
double getGroupEfficiencyFactor() const;
|
||||
bool getTransferGroupEfficiencyFactor() const;
|
||||
|
||||
std::size_t numWells() const;
|
||||
bool addGroup(const std::string& group_name);
|
||||
bool hasGroup(const std::string& group_name) const;
|
||||
void delGroup(const std::string& group_name);
|
||||
bool addWell(const std::string& well_name);
|
||||
bool hasWell(const std::string& well_name) const;
|
||||
void delWell(const std::string& well_name);
|
||||
|
||||
const std::vector<std::string>& wells() const;
|
||||
const std::vector<std::string>& groups() const;
|
||||
bool wellgroup() const;
|
||||
ProductionControls productionControls(const SummaryState& st) const;
|
||||
InjectionControls injectionControls(const SummaryState& st) const;
|
||||
const GroupProductionProperties& productionProperties() const;
|
||||
const GroupInjectionProperties& injectionProperties() const;
|
||||
ProductionCMode production_cmode() const;
|
||||
InjectionCMode injection_cmode() const;
|
||||
Phase injection_phase() const;
|
||||
bool has_control(ProductionCMode control) const;
|
||||
bool has_control(InjectionCMode control) const;
|
||||
private:
|
||||
bool hasType(GroupType gtype) const;
|
||||
void addType(GroupType new_gtype);
|
||||
|
||||
std::string m_name;
|
||||
std::size_t m_insert_index;
|
||||
std::size_t init_step;
|
||||
double udq_undefined;
|
||||
UnitSystem unit_system;
|
||||
GroupType group_type;
|
||||
double gefac;
|
||||
bool transfer_gefac;
|
||||
int vfp_table;
|
||||
|
||||
std::string parent_group;
|
||||
IOrderSet<std::string> m_wells;
|
||||
IOrderSet<std::string> m_groups;
|
||||
|
||||
GroupInjectionProperties injection_properties{};
|
||||
GroupProductionProperties production_properties{};
|
||||
};
|
||||
|
||||
Group2::GroupType operator |(Group2::GroupType lhs, Group2::GroupType rhs);
|
||||
Group2::GroupType operator &(Group2::GroupType lhs, Group2::GroupType rhs);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
98
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
Normal file
98
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GUIDE_RATE_HPP
|
||||
#define GUIDE_RATE_HPP
|
||||
|
||||
#include <string>
|
||||
#include <cstddef>
|
||||
#include <ctime>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class Schedule;
|
||||
class GuideRate {
|
||||
private:
|
||||
|
||||
struct GuideRateValue {
|
||||
GuideRateValue() = default;
|
||||
GuideRateValue(double t, double v, GuideRateModel::Target tg):
|
||||
sim_time(t),
|
||||
value(v),
|
||||
target(tg)
|
||||
{}
|
||||
|
||||
bool operator==(const GuideRateValue& other) const {
|
||||
return (this->sim_time == other.sim_time &&
|
||||
this->value == other.value);
|
||||
}
|
||||
|
||||
bool operator!=(const GuideRateValue& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
double eval(GuideRateModel::Target target_arg) const;
|
||||
|
||||
double sim_time;
|
||||
double value;
|
||||
GuideRateModel::Target target;
|
||||
};
|
||||
|
||||
struct Potential {
|
||||
Potential() = default;
|
||||
Potential(double op, double gp, double wp) :
|
||||
oil_pot(op),
|
||||
gas_pot(gp),
|
||||
wat_pot(wp)
|
||||
{}
|
||||
|
||||
|
||||
double eval(Group2::GuideRateTarget target) const;
|
||||
double eval(Well2::GuideRateTarget target) const;
|
||||
|
||||
|
||||
double oil_pot;
|
||||
double gas_pot;
|
||||
double wat_pot;
|
||||
};
|
||||
|
||||
public:
|
||||
GuideRate(const Schedule& schedule);
|
||||
void compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
|
||||
double get(const std::string& well, Well2::GuideRateTarget target) const;
|
||||
double get(const std::string& group, Group2::GuideRateTarget target) const;
|
||||
private:
|
||||
void well_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
|
||||
void group_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
|
||||
double eval_form(const GuideRateModel& model, double oil_pot, double gas_pot, double wat_pot, const GuideRateValue * prev) const;
|
||||
double eval_group_pot() const;
|
||||
double eval_group_resvinj() const;
|
||||
|
||||
std::unordered_map<std::string,GuideRateValue> values;
|
||||
std::unordered_map<std::string,Potential> potentials;
|
||||
const Schedule& schedule;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GUIDE_RATE_CONFIG_HPP
|
||||
#define GUIDE_RATE_CONFIG_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
class GuideRateConfig {
|
||||
public:
|
||||
|
||||
struct Well {
|
||||
double guide_rate;
|
||||
Well2::GuideRateTarget target;
|
||||
double scaling_factor;
|
||||
};
|
||||
|
||||
struct Group {
|
||||
double guide_rate;
|
||||
Group2::GuideRateTarget target;
|
||||
};
|
||||
|
||||
const GuideRateModel& model() const;
|
||||
bool has_model() const;
|
||||
bool update_model(const GuideRateModel& model);
|
||||
void update_well(const Well2& well);
|
||||
void update_group(const Group2& group);
|
||||
const Well& well(const std::string& well) const;
|
||||
const Group& group(const std::string& group) const;
|
||||
bool has_well(const std::string& well) const;
|
||||
bool has_group(const std::string& group) const;
|
||||
private:
|
||||
std::shared_ptr<GuideRateModel> m_model;
|
||||
std::unordered_map<std::string, Well> wells;
|
||||
std::unordered_map<std::string, Group> groups;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
Copyright 2019 Equinor ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GUIDE_RATE_MODEL_HPP
|
||||
#define GUIDE_RATE_MODEL_HPP
|
||||
|
||||
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class GuideRateModel {
|
||||
public:
|
||||
|
||||
enum class Target {
|
||||
OIL = 0,
|
||||
LIQ = 1,
|
||||
GAS = 2,
|
||||
WAT = 3,
|
||||
RES = 4,
|
||||
COMB = 5,
|
||||
NONE = 6
|
||||
};
|
||||
|
||||
static Target TargetFromString(const std::string& s);
|
||||
|
||||
GuideRateModel(double time_interval_arg,
|
||||
Target target_arg,
|
||||
double A_arg,
|
||||
double B_arg,
|
||||
double C_arg,
|
||||
double D_arg,
|
||||
double E_arg,
|
||||
double F_arg,
|
||||
bool allow_increase_arg,
|
||||
double damping_factor_arg,
|
||||
bool use_free_gas_arg);
|
||||
|
||||
GuideRateModel() = default;
|
||||
bool updateLINCOM(const UDAValue& alpha, const UDAValue& beta, const UDAValue& gamma);
|
||||
double eval(double oil_pot, double gas_pot, double wat_pot) const;
|
||||
double update_delay() const;
|
||||
bool allow_increase() const;
|
||||
double damping_factor() const;
|
||||
bool operator==(const GuideRateModel& other) const;
|
||||
bool operator!=(const GuideRateModel& other) const;
|
||||
Target target() const;
|
||||
|
||||
static Target convert_target(Group2::GuideRateTarget group_target);
|
||||
static Target convert_target(Well2::GuideRateTarget well_target);
|
||||
private:
|
||||
double pot(double oil_pot, double gas_pot, double wat_pot) const;
|
||||
/*
|
||||
Unfortunately the default values will give a GuideRateModel which can not
|
||||
be evaluated, due to a division by zero problem.
|
||||
*/
|
||||
double time_interval = 0;
|
||||
Target m_target = Target::NONE;
|
||||
double A = 0;
|
||||
double B = 0;
|
||||
double C = 0;
|
||||
double D = 0;
|
||||
double E = 0;
|
||||
double F = 0;
|
||||
bool allow_increase_ = true;
|
||||
double damping_factor_ = 1.0;
|
||||
bool use_free_gas = false;
|
||||
bool default_model = true;
|
||||
UDAValue alpha;
|
||||
UDAValue beta;
|
||||
UDAValue gamma;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
Copyright 2013 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GROUPTREE_HPP
|
||||
#define GROUPTREE_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class GroupTree {
|
||||
public:
|
||||
struct group {
|
||||
std::string name;
|
||||
std::string parent;
|
||||
|
||||
bool operator<( const group& rhs ) const;
|
||||
bool operator==( const std::string& name ) const;
|
||||
bool operator!=( const std::string& name ) const;
|
||||
|
||||
bool operator<( const std::string& name ) const;
|
||||
bool operator==( const group& rhs ) const;
|
||||
bool operator!=( const group& rhs ) const;
|
||||
};
|
||||
|
||||
void update( const std::string& name);
|
||||
void update( const std::string& name, const std::string& parent);
|
||||
void updateSeqIndex( const std::string& name, const std::string& other_parent);
|
||||
bool exists( const std::string& group ) const;
|
||||
const std::string& parent( const std::string& name ) const;
|
||||
std::vector< std::string > children( const std::string& parent ) const;
|
||||
const std::map<std::string , size_t>& nameSeqIndMap() const;
|
||||
const std::map<size_t, std::string >& seqIndNameMap() const;
|
||||
bool operator==( const GroupTree& ) const;
|
||||
bool operator!=( const GroupTree& ) const;
|
||||
std::vector<GroupTree::group>::const_iterator begin() const;
|
||||
std::vector<GroupTree::group>::const_iterator end() const;
|
||||
|
||||
private:
|
||||
std::vector< group >::iterator find( const std::string& );
|
||||
friend bool operator<( const std::string&, const group& );
|
||||
|
||||
std::vector< group > groups = { group { "FIELD", "" } };
|
||||
std::map<std::string , size_t> m_nameSeqIndMap;
|
||||
std::map<size_t, std::string > m_seqIndNameMap;
|
||||
};
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, const GroupTree& gt);
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif /* GROUPTREE_HPP */
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp>
|
||||
|
||||
namespace Opm {
|
||||
@@ -32,6 +31,31 @@ namespace Opm {
|
||||
|
||||
class WellSegments {
|
||||
public:
|
||||
enum class LengthDepth{
|
||||
INC = 0,
|
||||
ABS = 1
|
||||
};
|
||||
static const std::string LengthDepthToString(LengthDepth enumValue);
|
||||
static LengthDepth LengthDepthFromString(const std::string& stringValue);
|
||||
|
||||
|
||||
enum class CompPressureDrop {
|
||||
HFA = 0,
|
||||
HF_ = 1,
|
||||
H__ = 2
|
||||
};
|
||||
static const std::string CompPressureDropToString(CompPressureDrop enumValue);
|
||||
static CompPressureDrop CompPressureDropFromString(const std::string& stringValue);
|
||||
|
||||
|
||||
enum class MultiPhaseModel {
|
||||
HO = 0,
|
||||
DF = 1
|
||||
};
|
||||
static const std::string MultiPhaseModelToString(MultiPhaseModel enumValue);
|
||||
static MultiPhaseModel MultiPhaseModelFromString(const std::string& stringValue);
|
||||
|
||||
|
||||
WellSegments() = default;
|
||||
|
||||
const std::string& wellName() const;
|
||||
@@ -40,8 +64,8 @@ namespace Opm {
|
||||
double lengthTopSegment() const;
|
||||
double volumeTopSegment() const;
|
||||
|
||||
WellSegment::CompPressureDropEnum compPressureDrop() const;
|
||||
WellSegment::MultiPhaseModelEnum multiPhaseModel() const;
|
||||
CompPressureDrop compPressureDrop() const;
|
||||
MultiPhaseModel multiPhaseModel() const;
|
||||
|
||||
// mapping the segment number to the index in the vector of segments
|
||||
int segmentNumberToIndex(const int segment_number) const;
|
||||
@@ -63,7 +87,6 @@ namespace Opm {
|
||||
void processABS();
|
||||
void processINC(const bool first_time);
|
||||
|
||||
// name of the well
|
||||
std::string m_well_name;
|
||||
// depth of the nodal point of the top segment
|
||||
// it is taken as the BHP reference depth of the well
|
||||
@@ -74,11 +97,11 @@ namespace Opm {
|
||||
// effective wellbore volume of the top segment
|
||||
double m_volume_top;
|
||||
// type of the tubing length and depth information
|
||||
WellSegment::LengthDepthEnum m_length_depth_type;
|
||||
LengthDepth m_length_depth_type;
|
||||
// components of the pressure drop to be included
|
||||
WellSegment::CompPressureDropEnum m_comp_pressure_drop;
|
||||
CompPressureDrop m_comp_pressure_drop;
|
||||
// multi-phase flow model
|
||||
WellSegment::MultiPhaseModelEnum m_multiphase_model;
|
||||
MultiPhaseModel m_multiphase_model;
|
||||
// There are X and Y cooridnate of the nodal point of the top segment
|
||||
// Since they are not used for simulations and we are not supporting plotting,
|
||||
// we are not handling them at the moment.
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
|
||||
|
||||
namespace Opm {
|
||||
WellConnections * newConnectionsWithSegments(const DeckKeyword& compsegs, const WellConnections& input_connections,
|
||||
const WellSegments& segments, const EclipseGrid& grid);
|
||||
WellConnections * newConnectionsWithSegments(const DeckKeyword& compsegs, const WellConnections& input_connections,
|
||||
const WellSegments& segments, const EclipseGrid& grid,
|
||||
const ParseContext& parseContext, ErrorGuard& errors);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
/*
|
||||
@@ -35,12 +33,19 @@ namespace Opm
|
||||
*/
|
||||
class OilVaporizationProperties {
|
||||
public:
|
||||
enum class OilVaporization {
|
||||
UNDEF = 0,
|
||||
VAPPARS = 1,
|
||||
DRDT = 2 // DRSDT or DRVDT
|
||||
};
|
||||
|
||||
|
||||
explicit OilVaporizationProperties(const size_t numPvtReginIdx);
|
||||
static void updateDRSDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRSDT, const std::vector<std::string>& option);
|
||||
static void updateDRVDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRVDT);
|
||||
static void updateVAPPARS(Opm::OilVaporizationProperties& ovp, const std::vector<double>& vap1, const std::vector<double>& vap2);
|
||||
|
||||
Opm::OilVaporizationEnum getType() const;
|
||||
OilVaporization getType() const;
|
||||
double getVap1(const size_t pvtRegionIdx) const;
|
||||
double getVap2(const size_t pvtRegionIdx) const;
|
||||
double getMaxDRSDT(const size_t pvtRegionIdx) const;
|
||||
@@ -59,7 +64,7 @@ namespace Opm
|
||||
bool operator!=( const OilVaporizationProperties& ) const;
|
||||
|
||||
private:
|
||||
Opm::OilVaporizationEnum m_type = OilVaporizationEnum::UNDEF;
|
||||
OilVaporization m_type = OilVaporization::UNDEF;
|
||||
std::vector<double> m_vap1;
|
||||
std::vector<double> m_vap2;
|
||||
std::vector<double> m_maxDRSDT;
|
||||
|
||||
@@ -31,6 +31,26 @@ namespace Opm {
|
||||
class TimeMap;
|
||||
class RFTConfig {
|
||||
public:
|
||||
enum class RFT {
|
||||
YES = 1,
|
||||
REPT = 2,
|
||||
TIMESTEP = 3,
|
||||
FOPN = 4,
|
||||
NO = 5
|
||||
};
|
||||
static std::string RFT2String(RFT enumValue);
|
||||
static RFT RFTFromString(const std::string &stringValue);
|
||||
|
||||
enum class PLT {
|
||||
YES = 1,
|
||||
REPT = 2,
|
||||
TIMESTEP = 3,
|
||||
NO = 4
|
||||
};
|
||||
static std::string PLT2String(PLT enumValue);
|
||||
static PLT PLTFromString( const std::string& stringValue);
|
||||
|
||||
|
||||
explicit RFTConfig(const TimeMap& time_map);
|
||||
bool rft(const std::string& well, std::size_t report_step) const;
|
||||
bool plt(const std::string& well, std::size_t report_step) const;
|
||||
@@ -40,16 +60,16 @@ public:
|
||||
|
||||
bool active(std::size_t report_step) const;
|
||||
std::size_t firstRFTOutput() const;
|
||||
void updateRFT(const std::string& well, std::size_t report_step, RFTConnections::RFTEnum value);
|
||||
void updatePLT(const std::string& well, std::size_t report_step, PLTConnections::PLTEnum value);
|
||||
void updateRFT(const std::string& well, std::size_t report_step, RFT value);
|
||||
void updatePLT(const std::string& well, std::size_t report_step, PLT value);
|
||||
void addWellOpen(const std::string& well, std::size_t report_step);
|
||||
private:
|
||||
const TimeMap& tm;
|
||||
std::pair<bool, std::size_t> well_open_rft_time;
|
||||
std::unordered_set<std::string> well_open_rft_name;
|
||||
std::unordered_map<std::string, std::size_t> well_open;
|
||||
std::unordered_map<std::string, DynamicState<std::pair<RFTConnections::RFTEnum, std::size_t>>> rft_config;
|
||||
std::unordered_map<std::string, DynamicState<std::pair<PLTConnections::PLTEnum, std::size_t>>> plt_config;
|
||||
std::unordered_map<std::string, DynamicState<std::pair<RFT, std::size_t>>> rft_config;
|
||||
std::unordered_map<std::string, DynamicState<std::pair<PLT, std::size_t>>> plt_config;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp>
|
||||
@@ -39,14 +39,54 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp>
|
||||
|
||||
|
||||
/*
|
||||
The DynamicState<std::shared_ptr<T>> pattern: The quantities in the Schedule
|
||||
section like e.g. wellrates and completion properties are typically
|
||||
characterized by the following behaviour:
|
||||
|
||||
1. They can be updated repeatedly at arbitrary points in the Schedule
|
||||
section.
|
||||
|
||||
2. The value set at one timestep will apply until is explicitly set again at
|
||||
a later timestep.
|
||||
|
||||
These properties are typically stored in a DynamicState<T> container; the
|
||||
DynamicState<T> class is a container which implements this semantics:
|
||||
|
||||
1. It is legitimate to ask for an out-of-range value, you will then get the
|
||||
last value which has been set.
|
||||
|
||||
2. When assigning an out-of-bounds value the container will append the
|
||||
currently set value until correct length has been reached, and then the
|
||||
new value will be assigned.
|
||||
|
||||
3. The DynamicState<T> has an awareness of the total length of the time
|
||||
axis, trying to access values beyound that is illegal.
|
||||
|
||||
For many of the non-trival objects like eg Well2 and Group2 the DynamicState<>
|
||||
contains a shared pointer to an underlying object, that way the fill operation
|
||||
when the vector is resized is quite fast. The following pattern is quite
|
||||
common for the Schedule implementation:
|
||||
|
||||
|
||||
// Create a new well object.
|
||||
std::shared_ptr<Well> new_well = this->getWell2( well_name, time_step );
|
||||
|
||||
// Update the new well object with new settings from the deck, the
|
||||
// updateXXXX() method will return true if the well object was actually
|
||||
// updated:
|
||||
if (new_well->updateRate( new_rate ))
|
||||
this->dynamic_state.update( time_step, new_well);
|
||||
|
||||
*/
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
class Actions;
|
||||
class Deck;
|
||||
class DeckKeyword;
|
||||
@@ -61,7 +101,8 @@ namespace Opm
|
||||
class UnitSystem;
|
||||
class ErrorGuard;
|
||||
class WListManager;
|
||||
class UDQInput;
|
||||
class UDQConfig;
|
||||
class UDQActive;
|
||||
|
||||
class Schedule {
|
||||
public:
|
||||
@@ -115,39 +156,47 @@ namespace Opm
|
||||
size_t numWells() const;
|
||||
size_t numWells(size_t timestep) const;
|
||||
bool hasWell(const std::string& wellName) const;
|
||||
bool hasWell(const std::string& wellName, std::size_t timeStep) const;
|
||||
|
||||
std::vector<std::string> wellNames(const std::string& pattern, size_t timeStep, const std::vector<std::string>& matching_wells = {}) const;
|
||||
std::vector<std::string> wellNames(const std::string& pattern) const;
|
||||
std::vector<std::string> wellNames(size_t timeStep) const;
|
||||
std::vector<std::string> wellNames() const;
|
||||
|
||||
std::vector<std::string> groupNames(const std::string& pattern, size_t timeStep) const;
|
||||
std::vector<std::string> groupNames(size_t timeStep) const;
|
||||
std::vector<std::string> groupNames(const std::string& pattern) const;
|
||||
std::vector<std::string> groupNames() const;
|
||||
|
||||
void updateWell(std::shared_ptr<Well2> well, size_t reportStep);
|
||||
const Well2& getWell2(const std::string& wellName, size_t timeStep) const;
|
||||
std::vector< const Well2* > getChildWells2(const std::string& group_name, size_t timeStep, GroupWellQueryMode query_mode) const;
|
||||
const Well* getWell(const std::string& wellName) const;
|
||||
std::vector< const Well* > getOpenWells(size_t timeStep) const;
|
||||
std::vector< const Well* > getWells() const;
|
||||
std::vector< const Well* > getWells(size_t timeStep) const;
|
||||
std::vector< const Well* > getChildWells(const std::string& group_name, size_t timeStep, GroupWellQueryMode query_mode) const;
|
||||
const Well2& getWell2atEnd(const std::string& well_name) const;
|
||||
std::vector<Well2> getWells2(size_t timeStep) const;
|
||||
std::vector<Well2> getWells2atEnd() const;
|
||||
|
||||
std::vector<const Group2*> getChildGroups2(const std::string& group_name, size_t timeStep) const;
|
||||
std::vector<Well2> getChildWells2(const std::string& group_name, size_t timeStep) const;
|
||||
const OilVaporizationProperties& getOilVaporizationProperties(size_t timestep) const;
|
||||
|
||||
const UDQActive& udqActive(size_t timeStep) const;
|
||||
const WellTestConfig& wtestConfig(size_t timestep) const;
|
||||
const WListManager& getWListManager(size_t timeStep) const;
|
||||
const UDQInput& getUDQConfig(size_t timeStep) const;
|
||||
const Actions& actions() const;
|
||||
const UDQConfig& getUDQConfig(size_t timeStep) const;
|
||||
const Action::Actions& actions(std::size_t timeStep) const;
|
||||
void evalAction(const SummaryState& summary_state, size_t timeStep);
|
||||
|
||||
const GroupTree& getGroupTree(size_t t) const;
|
||||
std::vector< const Group* > getChildGroups(const std::string& group_name, size_t timeStep) const;
|
||||
GTNode groupTree(std::size_t report_step) const;
|
||||
GTNode groupTree(const std::string& root_node, std::size_t report_step) const;
|
||||
size_t numGroups() const;
|
||||
size_t numGroups(size_t timeStep) const;
|
||||
bool hasGroup(const std::string& groupName) const;
|
||||
const Group& getGroup(const std::string& groupName) const;
|
||||
std::vector< const Group* > getGroups() const;
|
||||
std::vector< const Group* > getGroups(size_t timeStep) const;
|
||||
bool hasGroup(const std::string& groupName, std::size_t timeStep) const;
|
||||
const Group2& getGroup2(const std::string& groupName, size_t timeStep) const;
|
||||
|
||||
const Tuning& getTuning() const;
|
||||
const MessageLimits& getMessageLimits() const;
|
||||
void invalidNamePattern (const std::string& namePattern, const ParseContext& parseContext, ErrorGuard& errors, const DeckKeyword& keyword) const;
|
||||
const GuideRateConfig& guideRateConfig(size_t timeStep) const;
|
||||
|
||||
const RFTConfig& rftConfig() const;
|
||||
const Events& getEvents() const;
|
||||
@@ -166,13 +215,12 @@ namespace Opm
|
||||
void filterConnections(const EclipseGrid& grid);
|
||||
size_t size() const;
|
||||
|
||||
void applyAction(size_t reportStep, const ActionX& action, const std::vector<std::string>& matching_wells);
|
||||
void applyAction(size_t reportStep, const Action::ActionX& action, const Action::Result& result);
|
||||
int getNupcol(size_t reportStep) const;
|
||||
private:
|
||||
TimeMap m_timeMap;
|
||||
OrderedMap< std::string, Well > m_wells;
|
||||
OrderedMap< std::string, Group > m_groups;
|
||||
OrderedMap< std::string, DynamicState<std::shared_ptr<Well2>>> wells_static;
|
||||
DynamicState< GroupTree > m_rootGroupTree;
|
||||
OrderedMap< std::string, DynamicState<std::shared_ptr<Group2>>> groups;
|
||||
DynamicState< OilVaporizationProperties > m_oilvaporizationproperties;
|
||||
Events m_events;
|
||||
DynamicVector< Deck > m_modifierDeck;
|
||||
@@ -183,35 +231,43 @@ namespace Opm
|
||||
std::map<int, DynamicState<std::shared_ptr<VFPInjTable>>> vfpinj_tables;
|
||||
DynamicState<std::shared_ptr<WellTestConfig>> wtest_config;
|
||||
DynamicState<std::shared_ptr<WListManager>> wlist_manager;
|
||||
DynamicState<std::shared_ptr<UDQInput>> udq_config;
|
||||
DynamicState<WellProducer::ControlModeEnum> global_whistctl_mode;
|
||||
DynamicState<std::shared_ptr<UDQConfig>> udq_config;
|
||||
DynamicState<std::shared_ptr<UDQActive>> udq_active;
|
||||
DynamicState<std::shared_ptr<GuideRateConfig>> guide_rate_config;
|
||||
DynamicState<Well2::ProducerCMode> global_whistctl_mode;
|
||||
DynamicState<std::shared_ptr<Action::Actions>> m_actions;
|
||||
RFTConfig rft_config;
|
||||
DynamicState<int> m_nupcol;
|
||||
|
||||
Actions m_actions;
|
||||
|
||||
std::vector< Well* > getWells(const std::string& wellNamePattern, const std::vector<std::string>& matching_wells = {});
|
||||
std::vector< Group* > getGroups(const std::string& groupNamePattern);
|
||||
std::map<std::string,Events> well_events;
|
||||
|
||||
bool updateWellStatus( const std::string& well, size_t reportStep , WellCommon::StatusEnum status);
|
||||
void addWellToGroup( Group& newGroup , const std::string& wellName , size_t timeStep);
|
||||
GTNode groupTree(const std::string& root_node, std::size_t report_step, const GTNode * parent) const;
|
||||
void updateGroup(std::shared_ptr<Group2> group, size_t reportStep);
|
||||
bool checkGroups(const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void updateUDQActive( std::size_t timeStep, std::shared_ptr<UDQActive> udq );
|
||||
bool updateWellStatus( const std::string& well, size_t reportStep , Well2::Status status);
|
||||
void addWellToGroup( const std::string& group_name, const std::string& well_name , size_t timeStep);
|
||||
void iterateScheduleSection(const ParseContext& parseContext , ErrorGuard& errors, const SCHEDULESection& , const EclipseGrid& grid,
|
||||
const Eclipse3DProperties& eclipseProperties);
|
||||
bool handleGroupFromWELSPECS(const std::string& groupName, GroupTree& newTree) const;
|
||||
void addGroup(const std::string& groupName , size_t timeStep);
|
||||
void addWell(const std::string& wellName, const DeckRecord& record, size_t timeStep, WellCompletion::CompletionOrderEnum wellCompletionOrder);
|
||||
void addACTIONX(const Action::ActionX& action, std::size_t currentStep);
|
||||
void addGroupToGroup( const std::string& parent_group, const std::string& child_group, size_t timeStep);
|
||||
void addGroupToGroup( const std::string& parent_group, const Group2& child_group, size_t timeStep);
|
||||
void addGroup(const std::string& groupName , size_t timeStep, const UnitSystem& unit_system);
|
||||
void addWell(const std::string& wellName, const DeckRecord& record, size_t timeStep, Connection::Order connection_order, const UnitSystem& unit_system);
|
||||
void handleUDQ(const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWLIST(const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPORD(const ParseContext& parseContext, ErrorGuard& errors, const DeckKeyword& compordKeyword, size_t currentStep);
|
||||
void handleWELSPECS( const SCHEDULESection&, size_t, size_t );
|
||||
void handleWELSPECS( const SCHEDULESection&, size_t, size_t , const UnitSystem& unit_system, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONHIST( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWGRUPCON( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const Eclipse3DProperties& eclipseProperties, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleCOMPLUMP( const DeckKeyword& keyword, size_t currentStep );
|
||||
void handleWELSEGS( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid);
|
||||
void handleWCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWFOAM( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWPOLYMER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWSOLVENT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWTRACER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
@@ -219,16 +275,19 @@ namespace Opm
|
||||
void handleWPMITAB( const DeckKeyword& keyword, const size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWSKPTAB( const DeckKeyword& keyword, const size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWINJTEMP( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONINJH( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWCONINJH(const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWELOPEN( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors, const std::vector<std::string>& matching_wells = {});
|
||||
void handleWELTARG( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGCONPROD( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGUIDERAT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleLINCOM( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleTUNING( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGRUPNET( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleNUPCOL( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleGRUPNET( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system);
|
||||
void handleWRFT( const DeckKeyword& keyword, size_t currentStep);
|
||||
void handleWTEST( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void handleWRFTPLT( const DeckKeyword& keyword, size_t currentStep);
|
||||
@@ -255,9 +314,6 @@ namespace Opm
|
||||
const UnitSystem& unit_system,
|
||||
std::vector<std::pair<const DeckKeyword*, size_t > >& rftProperties);
|
||||
void addWellEvent(const std::string& well, ScheduleEvents::Events event, size_t reportStep);
|
||||
#ifdef WELL_TEST
|
||||
bool checkWells(const ParseContext& parseContext, ErrorGuard& errors) const;
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,320 +0,0 @@
|
||||
/*
|
||||
Copyright 2013 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SCHEDULE_ENUMS_H
|
||||
#define SCHEDULE_ENUMS_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Opm {
|
||||
namespace WellCommon {
|
||||
|
||||
enum StatusEnum {
|
||||
OPEN = 1,
|
||||
STOP = 2,
|
||||
SHUT = 3,
|
||||
AUTO = 4
|
||||
};
|
||||
|
||||
const std::string Status2String(StatusEnum enumValue);
|
||||
StatusEnum StatusFromString(const std::string& stringValue);
|
||||
}
|
||||
|
||||
namespace WellCompletion {
|
||||
|
||||
enum StateEnum {
|
||||
OPEN = 1,
|
||||
SHUT = 2,
|
||||
AUTO = 3
|
||||
};
|
||||
|
||||
|
||||
enum DirectionEnum {
|
||||
X = 1,
|
||||
Y = 2,
|
||||
Z = 3
|
||||
};
|
||||
|
||||
|
||||
enum CompletionOrderEnum{
|
||||
DEPTH,
|
||||
INPUT,
|
||||
TRACK
|
||||
};
|
||||
|
||||
std::string DirectionEnum2String(const DirectionEnum enumValue);
|
||||
DirectionEnum DirectionEnumFromString(const std::string& stringValue);
|
||||
|
||||
const std::string StateEnum2String( StateEnum enumValue );
|
||||
StateEnum StateEnumFromString( const std::string& stringValue );
|
||||
|
||||
const std::string CompletionOrderEnum2String( CompletionOrderEnum enumValue );
|
||||
CompletionOrderEnum CompletionOrderEnumFromString(const std::string& comporderStringValue);
|
||||
|
||||
}
|
||||
|
||||
namespace WellTarget {
|
||||
enum ControlModeEnum {
|
||||
ORAT = 1,
|
||||
WRAT = 2,
|
||||
GRAT = 3,
|
||||
LRAT = 4,
|
||||
CRAT = 5, // Not supported
|
||||
RESV = 6,
|
||||
BHP = 7,
|
||||
THP = 8,
|
||||
VFP = 9,
|
||||
LIFT = 10, // Not supported
|
||||
GUID = 11
|
||||
};
|
||||
/*
|
||||
There are unfortuntaley separate enums for production controls,
|
||||
injection controls and also for WELTARG control arguments. Since the
|
||||
WELTARG control arguments are *not* used to enumerate available
|
||||
controls the numerical values are - conciously - not in 2^n range.
|
||||
*/
|
||||
|
||||
ControlModeEnum ControlModeFromString(const std::string& string_value);
|
||||
}
|
||||
|
||||
|
||||
namespace WellInjector {
|
||||
enum TypeEnum {
|
||||
WATER = 1,
|
||||
GAS = 2,
|
||||
OIL = 3,
|
||||
MULTI = 4
|
||||
};
|
||||
|
||||
|
||||
enum ControlModeEnum {
|
||||
RATE = 1 ,
|
||||
RESV = 2 ,
|
||||
BHP = 4 ,
|
||||
THP = 8 ,
|
||||
GRUP = 16 ,
|
||||
CMODE_UNDEFINED = 512
|
||||
};
|
||||
/*
|
||||
The elements in this enum are used as bitmasks to keep track
|
||||
of which controls are present, i.e. the 2^n structure must
|
||||
be intact.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const std::string ControlMode2String( ControlModeEnum enumValue );
|
||||
ControlModeEnum ControlModeFromString( const std::string& stringValue );
|
||||
|
||||
const std::string Type2String( TypeEnum enumValue );
|
||||
TypeEnum TypeFromString( const std::string& stringValue );
|
||||
}
|
||||
|
||||
|
||||
namespace WellProducer {
|
||||
|
||||
enum ControlModeEnum {
|
||||
NONE = 0,
|
||||
ORAT = 1,
|
||||
WRAT = 2,
|
||||
GRAT = 4,
|
||||
LRAT = 8,
|
||||
CRAT = 16,
|
||||
RESV = 32,
|
||||
BHP = 64,
|
||||
THP = 128,
|
||||
GRUP = 256,
|
||||
CMODE_UNDEFINED = 1024
|
||||
};
|
||||
|
||||
/*
|
||||
The items BHP, THP and GRUP only apply in prediction mode:
|
||||
WCONPROD. The elements in this enum are used as bitmasks to
|
||||
keep track of which controls are present, i.e. the 2^n
|
||||
structure must be intact.The NONE item is only used in WHISTCTL
|
||||
to cancel its effect.
|
||||
|
||||
The properties are initialized with the CMODE_UNDEFINED
|
||||
value, but the undefined value is never assigned apart from
|
||||
that; and it is not part of the string conversion routines.
|
||||
*/
|
||||
|
||||
|
||||
const std::string ControlMode2String( ControlModeEnum enumValue );
|
||||
ControlModeEnum ControlModeFromString( const std::string& stringValue );
|
||||
}
|
||||
|
||||
|
||||
namespace GroupInjection {
|
||||
|
||||
enum ControlEnum {
|
||||
NONE = 0,
|
||||
RATE = 1,
|
||||
RESV = 2,
|
||||
REIN = 3,
|
||||
VREP = 4,
|
||||
FLD = 5
|
||||
};
|
||||
|
||||
const std::string ControlEnum2String( ControlEnum enumValue );
|
||||
ControlEnum ControlEnumFromString( const std::string& stringValue );
|
||||
}
|
||||
|
||||
|
||||
namespace GroupProductionExceedLimit {
|
||||
enum ActionEnum {
|
||||
NONE = 0,
|
||||
CON = 1,
|
||||
CON_PLUS = 2, // String: "+CON"
|
||||
WELL = 3,
|
||||
PLUG = 4,
|
||||
RATE = 5
|
||||
};
|
||||
|
||||
const std::string ActionEnum2String( ActionEnum enumValue );
|
||||
ActionEnum ActionEnumFromString( const std::string& stringValue );
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace GroupProduction {
|
||||
|
||||
enum ControlEnum {
|
||||
NONE = 0,
|
||||
ORAT = 1,
|
||||
WRAT = 2,
|
||||
GRAT = 3,
|
||||
LRAT = 4,
|
||||
CRAT = 5,
|
||||
RESV = 6,
|
||||
PRBL = 7,
|
||||
FLD = 8
|
||||
};
|
||||
|
||||
const std::string ControlEnum2String( GroupProduction::ControlEnum enumValue );
|
||||
GroupProduction::ControlEnum ControlEnumFromString( const std::string& stringValue );
|
||||
}
|
||||
|
||||
namespace GuideRate {
|
||||
enum GuideRatePhaseEnum {
|
||||
OIL = 0,
|
||||
WAT = 1,
|
||||
GAS = 2,
|
||||
LIQ = 3,
|
||||
COMB = 4,
|
||||
WGA = 5,
|
||||
CVAL = 6,
|
||||
RAT = 7,
|
||||
RES = 8,
|
||||
UNDEFINED = 9
|
||||
};
|
||||
const std::string GuideRatePhaseEnum2String( GuideRatePhaseEnum enumValue );
|
||||
GuideRatePhaseEnum GuideRatePhaseEnumFromString( const std::string& stringValue );
|
||||
}
|
||||
|
||||
namespace RFTConnections {
|
||||
enum RFTEnum {
|
||||
YES = 1,
|
||||
REPT = 2,
|
||||
TIMESTEP = 3,
|
||||
FOPN = 4,
|
||||
NO = 5
|
||||
};
|
||||
|
||||
const std::string RFTEnum2String(RFTEnum enumValue);
|
||||
|
||||
RFTEnum RFTEnumFromString(const std::string &stringValue);
|
||||
}
|
||||
namespace PLTConnections{
|
||||
enum PLTEnum{
|
||||
YES = 1,
|
||||
REPT = 2,
|
||||
TIMESTEP = 3,
|
||||
NO = 4
|
||||
};
|
||||
const std::string PLTEnum2String( PLTEnum enumValue);
|
||||
PLTEnum PLTEnumFromString( const std::string& stringValue);
|
||||
}
|
||||
|
||||
enum OilVaporizationEnum{
|
||||
UNDEF = 0,
|
||||
VAPPARS = 1,
|
||||
DRDT = 2 // DRSDT or DRVDT
|
||||
};
|
||||
|
||||
|
||||
namespace WellSegment{
|
||||
|
||||
enum LengthDepthEnum {
|
||||
INC = 0,
|
||||
ABS = 1
|
||||
};
|
||||
const std::string LengthDepthEnumToString(LengthDepthEnum enumValue);
|
||||
LengthDepthEnum LengthDepthEnumFromString(const std::string& stringValue);
|
||||
|
||||
enum CompPressureDropEnum {
|
||||
HFA = 0,
|
||||
HF_ = 1,
|
||||
H__ = 2
|
||||
};
|
||||
const std::string CompPressureDropEnumToString(CompPressureDropEnum enumValue);
|
||||
CompPressureDropEnum CompPressureDropEnumFromString(const std::string& stringValue);
|
||||
|
||||
enum MultiPhaseModelEnum {
|
||||
HO = 0,
|
||||
DF = 1
|
||||
};
|
||||
const std::string MultiPhaseModelEnumToString(MultiPhaseModelEnum enumValue);
|
||||
MultiPhaseModelEnum MultiPhaseModelEnumFromString(const std::string& stringValue);
|
||||
|
||||
}
|
||||
|
||||
|
||||
namespace WellEcon {
|
||||
enum WorkoverEnum {
|
||||
NONE = 0,
|
||||
CON = 1, // CON
|
||||
CONP = 2, // +CON
|
||||
WELL = 3,
|
||||
PLUG = 4,
|
||||
// the following two only related to workover action
|
||||
// on exceeding secondary water cut limit
|
||||
LAST = 5,
|
||||
RED = 6
|
||||
};
|
||||
const std::string WorkoverEnumToString(WorkoverEnum enumValue);
|
||||
WorkoverEnum WorkoverEnumFromString(const std::string& stringValue);
|
||||
|
||||
enum QuantityLimitEnum {
|
||||
RATE = 0,
|
||||
POTN = 1
|
||||
};
|
||||
const std::string QuantityLimitEnumToString(QuantityLimitEnum enumValue);
|
||||
QuantityLimitEnum QuantityLimitEnumFromString(const std::string& stringValue);
|
||||
}
|
||||
|
||||
|
||||
enum class GroupWellQueryMode {
|
||||
Immediate,
|
||||
Recursive
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user