resolved merge conflict.
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <pybind11/stl.h>
|
||||
#include "sunbeam.hpp"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
const std::set<std::string> wellnames( const Group& g, size_t timestep ) {
|
||||
return g.getWells( timestep );
|
||||
const std::vector<std::string> wellnames( const Group2& g ) {
|
||||
return g.wells( );
|
||||
}
|
||||
|
||||
int get_vfp_table_nr( const Group& g, size_t timestep ) {
|
||||
return g.getGroupNetVFPTable(timestep);
|
||||
int get_vfp_table_nr( const Group2& g ) {
|
||||
return g.getGroupNetVFPTable();
|
||||
}
|
||||
}
|
||||
|
||||
void sunbeam::export_Group(py::module& module) {
|
||||
|
||||
py::class_< Group >( module, "Group")
|
||||
.def_property_readonly( "name", &Group::name)
|
||||
py::class_< Group2 >( module, "Group")
|
||||
.def_property_readonly( "name", &Group2::name)
|
||||
.def( "_vfp_table_nr", &get_vfp_table_nr )
|
||||
.def( "_wellnames", &wellnames );
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GroupTree.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
|
||||
#include "sunbeam.hpp"
|
||||
@@ -6,19 +6,20 @@
|
||||
|
||||
namespace {
|
||||
|
||||
std::string parent( const GroupTree& gt, const std::string& name ) {
|
||||
return gt.parent(name);
|
||||
GTNode parent( const GTNode & gt ) {
|
||||
return gt.parent();
|
||||
}
|
||||
|
||||
py::list children( const GroupTree& gt, const std::string& name ) {
|
||||
return iterable_to_pylist(gt.children(name)) ;
|
||||
py::list children( const GTNode & gt ) {
|
||||
return iterable_to_pylist(gt.groups()) ;
|
||||
}
|
||||
}
|
||||
|
||||
void sunbeam::export_GroupTree(py::module& module) {
|
||||
|
||||
py::class_< GroupTree >(module, "GroupTree")
|
||||
py::class_<GTNode>(module, "GroupTree")
|
||||
|
||||
.def( "name", >Node::name)
|
||||
.def( "_parent", &parent, "parent function returning parent of a group")
|
||||
.def( "_children", &children, "children function returning python"
|
||||
" list containing children of a group")
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace {
|
||||
throw py::key_error( name );
|
||||
}
|
||||
|
||||
const GroupTree& get_grouptree ( const Schedule& sch, const size_t& timestep) {
|
||||
return sch.getGroupTree(timestep);
|
||||
GTNode get_grouptree ( const Schedule& sch, const std::string& root_node, const size_t& timestep) {
|
||||
return sch.groupTree(root_node, timestep);
|
||||
}
|
||||
system_clock::time_point get_start_time( const Schedule& s ) {
|
||||
return datetime(s.posixStartTime());
|
||||
@@ -71,10 +71,10 @@ namespace {
|
||||
return v;
|
||||
}
|
||||
|
||||
std::vector<Group> get_groups( const Schedule& sch ) {
|
||||
std::vector< Group > groups;
|
||||
std::vector<Group2> get_groups( const Schedule& sch, size_t timestep ) {
|
||||
std::vector< Group2 > groups;
|
||||
for( const auto& group_name : sch.groupNames())
|
||||
groups.push_back( sch.getGroup(group_name) );
|
||||
groups.push_back( sch.getGroup2(group_name, timestep) );
|
||||
|
||||
return groups;
|
||||
}
|
||||
@@ -83,8 +83,8 @@ namespace {
|
||||
return sch.hasWell( wellName );
|
||||
}
|
||||
|
||||
const Group& get_group(const Schedule& sch, const std::string group_name) {
|
||||
return sch.getGroup(group_name);
|
||||
const Group2& get_group(const Schedule& sch, const std::string& group_name, std::size_t timestep) {
|
||||
return sch.getGroup2(group_name, timestep);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace {
|
||||
void sunbeam::export_Schedule(py::module& module) {
|
||||
|
||||
py::class_< Schedule >( module, "Schedule")
|
||||
.def_property_readonly( "_groups", &get_groups )
|
||||
.def("_groups", &get_groups )
|
||||
.def_property_readonly( "start", &get_start_time )
|
||||
.def_property_readonly( "end", &get_end_time )
|
||||
.def_property_readonly( "timesteps", &get_timesteps )
|
||||
|
||||
Reference in New Issue
Block a user