-
Notifications
You must be signed in to change notification settings - Fork 5
Implement _ParametricGeometry #138
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
83a01bd
Add a discrete specializations section
mikeingold 9c1debb
Add Unitful and explicit julia compat
mikeingold 1486059
Implement _ParametricGeometry and use it for BezierCurve and Tetrahedron
mikeingold b06f2bb
Update Tetrahedron tests
mikeingold 876793b
Update tests
mikeingold 1f86e0c
Update a remnant usage of zeros
mikeingold 844601b
Fix Unitful integrand handling in Triangle HAdaptiveCubature method
mikeingold 095d39d
Add missing reapplication of units
mikeingold b34b159
Remove extended tag from Tetrahedron tests
mikeingold ee6fcee
Apply suggestions from code review
mikeingold 96d1371
Add tests for _parametric bounds checks
mikeingold 4a14fcd
Fix typo
mikeingold e38f915
Fix typo
mikeingold c7ba113
Add checks for t1 and t2 args of _parametric Tetrahedron
mikeingold 1973b14
Update Tetrahedron status
mikeingold b0bd30b
Apply format suggestion
mikeingold 7f91f9d
Apply suggestions from code review
mikeingold b66084e
Update src/specializations/BezierCurve.jl
mikeingold ee8c52c
Update src/specializations/Tetrahedron.jl
mikeingold fa35675
Apply suggestions from code review
mikeingold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| """ | ||
| _ParametricGeometry <: Meshes.Primitive <: Meshes.Geometry | ||
|
|
||
| _ParametricGeometry is used internally in MeshIntegrals.jl to behave like a generic wrapper | ||
| for geometries with custom parametric functions. This type is used for transforming other | ||
| geometries to enable integration over the standard rectangular `[0,1]^n` domain. | ||
|
|
||
| Meshes.jl adopted a `ParametrizedCurve` type that performs a similar role as of `v0.51.20`, | ||
| but only supports geometries with one parametric dimension. Support is additionally planned | ||
| for more types that span surfaces and volumes, at which time this custom type will probably | ||
| no longer be required. | ||
|
|
||
| # Fields | ||
| - `fun` - anything callable representing a parametric function: (ts...) -> Meshes.Point | ||
|
|
||
| # Type Structure | ||
| - `M <: Meshes.Manifold` - same usage as in `Meshes.Geometry{M, C}` | ||
| - `C <: CoordRefSystems.CRS` - same usage as in `Meshes.Geometry{M, C}` | ||
| - `F` - type of the callable parametric function | ||
| - `Dim` - number of parametric dimensions | ||
| """ | ||
| struct _ParametricGeometry{M <: Meshes.Manifold, C <: CRS, F, Dim} <: | ||
| Meshes.Primitive{M, C} | ||
| fun::F | ||
|
|
||
| function _ParametricGeometry{M, C}( | ||
| fun::F, | ||
| Dim::Int64 | ||
| ) where {M <: Meshes.Manifold, C <: CRS, F} | ||
| return new{M, C, F, Dim}(fun) | ||
| end | ||
| end | ||
|
|
||
| """ | ||
| _ParametricGeometry(fun, dims) | ||
|
|
||
| Construct a `_ParametricGeometry` using a provided parametric function `fun` for a geometry | ||
| with `dims` parametric dimensions. | ||
|
|
||
| # Arguments | ||
| - `fun` - anything callable representing a parametric function mapping `(ts...) -> Meshes.Point` | ||
| - `dims::Int64` - number of parametric dimensions, i.e. `length(ts)` | ||
| """ | ||
| function _ParametricGeometry( | ||
| fun, | ||
| Dim::Int64 | ||
| ) | ||
| p = fun(_zeros(Dim)...) | ||
| return _ParametricGeometry{Meshes.manifold(p), Meshes.crs(p)}(fun, Dim) | ||
| end | ||
|
|
||
| # Allow a _ParametricGeometry to be called like a Geometry | ||
| (g::_ParametricGeometry)(ts...) = g.fun(ts...) | ||
|
|
||
| Meshes.paramdim(::_ParametricGeometry{M, C, F, Dim}) where {M, C, F, Dim} = Dim | ||
|
|
||
| """ | ||
| _parametric(geometry::G, ts...) where {G <: Meshes.Geometry} | ||
|
|
||
| Used in MeshIntegrals.jl for defining parametric functions that transform non-standard | ||
| geometries into a form that can be integrated over the standard rectangular [0,1]^n limits. | ||
| """ | ||
| function _parametric end |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.