Only require old stresses for elasticity if necessary#7007
Conversation
|
Hi @gassmoeller , Thank you for working on this. I think this is a very useful improvement. I have run into a similar issue in my recent 3-D viscoelastic models. In my tests, requiring the old stress fields did not seem to provide a noticeable improvement in accuracy for the cases I examined, but it did have a large impact on computational cost. The additional stress fields significantly affect memory use, advection cost, matrix assembly, and overall solve time in large 3-D calculations. In my local setup, I have been using an option similar to use old stress = false. I have tested this with several benchmarks and model comparisons, and so far I have not found a significant difference in the results for the cases where the old unrotated stress is not required by the time-stepping scheme. I had been planning to discuss this after finishing my current project, so I am very glad to see this issue being addressed in this PR. This looks like a very helpful change for large 3-D viscoelastic models. |
@anne-glerum as discussed this is a rebased version of anne-glerum#20. Can you give this a proper review? I am missing a changelog entry, I will need to write that as well.
Summary of PR: Our elasticity implementation under certain conditions needs two sets of stress tensors, one for the current time step, and one for the old time step partially modified into the current time (advected with the flow, but not rotated according to it). However, this is only necessary under certain conditions (see: https://github.com/geodynamics/aspect/compare/main...gassmoeller:aspect:only_use_as_many_fields_as_necessary?expand=1#diff-06e3c0241f4cd5f26a2dd149ee3e25bf3217d99aafcff84d02a98fe32629db6bR806). If these conditions are not met, we can get away with one advected stress tensor, which significantly reduces the compute time and memory requirements.
We will also have to look into all the elasticity benchmarks and tests to see which ones need to be modified. And we should decide if it should be allowed to specify two stress tensors (current and old) even if the old one is not needed. We could allow it for backward compatibility (and to make it easier to switch between the two approaches). I havent actually thought about if my current implementation allows both or not.