-
Notifications
You must be signed in to change notification settings - Fork 536
AD for TMOP_WorstCaseUntangleOptimizer_Metric #4836
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
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.
Pull Request Overview
This PR adds automatic differentiation (AD) support for the TMOP_WorstCaseUntangleOptimizer_Metric by introducing new AD hook functions and updating several metric classes to support AD-based computations. Key changes include:
- Addition of AD hook virtual functions (EvalW_AD1, EvalW_AD2) in the base TMOP_QualityMetric class and their overrides in derived classes.
- Implementation of AD-based functions (including helper templates and specializations) in fem/tmop.cpp ensuring support for metrics mu_4, mu_14, and mu_66.
- Minor comment updates in miniapps/meshing to reflect consistent command line usage.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
miniapps/meshing/pmesh-optimizer.cpp | Updated comment to match consistent command line arguments. |
miniapps/meshing/mesh-optimizer.cpp | Updated comment to match consistent command line arguments. |
fem/tmop.hpp | Added AD hook functions and type definitions for automatic differentiation. |
fem/tmop.cpp | Implemented AD-based metric functions and helper templates/specializations. |
Comments suppressed due to low confidence (1)
fem/tmop.cpp:220
- Consider adding parentheses around the subtraction in the conditional expression (i.e., use (alpha*min_detT - detT_ep) < 0.0) to improve clarity.
auto val1 = alpha*min_detT-detT_ep < 0.0 ? (alpha*min_detT-detT_ep)*one : zero;
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds AD for TMOP_WorstCaseUntangleOptimizer_Metric.
virtual
functions cannot be templated so this requires some boilerplate code. Currently only mu_4, mu_14, and mu_66 are supported.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
.