Pressio / pressio-demoapps

Suite of 1D, 2D, 3D demo apps of varying complexity with built-in support for sample mesh and exact Jacobians

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

schwarz: support custom BCs in a practical, less intrusive way

fnrizzi opened this issue · comments

design/thinking plan for supporting custom BCs for a problem

first prototype design: https://github.com/Pressio/pressio-demoapps/blob/d96bbb95c7615e86385df6611ca74da97ab863c8/tests_cpp/custom_bcs_sandbox/main.cc

@cwentland0 what do you think of this? could this be a good starting point for your needs?
btw I commented it quite a bit to make it more readable, happy to talk about it as much

Some general comments:

  1. since this custom BCs stuff is not a trivial thing, and considering the emphasis of demoapps on "well defined problems", I would like to make it explicit for users when they are instantating a problem with custom BCs. Therefore, I would like to have a new problem enum value: pda::Euler2d::RiemannCustomBCs to identify such a case (and similarly this will be added to all other problems for which we support this)

  2. effectively, by allowing custom BCs the problem loses some identity but this is ok i think

  3. I think that the draft/rough impl in this PR should be already decent/general enough to support vairous usecases. Also, note that the way the jacobian is computed, seems to me that we do not need to change anything for it, just need to set the proper "factors" as shown in the test

  4. important: keep in mind that near the boundaries we only do first-order jacobians (this is and will stay like this, unless we make a major investment in doing analytical there too, but don't think this is worth it and not an easy thing to do)