Skip to content

Conversation

bobpaw
Copy link
Collaborator

@bobpaw bobpaw commented Sep 13, 2024

Refactor Capstone support

apf_cap

  • move MeshCAP implementation into apfCAP.cc.
  • document functions and add documentation group.
  • remove unused/obsolete capMesh and capEntity forward declarations.
  • forward declare function arguments to reduce translation unit dependencies.
  • add functions to create a Capstone apf::Mesh2 from an existing gmi_model, load by mesh name, generate a mesh with Capstone meshing, and create empty meshes.
  • add model ownership like with MDS.
  • replace fake castEntity function with getCapId and getCapEntity.
  • add hasCAP to query support programmatically.
  • always setup full adjacencies when loading Capstone meshes.
  • only destroy the associated model if it exists and is owned.
  • add functions to handle capstone sizing info.

gmi_cap

  • remove using namespace declarations from the global scope
  • remove most #includes in favor of forward declaration.
    • had to leave in CreateMG_CoreDefs.h for M_GTopo because it's a typedef to at template.
  • document all functions and add documentation group.
  • add functions to probe, write, or load specific associated meshes from CRE files.
  • gmi_cap is now the preferred way to interact (load/write) with CRE files.
  • gmi_cap_start and gmi_cap_stop actually do things now (previously they were no-ops).
    • they load/unload an internal CapstoneModule for interaction with Capstone APIs
  • if models are owned (loaded with gmi_cap) they will call the Capstone API to delete the underlying model when destroyed.
  • base APIs (start, stop, register, load, write) are still C interfaces, but the extended ones (probe, load_selective, export, import) are C++ only.

test cases

  • Add capProbe and capLoadSome cases to test new APIs
  • Rewrite capVol to use new APIs, support parallel adaptation with intermediate MDS object, rework argument parsing, and change the names of output VTKs.
  • update the capVolSizeFields to work in parallel (namely CylBoundaryLayer).
  • add a new cube shock size field for capVol and make it the default given option 3.
  • Rewrite cap2vtk, capGeomTest, capCheckParam, cap_closestPoint, cap_inClosureOf tests to use new APIs.
  • rewrite capAdapt to use new APIs and add options to set the before/after VTK names

@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch from 5792912 to 537b4e3 Compare November 4, 2024 16:40
@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch 2 times, most recently from 3d9c856 to d377593 Compare June 17, 2025 05:10
@bobpaw
Copy link
Collaborator Author

bobpaw commented Jun 19, 2025

Running into problem with empty parts after --fixLargeAngles. Likely related to #198.

@bobpaw
Copy link
Collaborator Author

bobpaw commented Jun 19, 2025

This occurred with the capVol wing case with METIS on 4 procs.

Log for mpirun -np 4 ./capVol -gm 3 wing_surf_only.cre out.cre

Initalization of MetricInterpolation ...
Initalization of MetricInterpolation ...
Threads : 1
Threads : 1
Initalization of MetricInterpolation ...
Initalization of MetricInterpolation ...
Threads : 1Threads : 1

Expiration Date = 2025-8-26
Expiration Date = 2025-8-26
Expiration Date = 2025-8-26
Expiration Date = 2025-8-26
Number of Breps = 1
Number of Breps = 1
Number of Breps = 1
Number of Breps = 1
Loading Data Timer : cpu = 5.924e-03s wall = 7.67e-02s
Loading Data Timer : cpu = 5.807e-03s wall = 7.67e-02s
Loading Data Timer : cpu = 6.076e-03s wall = 7.67e-02s
Loading Data Timer : cpu = 8.435e-03s wall = 7.68e-02s
GenerateNMesh : Num Threads = 1
Number of sources : 12
Generating isotropic proxy
For iteration:0 marked cells:0 out of:1331
Max source number:12
Average source number:2.7408
Sizing Field Timing : cpu = 1.133e-02s wall = 3.69e-01s
Meshing edge 1
Meshing edge 2
Meshing edge 3
Meshing edge 4
Meshing edge 5
Meshing edge 6
Meshing edge 7
Meshing edge 8
Meshing edge 9
Meshing edge 10
Meshing edge 11
Meshing edge 12
Meshing face 1
Meshing face 2
Meshing face 3
Meshing face 4
Meshing face 5
Meshing face 6
Faces Mesher : cpu = 2.343e-02s wall = 2.84e-02s
Meshing region 1
Missing edges:0 over:2010
Iter=0 npoin=672 nelem=2037
Iter=1 npoin=673 nelem=2314
Iter=2 npoin=673 nelem=2314
Iter=0 npoin=673 nelem=2314 nface=1340
Iter=1 npoin=1119 nelem=4466 nface=2356
Iter=2 npoin=1121 nelem=4479 nface=1982
Iter=3 npoin=1153 nelem=4686 nface=1004
Iter=4 npoin=1409 nelem=6245 nface=1472
Iter=5 npoin=1413 nelem=6283 nface=1200
Iter=6 npoin=1449 nelem=6499 nface=636
Iter=7 npoin=1583 nelem=7305 nface=844
Iter=8 npoin=1590 nelem=7348 nface=644
Iter=9 npoin=1615 nelem=7497 nface=374
Iter=10 npoin=1664 nelem=7801 nface=396
Iter=11 npoin=1671 nelem=7847 nface=280
Iter=12 npoin=1682 nelem=7915 nface=188
Iter=13 npoin=1695 nelem=7996 nface=142
Iter=14 npoin=1696 nelem=8014 nface=96
Iter=15 npoin=1697 nelem=8025 nface=44
Iter=16 npoin=1697 nelem=8025 nface=14
Worst quality before optim:2900.75
Average quality before optim:2.46743
Iter=0
Edges swapped:480 over:10376 tried:8366
Elements swapped:0 over:8025 tried:30372
Points optimized:592 over:1025 tried:1023
Iter=1
Edges swapped:53 over:10376 tried:6144
Elements swapped:0 over:8025 tried:25745
Points optimized:233 over:1025 tried:922
Iter=2
Edges swapped:6 over:10376 tried:2891
Elements swapped:0 over:8025 tried:15572
Points optimized:97 over:1025 tried:711
Average quality after optim:1.37659
Worst quality after optim:1.91675
Regions Mesher : cpu = 6.954e-01s wall = 7.30e-01s
Timing(GenerateNMesh) : cpu = 7.310e-01s wall = 1.13e+00s
mesh verified in 0.036884 seconds
METIS: weights are not supported
METIS: partitioned in 0.003553 seconds
METIS: planned in 0.000735 seconds
METIS: split in 0.011952 seconds
mesh expanded from 1 to 4 parts in 0.003679 seconds
mesh migrated from 1 to 4 in 0.051315 seconds
writeVtuFile into buffers: 0.001556 seconds
writeVtuFile buffers to disk: 0.144549 seconds
vtk files before.vtk written in 0.167789 seconds

MeshAdapt: ma::configure: Based on requested sizefield, MeshAdapt requires at least 5 iterations.
Setting the number of iteration to 6!

MeshAdapt: version 2.0 !
METIS: weights are not supported
METIS: localized graph in 0.000232 seconds
METIS: partitioned in 0.004619 seconds
METIS: remapped in 0.000094 seconds
METIS: scattered in 0.000051 seconds
METIS: planned in 0.000422 seconds
METIS: migrated in 0.026521 seconds
METIS: balanced in 0.037136 seconds

MeshAdapt: iteration 0

MeshAdapt: coarsened 538 edges in 0.230906 seconds
METIS: weights are not supported
METIS: localized graph in 0.000538 seconds
METIS: partitioned in 0.002582 seconds
METIS: remapped in 0.000074 seconds
METIS: scattered in 0.000027 seconds
METIS: planned in 0.000142 seconds
METIS: migrated in 0.011190 seconds
METIS: balanced in 0.017814 seconds

MeshAdapt: refined 1603 edges in 0.032561 seconds

MeshAdapt: snapped in 0.000494 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 1

MeshAdapt: coarsened 458 edges in 0.401182 seconds
METIS: weights are not supported
METIS: localized graph in 0.002649 seconds
METIS: partitioned in 0.005030 seconds
METIS: remapped in 0.000161 seconds
METIS: scattered in 0.000039 seconds
METIS: planned in 0.000228 seconds
METIS: migrated in 0.025560 seconds
METIS: balanced in 0.041595 seconds

MeshAdapt: refined 4695 edges in 0.089507 seconds

MeshAdapt: snapped in 0.000980 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 2

MeshAdapt: coarsened 1175 edges in 1.189498 seconds
METIS: weights are not supported
METIS: localized graph in 0.009365 seconds
METIS: partitioned in 0.011108 seconds
METIS: remapped in 0.000358 seconds
METIS: scattered in 0.000066 seconds
METIS: planned in 0.000405 seconds
METIS: migrated in 0.083376 seconds
METIS: balanced in 0.138617 seconds

MeshAdapt: refined 10097 edges in 0.209393 seconds

MeshAdapt: snapped in 0.002037 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 3

MeshAdapt: coarsened 3976 edges in 2.870489 seconds
METIS: weights are not supported
METIS: localized graph in 0.021831 seconds
METIS: partitioned in 0.021483 seconds
METIS: remapped in 0.000682 seconds
METIS: scattered in 0.000094 seconds
METIS: planned in 0.000864 seconds
METIS: migrated in 0.184952 seconds
METIS: balanced in 0.306471 seconds

MeshAdapt: refined 14780 edges in 0.388254 seconds

MeshAdapt: snapped in 0.003598 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 4

MeshAdapt: coarsened 7300 edges in 4.476811 seconds
METIS: weights are not supported
METIS: localized graph in 0.025776 seconds
METIS: partitioned in 0.036831 seconds
METIS: remapped in 0.001051 seconds
METIS: scattered in 0.000134 seconds
METIS: planned in 0.001526 seconds
METIS: migrated in 0.236706 seconds
METIS: balanced in 0.409361 seconds

MeshAdapt: refined 15780 edges in 0.435036 seconds

MeshAdapt: snapped in 0.004559 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: iteration 5

MeshAdapt: coarsened 10152 edges in 6.280703 seconds
METIS: weights are not supported
METIS: localized graph in 0.029699 seconds
METIS: partitioned in 0.043759 seconds
METIS: remapped in 0.001136 seconds
METIS: scattered in 0.000149 seconds
METIS: planned in 0.002603 seconds
METIS: migrated in 0.268942 seconds
METIS: balanced in 0.477790 seconds

MeshAdapt: refined 8500 edges in 0.299709 seconds

MeshAdapt: snapped in 0.004292 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --iter 0 of shape correction loop: #bad elements 166453

MeshAdapt: snapped in 0.005070 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --fixLargeAngles in 9.376438 seconds: #bad elements 174251

MeshAdapt: --fixShortEdgeElements in 217.924783 seconds: #bad elements 78956
METIS: weights are not supported
METIS: localized graph in 0.071383 seconds
METIS: partitioned in 0.025649 seconds
METIS: remapped in 0.001230 seconds
METIS: scattered in 0.000119 seconds
METIS: planned in 0.000415 seconds
METIS: migrated in 0.592544 seconds
METIS: balanced in 0.900624 seconds

MeshAdapt: --percent change in number of bad elements 0.525656

MeshAdapt: --iter 1 of shape correction loop: #bad elements 78956

MeshAdapt: snapped in 0.003536 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --fixLargeAngles in 4.660544 seconds: #bad elements 78143

MeshAdapt: --fixShortEdgeElements in 123.399546 seconds: #bad elements 37207
METIS: weights are not supported
METIS: localized graph in 0.041078 seconds
METIS: partitioned in 0.014809 seconds
METIS: remapped in 0.000719 seconds
METIS: scattered in 0.000078 seconds
METIS: planned in 0.000419 seconds
METIS: migrated in 0.358449 seconds
METIS: balanced in 0.537830 seconds

MeshAdapt: --percent change in number of bad elements 0.528763

MeshAdapt: --iter 2 of shape correction loop: #bad elements 37207

MeshAdapt: snapped in 0.002259 seconds: 0 targets, 0 non-layer snaps

MeshAdapt: --fixLargeAngles in 2.428371 seconds: #bad elements 35320
APF warning: 1 empty parts
APF warning: 1 empty parts
APF warning: 1 empty parts

MeshAdapt: --fixShortEdgeElements in 71.502453 seconds: #bad elements 16995
METIS: weights are not supported
owned_xadj.size() > 1 failed at /users/woodra/lore/projects/capstone/core-capstone/metis/apfMETISbalancer.cc + 37

===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 2952076 RUNNING AT trouble.scorec.rpi.edu
= EXIT CODE: 134
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Aborted (signal 6)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions

@bobpaw
Copy link
Collaborator Author

bobpaw commented Jun 23, 2025

Metis balancing for meshes with empty parts is fixed in #499

@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch from cd5cb4b to 18c73b8 Compare June 24, 2025 00:03
bobpaw added 10 commits June 24, 2025 13:18
- Add -m option to convert mesh database to MDS during adaptation. This
  option speeds up adaptation.
- This tests the conversion capability.

Signed-off-by: Aiden Woodruff <[email protected]>
- Replace writeCre with cs.save_file.
- Replace ma::adaptVerbose with ma::adapt (the production version).
- Remove ma::Input arguments which are just reinforcing the defaults.
  - If the defaults chagne we shouldn't force using the old ones.
- Don't delete old mesh model before adapting.
- Change CapstoneModule name.
- Reorder mds mesh after conversion.

Signed-off-by: Aiden Woodruff <[email protected]>
- Disable verify() for non-volume meshes.

Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap.h: add gmi_cap_probe and gmi_cap_load_some functions.
- wrap headers and functions requiring C++ into #ifdef __cplusplus.
- remove using namespace declarations.
- add import with gmodel.
- gmi_cap.cc: add using namespace CreateMG.
- add Geometry namespace to enums (i.e. VERTEX, EDGE, FACE, REGION).
- add gmodel to struct cap_model.
- use reinterpret_cast instead of C-style casts.
- (gmi_cap_start): handle initialization of static
  capstonemodule.
- (gmi_cap_stop): destruct static capstone module.
- (create_cre): uncomment function.
- (gmi_cap_probe): add short overload to just get mesh names.
- add long overload to get model and mesh contents.
- (gmi_register_cap): register create_cre for gmi_load.
- (owned_import): uncomment function.
- (gmi_cap_load): call gmi_cap_load_some with all mesh names.
- (gmi_cap_load_some): add new function to only load specific mesh
  names.
- (gmi_import_cap): add overload to use current geometry.
- replace PCU_ALWAYS_ASSERT with if statement and gmi_fail.
- test/capLoadSome.cc: add utility to test gmi_cap_load_some.
- test/capProbe.cc: add utility to test gmi_cap_probe.
- test/CMakeLists.txt: add capLoadSome and capProbe.

Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap/CMakeLists.txt: update link libraries.
- gmi_cap/gmi_cap.h: add function documentation.
- add doxygen group

Signed-off-by: Aiden Woodruff <[email protected]>
- apf_cap/CMakeLists.txt:
- apf_cap/apfCAP.h: move MeshCAP definition to apfCAP.cc.
- add function documentation.
- (hasCAP): new function.
- add copyright notice.
- fix #include guard name.
- remove namespace using declarations.
- forward declare arguments.
- remove unnecessary #includes.
- (createMesh): rename to createCapMesh.
    - similar to loadMdsMesh, etc
- (createCapMesh): add overload using existing gmi_model.
- (getCapNative): add function to replace MeshCAP::getMesh
  functionality.
- test/cap*: replace createMesh with createCapMesh.
- update #includes now that apf_cap doesn't have anything.
- remove using namespace CreateMG::*.
- prefer MDBI/GDBI to long names.
- apf_cap/apfCAP.cc: reorganize #includes.
- add using namespace CreateMG and alias commonly used CreateMG::Mesh
  (which would also conflict with apf::Mesh).
- (hasCAP): add definition.
- (MeshCAP): add class definition from apfCAP.h
- add ownership of mesh database interface in case we use the gmi_model
  createCapMesh.
