Skip to content
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

Add MeshCAP implementation of Mesh2 to interface with Capstone #400

Merged
merged 103 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
29c4a49
First attempt at cap-stone Mesh2 wrapper
mortezah Dec 24, 2017
fc9304d
Basic cmake setup for capstone wrapper
mortezah Feb 1, 2018
17d290b
config file for capstone
mortezah Feb 1, 2018
68aea15
updated dependencies
mortezah Feb 2, 2018
d40df73
MeshCAP ctor + createMesh
mortezah Feb 2, 2018
46461ab
iterators + getPoint_
mortezah Feb 2, 2018
cd90e47
first attempt at adjacencies
mortezah Feb 5, 2018
096f72b
gmi wrappers for capstone
mortezah Feb 5, 2018
ed74a33
fixed iterate in MeshCAP
mortezah Feb 5, 2018
1a54855
more gmi and apf wrappers implemented
mortezah Feb 6, 2018
ba02a7d
return function names for un-impl-ed gmi wrappers
mortezah Feb 6, 2018
893c13f
Determining periodicity using parametrization type
mortezah Feb 6, 2018
7daa993
reordered members in apfCAP.cc to match with .h
mortezah Feb 7, 2018
b21621b
MeshCAP::createVert_ was added
mortezah Feb 9, 2018
29e1518
rest of adjacencies added.
mortezah Feb 11, 2018
86c94f2
base tag class + double tag
mortezah Feb 11, 2018
96c329e
comment clean up
mortezah Feb 11, 2018
b582525
int tag added
mortezah Feb 11, 2018
d0ff10e
isOwned and isShared added
mortezah Feb 11, 2018
9c31d65
using M_MTopo handles instead of a new class
mortezah Feb 11, 2018
923a45c
using M_GTopo handles instead of a new class
mortezah Feb 11, 2018
662fa8e
reparam and first_derivative wrappers
mortezah Feb 12, 2018
cf65617
setPoint_ and createEntity_ wrappers in apfCAP.cc
mortezah Feb 12, 2018
b7760ec
Handling cases where input model is empty
mortezah Feb 13, 2018
f779676
buildElement->MeshCAP::createEntity when using cap
mortezah Feb 13, 2018
6cd320a
MeshCAP::destroy_ implemented
mortezah Feb 13, 2018
5c45b67
MeshCAP::{increment, isDone, deref} implemented
mortezah Feb 13, 2018
8e65151
MeshCAP::setParam implemented
mortezah Feb 13, 2018
6bbe67e
tags must be destroyed manually
mortezah Feb 13, 2018
db7829f
disable advance snapping for capstone meshes
mortezah Feb 13, 2018
5456357
MeshCAP::getOwner implemented
mortezah Feb 14, 2018
59a8bd5
MeshCAP::{getRemotes, getResidense} implemented
mortezah Feb 14, 2018
f511fab
adjacent in gmi_cap.cc implemented
mortezah Feb 14, 2018
ef6ff7d
rebuildElement behaves different for cap meshes
mortezah Feb 14, 2018
77e751a
MeshCAP::getMatches implemented
mortezah Feb 15, 2018
7488d5a
reverted rebuildElement
mortezah Feb 16, 2018
0debe26
rewrote MeshCAP::createEntity_
mortezah Feb 16, 2018
47a267d
faster getUp and getUpward
mortezah Feb 16, 2018
5def445
tet_edge_verts/tet_tri_verts for capstone meshes
mortezah Feb 17, 2018
43d7ede
lots of changes to createEntity_
mortezah Feb 21, 2018
d4f8154
commented code removed
mortezah Feb 21, 2018
a47467f
more changes to createEntity_
mortezah Feb 21, 2018
6357402
Rewrote createEntity_ yet again!
mortezah Feb 22, 2018
162b03e
MeshCAP::verify() implemented
mortezah Feb 23, 2018
4549293
MeshCAP::getId() implemented
mortezah Feb 23, 2018
0c66720
add back the advanced snapping for capstone meshes
mortezah Feb 28, 2018
e920208
min version for cmake changed to 3.8
mortezah Mar 2, 2018
a1b9664
Unnecessary headers removed in apfCAP.h gmi_cap.h
mortezah Mar 2, 2018
949fe75
test added: adapt on capstone mesh via wrappers
mortezah Mar 2, 2018
82ae8f7
minimal cmake command for compilation
mortezah Mar 2, 2018
ccc455d
user should give path2mpich in capstone-config.sh
mortezah Mar 2, 2018
9336031
made CreateMG required if ENABLE_CAPSTONE
mortezah Mar 4, 2018
d5bc112
Implemented MeshCAP::renameTag.
mortezah Mar 13, 2018
1b65c7c
updated get_dim in gmi_cap.cc
mortezah Jul 31, 2018
a2211b1
updated getDownward and countUpward
mortezah Aug 22, 2018
c60a940
Implemented find() in gmi_cap.cc
mortezah Aug 22, 2018
34dfd8c
capStone{GeomTest,IsoAdapt}.cc clis created.
mortezah Sep 8, 2018
2a7b17d
implemented normal() in gmi_cap.cc
mortezah Sep 8, 2018
d9e72dd
renamed capStoneAdapt to capStoneAnisoAdapt
mortezah Sep 25, 2018
7a84c0f
moveed analytic sizefields to capStoneSizeFields
mortezah Sep 25, 2018
6c55fb4
updated CMakeList.txt
mortezah Sep 25, 2018
480c2ba
Some changes to capStone{Iso,Aniso}Adapt
mortezah Sep 26, 2018
6015c44
Executables for the wing and B737 examples
mortezah Sep 26, 2018
bbd2297
added a new executable for attaching solutions
mortezah Jan 13, 2019
0df14fc
removec parametrization checks.
mortezah Jan 13, 2019
ded0081
final edits/clean-ups of capStoneAttachSolution.cc
mortezah Jan 14, 2019
ca352f4
created a list which holds the strand information
mortezah Jan 15, 2019
fe19512
Alvin's changes related to size-field computations
mortezah Jan 30, 2019
91eb068
removed unused variables
mortezah Jan 30, 2019
830fc09
Added writeMdsMesh to write an smb file
mortezah Jan 30, 2019
c53a3a7
maxIter is computed using factor requested by user
mortezah Jan 30, 2019
6f5ca02
new cli to check the parametrization of cre mesh
mortezah Feb 5, 2019
f192d63
utility to write vtk given a capstone mesh
mortezah Feb 5, 2019
2f15801
Added bbox wrapper to gmi_cap
mortezah Apr 18, 2019
3d19bde
capStoneGeomTest write model faces to vtk meshes
mortezah Apr 18, 2019
9e47f8d
Added size distribution computation to capStoneAttachSolution.cc
mortezah Apr 18, 2019
b11e676
Moved capstone clis to the folder "capstone_clis"
mortezah Apr 18, 2019
013b0f6
capstone related lines where removed from test/CMakeList.txt
mortezah Apr 18, 2019
24ca632
capstone_clis added to CMakeLists.txt
mortezah Apr 18, 2019
c96ace6
conditional to build capstone_clis
mortezah Apr 18, 2019
56ef29c
Clean ups + Added new options to attachSolution cli
mortezah Apr 21, 2019
9f67b80
removed print statement
mortezah Apr 21, 2019
0b82c02
Implemented setModel for MeshCAP
mortezah Apr 21, 2019
1136bed
Turned of outputting intermediate meshes in attachSolution
mortezah Apr 21, 2019
6d22bdc
Updated capstone config to skip building tests
mortezah Apr 22, 2019
7e73ef6
[capstone] Basic speed-based error estimator
AjinkyaDahale May 31, 2019
4ff21fb
[capstone] Some additional stats based on speed and its Hessian
AjinkyaDahale Jun 5, 2019
ce1140a
[capstone] Alternative size fields for speed based estimates
AjinkyaDahale Jun 18, 2019
489b050
[capstone] Option to use q_fsl or i_fsl
AjinkyaDahale Jul 2, 2019
2c8e18b
Update to the wing example
mortezah Jul 16, 2019
e6aa482
[capstone] Modified bit-fields argument to just take bit-fields
AjinkyaDahale Jul 16, 2019
9a3037d
[capstone] Some cleanup
AjinkyaDahale Jul 16, 2019
06d7c7c
Fix test/1d.cc and pumi/GenTag.h file mode
bobpaw Nov 2, 2023
4ea21b4
Added capstone_clis from morteza and update env-scorec
bobpaw Nov 2, 2023
9b1bf76
Define MeshCAP::clearRemotes and wrap ma::configure
bobpaw Nov 2, 2023
8b52606
Compile gmi_cap and apf_cap only given ENABLE_CAPSTONE=yes
bobpaw Nov 3, 2023
5a48535
Remove comments and revert gentag, env-scorec
bobpaw Nov 8, 2023
6801aba
Link apf_cap to capstone_clis
bobpaw Nov 9, 2023
453362b
Convert find_package to bob_public_dep
bobpaw Nov 9, 2023
81bcc36
Add capstone tests
bobpaw Nov 11, 2023
609e1ac
Remove capstone-config.sh and added info to wiki page
bobpaw Nov 11, 2023
40ebce9
Defined MeshCAP::destroyNative
bobpaw Nov 23, 2023
ba627b8
Update pumi-meshes submodule
bobpaw Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if(DEFINED TRIBITS_PACKAGE)
endif()

