Commit Graph

4060 Commits

Author SHA1 Message Date
Roland Kaufmann
cec6f12f50 Store reference to UnstructuredGrid in EclipseWriter 2013-11-25 14:14:48 +01:00
Roland Kaufmann
e978cbf848 Remove tucked away reference to parser in Sim.outp. 2013-11-25 14:14:48 +01:00
Roland Kaufmann
ce7eb44836 Propagate UnstructuredGrid to the EclipseWriter ctor
The writer will need to know which cells are the active cells after
post-processing (because these are the cells there is stored results
for in the pressure and saturation arrays), and thus not only the
raw input grid (to get the COORD and ZCORN arrays which is not easily
detainable from the UnstructuredGrid), *and* the UnstructuredGrid
needs to be available.
2013-11-25 14:14:48 +01:00
Roland Kaufmann
3b22d1b8f9 Remove superfluous backing class for share_obj
I originally wanted to make share_obj a class so that I could hide the
helper function, but it turned out that I needed a function after all
since a function template can be inferred from the parameters but the
type cannot from the constructor.

By returning a shared_ptr directly, the compiler can do return object
optimization.
2013-11-25 14:14:48 +01:00
Roland Kaufmann
f71eee34e1 Forgot header for partial_sum 2013-11-25 14:14:48 +01:00
Roland Kaufmann
b6c192fea5 Move shared object hack into more useful generic
The template function share_obj let you pass regular references
as shared pointers, which makes it easy (perhaps too easy) to quick-
fix old code which pass references and have stern warnings about the
lifetime rules of the objects in the documentation section instead.
2013-11-25 14:14:48 +01:00
Roland Kaufmann
f710ff71d1 Provide wrapper which connect simulator and writer
This wrapper class aggregate all the result objects (state, timer
etc.) and register itself for notification with the simulator. At
every timestep the simulator should provide a notification. The
wrapper will receive this and pass all the state objects to the
writer(s) which creates a new timestep.

Currently this doesn't work out-of-the-box because only the
two-phase simulator sends notifications and the writer only
understand the state of blackoil simulators, but these two concepts
should be unified.
2013-11-25 14:14:48 +01:00
Roland Kaufmann
ede84e6cc8 Add helper to use stack variables with shared_ptr
If an interface requires a shared_ptr, but we have an object that is
known to outlive the client anyway, we can use a custom deleter to
suppress the delete part and pass this object around anyway.
2013-11-25 14:14:48 +01:00
Roland Kaufmann
568e597561 Use shared_ptr to signal lifetime requirement
The code is now allowed to use C++11, where shared_ptr is available
in the standard. To specify that the parser object must be present
for the output writer in its entire lifetime, we require to be passed
a shared_ptr. (This can be faked for local storage anyway).
2013-11-25 14:14:47 +01:00
Roland Kaufmann
cd3e047957 Change formatting due to shorter names 2013-11-25 14:14:47 +01:00
Roland Kaufmann
7ea2f32bca Use correct order of saturation names
Due to a glitch the order of the names was put incorrectly in the file,
even though the comment stressed that it was important it was right!

Hat tip: @bska
2013-11-25 14:14:47 +01:00
Roland Kaufmann
39e7943618 Accomodate older versions of boost::filesystem
The return type of the path methods has changed in newer version of
Boost; by wrapping them with a new path object we can get a string
in a way that is compatible for both version 2 and 3.

