Skip to content
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

Toward boundary gradient fix: part 1 #216

Merged
merged 6 commits into from
Jul 19, 2023
Merged

Toward boundary gradient fix: part 1 #216

merged 6 commits into from
Jul 19, 2023

Conversation

trevilo
Copy link
Contributor

@trevilo trevilo commented Jul 19, 2023

This PR is a first step toward #198. Specifically, we begin to put in the machinery that is necessary on the cpu path and implement it for an isothermal wall. Additional bcs as well as gpu support will come later.

Specifically, parts of GradNonLinearForm and GradFaceIntegrator had
_GPU_ specific code that was superseded by device-specific code in the
Gradients class and thus was never called.  This code has been
eliminated to improve hygiene in preparation for changes to address #198.
In preparation for further refactoring as part of addressing #198
The idea here is to take advantage of all the data that has already
been set up in class BCIntegrator by making class GradFaceIntegrator
its friend.  Then we can use the internal std::unordered_map objects
in BCIntegrator, which map the boundary attribute to the appropriate
BoundaryCondition class, to get access to any required boundary
condition information.  In principle that is all that is necessary,
but the data we need it is not in a convenient form.  To address this,
the method computeBdrPrimitiveStateForGradient has been added to the
BoundaryCondition class.  In the base class, this method just sets the
boundary state to the internal state, which results in the same
(incorrect) behavior we have now.  In future commits, this method will
be implemented in the children of BoundaryCondition in order to
provide the right boundary state.
)

Eventually useBCinGrad = true will be the default (and only) option.
But, during development, it is useful to be able to turn it off so we
can ensure we don't introduce any unintended effects by running the
regression tests (which will have to have their 'truth' solutions
regenerated once this change is ready.
(but only when using recent mods to account for BC in gradient)
@trevilo trevilo marked this pull request as ready for review July 19, 2023 03:08
@trevilo trevilo merged commit fa158f2 into main Jul 19, 2023
@trevilo trevilo deleted the dev-bc-grad-fix-pr1 branch August 18, 2023 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant