Closed tbenthompson closed 2 years ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
This is strange: I thought I had fixed the indexing for TDEs last week, as well as the sign of the tde velocity matrix (it should indeed be negative). But now I see that I was thinking about the assembly incorrectly: we are actually doing smoothing then constraints as a pair for each mesh, rather than smoothing for all meshes, then constraints for all meshes. This could explain the fact that the edge constraints seemed to be ignored in the dense solve! Thanks Ben!
@jploveless I had thought that we were doing all of the smoothing matrices and then all of the TDE constraints after that as well. As long as we pick a standard and keep with it, we should be good. This is also a good reminder to me to create a notebook that shows the structure of the linear system for the multiple meshes, case so that we have that for reference and documentaiton. See: https://github.com/brendanjmeade/celeri/issues/97
I think either method can make sense conceptually, but I do feel that Ben's new indexing (smoothing, constraint pairs) is more consistent overall with how meshes are treated within celeri: they are referenced separately, unlike in Blocks where they are treated as part of a single structure.
Just wanted to weigh in and say that I like Jack's argument for (smoothing1, constraint1, smoothing2, constraint2)! But, I also didn't realize that I was modifying the intended indexing when I changed that. The previous implementation was just wrong since it was overlapping the indices and everything was mushy bananas.
Added what I think is clean LaTex description of how we structure this in the notebook reference_linear_operator_structure.ipynb with https://github.com/brendanjmeade/celeri/commit/b12e6769130abded0430597c831753e3675446c0.
I haven't looked at the code for the indexingere. @tbenthompson and @jploveless are you in agreement on this structure?
I know this isn't helpful, but I really could go either way!
@jploveless
- The new LaTeX description looks fantastic and clearly lays out the structure. However, it would be cleaner in terms of LaTeX matrix structure to do all smoothing, then all slip rate constraints (no need for m_1 through m_n references)
I hear you that it would look cleaner but I think it shows the current assembly accurately?
- The construction of indices via for loop through the meshes (as is currently done) is more consistent with using smoothing, constraint pairs for each mesh sequentially.
Are you thinking that it's worthwhile to change this to all of the smoothing and then all of the constraints?
Sorry — I was trying to point out some pros and cons in my previous bullet points. Right now, Ben's indexing works well, and I think that conceptually it is more consistent with our more individualized treatment of meshes. Your LaTeX summary is accurate as is; I was just thinking that writing the assembly would be more compact if we did all smoothing, then all constraints. But I don't think it's necessary to change to that scheme, so I say we leave things as they are now.
I understand now! Let's leave it the way it is. Thanks!
For these last two issues, I don't understand the underlying reasons, but I'm just copying the behavior in
assemble_and_solve_dense
into the sparse matvec and H-matrix construction functions.See the "#TBTERROR" comments in the notebook. I am a terror.