Hat tip: @bska
2013-11-25 14:14:47 +01:00
Roland Kaufmann
b0b50618d0 Only write the declared phases to file
Only the phases that are specified in the input deck should be written.
Hence the class should work with both two- and three-phase simulations.
2013-11-25 14:14:47 +01:00
Roland Kaufmann
6f32b92f6c Renamed away extraneous verbosity in filenames 2013-11-25 14:14:47 +01:00
Roland Kaufmann
36dfc1db52 Assume positive rate for injectors, negative producers
The rate that is written to the file is always (if the flow is natural)
a positive value; for producers we flip the sign before writing.
2013-11-25 14:14:47 +01:00
Roland Kaufmann
c630220e6f Reorder loops to resemble future processing
We will look at the presence of keywords first, and then for each
keyword determine which wells it applies to.
2013-11-25 14:14:47 +01:00
Roland Kaufmann
441fd2825b Masquerade the actual output format with an interface
Using an interface allows us to code the simulator to just pass the
necessary state variables to something which implements this, and
then the user can select the actual output format with configuration
values. This allows us to set new formats without having to change
the code being compiled (for instance, we can have a special debug
"format" which prints out things of interest in each timestep)
2013-11-25 14:14:47 +01:00
Roland Kaufmann
992572c522 Don't rely on implicit inclusion 2013-11-25 14:14:47 +01:00
Roland Kaufmann
8a2fb74f0d Document limitations of type parameter for getValue 2013-11-25 14:14:46 +01:00
Roland Kaufmann
b53e9b952b Copy between arrays instead of function call
By getting a pointer directly into the data store, the copy can be
performed faster than calling a function for every item. Also, the
storage type of the array should now match the C++ one exactly (i.e.
no conversion to float).
2013-11-25 14:14:46 +01:00
Roland Kaufmann
d8db1acc75 Active cell flag is integral, not floating point type 2013-11-25 14:14:46 +01:00
Roland Kaufmann
82ed3dcd72 Refactor common constructor code into a function
GCC 4.4 doesn't handle calling another constructor in the same type.
(Allowed in C++11 but not supported in GCC 4.4's --std=c++0x mode)
2013-11-25 14:14:46 +01:00
Roland Kaufmann
cb14ee7ce8 Provide default (move) constructors and operators
C++11 will write a default move constructor that invoke the same in
the base class. However, GCC 4.4 doesn't support this, so we have to
explicitly give the implementation that would be generated on later
compilers.
2013-11-25 14:14:46 +01:00
Roland Kaufmann
74ed3d54c0 Avoid comparing signed and unsigned integers 2013-11-25 14:14:46 +01:00
Roland Kaufmann
4a6e502869 Use integer for counter and cast to enumeration 2013-11-25 14:14:46 +01:00
Roland Kaufmann
2b1ad42b9e Hide internals in its own namespace
If we put them in the anonymous namespace, then we cannot have a
reference to the types in the header (because that would mean different
things in each compilation unit).
2013-11-25 14:14:46 +01:00
Roland Kaufmann
351043f76e Explicitly mention template parameter for base class
GCC 4.4 doesn't understand that EclipseHandle (without template
parameter) is supposed to refer to the base class and not a field.
2013-11-25 14:14:46 +01:00
Roland Kaufmann
1a0b6f0eb6 Eliminate dependency on UnstructuredGrid
The only thing it was needed for was the number of cells in the grid,
and the Cartesian dimensions, and those are already available from other
structures.
2013-11-25 14:14:46 +01:00
Roland Kaufmann
9dc4df625f Correct parameter sequence
ecl_grid_alloc_GRDECL_kw takes zcorn first, then coord (slightly
unintuitive if you ask me), and this is also the order that is used
in EclipseGrid::make; thus, the order should be consistent through
the constructor also.
2013-11-25 14:14:45 +01:00
Roland Kaufmann
5a914a2852 Initialize writer with directories gotten from params 2013-11-25 14:14:45 +01:00
Roland Kaufmann
98a36189d3 Conditionally use input file
If config.h is written, then the build system will also define
HAVE_CONFIG_H.
2013-11-25 14:14:45 +01:00
Roland Kaufmann
cdc45b2d56 Trim needless header includes 2013-11-25 14:14:45 +01:00
Roland Kaufmann
1cda556cb9 Remove dependency on ERT in header 2013-11-25 14:14:45 +01:00
Roland Kaufmann
5ce5975586 Coalesce called methods into init and timestep 2013-11-25 14:14:45 +01:00
Roland Kaufmann
572123675d Updated copyright statement at top 2013-11-25 14:14:45 +01:00
Roland Kaufmann
92fd082630 Remove now unused member holding starting time
If we restart from a later time, then the SimulatorTimer should be
restarted in that state as well, so it is already always a reflection
of how far we've progressed in the input file's schedule.
2013-11-25 14:14:45 +01:00
Roland Kaufmann
f637a0cea9 Replace summary variables with RAII type 2013-11-25 14:14:45 +01:00
Roland Kaufmann
cf8c58a33d Replace restart and solution handling with RAII type 2013-11-25 14:14:45 +01:00
Roland Kaufmann
b0a4881d45 Replace init setup with RAII type 2013-11-25 14:14:45 +01:00
Roland Kaufmann
3b8d42ca02 Make grid writing part of the grid type 2013-11-25 14:14:44 +01:00
Roland Kaufmann
2ae164a878 Replace grid construction with RAII type 2013-11-25 14:14:44 +01:00
Roland Kaufmann
97b0dcc3ac Centralize all time conversion
Remove duplicate code into a common helper function
2013-11-25 14:14:44 +01:00
Roland Kaufmann
f845163a0b Replace file name handling with RAII type 2013-11-25 14:14:44 +01:00
Roland Kaufmann
fa03df1e8b Replace data series handling with RAII type
The EclipseKeyword class takes care of cleaning up the handle after we
are done using it, and provides several convenience constructors that
make the code read easier.
2013-11-25 14:14:44 +01:00
Roland Kaufmann
7d7470d36b Add generic version of getXxxValue
This allows us to call getIntegerValue/getFloatingPointValue from
generic code where the type to be used is a template parameter.
2013-11-25 14:14:44 +01:00
Bård Skaflestad
1467a16a34 Merge pull request #439 from andlaus/fix_configure_syntax_error
fix syntax error in configure shell script
2013-11-25 03:52:30 -08:00
Bård Skaflestad
aa9117cf02 Merge pull request #420 from rolk/420_state
Refactor BlackoilState and TwophaseState to have a common interface for writing
2013-11-25 03:30:38 -08:00
Bård Skaflestad
6c56cff450 Merge pull request #436 from rolk/436_searchdir
Search in build/ sub-dir if only suite root is given
2013-11-25 02:29:41 -08:00
Andreas Lauser
c1fc5c53c6 fix syntax error in configure shell script
strangly enough, it seems to work like it was in some circumstances...
2013-11-22 18:39:49 +01:00
Joakim Hove
2b65421d4e Merge remote-tracking branch 'upstream/master' into opm-parser-integrate 2013-11-22 10:23:11 +01:00