From bc20c75117e0dd4e592c36ef4e267c774f705f1f Mon Sep 17 00:00:00 2001 From: Albert de Montserrat Date: Fri, 3 May 2024 21:27:24 +0200 Subject: [PATCH] fixes --- src/stokes/Stokes2D.jl | 4 ++-- src/stokes/Stokes3D.jl | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/stokes/Stokes2D.jl b/src/stokes/Stokes2D.jl index 937d51e5..22c1ea75 100644 --- a/src/stokes/Stokes2D.jl +++ b/src/stokes/Stokes2D.jl @@ -322,7 +322,7 @@ function _solve!( # compute buoyancy forces and viscosity compute_ρg!(ρg[end], phase_ratios, rheology, args) - compute_viscosity!(stokes, phase_ratios, args, rheology, cutoff_visc) + compute_viscosity!(stokes, phase_ratios, args, rheology, viscosity_cutoff) while iter < 2 || (err > ϵ && iter ≤ iterMax) wtime0 += @elapsed begin @@ -508,7 +508,7 @@ function _solve!( # compute buoyancy forces and viscosity compute_ρg!(ρg[end], phase_ratios, rheology, args) - compute_viscosity!(stokes, phase_ratios, args, rheology, cutoff_visc) + compute_viscosity!(stokes, phase_ratios, args, rheology, viscosity_cutoff) while iter ≤ iterMax iterMin < iter && err < ϵ && break diff --git a/src/stokes/Stokes3D.jl b/src/stokes/Stokes3D.jl index 4cf00332..31503f25 100644 --- a/src/stokes/Stokes3D.jl +++ b/src/stokes/Stokes3D.jl @@ -171,6 +171,7 @@ function _solve!( nout=500, b_width=(4, 4, 4), viscosity_relaxation=1e-2, + viscosity_cutoff = (-Inf, Inf), verbose=true, kwargs..., ) where {T} @@ -204,7 +205,7 @@ function _solve!( # compute buoyancy forces and viscosity compute_ρg!(ρg[end], phase_ratios, rheology, args) - compute_viscosity!(stokes, phase_ratios, args, rheology, cutoff_visc) + compute_viscosity!(stokes, phase_ratios, args, rheology, viscosity_cutoff) # solver loop wtime0 = 0.0 @@ -232,7 +233,7 @@ function _solve!( # Update buoyancy update_ρg!(ρg[3], rheology, args) - compute_viscosity!( + update_viscosity!( stokes, phase_ratios, args, @@ -388,7 +389,7 @@ function _solve!( # compute buoyancy forces and viscosity compute_ρg!(ρg[end], phase_ratios, rheology, args) - compute_viscosity!(stokes, phase_ratios, args, rheology, cutoff_visc) + compute_viscosity!(stokes, phase_ratios, args, rheology, viscosity_cutoff) while iter < 2 || (err > ϵ && iter ≤ iterMax) wtime0 += @elapsed begin @@ -419,7 +420,7 @@ function _solve!( update_ρg!(ρg[end], phase_ratios, rheology, args) # Update viscosity - compute_viscosity!( + update_viscosity!( stokes, phase_ratios, args,