mdolab / pysurf

pySurf provides geometric operations for triangulated surfaces.
Apache License 2.0
2 stars 4 forks source link

Complexify #14

Closed sseraj closed 2 years ago

sseraj commented 2 years ago

Purpose

This PR adds a complexified version of pySurf. I followed the IDWarp structure to complexify the Fortran code. I also complexified parts of the Python layer for testing purposes.

I added complex-step tests for the functions used by DVGeoMulti. I summarize the results below:

adtapi.adtcomputenodalnormals: CS matches AD to atol=1e-14 (FD matches AD to atol=3e-8) adtapi.adtmindistancesearch: CS matches AD to rtol=3e-6 (same as FD) curvesearchapi.mindistancecurve: CS matches AD to rtol=1e-15 (FD matches AD to rtol=3e-6) intersectionapi.computeintersection: CS matches AD to rtol=1e-15 (FD matches AD to rtol=1e-7) utilitiesapi.remesh: CS matches AD to rtol=1e-7 (same as FD)

From this, it seems like the AD for adtmindistancesearch and remesh might have bugs, but I did not find anything obviously wrong. I will defer potential fixes to a future PR.

Expected time until merged

This is a large PR and not urgent, so I think 3-4 weeks is reasonable.

Type of change

Testing

See above for testing information.

Checklist

codecov[bot] commented 2 years ago

Codecov Report

Merging #14 (053191f) into main (0fe865b) will increase coverage by 1.17%. The diff coverage is 91.17%.

@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   48.79%   49.97%   +1.17%     
==========================================
  Files           5        5              
  Lines        1744     1683      -61     
==========================================
- Hits          851      841      -10     
+ Misses        893      842      -51     
Impacted Files Coverage Δ
pysurf/tsurf_tools.py 48.98% <87.50%> (+0.07%) :arrow_up:
pysurf/tsurf_component.py 64.76% <91.54%> (+4.03%) :arrow_up:
pysurf/__init__.py 100.00% <100.00%> (ø)
pysurf/baseClasses.py 27.32% <100.00%> (-1.49%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

ewu63 commented 2 years ago

I am merging this as Anil's approval was dismissed due to a minor change.