Commit e8319d7c authored by Michael Kuron's avatar Michael Kuron
Browse files

more test fixes for old versions

parent d7527773
Pipeline #21334 failed with stage
in 65 minutes
......@@ -159,11 +159,11 @@ def viscous_force(lb_velocity_field, phi_field, mrt_method, tau, density_heavy,
eq = np.array(eq)
g_vals = [lb_velocity_field.center(i) for i, _ in enumerate(stencil)]
m0 = np.dot(moment_matrix, g_vals)
m0 = np.dot(moment_matrix.tolist(), g_vals)
m = m0 - eq
m = m * rel
non_equilibrium = np.dot(moment_matrix.inv(), m)
non_equilibrium = np.dot(moment_matrix.inv().tolist(), m)
stress_tensor = [0] * 6
# Calculate Stress Tensor MRT
......@@ -293,7 +293,7 @@ def get_update_rules_velocity(src_field, u_in, lb_method, force, density):
indices.append(eq.index(first_eqs[i]))
src = [src_field.center(i) for i, _ in enumerate(stencil)]
m0 = np.dot(moment_matrix, src)
m0 = np.dot(moment_matrix.tolist(), src)
update_u = list()
update_u.append(Assignment(sp.symbols("rho"), m0[0]))
......@@ -356,7 +356,7 @@ def get_collision_assignments_hydro(density=1, optimization=None, **kwargs):
eq = np.array(eq)
g_vals = [src_field.center(i) for i, _ in enumerate(stencil)]
m0 = np.dot(moment_matrix, g_vals)
m0 = np.dot(moment_matrix.tolist(), g_vals)
mf = np.zeros(len(stencil), dtype=object)
for i in range(dimensions):
......@@ -374,7 +374,7 @@ def get_collision_assignments_hydro(density=1, optimization=None, **kwargs):
update_m.append(Assignment(m[i], m0[i] - (m0[i] - eq[i] + mf[i] / 2) * rel[i] + mf[i]))
update_g = list()
var = np.dot(moment_matrix.inv(), m)
var = np.dot(moment_matrix.inv().tolist(), m)
if params['kernel_type'] == 'collide_stream_push':
push_accessor = StreamPushTwoFieldsAccessor()
post_collision_accesses = push_accessor.write(dst_field, stencil)
......
......@@ -65,7 +65,7 @@ def plot_y_velocity(vel, **kwargs):
def fit_and_get_slope(x_values, y_values):
matrix = np.vstack([x_values, np.ones(len(x_values))]).T
m, _ = np.linalg.lstsq(matrix, y_values, rcond=None)[0]
m, _ = np.linalg.lstsq(matrix, y_values, rcond=1e-14)[0]
return m
......
import os
from tempfile import TemporaryDirectory
import shutil
import pytest
import numpy as np
......@@ -7,6 +10,7 @@ import lbmpy.plot as plt
from lbmpy.scenarios import create_lid_driven_cavity
@pytest.mark.skipif(shutil.which('ffmpeg') is None, reason="ffmpeg not available")
def test_animation():
ldc = create_lid_driven_cavity((10, 10), relaxation_rate=1.8)
......
Markdown is supported
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