Commit efb48fda authored by mischa's avatar mischa
Browse files

Field tested assignment collections in 2D

parent e264993d
......@@ -260,6 +260,7 @@ class Lattice:
symbolic_description.append(ps.Assignment(u_x, vel_x_formula))
symbolic_description.append(ps.Assignment(u_y, vel_y_formula))
if not self._debug:
for i in range(Q):
feq_formula = weights[i] * density * (
1
......@@ -291,9 +292,9 @@ class Lattice:
def _assignment_collection3d(self, ps):
c_s_sq, weights, velocities = self.velocity_set()
Q = self.q
c_ix = velocities[0]
c_iy = velocities[1]
c_iz = velocities[2]
c_ix = [vel[0] for vel in velocities]
c_iy = [vel[1] for vel in velocities]
c_iz = [vel[2] for vel in velocities]
src, dst = ps.fields("src({Q}), dst({Q}): double[2D]".format(Q=Q))
density, u_x, u_y, u_z, omega = sp.symbols("density, u_x, u_y, u_z, omega")
......@@ -586,6 +587,9 @@ class Lattice:
if c_s_sq.imag != 0:
raise ValueError("Imaginary root returned. This should not happen")
c_s_sq = float(c_s_sq.real)
if c_s_sq < 0:
raise ValueError("Negative Value for c_s_sq")
self._c_s_sq = c_s_sq
self._reduced_weights = weights
return weights
......
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