-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viscosity jacobian #132
base: main
Are you sure you want to change the base?
Viscosity jacobian #132
Conversation
lgtm but tests need fixing |
also note that the petsc strainrate vector involves 4 components in 2D (3D=9) |
The length of the strain rate is actually 4, but the |
julia> @btime ForwardDiff.jacobian(S_closed, τij, ∂u∂xi);
445.500 ns (6 allocations: 1.02 KiB)
julia> @btime jacobian(Forward, ∂u∂xi -> foo(τij, ∂u∂xi, c), ∂u∂xi);
3.500 μs (55 allocations: 3.00 KiB) # enzyme FD seems the best option here. |
So this kind of works for me with the PETSc code; yet, please note that the A workaround is this: τII = compute_τII(c, εII + eps(), args);
η_vep = τII/(εII + eps())/2.0
@. τij = 2 * η_vep * εij I guess it is better, though, to update |
My bad, that function already exists as in here |
Don't think that works as it should. Also can't handle this case: v = LinearViscous(; η=η)
vlow = LinearViscous(; η=1e-3) # lower cutoff
el = SetConstantElasticity(; G=G, ν=0.5)
pl = DruckerPrager_regularised(; C=0.15, ϕ = 0, η_vp = 1e-3)
comp = Parallel(CompositeRheology(v,el, pl),vlow) |
What is a full reproducer for this? Taking the code in the example I get:
|
I updated the MWE above, it required an import. It should run now. Thanks for taking a look! |
Both |
can this be extended? this is the way to add a lower viscosity cutoff in a differential manner |
Fixes the bug in `compute_elastoviscosity_εII` reported in #132
* Effective viscosity bug Fixes the bug in `compute_elastoviscosity_εII` reported in #132 * Fix viscosity tests
Small prototype