# This is the top level CMake file for the SCOREC build
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.8)
cwsmith marked this conversation as resolved.
Show resolved Hide resolved

project(SCOREC VERSION 2.2.8 LANGUAGES CXX C)

Expand Down Expand Up @@ -104,13 +104,18 @@ set(Trilinos_PREFIX "" CACHE STRING "Trilinos installation directory")
option(SKIP_SIMMETRIX_VERSION_CHECK "enable at your own risk; it may result in undefined behavior" OFF)
option(ENABLE_SIMMETRIX "Build with Simmetrix support" OFF)
message(STATUS "ENABLE_SIMMETRIX: ${ENABLE_SIMMETRIX}")
option(ENABLE_CAPSTONE "Build with Capstone support" OFF)
message(STATUS "ENABLE_CAPSTONE: ${ENABLE_CAPSTONE}")
option(ENABLE_OMEGA_H "Enable the Omega_h interface" OFF)
option(PUMI_USE_OMEGA_H_VERSION "Specify the Omega_h version PUMI should use" 10.0.0)
message(STATUS "ENABLE_OMEGA_H: ${ENABLE_OMEGA_H}")

if(ENABLE_SIMMETRIX)
add_definitions(-DHAVE_SIMMETRIX)
endif()
if(ENABLE_CAPSTONE)
add_definitions(-DHAVE_CAPSTONE)
endif()

