Skip to content

Feature/gridedit 2102 grading in triangulation#535

Open
BillSenior wants to merge 43 commits into
masterfrom
feature/GRIDEDIT-2102_grading_in_triangulation
Open

Feature/gridedit 2102 grading in triangulation#535
BillSenior wants to merge 43 commits into
masterfrom
feature/GRIDEDIT-2102_grading_in_triangulation

Conversation

@BillSenior

Copy link
Copy Markdown
Collaborator

No description provided.

BillSenior added 30 commits May 27, 2026 17:33
Comment on lines +207 to +209

sepran::mshoce(
newMesh != 0,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Change name to something more meaningful

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?

# 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()

# 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.

virtual ~TriangulationGenerator() = default;

/// \brief Compute triangulation
virtual std::unique_ptr<Mesh2D> generate(const Polygons& polygon) const = 0;

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.

Shouldn't PascalCase naming style be used (consistent with the rest of the code)?


for (UInt i = 0; i < NumberOfInner(); ++i)
{
auto [innerMinimum, innerMaximum] = Inner(i).SegmentLengthExtrema();

@RStolkerDeltares RStolkerDeltares Jul 20, 2026

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.

Missing handling for constants::missing::doubleValue from Polygon::SegmentLengthExtrema.

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?

POSITION_INDEPENDENT_CODE ON
)

source_group("Source Files" FILES ${TARGET_SRC_LIST}) No newline at end of file

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.


private:
/// \brief The scale factor used when generating points in polygon
const double scaleFactor_;

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.

Underscore should be dropped from the name (naming convention).


private:
/// \brief Find the smallest delta in the boundary polygon
static double minimumEdgeDelta(const std::vector<meshkernel::Point>& polygonNodes);

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.

Unused; can be removed?

// Compute the minimum spacing between points of the polygon, both outer and all inner polygons
const auto [minimumDelta, maximumDeltaDummy] = polygon.Enclosure(0).SegmentLengthExtrema();

const int estimatedNumberOfElements = static_cast<int>((estimatedArea / (0.433 * minimumDelta * minimumDelta)) * 3.5);

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.

What are these magic numbers (0.433, 3.5)? Consider adding named constants for readability.

// Get estimate of area covered by polygon, subtracting area covered by holes
const double estimatedArea = polygon.Enclosure(0).ComputeSurfaceArea();
// Compute the minimum spacing between points of the polygon, both outer and all inner polygons
const auto [minimumDelta, maximumDeltaDummy] = polygon.Enclosure(0).SegmentLengthExtrema();

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.

Should a constants::missing::doubleValue return be handled here?

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.

3 participants