Added simple Schedule::Well object
This commit is contained in:
@@ -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})
|
||||
|
||||
39
opm/parser/eclipse/EclipseState/Schedule/Well.cpp
Normal file
39
opm/parser/eclipse/EclipseState/Schedule/Well.cpp
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
43
opm/parser/eclipse/EclipseState/Schedule/Well.hpp
Normal file
43
opm/parser/eclipse/EclipseState/Schedule/Well.hpp
Normal 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_ */
|
||||
36
opm/parser/eclipse/EclipseState/Schedule/tests/WellTest.cpp
Normal file
36
opm/parser/eclipse/EclipseState/Schedule/tests/WellTest.cpp
Normal 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() );
|
||||
}
|
||||
36
opm/parser/eclipse/EclipseState/Schedule/tests/WellTests.cpp
Normal file
36
opm/parser/eclipse/EclipseState/Schedule/tests/WellTests.cpp
Normal 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() );
|
||||
}
|
||||
Reference in New Issue
Block a user