diff --git a/src/underworld3/constitutive_models.py b/src/underworld3/constitutive_models.py index 47293a680..7bd403e82 100644 --- a/src/underworld3/constitutive_models.py +++ b/src/underworld3/constitutive_models.py @@ -2184,7 +2184,7 @@ def _build_c_tensor(self): lambda_mat[i, j, k, l] = val - lambda_mat = sympy.simplify(uw.maths.tensor.rank4_to_mandel(lambda_mat, d)) + lambda_mat = uw.maths.tensor.rank4_to_mandel(lambda_mat, d) self._c = uw.maths.tensor.mandel_to_rank4(lambda_mat, d) diff --git a/src/underworld3/cython/petsc_generic_snes_solvers.pyx b/src/underworld3/cython/petsc_generic_snes_solvers.pyx index c4b3377e0..1b54813d8 100644 --- a/src/underworld3/cython/petsc_generic_snes_solvers.pyx +++ b/src/underworld3/cython/petsc_generic_snes_solvers.pyx @@ -3730,7 +3730,7 @@ class SNES_Stokes_SaddlePt(SolverBaseClass): if self.saddle_preconditioner is not None: self._pp_G0 = self.saddle_preconditioner else: - self._pp_G0 = sympy.simplify(1 / self.constitutive_model.K) + self._pp_G0 = 1 / self.constitutive_model.K fns_jacobian.append(self._pp_G0) diff --git a/src/underworld3/swarm.py b/src/underworld3/swarm.py index 358d9f193..9a06ee978 100644 --- a/src/underworld3/swarm.py +++ b/src/underworld3/swarm.py @@ -2147,7 +2147,7 @@ def createMask(self, funcsList): if len(funcsList) != self.indices: raise RuntimeError("Error input for createMask() - wrong length of input") - symo = sympy.simplify(0) + symo = sympy.S.Zero for i in range(self.indices): symo += funcsList[i] * self._MaskArray[i] diff --git a/src/underworld3/systems/solver_template.py b/src/underworld3/systems/solver_template.py index af9649578..98994aa1d 100644 --- a/src/underworld3/systems/solver_template.py +++ b/src/underworld3/systems/solver_template.py @@ -162,7 +162,7 @@ def F1(self): F1_val = expression( r"\mathbf{F}_1\left( u, \nabla u \right)", - sympy.simplify(flux), + flux, "MyEquation pointwise flux term: $F_1(u, \\nabla u)$", ) diff --git a/src/underworld3/systems/solvers.py b/src/underworld3/systems/solvers.py index 62387707a..067e4686f 100644 --- a/src/underworld3/systems/solvers.py +++ b/src/underworld3/systems/solvers.py @@ -224,7 +224,7 @@ def __init__( F1 = Template( r"\mathbf{F}_1\left( \mathbf{u} \right)", - lambda self: sympy.simplify(self.constitutive_model.flux.T), + lambda self: self.constitutive_model.flux.T, r"""Diffusive flux term for the Poisson equation (pointwise). The $\mathbf{F}_1$ vector represents the flux $k \nabla u$ @@ -705,7 +705,7 @@ def __init__( F1 = Template( r"\mathbf{F}_1\left( \mathbf{u} \right)", - lambda self: sympy.simplify( + lambda self: ( self.stress + self.penalty * self.div_u * sympy.eye(self.mesh.dim) ), r"""Velocity equation flux/stress term (pointwise). @@ -718,7 +718,7 @@ def __init__( PF0 = Template( r"\mathbf{h}_0\left( \mathbf{p} \right)", - lambda self: sympy.simplify(sympy.Matrix((self.constraints))), + lambda self: sympy.Matrix((self.constraints)), r"""Pressure equation constraint term (continuity). The $h_0$ term enforces the incompressibility constraint @@ -2478,7 +2478,7 @@ def F0(self): """Pointwise source term including time derivative.""" f0 = expression( r"f_0 \left( \mathbf{u} \right)", - -self.f + sympy.simplify(self.DuDt.bdf()) / self.delta_t, + -self.f + self.DuDt.bdf() / self.delta_t, "Diffusion pointwise force term: f_0(u)", ) @@ -2918,7 +2918,7 @@ def PF0(self): f0 = expression( r"\mathbf{F}_1\left( \mathbf{p} \right)", - sympy.simplify(sympy.Matrix((self.constraints))), + sympy.Matrix((self.constraints)), "NStokes pointwise flux term: f_0(p)", )