Skip to content

Commit

Permalink
Merge pull request #7844 from janetournois/Mesh_3-remove_unused_crite…
Browse files Browse the repository at this point in the history
…ria-GF

Mesh_3 - `Mesh_criteria_3` cleaning
  • Loading branch information
lrineau committed Dec 11, 2023
2 parents ab39775 + 8a4c99f commit ef881a1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 87 deletions.
15 changes: 4 additions & 11 deletions Mesh_3/include/CGAL/Mesh_criteria_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,15 @@ class Mesh_criteria_3_impl
// is not a problem
template <typename CGAL_NP_TEMPLATE_PARAMETERS>
Mesh_criteria_3_impl(const CGAL_NP_CLASS& np)
:edge_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_size_param),
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::edge_sizing_field_param),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(DBL_MAX)))),
:edge_criteria_(parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::edge_size_param), FT(DBL_MAX)),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::edge_min_size_param), FT(0))),
facet_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_angle_param), FT(0)),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_size_param),
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_sizing_field_param),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::sizing_field_param), FT(0)))),
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_size_param), FT(0)),
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::facet_distance_param), FT(0)),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_topology_param), CGAL::FACET_VERTICES_ON_SURFACE),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::facet_min_size_param), FT(0))),
cell_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_ratio_param),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_param), FT(0))),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_size_param),
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::cell_sizing_field_param),
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::sizing_field_param), FT(0)))),
cell_criteria_(parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_radius_edge_ratio_param), FT(0)),
parameters::choose_parameter(parameters::get_parameter_reference(np, internal_np::cell_size_param), FT(0)),
parameters::choose_parameter(parameters::get_parameter(np, internal_np::cell_min_size_param), FT(0)))
{ }

Expand Down
86 changes: 16 additions & 70 deletions Mesh_3/test/Mesh_3/test_mesh_criteria_creation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,12 @@ int main()
Mc ec1(edge_size = 1);
assert( ec1.edge_criteria_object().sizing_field(bp1,1,index) == 1 );

Mc ec2(edge_sizing_field = Esf(2));
Mc ec2(edge_size = Esf(2));
assert( ec2.edge_criteria_object().sizing_field(bp1,1,index) == 2 );

Mc ec3(edge_sizing_field = 3.);
Mc ec3(edge_size = 3.);
assert( ec3.edge_criteria_object().sizing_field(bp1,1,index) == 3 );

Mc ec4(edge_size = 4.,
edge_sizing_field = Esf(5.));
assert( ec4.edge_criteria_object().sizing_field(bp1,1,index) == 4. );

Mc ec5(sizing_field = 5.);
assert( ec5.edge_criteria_object().sizing_field(bp1,1,index) == 5 );

Mc ec6(sizing_field = 6.,
edge_sizing_field = 7.);
assert( ec6.edge_criteria_object().sizing_field(bp1,1,index) == 7. );

Mc ec7(sizing_field = 7.,
edge_size = 8.);
assert( ec7.edge_criteria_object().sizing_field(bp1,1,index) == 8. );


// -----------------------------------
// Test facet criteria
// -----------------------------------
Expand All @@ -109,48 +93,29 @@ int main()
cp(tr.point(ch, k+3))));

FT facet_size_ok = radius_facet*FT(10);
FT facet_size_nok = radius_facet/FT(10);

Mc fc1(facet_size = facet_size_ok);
assert( ! fc1.facet_criteria_object()(tr, f) );

Mc fc2(facet_sizing_field = facet_size_ok);
assert( ! fc2.facet_criteria_object()(tr, f) );

Mc fc3(facet_sizing_field = Fsf(facet_size_ok));
Mc fc3(facet_size = Fsf(facet_size_ok));
assert( ! fc3.facet_criteria_object()(tr, f) );

Mc fc4(facet_sizing_field = facet_size_nok,
facet_size = facet_size_ok);
assert( ! fc4.facet_criteria_object()(tr, f) );

Mc fc5(sizing_field = facet_size_ok);
assert( ! fc5.facet_criteria_object()(tr, f) );

Mc fc6(facet_size = facet_size_ok,
facet_sizing_field = facet_size_nok,
sizing_field = facet_size_nok);
assert( ! fc6.facet_criteria_object()(tr, f) );

Mc fc7(facet_sizing_field = Fsf(facet_size_ok),
sizing_field = facet_size_nok);
assert( ! fc7.facet_criteria_object()(tr, f) );

Mc fc8(facet_distance = 8.);
Mc fc9(facet_angle = 9.);
Mc fc10(facet_angle = 10.1,
facet_distance = 10.2,
facet_size = 10.3,
facet_min_size = 0.2,
facet_sizing_field = Fsf(10.4),
sizing_field = 10.5);
facet_min_size = 0.2);
Mc fc1Ob(facet_angle = 10.11,
facet_distance = 10.12,
facet_min_size = 0.3,
facet_size = Fsf(10.14));

// Test construction from int
Mc fc11(facet_size = 11);
Mc fc11b(facet_size = 11, facet_min_size = 1);
Mc fc12(facet_sizing_field = 12);
Mc fc12b(facet_sizing_field = 12, facet_min_size = 2);
Mc fc13(sizing_field = 13);
Mc fc12(facet_size = Fsf(12));
Mc fc12b(facet_size = Fsf(12), facet_min_size = 1);

// Test topological criterion creation
Mc fc14(facet_topology = CGAL::FACET_VERTICES_ON_SURFACE);
Expand All @@ -168,46 +133,27 @@ int main()
cp(tr.point(ch, 3))));

FT cell_size_ok = radius_cell*FT(10);
FT cell_size_nok = radius_cell/FT(10);

Mc cc1(cell_size = cell_size_ok);
assert( ! cc1.cell_criteria_object()(tr, ch) );

Mc cc2(cell_sizing_field = cell_size_ok);
assert( ! cc2.cell_criteria_object()(tr, ch) );

Mc cc3(cell_sizing_field = Fsf(cell_size_ok));
Mc cc3(cell_size = Fsf(cell_size_ok));
assert( ! cc3.cell_criteria_object()(tr, ch) );

Mc cc4(cell_sizing_field = cell_size_nok,
cell_size = cell_size_ok);
assert( ! cc4.cell_criteria_object()(tr, ch) );

Mc cc5(sizing_field = cell_size_ok);
assert( ! cc5.cell_criteria_object()(tr, ch) );

Mc cc6(cell_size = cell_size_ok,
cell_sizing_field = cell_size_nok,
sizing_field = cell_size_nok);
assert( ! cc6.cell_criteria_object()(tr, ch) );

Mc cc7(cell_sizing_field = Csf(cell_size_ok),
sizing_field = cell_size_nok);
Mc cc7(cell_size = Csf(cell_size_ok));
assert( ! cc7.cell_criteria_object()(tr, ch) );

Mc cc8(cell_radius_edge_ratio = 8.);
Mc cc9(cell_radius_edge_ratio = 9.1,
sizing_field = Csf(9.2) );
cell_size = Csf(9.2) );
Mc cc10(cell_radius_edge_ratio = 10.1,
cell_size = 10.2,
cell_min_size = 0.1);
Mc cc10b(cell_radius_edge_ratio = 10.1,
cell_min_size = 0.1,
cell_sizing_field = Csf(10.3),
sizing_field = 10.4);
cell_size = Csf(10.3));

// Test construction from int
Mc cc11(cell_size = 11);
Mc cc11b(cell_size = 11, cell_min_size = 1);
Mc cc12(cell_sizing_field = 12);
Mc cc12b(cell_sizing_field = 12, cell_min_size = 2);
Mc cc13(sizing_field = 13);
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ int main()
Periodic_mesh_criteria criteria(facet_angle = 30,
facet_size = 0.05,
facet_distance = 0.025,
cell_radius_edge = 2,
cell_radius_edge_ratio = 2,
cell_size = 0.05);

// Mesh generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,14 @@ CGAL_add_named_parameter_with_compatibility(features_detector_param_t, features_
CGAL_add_named_parameter_with_compatibility(input_features_param_t, input_features_param, input_features)

CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size)
CGAL_add_named_parameter_with_compatibility_cref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field)
CGAL_add_named_parameter_with_compatibility(edge_min_size_param_t, edge_min_size_param, edge_min_size)
CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle)
CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size)
CGAL_add_named_parameter_with_compatibility_cref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field)
CGAL_add_named_parameter_with_compatibility_cref_only(facet_distance_param_t, facet_distance_param, facet_distance)
CGAL_add_named_parameter_with_compatibility(facet_min_size_param_t, facet_min_size_param, facet_min_size)
CGAL_add_named_parameter_with_compatibility(facet_topology_param_t, facet_topology_param, facet_topology)
CGAL_add_named_parameter_with_compatibility(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge)
CGAL_add_named_parameter_with_compatibility(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio)
CGAL_add_named_parameter_with_compatibility(cell_size_param_t, cell_size_param, cell_size)
CGAL_add_named_parameter_with_compatibility_cref_only(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field)
CGAL_add_named_parameter_with_compatibility_cref_only(sizing_field_param_t, sizing_field_param, sizing_field)
CGAL_add_named_parameter_with_compatibility(cell_min_size_param_t, cell_min_size_param, cell_min_size)

CGAL_add_named_parameter_with_compatibility(function_param_t, function_param, function)
Expand Down

0 comments on commit ef881a1

Please sign in to comment.