Skip to content

Add L2/H1 boundary optimization - #166

Merged
andrewwinters5000 merged 92 commits into
mainfrom
BoundaryOptimization
Aug 5, 2026
Merged

Add L2/H1 boundary optimization#166
andrewwinters5000 merged 92 commits into
mainfrom
BoundaryOptimization

Conversation

@andrewwinters5000

@andrewwinters5000 andrewwinters5000 commented Jul 17, 2026

Copy link
Copy Markdown
Member

This adds a feature that computes optimized boundary approximations from a user given tolerance. These errors are also included in the output after generation.

TODO:

  • Unit testing
  • Integration testing via examples
  • Examples (Blob and a possible a second)
  • User documentation
  • Technical documentation
  • Add entry in News.md of this new feature
  • Intel compilation. Requires some changes to FTOL (see PR #79 there). Here, Utilities/bootstrap has been adjusted to clone that branch of FTOL. Should be changed back to clone main once the FTOL changes are merged.

Add code for boundary optimization. Add control file reading for the new parameters and instance variables in the SMChainedCurve class. Add the new derivativeAt method to the SMCurve class.
Add optimization to the sizer. Use the optimized segment lengths to determine mesh sizes in the sizer.
Add the elliptic arc to the template file.
Use an estimate for the change in the error with segment spacing to adjust the last segment size when it is too small.
Fix a bug so that refinement due to optimization only occurs where it is needed. When optimization is performed, the minimum mesh size is written out in verbose mode so that it can be compared to the background mesh size.
Add segment lengths and points to the MultisegmentModalCurve and  the ability to use those in IntervalSearch
Add breaks to a segmented curve optimization to allow breaking up a curve into sections across which optimization will not occur. AT THIS POINT, THE MATRIX OPTIMIZATION PROBLEM HAS NOT BEEN IMPLEMENTED YET. But the datastructures and arrays needed are now availavle.
Fix an uninitialized array and add tests for subdividing a curve.
Remove unneeded size code. This functionality is moved to FRSegementedCurve where the size info is stored.
Use optimized segments if turned on in the smchained curve
Add string scanner class and tests.
Fix endpoint errors
Add scanner tests
Add the reading of breaks in the chain definition
Clean up unused variables. Fix the TODO items for using inputted breaks and for optimizing positions on inner and interface curves.
Add instance derivative method to chained curve.
Use Andrew's Pegasus implementation for iteration. Use limits for endpoints of chain segments by slightly offsetting those segments.
Add a new test for the optimal segment decomposition. Not completed yet. Needs assertions.
Add testing for segmented curve. Update test values due to new iterative solver differences.
Add the segmented curve tests to the test suite
Finish the implementation of finding the optimal segments along a segmented curve.
Fix allocation/deallocation bug. Fix copy/paste error in inner and interface boundary sections.
Compute the curve subdivisions created by the boundary node distribution after the mesh has been generated.
Rename the GatherboundaryNodes to ComputeBoundaryDivisionsFromBoundaryNodes to be more descriptive as to what is done.
Rename DerivativeAt to not conflict with the SMCurveClass member function.
In preparation for error estimates along boundaries, add a new polynomial interpolant subclass of SMCurve.
Change quadrature from Lobatto to Gauss to avoid segment endpoints.
Implement the boundary measure of the errors after a mesh has been generated. What's left is to implement curve joining for optimization. This means parsing the control file and using that to modify the "ends" array in ComputeBoundaryPolynomials.
Use the optimal segments along a curve to estimate size, generate, compute the error, then remesh bassed on a size estimate. Only Proof of concept. Only implemented for the outer boundary with one curve, no chain.
andrewwinters5000 and others added 17 commits July 24, 2026 12:56
Make more changes to pass ifort compiler.
Add line to force compile
Remove previous comment
Looing to see why ifx fails on one test.
Change the allChains from and FTMutableObjectArray to an array of pointers to an object. Memory is now managed manually. HOHQMesh no longer has a recursion that the ifort compiler choked on.
Formatting changes
Change SPREAD function to loops because ifort would crash.
Adaptive mesh covering example using the blob.

@andrewwinters5000 andrewwinters5000 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left two comments for you to check @DavidAKopriva . Overall things look good. I will push a few cosmetic changes I made after looking over all the code. I also want to add a bit more info in the "warning" box in the docs about the experimental feature and the user set tolerance may not be achieved by the meshing process.

Comment thread Source/Mesh/MeshGeneratorMethods.f90 Outdated
Comment thread Source/Project/MeshProject.f90 Outdated
andrewwinters5000 and others added 3 commits August 3, 2026 17:07
Remove original gatherElementBoundaryInfo that has been superseded by the one that uses the boundary approximations. Remove some commented out debug lines. Finally, remove the unused project-wise default boundary error tolerance. All optimization is now done curve-by-curve. Fix a comment: Breaks are assumed and connections are specified, rather than the other way around.
@DavidAKopriva

Copy link
Copy Markdown
Collaborator

@andrewwinters5000 , your changes are all fine.

@andrewwinters5000

Copy link
Copy Markdown
Member Author

I added one final change to the docs to point users to the blob example. I think this is good to go. Are you ready to pull the trigger and merge @DavidAKopriva ?

Update the adaprive mesh and news sections to show that HOHQMesh writes out the maximum errors along the boundary curves.
@DavidAKopriva

Copy link
Copy Markdown
Collaborator

I added remarks to the adaptive and news documentation to show how the boundary errors are written out as part of the report. Beyond that, it passes all the tests, so let's deploy and see how it goes.

@andrewwinters5000
andrewwinters5000 merged commit 7fcea4d into main Aug 5, 2026
23 checks passed
@andrewwinters5000
andrewwinters5000 deleted the BoundaryOptimization branch August 5, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants