Files
opm-common/opm/output/eclipse/Summary.hpp

93 lines
3.0 KiB
C++
Raw Normal View History

/*
Copyright 2016 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_OUTPUT_SUMMARY_HPP
#define OPM_OUTPUT_SUMMARY_HPP
#include <opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculatorCollection.hpp>
2020-03-16 13:51:05 +01:00
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <opm/output/data/Aquifer.hpp>
#include <map>
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
#include <memory>
#include <string>
#include <unordered_map>
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
#include <utility>
#include <vector>
namespace Opm {
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
class EclipseGrid;
class EclipseState;
class Schedule;
class SummaryConfig;
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
class SummaryState;
class Inplace;
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
} // namespace Opm
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
namespace Opm { namespace data {
2021-06-12 09:06:03 +02:00
class Wells;
class GroupAndNetworkValues;
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
}} // namespace Opm::data
namespace Opm { namespace out {
class Summary {
public:
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
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>;
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
Summary(const EclipseState& es,
const SummaryConfig& sumcfg,
const EclipseGrid& grid,
const Schedule& sched,
const std::string& basename = "",
const bool& writeEsmry = false
);
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
~Summary();
void add_timestep(const SummaryState& st, const int report_step, bool isSubstep);
void eval(SummaryState& summary_state,
const int report_step,
const double secs_elapsed,
2021-06-12 09:06:03 +02:00
const data::Wells& well_solution,
const data::GroupAndNetworkValues& group_and_nwrk_solution,
GlobalProcessParameters single_values,
const Inplace& initial_inplace,
2020-11-24 12:06:31 +01:00
const Inplace& inplace,
const PAvgCalculatorCollection& ,
const RegionParameters& region_values = {},
const BlockValues& block_values = {},
const data::Aquifers& aquifers_values = {}) const;
void write() const;
PAvgCalculatorCollection wbp_calculators(std::size_t report_step) const;
private:
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
class SummaryImplementation;
std::unique_ptr<SummaryImplementation> pImpl_;
};
Replace Writer for Summary/SMSPEC Files This commit replaces the existing system for writing summary and specification (SMSPEC) files with a new implementation based on class EclOutput. We package the evaluators of individual parameters in a set of classes determined by the parameter's category which each implement a virtual 'update()' function. This update function ultimately writes new values into a SummaryState object. Add a factory-like system for instantiating the appropriate class depending on a SummaryNode's 'category()'. Also, add a helper class for managing the parameters that a configured in a simulation model's SUMMARY section in order to distinguish these from those parameters that are merely needed for restart purposes. The summary class's 'eval()' function then becomes a loop over the evaluators for parameters in SUMMARY followed by a loop over the evaluators for restart vectors. We reimplement the 'internal_store()' function in terms of an std::vector of a helper structure 'MiniStep' which holds a ministep ID (contiguous counter started at zero), a report step ID, and all the evaluated parameters of this ministep. The final write function then consists of outputting those ministep structures that have accumulated since the previous call to write(). If a simulation does not call write at all, then this will accumulate all parameters for all ministeps throughout the simulation history. We create the SMSPEC file at most once, and write to it at most each report step. We create the summary file once (if unified) or at each report step (if separate).
2019-10-09 00:25:45 -05:00
}} // namespace Opm::out
#endif //OPM_OUTPUT_SUMMARY_HPP