summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-15 11:18:16 +0100
committerAdrian Kummerlaender2019-06-24 15:17:42 +0200
commitbabe2dc2b72fad674be8aa48d6ec232a50d020df (patch)
tree45b31c3b50f5a1e10f5678d8f61126d4c1a4d1a2
parentfbf8a9c4e69134ea53a583faebe3aec91e9abc4f (diff)
downloadgrid_refinement_openlb-babe2dc2b72fad674be8aa48d6ec232a50d020df.tar
grid_refinement_openlb-babe2dc2b72fad674be8aa48d6ec232a50d020df.tar.gz
grid_refinement_openlb-babe2dc2b72fad674be8aa48d6ec232a50d020df.tar.bz2
grid_refinement_openlb-babe2dc2b72fad674be8aa48d6ec232a50d020df.tar.xz
grid_refinement_openlb-babe2dc2b72fad674be8aa48d6ec232a50d020df.zip
Move NamedType template into separate header
-rw-r--r--src/refinement/grid2D.h36
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();