-
Notifications
You must be signed in to change notification settings - Fork 35
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
Discussion: Design of face loops (acoustics module) #597
base: master
Are you sure you want to change the base?
Conversation
do_face_integral<false>(pressure_m, pressure_p, velocity_m, velocity_p); | ||
for(unsigned int q : pressure_m.quadrature_point_indices()) | ||
{ | ||
scalar const pm = pressure_m.get_value(q); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, one can now easily call e.g. a free function calculate_interior_value()
taking into account homogeneous/inhomogeneous/full operators, see discussion https://github.com/exadg/exadg/pull/587/files#r1389376858
Thank you for proposing another design. Can we postpone this discussion weather the current design is changed in this way until I filed a PR, how to address non-matching discretizations? This will have some implications. |
Could you explain what is different for the non-matching case in terms of the required interfaces? From previous discussions I thought that the |
Dependent on the non-matching methodology, I am currently working on a tutorial how to make use of Nitsche-type mortaring in |
If |
The design I would choose has additional template parameters. At this point, I want to emphasize that using template parameters also has advantages and that compilation times can still be kept low by shifting the relevant parts to source files. In any way, we can discuss options on how to avoid the template parameters, but I think it would be good to postpone this discussion. |
In PR #587, we discussed to introduce template parameters because they will be needed later for the non-matching case (even though they are not needed right now for the functionality currently available, i.e. matching case only). If I understand you correctly, we would need even more template parameters to realize the non-matching case in the future. Then, however, it is not clear to me why we introduced template parameters at all in PR #587 (and I would like to refer to those discussions where we exchanged pros and cons or different perspectives on the use template parameters). I think the dis-agreement currently is whether we base discussion on the present code, or on future code. In my opinion, the standard procedure would be the former variant and to keep the code as simple as possible for now (according to the current requirements), and add complexity once it is needed or find solutions to problems once they occur. The implication of the latter variant is in my opinion that, realistically, we already spent more time with PR #587 (and references to upcoming PRs) than following - for now - the standard implementation procedure in ExaDG for matching problems and introducing the non-matching case (with potential design changes) once we address this concretely. |
I think the current design is superior to the design in the rest of I was continuously asking to discuss this later, since we will have the same discussion again when introducing Nitsche-type mortaring. I don't think the presented design can be extended to mortaring (the current design is easy to extend), but I might be mistaken. I know this is referencing upcoming code, but I wanted to point out that I see implications later to save us some time. If you want to, you can go with proposed changes. I will most certainly have to undo these changes, and we can discuss the design of the function at this point again. |
@jh66637 What I somewhat miss in this discussion is that you did not comment on the arguments provided here: https://github.com/exadg/exadg/pull/587/files#r1389376858, https://github.com/exadg/exadg/pull/587/files#r1389390122, #597 (comment). Last week, I agreed to your proposed template version, but now I think it seems to have shortcomings (see links above), which is why I came up with the present PR and with the goal to have a discussion about these shortcomings. As a sidenote/comment and independently of how we proceed with this PR: It is only partly true that "the code that calculates the face integrals is only written once". Looking at exadg/include/exadg/acoustic_conservation_equations/spatial_discretization/operators/operator.h Lines 338 to 378 in 51a6a7e
one can see that the logic pressure_m.submit_value(..., q);
velocity_m.submit_value(..., q);
if constexpr(weight_neighbor)
{
pressure_p.submit_value(..., q);
velocity_p.submit_value(..., q);
} is implemented three times. Some implementations in ExaDG address this by computing tuples of fluxes, see exadg/include/exadg/convection_diffusion/spatial_discretization/operators/convective_operator.h Line 413 in 51a6a7e
get_value() and those that call submit_value() . One could argue such an implementation needs to implement the face integral only once as well. Of course, the get_value() part is written more than once for such an implementation, but this is exactly the part that is different for different "FEEvaluation types". Implementing classes like BoundaryFaceIntegratorP/U (as a consequence of the template design) can be seen as another way of implementing the get_value() part more than once.
|
Let's set this PR (or, better, discussion) "on hold". |
@nfehn I hope this answers all the questions: To the question of how to deal with interior values. As already suggested, we could have an additional class (similar to the class that provides the boundary values). I don't think the duplication of While looking at the I am hereby proposing an alternative solution that tries to fit in with the current
A short sidenote: I have been working on the non-matching implementation during the last few days and I think it is safe to say, that a function that automatically does the correct thing needs
Where InteriorIntegrator can be of type FEFaceEval, FEPointEval and ExteriorIntegrator can be of type FEFaceEval BoundaryFaceEval and (possibly two different types) of FERemoteEval. So I think we can not avoid templates if we want to have one function that implements the logic that is happening at any face. |
In commit 41d3a33, I removed the To make it simple, I suggest to discuss certain things independently from Properties of current standard version:
Properties of template version:
In my opinion, it is far from obvious that the advantages of the templated version really outperform its disadvantages (as compared to the standard version). The potential increase in compile times for the templated version is not my main concern or the only concern actually (in particular not for the explicit acoustic operator addressed currently). (However, I would indeed like to avoid a pure header implementation of the base class In the end and when looking just at the code in ExaDG, one can probably argue for one or the other version (as the two of us currently do ;)) as long as we are not concrete/explicit about the non-matching case. However, we should also incorporate other aspects. In my opinion, the present discussion raised different questions:
|
Sorry for the late reply. I finished the tutorial on how to deal with non-matching interfaces dealii/dealii#16299. With this, we have a better base for the discussion in the non-matching point. I think we should discuss this with |
Follow up to PR #587, related to discussions https://github.com/exadg/exadg/pull/587/files#r1389376858 and https://github.com/exadg/exadg/pull/587/files#r1389390122. I also added a .cpp file, because the code was otherwise not built.
The second commit shows how to get rid of the template parameters. By using default arguments for
pressure_p
,velocity_p
inface_kernel(..., pressure_p = pressure_m, velocity_p = velocity_m)
, we could even get rid of the unused function parameters passed to the face-kernel in case of boundary face loops. The template parameterweight_neighbor
still exists, but could now actually be removed when using the design suggested here.Note that the new design needs essentially the same number of lines of code. The new version should however be more flexible according to discussion https://github.com/exadg/exadg/pull/587/files#r1389376858. It also does not need template parameters. Hence, I would suggest to change the design.
@jh66637 FYI