- (MeshCAP::MeshCAP): use Capstone get_dimension.
- add MeshMG:: namespace where needed.
- light reformatting.
- (createMesh): remove unused function (with non-existent capMesh* type).
- (castEntity): remove unused function.

Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap/gmi_cap.h: add gmi_cap_write.
- gmi_cap/gmi_cap.cc (gmi_cap_write): add function to write native
  capstone CRE file.
- apf_cap/apfCAP.h: add createCapMesh with no mesh name to load first
  Capstone mesh model.
- remove trailing whitespace.
- add generateCapMesh to generate meshes.
- add makeEmptyCapMesh for copying.
- add disownCapModel like disownMdsModel.
- apf_cap/apfCAP.cc: add AppProcessor for Functions.
- (MeshCAP): add setupAdjacencies helper and model ownership boolean.
- (MeshCAP::setupAdjacencies): always setup complete adjacencies.
- (MeshCAP::MeshCAP): use setupAdjacencies.
- (MeshCAP::~MeshCAP): only destroy model if owned.
- add new CreateCapMesh, makeEmptyMesh, generateCapMesh, disownCapModel
  function definitions.
- test/capVol: reorganize #includes.
- use exceptions and add new Args class.
- add extensive help text with raw string literal.
- refactor main into functions.
- add before/after vtk flags.
- add flag to force splitter/balancer.
- test/testing.cmake: reduce capVol test cases without new flag.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/capVolSizeFields.h (CylBoundaryLayer): use ma::getBoundingBox
  which does PCU::Max.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/testing.cmake: add parallel capVol cases.

Signed-off-by: Aiden Woodruff <[email protected]>
@bobpaw bobpaw force-pushed the apw/capVol_mds_adapt branch from 18c73b8 to d92206b Compare June 24, 2025 17:18
bobpaw added 7 commits June 25, 2025 16:21
- gmi_cap/gmi_cap.h: remove #include gmi.h and forward declare
  gmi_model/gmi_ent.
- rename gmi_cap_load_some to gmi_cap_load_selective.
- update references to gmi_cap_load_some.
- (gmi_cap_write): add documentation.
- (gmi_cap_probe): add documentation.
- (gmi_cap_load_selective): add documentation.
- gmi_cap/gmi_cap.cc: rename gmi_cap_load_some to
  gmi_cap_load_selective.
- apf_cap/apfCAP.h: add \file documentation block.
- remove forward declarations (i.e. pcu namespace) from Doxygen with
  empty \cond.
- add apf_cap documentation group.
- rename gmi_cap_load_some to gmi_cap_load_selective.
- add missing \param documentation
- test/capLoadSome.cc: remove #include <apf*.h>
- replace gmi_cap_load_some with gmi_cap_load_selective.
- sort #include blocks.
- test/capVol.cc: remove obsolete #include <CapstoneModule> and
  <CreateMG_Framework_Mesh> now that the details have been refactored
  into apf_cap.
- remove using namespace declaration.
- replace gmi_cap_load_some with gmi_cap_load_selective.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/testing.cmake: further limit default capVol test set.
    - remove tests that took more than 500 seconds.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/capVolSizeFields.h: add Shock2 which is similar to the old cube
  shock (Shock) but with steeper gradation toward the shock and a
  minimum size (the minimum has the biggest speed impact).
- also the new Shock2 is a little more geometry-agnostic wrt bounds.
- (CylBoundaryLayer): update lion_oprint statements now that there is a
  distinct Shock2 class.
- test/capVol.cc: use Shock2 as cube shock (input 3).
- test/testing.cmake: re-enable CubeMds3d cases now that they use the
  faster size-field.
- remove PUMI_TEST_CAPVOL_FULL section so that the only additional flag
  is PUMI_TEST_CAPVOL_EXTRA.

Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap/gmi_cap.cc (gmi_cap_probe): check return value of
  reader->probe for failure (missing file, etc.) and gmi_fail.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/cap2vtk.cc: remove obsolete #includes.
- replace direct Capstone calls with new gmi_cap/apf_cap APIs.
- use exceptions to ensure allocated objects are cleaned up.
- test/cap_closestPoint.cc: replace direct capstone calls with new APIs.
- test/cap_inClosureOf.cc: replace direct capstone calls with new APIs.

