summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-01-08 14:44:44 +0100
committerAdrian Kummerlaender2019-06-24 15:16:01 +0200
commite1626f2eb19215482aa6f17966f5e54e3a0c4faa (patch)
treed4ce5ef842bffc3e73875cd9f32711464371a817 /src
parentae4f808b51329a236dcbd7671ceb8c85c3906b6f (diff)
downloadgrid_refinement_openlb-e1626f2eb19215482aa6f17966f5e54e3a0c4faa.tar
grid_refinement_openlb-e1626f2eb19215482aa6f17966f5e54e3a0c4faa.tar.gz
grid_refinement_openlb-e1626f2eb19215482aa6f17966f5e54e3a0c4faa.tar.bz2
grid_refinement_openlb-e1626f2eb19215482aa6f17966f5e54e3a0c4faa.tar.lz
grid_refinement_openlb-e1626f2eb19215482aa6f17966f5e54e3a0c4faa.tar.xz
grid_refinement_openlb-e1626f2eb19215482aa6f17966f5e54e3a0c4faa.tar.zst
grid_refinement_openlb-e1626f2eb19215482aa6f17966f5e54e3a0c4faa.zip
Further indicatorize geometry setup
Grid refinement is at its easiest when discrete materials are set using analytical - i.e. resolution independent - indicators.
Diffstat (limited to 'src')
-rw-r--r--src/refinement/grid2D.h2
-rw-r--r--src/refinement/grid2D.hh10
2 files changed, 11 insertions, 1 deletions
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<T,DESCRIPTOR>& addCoarseCoupling(
Grid2D<T,DESCRIPTOR>& fineGrid, Vector<T,2> origin, Vector<T,2> extend);
+ Vector<T,2> alignToGrid(Vector<T,2> physR) const;
+
Grid2D<T,DESCRIPTOR>& refine(IndicatorF2D<T>& domainF);
Grid2D<T,DESCRIPTOR>& refine(Vector<T,2> origin, Vector<T,2> 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,13 +169,21 @@ Grid2D<T,DESCRIPTOR>& Grid2D<T,DESCRIPTOR>::refine(IndicatorF2D<T>& domainF)
new Grid2D<T,DESCRIPTOR>(
domainF,
2*getConverter().getResolution(),
- 2.0*getConverter().getLatticeRelaxationTime() - 0.5,
+ 2*getConverter().getLatticeRelaxationTime() - 0.5,
getConverter().getReynoldsNumber()
));
return *_fineGrids.back();
}
template <typename T, template<typename> class DESCRIPTOR>
+Vector<T,2> Grid2D<T,DESCRIPTOR>::alignToGrid(Vector<T,2> physR) const
+{
+ Vector<int,3> latticeR{};
+ _cuboids->getLatticeR(physR, latticeR);
+ return _cuboids->getPhysR(latticeR.toStdVector());
+}
+
+template <typename T, template<typename> class DESCRIPTOR>
Grid2D<T,DESCRIPTOR>& Grid2D<T,DESCRIPTOR>::refine(Vector<T,2> origin, Vector<T,2> extend)
{
IndicatorCuboid2D<T> fineCuboid(extend, origin);