option(ENABLE_FPP "Build with snapping to first problem plane" OFF)
message(STATUS "ENABLE_FPP: ${ENABLE_FPP}")
Expand All @@ -127,6 +132,11 @@ if(ENABLE_SIMMETRIX)
find_package(SimModSuite MODULE REQUIRED)
endif()

if(ENABLE_CAPSTONE)
set(SCOREC_USE_CreateMG_DEFAULT ${ENABLE_CAPSTONE})
bob_public_dep(CreateMG)
endif()

if(ENABLE_OMEGA_H)
# find the omega_h library
set(SCOREC_USE_Omega_h_DEFAULT ${ENABLE_OMEGA_H})
Expand Down Expand Up @@ -196,4 +206,10 @@ if(PUMI_PYTHON_INTERFACE)
add_subdirectory(python_wrappers)
endif()

if(ENABLE_CAPSTONE)
add_subdirectory(gmi_cap)
add_subdirectory(apf_cap)
add_subdirectory(capstone_clis)
endif()

bob_end_package()
17 changes: 17 additions & 0 deletions apf/apfMesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,22 @@ int const quad_edge_verts[4][2] =
*/

int const tet_edge_verts[6][2] =
#ifndef HAVE_CAPSTONE
{{0,1}
,{1,2}
,{2,0}
,{0,3}
,{1,3}
,{2,3}};
#else
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC, these changes are modifying the canonical ordering of entities. If that is correct, will enabling Capstone break support for Simmetrix meshes? If we haven't tested that combination, would you please try building with -DENABLE_SIMMETRIX=on and -DENABLE_CAPSTONE=on then running ctest?

Copy link
Collaborator Author

@bobpaw bobpaw Nov 9, 2023

Choose a reason for hiding this comment

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

Failures with Simmetrix (mpich3) (no change with nocxx11abi)

The following tests FAILED:
96 - parallel_meshgen (Failed)
97 - parallel_meshgen_surf (Failed)
98 - parallel_meshgen_vol (Failed)

Failures with Capstone

The following tests FAILED:
5 - bezierElevation (Failed)
6 - bezierMesh (Failed)
8 - bezierRefine (Failed)
9 - bezierSubdivision (Failed)
10 - bezierValidity (Failed)
75 - nedelec (Failed)
78 - h1_shape_serial (Failed)
79 - h1_shape_parallel (Failed)

Failures with Capstone and Simmetrix

The following tests FAILED:
5 - bezierElevation (Failed)
6 - bezierMesh (Failed)
8 - bezierRefine (Failed)
9 - bezierSubdivision (Failed)
10 - bezierValidity (Failed)
80 - nedelec (Failed)
83 - h1_shape_serial (Failed)
84 - h1_shape_parallel (Failed)
96 - parallel_meshgen (Failed)
97 - parallel_meshgen_surf (Failed)
98 - parallel_meshgen_vol (Failed)

My interpretation is that the combination of the two causes no extra breakage. However, the capstone failures merit investigation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for testing. I have seen the parallel_meshgen_* on the rhel9 systems (#398); as you said, they are unrelated to this PR. Ideally, we can quickly resolve the capstone test failures but I won't be opposed to merging this and creating another PR to fix the errors if time is tight/limited.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure why Morteza added this change (in commit 5def445). I need to make Capstone test meshes with tets because right now all new capstone tests pass when this section is reverted. Reverting just this section fixes bezierElevation, bezierSubdivision, nedelec, and h1_shape_*. However, it doesn't fix bezierMesh or bezierValidity which is beguiling. Is there capstone documentation that would back up the tet-reorder?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, so I've checked out the capstone mesh topologies and these are the correct values. Not sure if this will create incompatibilities.

{{0,1}
,{1,2}
,{2,0}
,{0,3}
,{3,1}
,{3,2}};
#endif


int const prism_edge_verts[9][2] =
{{0,1},{1,2},{2,0}
Expand All @@ -68,10 +78,17 @@ int const pyramid_edge_verts[8][2] =
,{0,4},{1,4},{2,4},{3,4}};

int const tet_tri_verts[4][3] =
#ifndef HAVE_CAPSTONE
{{0,1,2}
,{0,1,3}
,{1,2,3}
,{0,2,3}};
#else
{{0,1,2}
,{1,0,3}
,{1,3,2}
,{3,0,2}};
#endif

int const hex_quad_verts[6][4] =
{{0,1,2,3}
Expand Down
26 changes: 26 additions & 0 deletions apf_cap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
if(DEFINED TRIBITS_PACKAGE)
include(pkg_tribits.cmake)
return()
endif()

#Sources & Headers
set(SOURCES apfCAP.cc)
set(HEADERS apfCAP.h)

#Library
add_library(apf_cap ${SOURCES})
target_link_libraries(apf_cap PUBLIC apf gmi_cap)
target_link_libraries(apf_cap PUBLIC capstone_module
framework_testing)
target_include_directories(apf_cap PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)

#directory containing apf_simConfig.h
target_include_directories(apf_cap PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

scorec_export_library(apf_cap)
bobpaw marked this conversation as resolved.
Show resolved Hide resolved

bob_end_subdir()
Loading
Loading