From 5e888fc13f38c94777963d72fc9e391cd4fa477a Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 30 Jan 2019 20:12:31 +0100 Subject: Manage dynamics, boundary condition memory in Grid2D Mainly to further declutter simulation and refinement setup --- src/refinement/grid2D.h | 6 ++++++ src/refinement/grid2D.hh | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'src/refinement') diff --git a/src/refinement/grid2D.h b/src/refinement/grid2D.h index f58a4ea..37e764a 100644 --- a/src/refinement/grid2D.h +++ b/src/refinement/grid2D.h @@ -77,6 +77,9 @@ protected: std::unique_ptr> _geometry; std::unique_ptr> _lattice; + std::vector>> _dynamics; + std::vector>> _onLatticeBoundaryConditions; + std::vector>> _fineGrids; std::vector>> _fineCouplers; @@ -92,6 +95,9 @@ public: SuperGeometry2D& getSuperGeometry(); SuperLattice2D& getSuperLattice(); + Dynamics& addDynamics(std::unique_ptr>&& dynamics); + sOnLatticeBoundaryCondition2D& getOnLatticeBoundaryCondition(); + void collideAndStream(); FineCoupler2D& addFineCoupling( diff --git a/src/refinement/grid2D.hh b/src/refinement/grid2D.hh index f1caf84..941bff7 100644 --- a/src/refinement/grid2D.hh +++ b/src/refinement/grid2D.hh @@ -133,6 +133,23 @@ SuperLattice2D& Grid2D::getSuperLattice() return *_lattice; } +template class DESCRIPTOR> +Dynamics& Grid2D::addDynamics( + std::unique_ptr>&& dynamics) +{ + Dynamics& ref = *dynamics; + _dynamics.emplace_back(std::move(dynamics)); + return ref; +} + +template class DESCRIPTOR> +sOnLatticeBoundaryCondition2D& Grid2D::getOnLatticeBoundaryCondition() +{ + _onLatticeBoundaryConditions.emplace_back( + new sOnLatticeBoundaryCondition2D(getSuperLattice())); + return *_onLatticeBoundaryConditions.back(); +} + template class DESCRIPTOR> void Grid2D::collideAndStream() { -- cgit v1.2.3