-
Notifications
You must be signed in to change notification settings - Fork 536
NURBS surface interpolation minapp #4841
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR updates several mesh and NURBS routines to enhance functionality and efficiency. Key changes include:
- Updating Print/Printer functions across mesh header and source files to accept an optional GridFunction pointer.
- Modifying NURBS routines by adding a reuse_inverse flag in FindInterpolant and refining the collocation matrix assembly with optional LAPACK banded solvers.
- Adding new LAPACK routines for banded matrix solving in the linalg module.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
mesh/pmesh.hpp, mesh/pmesh.cpp | Updated Print function signature to include an optional GridFunction pointer for node output. |
mesh/nurbs.hpp, mesh/nurbs.cpp | Modified NURBS routines: added a reuse_inverse parameter and updated collocation matrix assembly. |
mesh/mesh.hpp, mesh/mesh.cpp | Revised Printer/Print signatures to accept an optional GridFunction pointer for node saving. |
linalg/lapack.hpp, densemat.hpp, densemat.cpp | Introduced new LAPACK routines for banded matrix solving to support efficient operations. |
Files not reviewed (1)
- miniapps/nurbs/CMakeLists.txt: Language not supported
Comments suppressed due to low confidence (1)
mesh/nurbs.cpp:595
- Consider clarifying in the comment that, under MFEM_USE_LAPACK, the collocation matrix is assembled in a banded format to take advantage of efficient LAPACK banded solvers.
/* Assemble collocation matrix (banded with order + 1 nonzeros per row). */
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.
Nice work @dylan-copeland!
Here are some comments and suggestions:
- Update
CHANGELOG
- Check all items under "New miniapps" in the PR checklist
- I would keep only three outputs: "initial-surf.mesh", "final-surf.mesh", "nurbs-surf.mesh"
- Add a sample run where the final mesh is coarser than the initial one?
- Simplify the user API to just a few simple NURBS-agnostic functions? Maybe
Create(nx, ny, vpos, order)
andResample(NX, NY, VPOS)
? - This could be extended to initial and final meshes that are high-order. We don't have to do it here, but this will be useful to have in the future
This PR is now under review (see the table in the PR description). To help with the review process, please do not force push to the branch. |
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.
Thanks @dylan-copeland !
Saved results from some of the example runs can be found at https://github.com/tzanio/data/tree/main/nurbs-surf. |
@justinlaughlin, @vladotomov, @kmittal2 and @v-dobrev -- can we get another approval please? |
@dylan-copeland , can you please resolve conflicts? |
The new miniapp in this PR takes an input structured 2D array of 3D points, interpolates the points with a NURBS surface of arbitrary order, and outputs a linear surface mesh with arbitrarily many points in each direction (possible finer or coarser than the initial grid). Three surface meshes are output, representing the initial grid, the NURBS surface, and the output grid.
There is intermediate computation of 3D volume NURBS meshes for each of the 3 coordinates of the surface points. It seems that this 3D mesh is excessive, and that a 2D NURBS mesh should work, but I think MFEM needs more generalization in order to enable using a 2D NURBS mesh for this purpose. A 2D
NURBSPatch
with 3D coordinates can be defined, but using it in aNURBSExtension
and constructing a Mesh object does not work, since it usesNURBSExtension::Set2DSolutionVector
and expectspatch.GetNC()
to be 2. This is something we could generalize in the future, but for now this miniapp uses a 3D NURBS mesh for the 2D surface in 3D, with a single element in the third dimension.Note that this issue is only for an intermediate 3D mesh not written out. The output mesh

nurbs-surf.mesh
is a 2D NURBS mesh with a 3D nodesGridFunction
, which is written to file but not constructed in the code. A generalization ofMesh::Print
enables writing a 2D NURBS mesh with a 3DGridFunction
.PR Checklist
make style
.CHANGELOG
:CHANGELOG
to group with other related features?INSTALL
:make
orcmake
have a new target?.github
.appveyor.yml
.gitignore
:make distclean; git status
shows any files that were generated from the source by the project (not an IDE) but we don't want to track in the repository.examples/makefile
:SEQ_EXAMPLES
andPAR_EXAMPLES
variables.clean
target..gitignore
file.examples/CMakeLists.txt
:ALL_EXE_SRCS
variable.THIS_TEST_OPTIONS
is set correctly for the new example.doc/CodeDocumentation.dox
.examples/pumi
), list it indoc/CodeDocumentation.conf.in
src/examples.md
.src/examples.md
andsrc/img
.examples.md
, list the example under the appropriate categories, add new categories if necessary.features.md
.makefile
andmakefile
in corresponding miniapp directory..gitignore
file.CMakeLists.txt
file in theminiapps
directory, if the new miniapp is in a new directory.CMakeLists.txt
file in the new miniapp directory.doc/CodeDocumentation.dox
miniapps/nurbs
), add it toMINIAPP_SUBDIRS
in themakefile
.miniapps/nurbs
), list it indoc/CodeDocumentation.conf.in
src/meshing.md
andsrc/electromagnetics.md
files.src/examples.md
andsrc/img
.features.md
.mfem/web
repo.README
(rare).doc/CodeDocumentation.dox
(rare).make unittest
to make sure all unit tests pass.tests/scripts
.