From babe2dc2b72fad674be8aa48d6ec232a50d020df Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 15 Feb 2019 11:18:16 +0100 Subject: Move NamedType template into separate header --- src/refinement/grid2D.h | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'src/refinement') diff --git a/src/refinement/grid2D.h b/src/refinement/grid2D.h index f538850..42937ca 100644 --- a/src/refinement/grid2D.h +++ b/src/refinement/grid2D.h @@ -37,6 +37,7 @@ #include "communication/loadBalancer.h" #include "functors/analytical/indicator/indicatorF2D.h" #include "utilities/functorPtr.h" +#include "utilities/namedType.h" namespace olb { @@ -45,28 +46,11 @@ template class DESCRIPTOR> class FineCoupler2D; template class DESCRIPTOR> class CoarseCoupler2D; template class DESCRIPTOR> class RefiningGrid2D; -template -class NamedType { -private: - T _value; - -public: - explicit NamedType(const T& value): - _value(value) {} - explicit NamedType(T&& value): - _value(std::move(value)) {} - - operator T() const - { - return _value; - } -}; - template -using RelaxationTime = NamedType; +using RelaxationTime = utilities::NamedType; template -using LatticeVelocity = NamedType; +using LatticeVelocity = utilities::NamedType; template struct Characteristics { @@ -98,8 +82,8 @@ protected: std::unique_ptr> _geometry; std::unique_ptr> _lattice; - std::vector>> _dynamics; - std::vector>> _onLatticeBoundaryConditions; + std::vector>> _dynamics; + std::vector>> _onLatticeBoundaryConditions; std::vector>> _offLatticeBoundaryConditions; std::vector>> _fineGrids; @@ -122,14 +106,14 @@ public: Characteristics getCharacteristics() const; - UnitConverter& getConverter(); - CuboidGeometry2D& getCuboidGeometry(); - LoadBalancer& getLoadBalancer(); - SuperGeometry2D& getSuperGeometry(); + UnitConverter& getConverter(); + CuboidGeometry2D& getCuboidGeometry(); + LoadBalancer& getLoadBalancer(); + SuperGeometry2D& getSuperGeometry(); SuperLattice2D& getSuperLattice(); Dynamics& addDynamics(std::unique_ptr>&& dynamics); - sOnLatticeBoundaryCondition2D& getOnLatticeBoundaryCondition(); + sOnLatticeBoundaryCondition2D& getOnLatticeBoundaryCondition(); sOffLatticeBoundaryCondition2D& getOffLatticeBoundaryCondition(); void collideAndStream(); -- cgit v1.2.3