1. The normalizing in keyword names has been moved from
Eclipse3DProperties to GridProperties.
2. The normalizing does both UPPERCASE and removes trailing
whitespace.
- Moved the handling of keywords from Eclipse3DProperties to
GridProperties<T>.
- The GridProperty<T> postprocessor is invoked from
GridProperties<T>::getKeyword() method. The question of whether the
postprocessor should be invoked or not is determined by the
overload:
public:
const GridProperty<T>& getKeyword(const std::string) const;
private:
GridProperty<T>& getKeyword(const std::string);
The public const overload will run the postprocessor, whereas the
non-const private overload should (will) be used in the construction
phase and should not invoke the post processor.
- The two pass passing where we first internalize integer keywords and
then floating point keywords has been removed.
- Code in GridProperties has mainly been moved to GridProperties.cpp
with explicit instantiation for int and double.
Replaces the home-grown capturing function object with std::function.
Using the library provided std::function enables creating the objects
via std::bind, enabling non-uniform signatures and relieves us of a
maintenance burden.
* Added keyword "OPERNUM" to supported keywords in Eclipse3DProperties
* Updated tests to use Eclipse3DProperties API instead of GridProperties
* Moved init sequence of title into constructor
* ThresholdPressure and SimulationConfig now tasks Deck ref instead of shared_ptr
* Removed obsolete test and unused tests that tested gridProperties
* Refactor use of TableManager. Is now a reference.
* Added non-const GridProperties.getKeyword(size_t i)
* moved region-property from EclipseState to Eclipse3DProperties
* moved initGridopts from EclipseState to Eclipse3DProperties
* made several Eclipse3DProperties methods private
* removed obsolete tests
* replaced log with throw internally in private method---is domain_error
* removed typedef in SatFuncPropertyInitializers
* postprocessors take raw pointers, not shared_ptr---these will be phased out
* fixed return reference instead of copy several places
** gridProperties<T> in Eclipse3DProperties are now references, not shared_ptr
** Eclipse3DProperties takes const Deck&, not shared_ptr
** EclipseGrid and Section are references
* Removed all references to state, need to fix initPORV
* Made TransMult return raw pointer const GridProperty over shared pointer.
* Moved getDirectionProperty and hasDirectionProperty out of API
** Removed tests as these methods are no longer public
* Moved grid properties stuff to new class
* Removed use of deck in SatfuncInitializers, moved to TableManager
* Removed shared_ptr for several members of EclipseState and 3DProperties
* Moved region-property from EclipseState to Eclipse3DProperties
* Moved initGridopts from EclipseState to Eclipse3DProperties
* Made several Eclipse3DProperties methods private
* Postprocessors take raw pointers, not shared_ptr---these will be phased out
* Fixed return reference instead of copy several places
** GridProperties<T> in Eclipse3DProperties are now references, not shared_ptr
** Eclipse3DProperties takes const Deck&, not shared_ptr
* Removed obsolete tests
In an effort to make GridPropertyInitializer and
SatfuncPropertyInitializer functionality more maintainble, the
shared-ptr-to-base-class model has been replaced by a specialised
function object and free functions. This means:
* GridPropertyBaseInitializer and everything derived from it is gone
* All SatfuncPropertyInitializer code has been heavily rewritten to
emphasise dependencies. Now behaves like proper functions.
* EclipseState intialisation code is somewhat simpler
* Code is more declarative. In particular, some maybe unintended
behaviour has been discovered and described.
The new GridPropertyFunction processes grid cell property vectors and
replaces GridPropertyBase* inheritance model. This implementation
re-uses the old implementations as a transition.
GridProperty< T > has only two sensible types to parametrise, int and
double. Moves the implementation and instantiation of GridProperty to
GridProperty.cpp. This also applies to GridPropertyInitializers which
has also been moved to source files.
Results are a cleaner header file (for reading & understanding the
interface) and faster compilations.
Changes the type of the stored supported keywords from pointer-to-vector
to vector. This accomplishes the following:
* we avoid an unecessary level of indirection
* we enable initializer list syntax for tests etc.
* GridProperties' interface properly communicates that it takes over
ownership of the passed keywords.
* it feels more natural in use as generating and returning a vector in a
free function can be returned and directly passed to the constructor
(the motivation for this change).
Bundled with this is the move of the supported keyword population into
using loops to exploit the similarities of families of keywords w.r.t.
GridProperties representation.
I'm pretty sure that most users do not expect this. If that behaviour
was really intentional, one can add a
```
FOO
$NUM_CELLS*
```
line to the deck before the keyword which requires FOO to initialize
itself.
that's because they are not supposed to be modified outside of the
EclipseState. (if they are, why? I'd consider that *very* bad style
since it is also possible to copy these objects and modify the copy
and also this was used nowhere within the OPM project.)
also, the has*Property() is now working as expected: if e.g.,
```c++
bool hasSatnum = eclipseState->hasIntProperty("SATNUM");
eclipseState->getIntProperty("SATNUM");
assert(hasSatnum == eclipseState->hasIntProperty("SATNUM"));
```
will now work for decks which does not explicitly specify
SATNUM. (before the getIntProperty() method silently created the
SATNUM property which caused hasIntProperty() to change its
opinion. With this patch, the property will still be silently created,
but has*Property() ignores it, i.e., that method could be renamed to
hasExplicit*Property() which -- as far as I understand this -- was its
intention from start.)
This is an effort to improve build performance. Several includes
scattered across the project are either unused or partially used (i.e.
just used to import a type name, not depending on the actual contents of
the header file).
Replaces a lot of these includes with forward declarations.
The getKeyword() method will autocreate and initialize a keyword if you
ask for one which is supported, but has not yet been accessed. The new
getInitializedkeyword() method will raise an exception if the keyword
has not already been initialized.
this is just the result of
```
find -iname "*.[ch]pp" | xargs sed -i "s/ *$//"
find opm/parser/share/keywords -type f | xargs sed -i "s/ *$//"
```
so if it causes conflicts with other patches, the others should get
priority. The rationale behind this patch is that some people tell
their editor to remove white space which leads to larger than
necessary patches...
this fixes a really ugly and hard to find bug if EclipseState was
instanced multiple times: The EclipseState object passed to some of
these structures was destroyed, but the arrays stayed even if the next
EclipseState object was at a different location and also could use a
completely different grid...
this uses a small amount of template magic, to automatically change
the API of the GridProperty class depending on wheter it is
instantiated for double or for int.