Implement simple linear primal-primal flat #115
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we support a flat operation from dual vector-fields to primal one-forms. However, it is sometimes convenient to have a flat operation from primal vector-fields to primal one-forms.
So, this PR adds an implementation of such a flat operation. It is pedagogically simple to understand, and is quick to implement. It assumes that a the values of a primal vector-field can be linearly-interpolated along primal edges. Integrating such a vector-field along one of these primal edges (line-segments) is equivalent to taking the dot-product of the average value of the vector-field with the vector represented by that line segment. This scheme perfectly flattens static vector-fields, of course.
Future PRs can add a cached version of this operation, as in the other "flat matrix" operation, or as a kernel. The interpolation scheme can be improved by doing a modicum of algebra to determine appropriate weights concerning more samples of the vector-field.