Added simple Schedule::Well object

This commit is contained in:
Joakim Hove
2013-11-05 12:55:03 +01:00
parent 3de996acc3
commit 61b640f00f
5 changed files with 156 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ Parser/ParserStringItem.cpp
set (state_source
EclipseState/Schedule/TimeMap.cpp
EclipseState/Schedule/Schedule.cpp )
EclipseState/Schedule/Well.cpp )
set( HEADER_FILES
RawDeck/RawConsts.hpp
@@ -77,6 +78,7 @@ Parser/ParserStringItem.hpp
#
EclipseState/Schedule/TimeMap.hpp
EclipseState/Schedule/Schedule.hpp
EclipseState/Schedule/Well.hpp
)
add_library(buildParser ${rawdeck_source} ${build_parser_source} ${deck_source})

View File

@@ -0,0 +1,39 @@
/*
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/>.
*/
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <string>
namespace Opm {
Well::Well(const std::string& name) {
m_name = name;
}
const std::string& Well::name() const {
return m_name;
}
}

View File

@@ -0,0 +1,43 @@
/*
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 WELL_HPP_
#define WELL_HPP_
#include <boost/shared_ptr.hpp>
#include <string>
namespace Opm {
class Well {
public:
Well(const std::string& name);
const std::string& name() const;
private:
std::string m_name;
};
typedef boost::shared_ptr<Well> WellPtr;
typedef boost::shared_ptr<const Well> WellConstPtr;
}
#endif /* WELL_HPP_ */

View File

@@ -0,0 +1,36 @@
/*
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/>.
*/
#include <stdexcept>
#include <iostream>
#include <boost/filesystem.hpp>
#define BOOST_TEST_MODULE WellTest
#include <boost/test/unit_test.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
BOOST_AUTO_TEST_CASE(CreateWellCorrentName) {
Opm::Well well("WELL1");
BOOST_CHECK_EQUAL( "WELL1" , well.name() );
}

View File

@@ -0,0 +1,36 @@
/*
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/>.
*/
#include <stdexcept>
#include <iostream>
#include <boost/filesystem.hpp>
#define BOOST_TEST_MODULE WellTest
#include <boost/test/unit_test.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
BOOST_AUTO_TEST_CASE(CreateWellCorrentName) {
Opm::Well well("WELL1");
BOOST_CHECK_EQUAL( "WELL1" , well.name() );
}