-
Notifications
You must be signed in to change notification settings - Fork 92
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
Fold Ferrite.value
into methods of shape_value
#721
Conversation
16466b7
to
30a144c
Compare
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.
I think this is a good change. For example in problems with contact or mortar methods I think it is common to eval the shape functions directly (and to not pre-compute the shape functions using e.g CellValues)
This patch deprecates `Ferrite.value(ip::Interpolation, i::Int, ξ::Vec)` in favor of `shape_value(ip::Interpolation, ξ::Vec, i::Int)`. Note that the argument order is flipped to resemble the `(Cell|Face)Values` API more. Compare e.g. `shape_value(ip, ξ, i)` with `shape_value(cv, qp, i)`: the second argument becomes the "quadrature point" argument (`ξ` ~ `qp`), and the third argument is the shape function index, in both cases. Since `shape_value` is exported this introduces new (public) functionality to users -- for some applications it is nice to be able to evaluate the shape functions in the reference domain without having to go through `CellValues`. For the same reason this patch also adds the method `shape_gradient(ip::Interpolation, ξ::Vec, i::Int)` which falls back to AD from Tensors.jl. Fixes #609.
30a144c
to
bdbcbca
Compare
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #721 +/- ##
==========================================
- Coverage 92.24% 91.92% -0.33%
==========================================
Files 30 30
Lines 4529 4530 +1
==========================================
- Hits 4178 4164 -14
- Misses 351 366 +15
☔ View full report in Codecov by Sentry. |
Not sure if it makes sense, but at least worth considering IMO;
with the same interface? The current implementation could just be on top using the tensor operations, but it might be possible to have some optimized implementations in the future. |
Maybe, note that these return unmapped values, so not sure how useful it is? |
Perhaps this should have been |
…lue` This patch is a follow up to #721 and replaces `shape_value`, `shape_gradient` etc for interpolations, which return evaluations in the reference domain, with new functions `reference_shape_value`, `reference_shape_gradient`, etc. The new functions are public but not exported. Separating these functions make it possible to support `reference_shape_value` etc for `CellValues` too in the future.
…lue` (#997) This patch is a follow up to #721 and replaces `shape_value`, `shape_gradient` etc for interpolations, which return evaluations in the reference domain, with new functions `reference_shape_value`, `reference_shape_gradient`, etc. The new functions are public but not exported. Separating these functions make it possible to support `reference_shape_value` etc for `CellValues` too in the future.
This patch deprecates
Ferrite.value(ip::Interpolation, i::Int, ξ::Vec)
in favor ofshape_value(ip::Interpolation, ξ::Vec, i::Int)
. Note that the argument order is flipped to resemble the(Cell|Face)Values
API more. Compare e.g.shape_value(ip, ξ, i)
withshape_value(cv, qp, i)
: the second argument becomes the "quadrature point" argument (ξ
~qp
), and the third argument is the shape function index, in both cases.Since
shape_value
is exported this introduces new (public) functionality to users -- for some applications it is nice to be able to evaluate the shape functions in the reference domain without having to go throughCellValues
. For the same reason this patch also adds the methodshape_gradient(ip::Interpolation, ξ::Vec, i::Int)
which falls back to AD from Tensors.jl.Fixes #609.