From aad7e13965046c110440d237cf5fbaaadae27c19 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Wed, 28 Apr 2021 22:11:52 +0200
Subject: [PATCH] [PL/TH2M] Rename PhaseTransitionModel base class.

Plural is incorrect, just a model.
---
 ProcessLib/TH2M/CreateTH2MProcess.cpp                      | 2 +-
 .../PhaseTransitionModels/PhaseTransitionDissolution.cpp   | 2 +-
 .../PhaseTransitionModels/PhaseTransitionDissolution.h     | 4 ++--
 .../PhaseTransitionModels/PhaseTransitionEvaporation.cpp   | 2 +-
 .../PhaseTransitionModels/PhaseTransitionEvaporation.h     | 4 ++--
 .../TH2M/PhaseTransitionModels/PhaseTransitionFull.cpp     | 2 +-
 .../TH2M/PhaseTransitionModels/PhaseTransitionFull.h       | 4 ++--
 .../{PhaseTransitionModels.h => PhaseTransitionModel.h}    | 7 +++----
 .../TH2M/PhaseTransitionModels/PhaseTransitionNone.cpp     | 2 +-
 .../TH2M/PhaseTransitionModels/PhaseTransitionNone.h       | 4 ++--
 ProcessLib/TH2M/TH2MProcessData.h                          | 4 ++--
 .../ProcessLib/TH2M/TestTH2MPhaseTransitionEvaporation.cpp | 2 +-
 Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionNone.cpp      | 3 +--
 13 files changed, 20 insertions(+), 22 deletions(-)
 rename ProcessLib/TH2M/PhaseTransitionModels/{PhaseTransitionModels.h => PhaseTransitionModel.h} (96%)

diff --git a/ProcessLib/TH2M/CreateTH2MProcess.cpp b/ProcessLib/TH2M/CreateTH2MProcess.cpp
index 3f069daf824..159c44bf51b 100644
--- a/ProcessLib/TH2M/CreateTH2MProcess.cpp
+++ b/ProcessLib/TH2M/CreateTH2MProcess.cpp
@@ -27,7 +27,7 @@ namespace ProcessLib
 {
 namespace TH2M
 {
-std::unique_ptr<PhaseTransitionModels> createPhaseTransitionModel(
+std::unique_ptr<PhaseTransitionModel> createPhaseTransitionModel(
     std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
 {
     // the approach here is that the number of phase components determines the
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.cpp b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.cpp
index e1f629df75f..b2c048fa462 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.cpp
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.cpp
@@ -15,7 +15,7 @@ namespace TH2M
 {
 PhaseTransitionDissolution::PhaseTransitionDissolution(
     std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
-    : PhaseTransitionModels(media)
+    : PhaseTransitionModel(media)
 {
     DBUG("Create PhaseTransitionDissolution constitutive model.");
 }
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.h b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.h
index 0e4021c876b..32af7def7d3 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.h
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionDissolution.h
@@ -12,7 +12,7 @@
 #include <map>
 
 #include "MaterialLib/MPL/Medium.h"
-#include "PhaseTransitionModels.h"
+#include "PhaseTransitionModel.h"
 
 namespace ProcessLib
 {
@@ -21,7 +21,7 @@ namespace TH2M
 /// Dissolution only: Amounts of the gas phase can be dissolved into the liquid
 /// phase. This is realized by defining two components in the liqid phase but
 /// only one (or zero) components in the gas phase.
-struct PhaseTransitionDissolution : PhaseTransitionModels
+struct PhaseTransitionDissolution : PhaseTransitionModel
 {
     explicit PhaseTransitionDissolution(
         std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.cpp b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.cpp
index cd5124f5c15..baa544c8cd4 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.cpp
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.cpp
@@ -74,7 +74,7 @@ namespace TH2M
 {
 PhaseTransitionEvaporation::PhaseTransitionEvaporation(
     std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
-    : PhaseTransitionModels(media),
+    : PhaseTransitionModel(media),
       n_components_gas_{numberOfGasComponents(media)},
       gas_phase_vapour_component_index_{findVapourComponentIndex(media)},
       // dry air component is complement of vapour component index
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.h b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.h
index 22d30c9c82a..b350817df08 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.h
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionEvaporation.h
@@ -12,13 +12,13 @@
 #include <map>
 
 #include "MaterialLib/MPL/Medium.h"
-#include "PhaseTransitionModels.h"
+#include "PhaseTransitionModel.h"
 
 namespace ProcessLib
 {
 namespace TH2M
 {
-struct PhaseTransitionEvaporation : PhaseTransitionModels
+struct PhaseTransitionEvaporation : PhaseTransitionModel
 {
     explicit PhaseTransitionEvaporation(
         std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.cpp b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.cpp
index d4e1d4ed3be..9029da1b577 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.cpp
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.cpp
@@ -17,7 +17,7 @@ namespace TH2M
 {
 PhaseTransitionFull::PhaseTransitionFull(
     std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
-    : PhaseTransitionModels(media)
+    : PhaseTransitionModel(media)
 {
     DBUG("Create PhaseTransitionFull constitutive model.");
 }
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.h b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.h
index 70551d114d6..705e7e50543 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.h
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionFull.h
@@ -12,7 +12,7 @@
 #include <map>
 
 #include "MaterialLib/MPL/Medium.h"
-#include "PhaseTransitionModels.h"
+#include "PhaseTransitionModel.h"
 
 namespace ProcessLib
 {
@@ -22,7 +22,7 @@ namespace TH2M
 /// an equilibrium and water evaporates into the gas phase according to Dalton's
 /// law. This is realized by defining two components in each gas and liquid
 /// phase.
-struct PhaseTransitionFull : PhaseTransitionModels
+struct PhaseTransitionFull : PhaseTransitionModel
 {
     explicit PhaseTransitionFull(
         std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModels.h b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.h
similarity index 96%
rename from ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModels.h
rename to ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.h
index 930e7ab1d18..07ddeaf253d 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModels.h
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionModel.h
@@ -5,7 +5,6 @@
  *            Distributed under a Modified BSD License.
  *              See accompanying file LICENSE.txt or
  *              http://www.opengeosys.org/project/license
- *
  */
 
 #pragma once
@@ -18,9 +17,9 @@ namespace ProcessLib
 {
 namespace TH2M
 {
-struct PhaseTransitionModels
+struct PhaseTransitionModel
 {
-    explicit PhaseTransitionModels(
+    explicit PhaseTransitionModel(
         std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
             media)
     {
@@ -43,7 +42,7 @@ struct PhaseTransitionModels
         }
     }
 
-    virtual ~PhaseTransitionModels() = default;
+    virtual ~PhaseTransitionModel() = default;
 
     virtual void computeConstitutiveVariables(
         const MaterialPropertyLib::Medium* medium,
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.cpp b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.cpp
index ec425c50001..e046096906d 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.cpp
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.cpp
@@ -17,7 +17,7 @@ namespace TH2M
 {
 PhaseTransitionNone::PhaseTransitionNone(
     std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
-    : PhaseTransitionModels(media)
+    : PhaseTransitionModel(media)
 {
     DBUG("Create PhaseTransitionNone constitutive model.");
 
diff --git a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.h b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.h
index 2c370915516..67950101e79 100644
--- a/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.h
+++ b/ProcessLib/TH2M/PhaseTransitionModels/PhaseTransitionNone.h
@@ -12,13 +12,13 @@
 #include <map>
 
 #include "MaterialLib/MPL/Medium.h"
-#include "PhaseTransitionModels.h"
+#include "PhaseTransitionModel.h"
 
 namespace ProcessLib
 {
 namespace TH2M
 {
-struct PhaseTransitionNone : PhaseTransitionModels
+struct PhaseTransitionNone : PhaseTransitionModel
 {
     explicit PhaseTransitionNone(
         std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
diff --git a/ProcessLib/TH2M/TH2MProcessData.h b/ProcessLib/TH2M/TH2MProcessData.h
index 21222506a84..d7ae91b5c40 100644
--- a/ProcessLib/TH2M/TH2MProcessData.h
+++ b/ProcessLib/TH2M/TH2MProcessData.h
@@ -19,7 +19,7 @@
 #include "PhaseTransitionModels/PhaseTransitionDissolution.h"
 #include "PhaseTransitionModels/PhaseTransitionEvaporation.h"
 #include "PhaseTransitionModels/PhaseTransitionFull.h"
-#include "PhaseTransitionModels/PhaseTransitionModels.h"
+#include "PhaseTransitionModels/PhaseTransitionModel.h"
 #include "PhaseTransitionModels/PhaseTransitionNone.h"
 
 namespace MaterialLib
@@ -48,7 +48,7 @@ struct TH2MProcessData
                       MaterialLib::Solids::MechanicsBase<DisplacementDim>>>
         solid_materials;
 
-    std::unique_ptr<PhaseTransitionModels> phase_transition_model_ = nullptr;
+    std::unique_ptr<PhaseTransitionModel> phase_transition_model_ = nullptr;
 
     ParameterLib::Parameter<double> const& reference_temperature;
 
diff --git a/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionEvaporation.cpp b/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionEvaporation.cpp
index cc3bd4b7247..7bbcb87f18f 100644
--- a/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionEvaporation.cpp
+++ b/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionEvaporation.cpp
@@ -112,7 +112,7 @@ TEST(ProcessLib, TH2MPhaseTransitionEvaporation)
     double const time = std::numeric_limits<double>::quiet_NaN();
     double const dt = std::numeric_limits<double>::quiet_NaN();
 
-    std::unique_ptr<ProcessLib::TH2M::PhaseTransitionModels> ptm =
+    auto ptm =
         std::make_unique<ProcessLib::TH2M::PhaseTransitionEvaporation>(media);
 
     double const pGR = 1000000.;
diff --git a/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionNone.cpp b/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionNone.cpp
index 3445040f2e2..e54bf1d8680 100644
--- a/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionNone.cpp
+++ b/Tests/ProcessLib/TH2M/TestTH2MPhaseTransitionNone.cpp
@@ -84,8 +84,7 @@ TEST(ProcessLib, TH2MPhaseTransitionNone)
     double const time = std::numeric_limits<double>::quiet_NaN();
     double const dt = std::numeric_limits<double>::quiet_NaN();
 
-    std::unique_ptr<ProcessLib::TH2M::PhaseTransitionModels> ptm =
-        std::make_unique<ProcessLib::TH2M::PhaseTransitionNone>(media);
+    auto ptm = std::make_unique<ProcessLib::TH2M::PhaseTransitionNone>(media);
 
     double const pGR = 1000000.;
     double const pCap = 1000000.;
-- 
GitLab