aboutsummaryrefslogtreecommitdiff
path: root/code/grid2d_collide_and_stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'code/grid2d_collide_and_stream.cpp')
-rw-r--r--code/grid2d_collide_and_stream.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/code/grid2d_collide_and_stream.cpp b/code/grid2d_collide_and_stream.cpp
new file mode 100644
index 0000000..4660946
--- /dev/null
+++ b/code/grid2d_collide_and_stream.cpp
@@ -0,0 +1,31 @@
+template <typename T, template<typename> class DESCRIPTOR>
+void Grid2D<T,DESCRIPTOR>::collideAndStream()
+{
+ for ( auto& fineCoupler : _fineCouplers ) {
+ fineCoupler->store(); // Speichern von Werten in $x_{g \to f}^g \in \G$ zu Zeit $t$
+ }
+
+ this->getSuperLattice().collideAndStream(); // Zeitschritt $t \to t+\delta t_g$ auf $\G$
+
+ for ( auto& fineGrid : _fineGrids ) {
+ fineGrid->collideAndStream(); // Zeitschritt $t \to t+\delta t_g / 2$ auf $\F$
+ }
+
+ for ( auto& fineCoupler : _fineCouplers ) {
+ fineCoupler->interpolate(); // Interpolation von Werten in $x_{g \to f}^g \in \G$ zu Zeit $t + \delta t_g / 2$
+ fineCoupler->couple(); // Setzen von $f_{f,i}$ in $x_{g \to f} \in \F$
+ }
+
+ for ( auto& fineGrid : _fineGrids ) {
+ fineGrid->collideAndStream(); // Zeitschritt $t+\delta t_f \to t+2\delta t_f$ auf $\F$
+ }
+
+ for ( auto& fineCoupler : _fineCouplers ) {
+ fineCoupler->store(); // Speichern von Werten in $x_{g \to f}^g \in \G$ zu Zeit $t + \delta t_g$
+ fineCoupler->couple(); // Setzen von $f_{f,i}$ in $x_{g \to f} \in \F$
+ }
+
+ for ( auto& coarseCoupler : _coarseCouplers ) {
+ coarseCoupler->couple(); // Setzen von $f_{g,i}$ in $x_{f \to g} \in \G$
+ }
+}