Changed names of C++ classes implementing interface.

This commit is contained in:
Atgeirr Flø Rasmussen 2010-10-12 10:28:50 +00:00
parent 9a4b131186
commit ab2e260f53
2 changed files with 18 additions and 20 deletions

View File

@ -17,14 +17,14 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>. along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef SINTEF_GRIDCPLUSPLUS_HEADER #ifndef OPM_GRIDADAPTER_HEADER_INCLUDED
#define SINTEF_GRIDCPLUSPLUS_HEADER #define OPM_GRIDADAPTER_HEADER_INCLUDED
#include "grid.h" #include "grid.h"
#include <stdexcept> #include <stdexcept>
class GridCplusplus class GridAdapter
{ {
public: public:
/// @brief /// @brief
@ -164,4 +164,4 @@ private:
}; };
#endif // SINTEF_GRIDCPLUSPLUS_HEADER #endif // OPM_GRIDADAPTER_HEADER_INCLUDED

View File

@ -18,31 +18,31 @@
*/ */
#ifndef SINTEF_LIBMIMETIC_HEADER #ifndef OPM_HYBRIDPRESSURESOLVER_HEADER_INCLUDED
#define SINTEF_LIBMIMETIC_HEADER #define OPM_HYBRIDPRESSURESOLVER_HEADER_INCLUDED
#include "ifsh.h" #include "ifsh.h"
#include "mimetic.h" #include "mimetic.h"
#include "GridCplusplus.hpp" #include "GridAdapter.hpp"
#include <stdexcept> #include <stdexcept>
/// @brief /// @brief
/// Encapsulates the ifsh (= incompressible flow solver hybrid) solver modules. /// Encapsulates the ifsh (= incompressible flow solver hybrid) solver modules.
class Ifsh class HybridPressureSolver
{ {
public: public:
/// @brief /// @brief
/// Default constructor, does nothing. /// Default constructor, does nothing.
Ifsh() HybridPressureSolver()
: state_(Uninitialized), data_(0) : state_(Uninitialized), data_(0)
{ {
} }
/// @brief /// @brief
/// Destructor. /// Destructor.
~Ifsh() ~HybridPressureSolver()
{ {
ifsh_destroy(data_); ifsh_destroy(data_);
} }
@ -123,7 +123,7 @@ public:
const std::vector<double> bcvalues) const std::vector<double> bcvalues)
{ {
if (state_ == Uninitialized) { if (state_ == Uninitialized) {
throw std::runtime_error("Error in Ifsh::assemble(): You must call init() prior to calling assemble()."); throw std::runtime_error("Error in HybridPressureSolver::assemble(): You must call init() prior to calling assemble().");
} }
// Boundary conditions. // Boundary conditions.
@ -190,7 +190,7 @@ public:
{ {
if (state_ != Assembled) { if (state_ != Assembled) {
throw std::runtime_error("Error in Ifsh::linearSystem(): " throw std::runtime_error("Error in HybridPressureSolver::linearSystem(): "
"You must call assemble() prior to calling linearSystem()."); "You must call assemble() prior to calling linearSystem().");
} }
s.n = data_->A->n; s.n = data_->A->n;
@ -213,7 +213,7 @@ public:
std::vector<double>& face_fluxes) std::vector<double>& face_fluxes)
{ {
if (state_ != Assembled) { if (state_ != Assembled) {
throw std::runtime_error("Error in Ifsh::computePressuresAndFluxes(): " throw std::runtime_error("Error in HybridPressureSolver::computePressuresAndFluxes(): "
"You must call assemble() (and solve the linear system) " "You must call assemble() (and solve the linear system) "
"prior to calling computePressuresAndFluxes()."); "prior to calling computePressuresAndFluxes().");
} }
@ -242,7 +242,7 @@ public:
std::vector<double>& cell_fluxes) std::vector<double>& cell_fluxes)
{ {
if (state_ != Assembled) { if (state_ != Assembled) {
throw std::runtime_error("Error in Ifsh::faceFluxToCellFlux(): " throw std::runtime_error("Error in HybridPressureSolver::faceFluxToCellFlux(): "
"You must call assemble() (and solve the linear system) " "You must call assemble() (and solve the linear system) "
"prior to calling faceFluxToCellFlux()."); "prior to calling faceFluxToCellFlux().");
} }
@ -267,8 +267,8 @@ public:
private: private:
// Disabling copy and assigment for now. // Disabling copy and assigment for now.
Ifsh(const Ifsh&); HybridPressureSolver(const HybridPressureSolver&);
Ifsh& operator=(const Ifsh&); HybridPressureSolver& operator=(const HybridPressureSolver&);
enum State { Uninitialized, Initialized, Assembled }; enum State { Uninitialized, Initialized, Assembled };
State state_; State state_;
@ -276,7 +276,7 @@ private:
// Solver data. // Solver data.
ifsh_data* data_; ifsh_data* data_;
// Grid. // Grid.
GridCplusplus grid_; GridAdapter grid_;
// Number of faces per cell. // Number of faces per cell.
std::vector<int> ncf_; std::vector<int> ncf_;
// B^{-1} storage. // B^{-1} storage.
@ -290,6 +290,4 @@ private:
}; };
#endif // OPM_HYBRIDPRESSURESOLVER_HEADER_INCLUDED
#endif // SINTEF_LIBMIMETIC_HEADER