Signed-off-by: Aiden Woodruff <[email protected]>
Signed-off-by: Aiden Woodruff <[email protected]>
- test/capCheckParam.cc: remove most direct capstone #includes, except
  Geometry/Mesh Frameworks (and only directly).
- use new apf_cap APIs to load geometry/mesh.
- (checkParameterization): fix indentation.
- replace printf with cout.
- test/capGeomTest.cc: remove obsolete and direct Capstone #includes.
- use new apf_cap APIs to load geometry/mesh.
- replace ma::Vector with apf::Vector3, ma::MeshEntity with
  apf::MeshEntity, ma::Iterator with apf::MeshIterator, and remove
  #include <ma.h>
    - these are all typedefs, but should be regarded as internal to ma.

Signed-off-by: Aiden Woodruff <[email protected]>
@bobpaw bobpaw changed the title Add MDS adapt option to capVol test Refactor Capstone support Jun 26, 2025
bobpaw added 4 commits June 26, 2025 18:07
- gmi_cap/gmi_cap.h: prioritize system files over local ones.

Signed-off-by: Aiden Woodruff <[email protected]>
- gmi_cap/gmi_cap.h: use CreateMG_CoreDefs.h for M_GTopo i.e. Handle and
  forward declare GDBI.
- gmi_cap/gmi_cap.cc: move CreateMG_Framework_Geometry.h here instead to
  reduce TU size.
- sort #include blocks.
- gmi_cap/CMakeLists.txt: update public link libraries.

- apf_cap/apfCAP.h: rename getCapNative to exportCapNative (which is
  congruent with gmi_export_cap).
- (disownCapModel): fix doxygen block.
- (getCapId): add function to facilitate conversion from apf::MeshEntity
  to M_MTopo. forward declare MeshEntity.
- (getCapEntity): add function to convert M_MTopo to MeshEntity.
- (loadCapSizing): add function to load Capstone sizing from a vector of
  Capstone Metric6s.
- add convenience overload to create `apf::Field`s.
- (loadCapSizingFile): add function to load Capstone sizing from a bulk
  sizing file.
- add convenience overload to create `apf::Field`s.
- (has_smoothCapAnisoSizes): change CAP to Cap to unify convention.
- (smoothCapAnisoSizes): change CAP to Cap to unify convention.

- apf_cap/apfCAPsizing.cc: add separate file with sizing-related
  functions that generally do not need to access the full MeshCAP
  interface (although at some point the interface may be moved to an
  internal apfCAPmesh.h file).
- (load_file): move here from test/capAdapt.cc.
- (doSmoothing): refactor from smoothCapAnisoSizes for reuse in
  loadCapSizingFile.
- (loadCapSizing): add function definition, moved from test/capAdapt.cc
  convertMetric6ToAnisoFields.
- add overload definition.
- (loadCapSizingFile): add function definition from test/capAdapt
  loadSizing.
- (has_smoothCapAnisoSizes): move from apfCAP.cc.
- (smoothCapAnisoSizes): move from apfCAP.cc and use doSmoothing and
  loadCapSizing.

- apf_cap/apfCAP.cc (getCapId, getCapEntity): define functions.
- (exportCapNative): rename function. fix error message.

- apf_cap/CMakeLists.txt: add apfCAPsizing.cc.
- update link libraries.
- fix HAVE_CAPSTONE_SIZINGMETRICTOOL check for Capstone 12.5.2.

- test/capAdapt.cc: remove direct Capstone #includes and clean other
  unneeded headers.
- (load_file, decompose_metric, loadSizing, convertMetric6toAnisoFields,
  makeApfInterfaceWithSizing): remove functions and use new apf_cap
  interfaces.
- remove CapstoneModule.
- load gmi_model everywhere and only rank 0 gets full mesh.
- use apf::makeEmptyCapMesh instead of direct Capstone API.
- destroy model (and always mark unowned).

- test/capCheckParam.cc: rename getCapNative to exportCapNative.

- test/cap_smooth.cc: rename has_smoothCAPAnisoSizes to
  has_smoothCapAnisoSizes.

- test/CMakeLists.txt: update capAdapt and capCheckParam linking (the
  latter needs real Capstone headers now).

Signed-off-by: Aiden Woodruff <[email protected]>
- change HAVE_CAPSTONE_SIZINGMETRICTOOL to PUMI_HAS_CAPSTONEMETRICTOOL
  to get ahead of #477.

Signed-off-by: Aiden Woodruff <[email protected]>
- CMakeLists.txt: change capstone option to PUMI_ENABLE_CAPSTONE to
  avoid collision, but still recognize old ENABLE_CAPSTONE flag.
- rename compile definition to PUMI_HAS_CAPSTONE

- apf_cap/CMakeLists.txt, gmi_cap/CMakeLists.txt: use
  PUMI_ENABLE_CAPSTONE.
- fix PUMI_HAS_CAPSTONE_SIZINGMETRICTOOL.

- apf/apfMesh.cc, ma/maSnap.cc: use PUMI_HAS_CAPSTONE

- test/CMakeLists.txt, test/testing.cmake: use PUMI_ENABLE_CAPSTONE and
  PUMI_HAS_CAPSTONE_SIZINGMETRICTOOL.

Signed-off-by: Aiden Woodruff <[email protected]>
bobpaw added 3 commits June 30, 2025 14:28
- apf_cap/apfCAP.h: add extractCapSizing.
- apf_cap/apfCAPsizing.cc: refactor first part of smoothCapAnisoSizes
  into extractCapSizing and then use the function for smoothing.

Signed-off-by: Aiden Woodruff <[email protected]>
- apf_cap/apfCAP.h: add apf_cap_sizing subgroup and document new
  functions. added direction since it's non-obvious based on const-ness
  alone.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/capAdapt.cc: make Args a struct and remove accessors in favor of
  simple members.
- add before.vtk and after.vtk prefix name arguments
- only write vtks if those arguments are given

Signed-off-by: Aiden Woodruff <[email protected]>
@bobpaw bobpaw marked this pull request as ready for review June 30, 2025 21:27
@bobpaw bobpaw requested a review from cwsmith June 30, 2025 21:27
@bobpaw
Copy link
Collaborator Author

bobpaw commented Jul 1, 2025

@cwsmith please review when you get a chance.

@bobpaw
Copy link
Collaborator Author

bobpaw commented Jul 1, 2025

Also might be good to get Jacob's eyes on this since there are substantial API changes and he might have inputs.

@cwsmith
Copy link
Contributor

cwsmith commented Jul 1, 2025

/runtests

Copy link

github-actions bot commented Jul 1, 2025

Build Log
Simmetrix Test Result: success
Simmetrix + CGNS Test Result: success

bobpaw added 2 commits July 1, 2025 12:40
- test/capCheckParam.cc: use apf APIs to call the same underlying
  Capstone ones.
- reformat table.
- check edges as well as faces.
- enable lion error messages
- test/CMakeLists.txt: remove obsolete capVol include dir.
- remove obsolete capCheckParam link libraries.

Signed-off-by: Aiden Woodruff <[email protected]>
- test/capNativeAdapt.cc: similar to simxAnisoAdapt, add utility to run
  native capstone adaptation for testing/timing purposes.
- test/CMakeLists.txt: add capNativeAdapt.
- apf_cap/apfCAP.h: add loadCapSizingFileMetrics to facilitate loading
  sizing/vmap files.
- apf_cap/apfCAPsizing.cc (load_file): add error checking for file open
  failure.
- (loadCapSizingFileMetrics): refactor file loading/remapping part of
  loadCapSizingFile into this function. doesn't require writing new code
  and allows me to keep the SFINAE load_file function limited to
  apfCAPsizing.cc

Signed-off-by: Aiden Woodruff <[email protected]>
@cwsmith cwsmith merged commit ceab906 into develop Jul 3, 2025
21 checks passed
@cwsmith cwsmith deleted the apw/capVol_mds_adapt branch July 3, 2025 00:34
@cwsmith cwsmith mentioned this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants