Skip to content
Snippets Groups Projects
Commit 34272d9e authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Fix operation-counting tests with second order moment getter

parent bc490bdf
No related merge requests found
Pipeline #32542 passed with stage
in 29 minutes and 3 seconds
......@@ -136,8 +136,7 @@ class DensityVelocityComputation(AbstractConservedQuantityComputation):
def equilibrium_input_equations_from_pdfs(self, pdfs):
dim = len(self._stencil[0])
eq_coll = get_equations_for_zeroth_and_first_order_moment(self._stencil, pdfs, self._symbolOrder0,
self._symbolsOrder1[:dim],
self._symbolsOrder2[:(dim * dim)])
self._symbolsOrder1[:dim])
if self._compressible:
eq_coll = divide_first_order_moments_by_rho(eq_coll, dim)
......@@ -210,8 +209,7 @@ class DensityVelocityComputation(AbstractConservedQuantityComputation):
momentum_density_output_symbols = output_quantity_names_to_symbols['momentum_density']
mom_density_eq_coll = get_equations_for_zeroth_and_first_order_moment(self._stencil, pdfs,
self._symbolOrder0,
self._symbolsOrder1,
self._symbolsOrder2)
self._symbolsOrder1)
mom_density_eq_coll = apply_force_model_shift('macroscopic_momentum_density_shift', dim,
mom_density_eq_coll, self._forceModel, self._compressible)
......@@ -244,7 +242,7 @@ class DensityVelocityComputation(AbstractConservedQuantityComputation):
def get_equations_for_zeroth_and_first_order_moment(stencil, symbolic_pdfs, symbolic_zeroth_moment,
symbolic_first_moments, symbolic_second_moments):
symbolic_first_moments, symbolic_second_moments=None):
r"""
Returns an equation system that computes the zeroth and first order moments with the least amount of operations
......@@ -302,7 +300,8 @@ def get_equations_for_zeroth_and_first_order_moment(stencil, symbolic_pdfs, symb
equations = []
equations += [Assignment(symbolic_zeroth_moment, pdf_sum)]
equations += [Assignment(u_i_sym, u_i) for u_i_sym, u_i in zip(symbolic_first_moments, u)]
equations += [Assignment(symbolic_second_moments[i], p[i]) for i in range(dim**2)]
if symbolic_second_moments:
equations += [Assignment(symbolic_second_moments[i], p[i]) for i in range(dim**2)]
return AssignmentCollection(equations, subexpressions)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment