From e1626f2eb19215482aa6f17966f5e54e3a0c4faa Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 8 Jan 2019 14:44:44 +0100 Subject: Further indicatorize geometry setup Grid refinement is at its easiest when discrete materials are set using analytical - i.e. resolution independent - indicators. --- src/refinement/grid2D.h | 2 ++ src/refinement/grid2D.hh | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/refinement') diff --git a/src/refinement/grid2D.h b/src/refinement/grid2D.h index fda38ed..6d3579c 100644 --- a/src/refinement/grid2D.h +++ b/src/refinement/grid2D.h @@ -76,6 +76,8 @@ public: CoarseCoupler2D& addCoarseCoupling( Grid2D& fineGrid, Vector origin, Vector extend); + Vector alignToGrid(Vector physR) const; + Grid2D& refine(IndicatorF2D& domainF); Grid2D& refine(Vector origin, Vector extend); diff --git a/src/refinement/grid2D.hh b/src/refinement/grid2D.hh index 86c3102..d609746 100644 --- a/src/refinement/grid2D.hh +++ b/src/refinement/grid2D.hh @@ -169,12 +169,20 @@ Grid2D& Grid2D::refine(IndicatorF2D& domainF) new Grid2D( domainF, 2*getConverter().getResolution(), - 2.0*getConverter().getLatticeRelaxationTime() - 0.5, + 2*getConverter().getLatticeRelaxationTime() - 0.5, getConverter().getReynoldsNumber() )); return *_fineGrids.back(); } +template class DESCRIPTOR> +Vector Grid2D::alignToGrid(Vector physR) const +{ + Vector latticeR{}; + _cuboids->getLatticeR(physR, latticeR); + return _cuboids->getPhysR(latticeR.toStdVector()); +} + template class DESCRIPTOR> Grid2D& Grid2D::refine(Vector origin, Vector extend) { -- cgit v1.2.3