diff options
Move NamedType template into separate header
Diffstat (limited to 'src/refinement')
-rw-r--r-- | src/refinement/grid2D.h | 36 |
1 files changed, 10 insertions, 26 deletions
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 <typename T, template<typename> class DESCRIPTOR> class FineCoupler2D; template <typename T, template<typename> class DESCRIPTOR> class CoarseCoupler2D; template <typename T, template<typename> class DESCRIPTOR> class RefiningGrid2D; -template <typename T, typename Identificator> -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 <typename T> -using RelaxationTime = NamedType<T,struct NamedRelaxationTime>; +using RelaxationTime = utilities::NamedType<T,struct NamedRelaxationTime>; template <typename T> -using LatticeVelocity = NamedType<T,struct NamedLatticeVelocity>; +using LatticeVelocity = utilities::NamedType<T,struct NamedLatticeVelocity>; template <typename T> struct Characteristics { @@ -98,8 +82,8 @@ protected: std::unique_ptr<SuperGeometry2D<T>> _geometry; std::unique_ptr<SuperLattice2D<T,DESCRIPTOR>> _lattice; - std::vector<std::unique_ptr<Dynamics<T,DESCRIPTOR>>> _dynamics; - std::vector<std::unique_ptr<sOnLatticeBoundaryCondition2D<T,DESCRIPTOR>>> _onLatticeBoundaryConditions; + std::vector<std::unique_ptr<Dynamics<T,DESCRIPTOR>>> _dynamics; + std::vector<std::unique_ptr<sOnLatticeBoundaryCondition2D<T,DESCRIPTOR>>> _onLatticeBoundaryConditions; std::vector<std::unique_ptr<sOffLatticeBoundaryCondition2D<T,DESCRIPTOR>>> _offLatticeBoundaryConditions; std::vector<std::unique_ptr<RefiningGrid2D<T,DESCRIPTOR>>> _fineGrids; @@ -122,14 +106,14 @@ public: Characteristics<T> getCharacteristics() const; - UnitConverter<T,DESCRIPTOR>& getConverter(); - CuboidGeometry2D<T>& getCuboidGeometry(); - LoadBalancer<T>& getLoadBalancer(); - SuperGeometry2D<T>& getSuperGeometry(); + UnitConverter<T,DESCRIPTOR>& getConverter(); + CuboidGeometry2D<T>& getCuboidGeometry(); + LoadBalancer<T>& getLoadBalancer(); + SuperGeometry2D<T>& getSuperGeometry(); SuperLattice2D<T,DESCRIPTOR>& getSuperLattice(); Dynamics<T,DESCRIPTOR>& addDynamics(std::unique_ptr<Dynamics<T,DESCRIPTOR>>&& dynamics); - sOnLatticeBoundaryCondition2D<T,DESCRIPTOR>& getOnLatticeBoundaryCondition(); + sOnLatticeBoundaryCondition2D<T,DESCRIPTOR>& getOnLatticeBoundaryCondition(); sOffLatticeBoundaryCondition2D<T,DESCRIPTOR>& getOffLatticeBoundaryCondition(); void collideAndStream(); |