From ab2e260f53b50d4954c4272285e15b17a56ecbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 12 Oct 2010 10:28:50 +0000 Subject: [PATCH] Changed names of C++ classes implementing interface. --- GridCplusplus.hpp => GridAdapter.hpp | 8 +++--- LibMimetic.hpp => HybridPressureSolver.hpp | 30 ++++++++++------------ 2 files changed, 18 insertions(+), 20 deletions(-) rename GridCplusplus.hpp => GridAdapter.hpp (97%) rename LibMimetic.hpp => HybridPressureSolver.hpp (92%) diff --git a/GridCplusplus.hpp b/GridAdapter.hpp similarity index 97% rename from GridCplusplus.hpp rename to GridAdapter.hpp index 1960c3b8..a8b95c1c 100644 --- a/GridCplusplus.hpp +++ b/GridAdapter.hpp @@ -17,14 +17,14 @@ along with OPM. If not, see . */ -#ifndef SINTEF_GRIDCPLUSPLUS_HEADER -#define SINTEF_GRIDCPLUSPLUS_HEADER +#ifndef OPM_GRIDADAPTER_HEADER_INCLUDED +#define OPM_GRIDADAPTER_HEADER_INCLUDED #include "grid.h" #include -class GridCplusplus +class GridAdapter { public: /// @brief @@ -164,4 +164,4 @@ private: }; -#endif // SINTEF_GRIDCPLUSPLUS_HEADER +#endif // OPM_GRIDADAPTER_HEADER_INCLUDED diff --git a/LibMimetic.hpp b/HybridPressureSolver.hpp similarity index 92% rename from LibMimetic.hpp rename to HybridPressureSolver.hpp index 7457db9a..aa50b5e6 100644 --- a/LibMimetic.hpp +++ b/HybridPressureSolver.hpp @@ -18,31 +18,31 @@ */ -#ifndef SINTEF_LIBMIMETIC_HEADER -#define SINTEF_LIBMIMETIC_HEADER +#ifndef OPM_HYBRIDPRESSURESOLVER_HEADER_INCLUDED +#define OPM_HYBRIDPRESSURESOLVER_HEADER_INCLUDED #include "ifsh.h" #include "mimetic.h" -#include "GridCplusplus.hpp" +#include "GridAdapter.hpp" #include /// @brief /// Encapsulates the ifsh (= incompressible flow solver hybrid) solver modules. -class Ifsh +class HybridPressureSolver { public: /// @brief /// Default constructor, does nothing. - Ifsh() + HybridPressureSolver() : state_(Uninitialized), data_(0) { } /// @brief /// Destructor. - ~Ifsh() + ~HybridPressureSolver() { ifsh_destroy(data_); } @@ -123,7 +123,7 @@ public: const std::vector bcvalues) { 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. @@ -190,7 +190,7 @@ public: { 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()."); } s.n = data_->A->n; @@ -213,7 +213,7 @@ public: std::vector& face_fluxes) { 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) " "prior to calling computePressuresAndFluxes()."); } @@ -242,7 +242,7 @@ public: std::vector& cell_fluxes) { 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) " "prior to calling faceFluxToCellFlux()."); } @@ -267,8 +267,8 @@ public: private: // Disabling copy and assigment for now. - Ifsh(const Ifsh&); - Ifsh& operator=(const Ifsh&); + HybridPressureSolver(const HybridPressureSolver&); + HybridPressureSolver& operator=(const HybridPressureSolver&); enum State { Uninitialized, Initialized, Assembled }; State state_; @@ -276,7 +276,7 @@ private: // Solver data. ifsh_data* data_; // Grid. - GridCplusplus grid_; + GridAdapter grid_; // Number of faces per cell. std::vector ncf_; // B^{-1} storage. @@ -290,6 +290,4 @@ private: }; - - -#endif // SINTEF_LIBMIMETIC_HEADER +#endif // OPM_HYBRIDPRESSURESOLVER_HEADER_INCLUDED