From 71a48f8c3bbcc13e965a14759e12232fdbfa57e0 Mon Sep 17 00:00:00 2001 From: LasNikas Date: Thu, 19 Sep 2024 19:21:35 +0200 Subject: [PATCH] rename --- docs/src/preprocessing/preprocessing.md | 6 +++--- src/TrixiParticles.jl | 2 +- src/preprocessing/point_in_poly/point_in_poly.jl | 2 +- ...ng_number_horman.jl => winding_number_hormann.jl} | 12 ++++++------ src/setups/complex_shape.jl | 8 ++++---- ...man_circle.csv => coordinates_hormann_circle.csv} | 0 ...n_hexagon.csv => coordinates_hormann_hexagon.csv} | 0 ...v => coordinates_hormann_inverted_open_curve.csv} | 0 test/setups/complex_shape.jl | 6 +++--- 9 files changed, 18 insertions(+), 18 deletions(-) rename src/preprocessing/point_in_poly/{winding_number_horman.jl => winding_number_hormann.jl} (83%) rename test/preprocessing/data/{coordinates_horman_circle.csv => coordinates_hormann_circle.csv} (100%) rename test/preprocessing/data/{coordinates_horman_hexagon.csv => coordinates_hormann_hexagon.csv} (100%) rename test/preprocessing/data/{coordinates_horman_inverted_open_curve.csv => coordinates_hormann_inverted_open_curve.csv} (100%) diff --git a/docs/src/preprocessing/preprocessing.md b/docs/src/preprocessing/preprocessing.md index 5d367d015..67192221f 100644 --- a/docs/src/preprocessing/preprocessing.md +++ b/docs/src/preprocessing/preprocessing.md @@ -15,7 +15,7 @@ Here, ``\Theta_i`` is the *signed* angle between ``\mathbf{c}_i - \mathbf{p}`` a In 3D, we refer to the solid angle of an *oriented* triangle with respect to ``\mathbf{p}``. We provide the following methods to calculate ``w(\mathbf{p})``: -- Horman et al. (2001) evaluate the winding number combined with an even-odd rule, but only for 2D polygons (see [WindingNumberHorman](@ref)). +- Hormann et al. (2001) evaluate the winding number combined with an even-odd rule, but only for 2D polygons (see [WindingNumberHormann](@ref)). - Naive winding: Jacobson et al. (2013) generalized the winding number so that the algorithm can be applied for both 2D and 3D geometries (see [WindingNumberJacobson](@ref)). - Hierarchical winding: Jacobson et al. (2013) also introduced a fast hierarchical evaluation of the winding number. For further information see the description below. @@ -243,7 +243,7 @@ The evaluation then looks as follows. ```@autodocs Modules = [TrixiParticles] -Pages = [joinpath("preprocessing", "point_in_poly", "winding_number_horman.jl")] +Pages = [joinpath("preprocessing", "point_in_poly", "winding_number_hormann.jl")] ``` ```@autodocs @@ -260,6 +260,6 @@ Pages = [joinpath("preprocessing", "geometries", "io.jl")] - Alec Jacobson, Ladislav Kavan, and Olga Sorkine-Hornung "Robust inside-outside segmentation using generalized winding numbers". In: ACM Transactions on Graphics, 32.4 (2013), pages 1--12. [doi: 10.1145/2461912.2461916](https://igl.ethz.ch/projects/winding-number/robust-inside-outside-segmentation-using-generalized-winding-numbers-siggraph-2013-jacobson-et-al.pdf) -- Kai Horman, Alexander Agathos "The point in polygon problem for arbitrary polygons". +- Kai Hormann, Alexander Agathos "The point in polygon problem for arbitrary polygons". In: Computational Geometry, 20.3 (2001), pages 131--144. [doi: 10.1016/s0925-7721(01)00012-8](https://doi.org/10.1016/S0925-7721(01)00012-8) diff --git a/src/TrixiParticles.jl b/src/TrixiParticles.jl index 637a8bc08..d6e0c2996 100644 --- a/src/TrixiParticles.jl +++ b/src/TrixiParticles.jl @@ -73,7 +73,7 @@ export BoundaryMovement export examples_dir, validation_dir, trixi_include export trixi2vtk export RectangularTank, RectangularShape, SphereShape, ComplexShape -export WindingNumberHorman, WindingNumberJacobson +export WindingNumberHormann, WindingNumberJacobson export VoxelSphere, RoundSphere, reset_wall!, extrude_geometry, load_geometry export SourceTermDamping export ShepardKernelCorrection, KernelCorrection, AkinciFreeSurfaceCorrection, diff --git a/src/preprocessing/point_in_poly/point_in_poly.jl b/src/preprocessing/point_in_poly/point_in_poly.jl index 8f799757e..70ebaaf90 100644 --- a/src/preprocessing/point_in_poly/point_in_poly.jl +++ b/src/preprocessing/point_in_poly/point_in_poly.jl @@ -1,3 +1,3 @@ include("hierarchical_winding.jl") -include("winding_number_horman.jl") +include("winding_number_hormann.jl") include("winding_number_jacobson.jl") diff --git a/src/preprocessing/point_in_poly/winding_number_horman.jl b/src/preprocessing/point_in_poly/winding_number_hormann.jl similarity index 83% rename from src/preprocessing/point_in_poly/winding_number_horman.jl rename to src/preprocessing/point_in_poly/winding_number_hormann.jl index cae358049..02e835cd7 100644 --- a/src/preprocessing/point_in_poly/winding_number_horman.jl +++ b/src/preprocessing/point_in_poly/winding_number_hormann.jl @@ -1,18 +1,18 @@ """ - WindingNumberHorman() + WindingNumberHormann() -Algorithm for inside-outside segmentation of a complex geometry proposed by [Horman et al. (2001)](@ref references_complex_shape). +Algorithm for inside-outside segmentation of a complex geometry proposed by [Hormann et al. (2001)](@ref references_complex_shape). It is only supported for 2D geometries. -[`WindingNumberHorman`](@ref) might handle edge cases a bit better, since the winding number is an integer value. +[`WindingNumberHormann`](@ref) might handle edge cases a bit better, since the winding number is an integer value. !!! warning "Experimental Implementation" This is an experimental feature and may change in any future releases. """ -struct WindingNumberHorman end +struct WindingNumberHormann end -# Algorithm 2 from Horman et al. (2001) "The point in polygon problem for arbitrary polygons" +# Algorithm 2 from Hormann et al. (2001) "The point in polygon problem for arbitrary polygons" # https://doi.org/10.1016/S0925-7721(01)00012-8 -function (point_in_poly::WindingNumberHorman)(geometry, points; store_winding_number=false) +function (point_in_poly::WindingNumberHormann)(geometry, points; store_winding_number=false) (; edge_vertices) = geometry # We cannot use a `BitVector` here, as writing to a `BitVector` is not thread-safe diff --git a/src/setups/complex_shape.jl b/src/setups/complex_shape.jl index fb5dcb1e7..4b1592ce6 100644 --- a/src/setups/complex_shape.jl +++ b/src/setups/complex_shape.jl @@ -10,7 +10,7 @@ Sample a complex geometry with particles. Returns an [`InitialCondition`](@ref). Note that an initial particle grid is generated inside the bounding box of the geometry. A `point_in_geometry_algorithm` checks if particles are inside the geometry or not. -For more information about the method see [`WindingNumberJacobson`](@ref) or [`WindingNumberHorman`](@ref). +For more information about the method see [`WindingNumberJacobson`](@ref) or [`WindingNumberHormann`](@ref). # Arguments - `geometry`: Geometry returned by [`load_geometry`](@ref). @@ -30,7 +30,7 @@ For more information about the method see [`WindingNumberJacobson`](@ref) or [`W will be overwritten when using an initial pressure function in the system. - `point_in_geometry_algorithm`: Algorithm for sampling the complex geometry with particles. It basically checks whether a particle is inside an object or not. - For more information see [`WindingNumberJacobson`](@ref) or [`WindingNumberHorman`](@ref) + For more information see [`WindingNumberJacobson`](@ref) or [`WindingNumberHormann`](@ref) - `grid_offset`: Offset of the initial particle grid of the bounding box of the `geometry`. - `max_nparticles`: Maximum number of particles in the initial particle grid. This is only used to avoid accidentally choosing a `particle_spacing` @@ -48,8 +48,8 @@ function ComplexShape(geometry::Union{TriangleMesh, Polygon}; particle_spacing, winding_number_factor=sqrt(eps())), store_winding_number=false, grid_offset::Real=0.0, max_nparticles=10^7, pad_initial_particle_grid=2particle_spacing) - if ndims(geometry) == 3 && point_in_geometry_algorithm isa WindingNumberHorman - throw(ArgumentError("`WindingNumberHorman` only supports 2D geometries")) + if ndims(geometry) == 3 && point_in_geometry_algorithm isa WindingNumberHormann + throw(ArgumentError("`WindingNumberHormann` only supports 2D geometries")) end if grid_offset < 0.0 diff --git a/test/preprocessing/data/coordinates_horman_circle.csv b/test/preprocessing/data/coordinates_hormann_circle.csv similarity index 100% rename from test/preprocessing/data/coordinates_horman_circle.csv rename to test/preprocessing/data/coordinates_hormann_circle.csv diff --git a/test/preprocessing/data/coordinates_horman_hexagon.csv b/test/preprocessing/data/coordinates_hormann_hexagon.csv similarity index 100% rename from test/preprocessing/data/coordinates_horman_hexagon.csv rename to test/preprocessing/data/coordinates_hormann_hexagon.csv diff --git a/test/preprocessing/data/coordinates_horman_inverted_open_curve.csv b/test/preprocessing/data/coordinates_hormann_inverted_open_curve.csv similarity index 100% rename from test/preprocessing/data/coordinates_horman_inverted_open_curve.csv rename to test/preprocessing/data/coordinates_hormann_inverted_open_curve.csv diff --git a/test/setups/complex_shape.jl b/test/setups/complex_shape.jl index 977707bc3..de53aea6f 100644 --- a/test/setups/complex_shape.jl +++ b/test/setups/complex_shape.jl @@ -4,7 +4,7 @@ @testset verbose=true "2D" begin @testset verbose=true "Shifted Rectangle" begin - algorithms = [WindingNumberHorman(), WindingNumberJacobson()] + algorithms = [WindingNumberHormann(), WindingNumberJacobson()] shifts = [-0.5, 0.0, 0.5] particle_spacings = [0.03, 0.05] @@ -39,8 +39,8 @@ @testset verbose=true "Real World Data" begin files = ["hexagon", "circle", "inverted_open_curve"] - algorithms = [WindingNumberHorman(), WindingNumberJacobson()] - algorithm_names = ["horman", "jacobson"] + algorithms = [WindingNumberHormann(), WindingNumberJacobson()] + algorithm_names = ["hormann", "jacobson"] @testset verbose=true "Algorithm: $(TrixiParticles.type2string(algorithms[i]))" for i in 1:2 @testset verbose=true "Test File `$(files[j])`" for j in eachindex(files)