-
Notifications
You must be signed in to change notification settings - Fork 10
Towards AD rheology calculations #68
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
base: main
Are you sure you want to change the base?
Conversation
|
this is great - I attempted using AD to do more complicated Composite & Parallel rheologies, which was failing. Perhaps this can do the job? |
|
I got the composites with n- |
|
That's great! |
When non-linear iterations are required to during the local iterations to compute stress/strain we do require to evaluate
εIIand∂εII∂τII(or same for the stress tensor). Currently we do compute the tensor and its derivative in two separate operations, while with AD we can evaluate the functions and its derivative with a single function call. The latter yields a more efficient algorithm with no loss of accuracy. Proof of concept:v1 = SetDiffusionCreep("Dry Anorthite | Rybacki et al. (2006)") v2 = SetDislocationCreep("Dry Anorthite | Rybacki et al. (2006)") e1 = ConstantElasticity() # elasticity c = CompositeRheology(v1, v2, e1) # with elasticity args = (T=900.0, d=100e-6, τII_old=1e6, dt=1e8) εII, τII = 2e-15, 2e6 julia> compute_τII_AD(c, εII, args) == compute_τII(c, εII, args) true julia> @btime compute_τII($c, $εII, $args) 203.500 ns (0 allocations: 0 bytes) julia> @btime compute_τII_AD($c, $εII, $args) 162.183 ns (0 allocations: 0 bytes)