You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried implementing the test_moments functions for #172
The Transform classes require Lattice in init, partially for the Context information, partially for functions such as mv, sometimes for q (in base class, which could be replaced!), D2Q9Lallemand even uses the equilibrium, which is now in Flow. We should discuss how to harmonize this.
Often, the functions could be made independent of flow: The observables rho, u, velocity, etc., are not redefined in Flow subclasses.
However, some calculations require information, e.g., about the stencil. This could be solved by always passing the flow itself to the calculation. This would not be very different from the current setup, where the flow is just self. The issue here is that functions which do not numerically depend on a simulation domain are made depend on it in implementation.
So, I suggest moving the functions into something like the util directory and importing them when they are needed, passing the required arguments such as f, rho, equilibrium, etc.
To additionally reduce the number of methods, most einsum usages (see #111 ) such as mv (matrix-vector-product) or j (momentum) should be called inline as they have hardly any usages outside of flow.
The text was updated successfully, but these errors were encountered:
What happened?
I tried implementing the test_moments functions for #172
The Transform classes require Lattice in init, partially for the Context information, partially for functions such as mv, sometimes for q (in base class, which could be replaced!), D2Q9Lallemand even uses the equilibrium, which is now in Flow. We should discuss how to harmonize this.
Further context
This is strongly related to #169
Suggestion
Often, the functions could be made independent of flow: The observables rho, u, velocity, etc., are not redefined in Flow subclasses.
However, some calculations require information, e.g., about the stencil. This could be solved by always passing the flow itself to the calculation. This would not be very different from the current setup, where the flow is just self. The issue here is that functions which do not numerically depend on a simulation domain are made depend on it in implementation.
So, I suggest moving the functions into something like the util directory and importing them when they are needed, passing the required arguments such as f, rho, equilibrium, etc.
To additionally reduce the number of methods, most einsum usages (see #111 ) such as mv (matrix-vector-product) or j (momentum) should be called inline as they have hardly any usages outside of flow.
The text was updated successfully, but these errors were encountered: