Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3ca84c0
GRIDEDIT-2102 Add closing point of polygon only if not already added
BillSenior May 27, 2026
f2420d9
GRIDEDIT-2102 First working version of calling the sepran triangulati…
BillSenior May 27, 2026
be95e30
GRIDEDIT-2102 Some testing changes (will be removed when finished, pa…
BillSenior Jun 4, 2026
b9c847d
GRIDEDIT-2102 Added hole in mesh
BillSenior Jun 4, 2026
354130d
GRIDEDIT-2102 Can now handle triangulation around holes
BillSenior Jun 4, 2026
222b6f9
GRIDEDIT-2102 Added the SEPRAN triangulation library
BillSenior Jun 4, 2026
063fae8
GRIDEDIT-2102 Remvoed executable mode bit from files
BillSenior Jun 4, 2026
ab82b34
GRIDEDIT-2102 Added sepran directory
BillSenior Jun 4, 2026
e089689
GRIDEDIT-2102 Added sepran library
BillSenior Jun 4, 2026
bbecf4e
GRIDEDIT-2102 Added sepran library cmake file
BillSenior Jun 4, 2026
0f172b2
GRIDEDIT-2102 Moved triangulation to polymorphic triangulation generator
BillSenior Jun 4, 2026
f6ab05d
GRIDEDIT-2102 Removing triangulation test code temporaily
BillSenior Jun 4, 2026
66b2d03
GRIDEDIT-2102 Added sepran library mk api cmake file
BillSenior Jun 4, 2026
195572d
GRIDEDIT-2102 Added unit test for sepran triangulation
BillSenior Jun 4, 2026
58255ca
GRIDEDIT-2102 Added back test that removed during development of sepr…
BillSenior Jun 4, 2026
e8bbce9
GRIDEDIT-2102 Fixed clang formatting warning
BillSenior Jun 8, 2026
652eb5c
GRIDEDIT-2102 Fixed doxygen warnings
BillSenior Jun 8, 2026
e2f9c68
GRIDEDIT-2102 Try to get working under macos
BillSenior Jun 8, 2026
12277d8
DST-112 Moved generation of points to separate function
BillSenior Jun 8, 2026
cf166c4
GRIDEDIT-2102 Try again to get working on macos
BillSenior Jun 8, 2026
a96afcc
GRIDEDIT-2102 Try again to get working on macos
BillSenior Jun 8, 2026
41c6062
GRIDEDIT-2102 Try again to get working on macos
BillSenior Jun 8, 2026
c1351c9
GRIDEDIT-2102 Fixed compilation error under macos
BillSenior Jun 8, 2026
6e5c614
GRIDEDIT-2102 Fixed linking error under macos
BillSenior Jun 8, 2026
4340684
GRIDEDIT-2102 Attempt tofix linking error under macos
BillSenior Jun 8, 2026
87ab525
GRIDEDIT-2102 Attempt to fix linking error under macos
BillSenior Jun 8, 2026
3b0d684
GRIDEDIT-2102 Attempt to fix linking error under macos
BillSenior Jun 8, 2026
dfa74ce
GRIDEDIT-2102 Attempt to fix linking error under macos
BillSenior Jun 8, 2026
3a81b77
GRIDEDIT-2102 Attempt to fix linking error under macos
BillSenior Jun 8, 2026
ee88ae8
GRIDEDIT-2102 Try to get working under macos
BillSenior Jun 8, 2026
718ee94
GRIDEDIT-2102 Try to get working under macos
BillSenior Jun 8, 2026
1d83b8e
GRIDEDIT-2102 Try to get working under macos
BillSenior Jun 8, 2026
dffe63e
Fix macOS gfortran discovery to include symlinks
Copilot Jun 8, 2026
4a46202
GRIDEDIT-2102 Added c++ conversion of the fortran Sepran code
BillSenior Jun 10, 2026
4d70be0
GRIDEDIT-2102 Fixed clang formatting warning
BillSenior Jun 10, 2026
b1f5cf3
GRIDEDIT-2102 Fixed windows build failure
BillSenior Jun 10, 2026
489d7e1
GRIDEDIT-2102 Fixed windows build failure
BillSenior Jun 10, 2026
536885b
GRIDEDIT-2102 Fixed unit test failure (temporary)
BillSenior Jun 10, 2026
1355517
GRIDEDIT-2102 Missed polygon file in last commit
BillSenior Jun 10, 2026
f602248
GRIDEDIT-2102 Fix macos build failures
BillSenior Jun 10, 2026
a9c52b7
GRIDEDIT-2102 Added license header
BillSenior Jun 11, 2026
d8a71cd
GRIDEDIT-2102 Removed unnecessary Fortran files
BillSenior Jun 25, 2026
ba3b257
GRIDEDIT-2102 Fix compilation under macos
BillSenior Jul 13, 2026
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
27 changes: 23 additions & 4 deletions .github/workflows/build-and-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,25 @@ jobs:

- name: Install system-provided dependencies
run: |
brew install boost doxygen libaec libomp
brew install boost doxygen gcc libaec libomp

- name: Set Fortran compiler (macOS)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can be removed now that there's no Fortran code anymore?

if: runner.os == 'macOS'
run: |
GFORTRAN_BIN="$(command -v gfortran || true)"
if [ -z "$GFORTRAN_BIN" ]; then
HOMEBREW_PREFIX="$(brew --prefix)"
GFORTRAN_BIN="$(find "$HOMEBREW_PREFIX/bin" -maxdepth 1 \( -type f -o -type l \) -name 'gfortran-*' | sort -V | tail -n 1)"
fi

if [ -z "$GFORTRAN_BIN" ]; then
echo "Unable to locate Homebrew gfortran" >&2
exit 1
fi

echo "Using Fortran compiler: $GFORTRAN_BIN"
echo "FC=$GFORTRAN_BIN" >> "$GITHUB_ENV"
echo "F77=$GFORTRAN_BIN" >> "$GITHUB_ENV"

# Step: Set OpenMP environment variables (architecture-aware)
- name: Set OpenMP environment variables
Expand All @@ -58,7 +76,7 @@ jobs:
else
HOMEBREW_PREFIX="/usr/local"
fi

echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >> $GITHUB_ENV
echo "LDFLAGS=-L$HOMEBREW_PREFIX/opt/libomp/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I$HOMEBREW_PREFIX/opt/libomp/include" >> $GITHUB_ENV
Expand Down Expand Up @@ -114,13 +132,14 @@ jobs:
# Suppress unused parameter warnings on macOS 15 Intel runner (known platform-specific issue)
SUPPRESS_PARAM_FLAG="-DSUPPRESS_UNUSED_PARAMETER_WARNING=ON"
fi

cmake \
-S ${{ github.workspace }} \
-B ${{ steps.paths.outputs.build_dir }} \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DCMAKE_PREFIX_PATH=${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c \
-DCMAKE_INSTALL_PREFIX=${{ steps.paths.outputs.install_dir }} \
-DCMAKE_Fortran_COMPILER="$FC" \
$SUPPRESS_PARAM_FLAG \
-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$HOMEBREW_PREFIX/opt/libomp/include" \
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I$HOMEBREW_PREFIX/opt/libomp/include" \
Expand All @@ -144,7 +163,7 @@ jobs:
if [ -f "${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c/bin/libz.dylib" ]; then
ln -sf libz.dylib ${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c/bin/libz.1.dylib
fi

export DYLD_LIBRARY_PATH="${{ steps.paths.outputs.ext_deps_dir }}/netcdf-c/install/netcdf-c/bin:$DYLD_LIBRARY_PATH"
ctest --test-dir ${{ steps.paths.outputs.build_dir }} \
-C ${{ inputs.build_type }} \
Expand Down
9 changes: 9 additions & 0 deletions cmake/compiler_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ if(APPLE)
message(STATUS "Configuring build for macOS with ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION}).")
# Common warning and visibility flags
add_compile_options("-fvisibility=hidden;-Wall;-Wextra;-pedantic;-Werror;-Wno-unused-function")

cmake_host_system_information(RESULT os_release QUERY OS_RELEASE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CMake has a (more robust) command for checking compiler flags:

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wno-character-conversion" SUPPORTS_WNO_CHARACTER_CONVERSION)
if(SUPPORTS_WNO_CHARACTER_CONVERSION)
  add_compile_options("-Wno-character-conversion")
endif()


if(os_release VERSION_GREATER_EQUAL "26.0")
add_compile_options("-Wno-character-conversion")
endif()

# Conditionally suppress unused parameter warnings (used for platform-specific compiler issues)
if(SUPPRESS_UNUSED_PARAMETER_WARNING)
add_compile_options("-Wno-unused-parameter")
Expand All @@ -25,6 +32,8 @@ if(APPLE)
# Optimization / debug flags
add_compile_options("$<$<CONFIG:RELEASE>:-O2>")
add_compile_options("$<$<CONFIG:DEBUG>:-g>")
# Disable warnings about implicit conversions between character types

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment seems out of place.

# This is required because of a compatibility issue between clang++ and googletest
else()
message(FATAL_ERROR "Unsupported compiler on macOS. Supported: AppleClang/Clang. Found ${CMAKE_CXX_COMPILER_ID}.")
endif()
Expand Down
235 changes: 235 additions & 0 deletions data/test/data/northbank_001b.pol
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
*
* Deltares, RGFGRID Version 7.03.00.77422 (Win64), Nov 30 2022, 15:52:41
* File creation date: 2025-12-01, 21:04:21
*
* Coordinate System = Cartesian
*
L000001
227 2
4.8269651E+04 4.1104092E+05
4.8309201E+04 4.1101690E+05
4.8348617E+04 4.1099271E+05
4.8387901E+04 4.1096835E+05
4.8427367E+04 4.1094396E+05
4.8465908E+04 4.1091938E+05
4.8503840E+04 4.1089477E+05
4.8541162E+04 4.1087013E+05
4.8578186E+04 4.1084545E+05
4.8614778E+04 4.1082038E+05
4.8651248E+04 4.1079491E+05
4.8687598E+04 4.1076905E+05
4.8724086E+04 4.1074251E+05
4.8758623E+04 4.1071678E+05
4.8791471E+04 4.1069159E+05
4.8822627E+04 4.1066693E+05
4.8852209E+04 4.1064235E+05
4.8881096E+04 4.1061850E+05
4.8909403E+04 4.1059494E+05
4.8937131E+04 4.1057166E+05
4.8964120E+04 4.1054840E+05
4.8990744E+04 4.1052578E+05
4.9016843E+04 4.1050354E+05
4.9042417E+04 4.1048167E+05
4.9067297E+04 4.1045999E+05
4.9091808E+04 4.1043902E+05
4.9115781E+04 4.1041857E+05
4.9139217E+04 4.1039866E+05
4.9161994E+04 4.1037919E+05
4.9184333E+04 4.1036030E+05
4.9206113E+04 4.1034191E+05
4.9227334E+04 4.1032402E+05
4.9247984E+04 4.1030662E+05
4.9268183E+04 4.1028959E+05
4.9287921E+04 4.1027292E+05
4.9307197E+04 4.1025661E+05
4.9326096E+04 4.1024074E+05
4.9344349E+04 4.1022525E+05
4.9362041E+04 4.1021021E+05
4.9379173E+04 4.1019564E+05
4.9395813E+04 4.1018150E+05
4.9412005E+04 4.1016765E+05
4.9427817E+04 4.1015406E+05
4.9443251E+04 4.1014074E+05
4.9458364E+04 4.1012766E+05
4.9473152E+04 4.1011479E+05
4.9487675E+04 4.1010209E+05
4.9501933E+04 4.1008957E+05
4.9515984E+04 4.1007721E+05
4.9529797E+04 4.1006498E+05
4.9543432E+04 4.1005287E+05
4.9556888E+04 4.1004086E+05
4.9570226E+04 4.1002895E+05
4.9583380E+04 4.1001712E+05
4.9596410E+04 4.1000536E+05
4.9609317E+04 4.0999367E+05
4.9622162E+04 4.0998202E+05
4.9634852E+04 4.0997043E+05
4.9647450E+04 4.0995888E+05
4.9659954E+04 4.0994738E+05
4.9672429E+04 4.0993590E+05
4.9684762E+04 4.0992446E+05
4.9697017E+04 4.0991306E+05
4.9709194E+04 4.0990168E+05
4.9721358E+04 4.0989032E+05
4.9733383E+04 4.0987900E+05
4.9745335E+04 4.0986770E+05
4.9757214E+04 4.0985643E+05
4.9769089E+04 4.0984517E+05
4.9780823E+04 4.0983395E+05
4.9792486E+04 4.0982275E+05
4.9804077E+04 4.0981158E+05
4.9815668E+04 4.0980042E+05
4.9827116E+04 4.0978930E+05
4.9838491E+04 4.0977820E+05
4.9849794E+04 4.0976713E+05
4.9861102E+04 4.0975606E+05
4.9872260E+04 4.0974504E+05
4.9883345E+04 4.0973405E+05
4.9894357E+04 4.0972308E+05
4.9905376E+04 4.0971212E+05
4.9916239E+04 4.0970121E+05
4.9927028E+04 4.0969032E+05
4.9937741E+04 4.0967946E+05
4.9948459E+04 4.0966860E+05
4.9959021E+04 4.0965779E+05
4.9969507E+04 4.0964701E+05
4.9979916E+04 4.0963626E+05
4.9990329E+04 4.0962551E+05
5.0000590E+04 4.0961481E+05
5.0010779E+04 4.0960414E+05
5.0020896E+04 4.0959350E+05
5.0031029E+04 4.0958287E+05
5.0041006E+04 4.0957229E+05
5.0050915E+04 4.0956174E+05
5.0060756E+04 4.0955121E+05
5.0070630E+04 4.0954072E+05
5.0080330E+04 4.0953023E+05
5.0089956E+04 4.0951977E+05
5.0099508E+04 4.0950931E+05
5.0109053E+04 4.0949883E+05
5.0118458E+04 4.0948839E+05
5.0127790E+04 4.0947794E+05
5.0137049E+04 4.0946750E+05
5.0146223E+04 4.0945694E+05
5.0155375E+04 4.0944650E+05
5.0164493E+04 4.0943607E+05
5.0173578E+04 4.0942565E+05
5.0182618E+04 4.0941513E+05
5.0191672E+04 4.0940473E+05
5.0200728E+04 4.0939434E+05
5.0209787E+04 4.0938397E+05
5.0218920E+04 4.0937358E+05
5.0227979E+04 4.0936305E+05
5.0237036E+04 4.0935235E+05
5.0246091E+04 4.0934149E+05
5.0255245E+04 4.0933030E+05
5.0264132E+04 4.0931934E+05
5.0272856E+04 4.0930847E+05
5.0281415E+04 4.0929767E+05
5.0289830E+04 4.0928695E+05
5.0298329E+04 4.0927611E+05
5.0306931E+04 4.0926513E+05
5.0315637E+04 4.0925403E+05
5.0324558E+04 4.0924254E+05
5.0333321E+04 4.0923127E+05
5.0342038E+04 4.0921996E+05
5.0350709E+04 4.0920861E+05
5.0359216E+04 4.0919720E+05
5.0367862E+04 4.0918569E+05
5.0376529E+04 4.0917408E+05
5.0385217E+04 4.0916234E+05
5.0393847E+04 4.0915032E+05
5.0402585E+04 4.0913832E+05
5.0411349E+04 4.0912618E+05
5.0420140E+04 4.0911390E+05
5.0429022E+04 4.0910131E+05
5.0437815E+04 4.0908879E+05
5.0446584E+04 4.0907617E+05
5.0455328E+04 4.0906347E+05
5.0464075E+04 4.0905051E+05
5.0472787E+04 4.0903760E+05
5.0481493E+04 4.0902458E+05
5.0490192E+04 4.0901144E+05
5.0498869E+04 4.0899802E+05
5.0507582E+04 4.0898462E+05
5.0516316E+04 4.0897107E+05
5.0525070E+04 4.0895737E+05
5.0533803E+04 4.0894336E+05
5.0542640E+04 4.0892931E+05
5.0551538E+04 4.0891504E+05
5.0560498E+04 4.0890058E+05
5.0579910E+04 4.0888206E+05
5.0598392E+04 4.0885159E+05
5.0617156E+04 4.0881975E+05
5.0636716E+04 4.0878676E+05
5.0678375E+04 4.0874172E+05
5.0721626E+04 4.0866610E+05
5.0768423E+04 4.0858381E+05
5.0818108E+04 4.0849554E+05
5.0868762E+04 4.0840250E+05
5.0968545E+04 4.0833842E+05
5.1027975E+04 4.0841417E+05
5.1099739E+04 4.0847768E+05
5.1072798E+04 4.0857736E+05
5.0987017E+04 4.0862324E+05
5.0893257E+04 4.0866713E+05
5.0804816E+04 4.0870770E+05
5.0741644E+04 4.0878350E+05
5.0701081E+04 4.0887194E+05
5.0681464E+04 4.0891949E+05
5.0661848E+04 4.0896703E+05
5.0633254E+04 4.0900593E+05
5.0604661E+04 4.0904483E+05
5.0587704E+04 4.0909304E+05
5.0570747E+04 4.0914125E+05
5.0551796E+04 4.0918547E+05
5.0532844E+04 4.0922970E+05
5.0506245E+04 4.0927425E+05
5.0479647E+04 4.0931880E+05
5.0470670E+04 4.0936435E+05
5.0461693E+04 4.0940990E+05
5.0472000E+04 4.0946044E+05
5.0482307E+04 4.0951098E+05
5.0492281E+04 4.0955786E+05
5.0502256E+04 4.0960474E+05
5.0513560E+04 4.0965428E+05
5.0524864E+04 4.0970382E+05
5.0536942E+04 4.0976462E+05
5.0526089E+04 4.0982664E+05
5.0486296E+04 4.0988336E+05
5.0421129E+04 4.0995584E+05
5.0352638E+04 4.1002965E+05
5.0285476E+04 4.1010014E+05
5.0216319E+04 4.1017528E+05
5.0150488E+04 4.1024577E+05
5.0080001E+04 4.1032157E+05
5.0014169E+04 4.1039272E+05
4.9946342E+04 4.1046654E+05
4.9877186E+04 4.1053702E+05
4.9796725E+04 4.1059687E+05
4.9720253E+04 4.1065738E+05
4.9643117E+04 4.1072321E+05
4.9566646E+04 4.1078372E+05
4.9488845E+04 4.1084690E+05
4.9412373E+04 4.1090741E+05
4.9333907E+04 4.1097058E+05
4.9258766E+04 4.1103176E+05
4.9180964E+04 4.1108629E+05
4.9093854E+04 4.1104306E+05
4.9023085E+04 4.1101596E+05
4.8954210E+04 4.1098920E+05
4.8908328E+04 4.1097125E+05
4.8861447E+04 4.1095396E+05
4.8814567E+04 4.1093667E+05
4.8768684E+04 4.1094099E+05
4.8722802E+04 4.1094531E+05
4.8681241E+04 4.1097357E+05
4.8639681E+04 4.1100183E+05
4.8598785E+04 4.1102943E+05
4.8557890E+04 4.1105703E+05
4.8512339E+04 4.1107465E+05
4.8466789E+04 4.1109227E+05
4.8418911E+04 4.1108429E+05
4.8371034E+04 4.1107631E+05
4.8320342E+04 4.1105861E+05
4.8269651E+04 4.1104092E+05
1 change: 1 addition & 0 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(triangle)
add_subdirectory(sepran)
34 changes: 34 additions & 0 deletions extern/sepran/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# C++20 translation of the SEPRAN mesh-generation library.
# Replaces the original Fortran sources.
Comment on lines +1 to +2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of this comment, add a README.md file like the triangle library has with similar contents (information, usage, modifications).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also add a .clang-format file similar as in the triangle library to overwrite the default formatting rules.


set(target_name Sepran)

add_library(${target_name} STATIC)

set(
TARGET_SRC_LIST
SepranSort.cpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sources should be placed in a src dir and the headers in an include dir.

SepranGeometry.cpp
SepranCurveIntersection.cpp
SepranBoundary.cpp
SepranTransform.cpp
SepranTopology.cpp
SepranFront.cpp
SepranQuadratic.cpp
Msho2d.cpp
Mshoce.cpp
)

target_sources(${target_name} PRIVATE ${TARGET_SRC_LIST})

target_include_directories(${target_name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

target_compile_features(${target_name} PUBLIC cxx_std_20)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add precompiled headers to speedup compilation like in libs\MeshKernel\CMakeLists.txt?

set_target_properties(
${target_name}
PROPERTIES
POSITION_INDEPENDENT_CODE ON
)

source_group("Source Files" FILES ${TARGET_SRC_LIST})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also add header files group.

Loading
Loading