Skip to content

Commit

Permalink
Merge pull request #169 from nschloe/exude-time
Browse files Browse the repository at this point in the history
expose more exude options
  • Loading branch information
nschloe authored Oct 30, 2021
2 parents f34de13 + 5b78828 commit 0ddcb67
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 8 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pygalmesh.svg?style=flat-square)](https://pypi.org/pypi/pygalmesh/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5564818.svg?style=flat-square)](https://doi.org/10.5281/zenodo.5564818)
[![GitHub stars](https://img.shields.io/github/stars/nschloe/pygalmesh.svg?style=flat-square&label=Stars&logo=github)](https://github.com/nschloe/pygalmesh)
[![PyPi downloads](https://img.shields.io/pypi/dm/pygalmesh.svg?style=flat-square)](https://pypistats.org/packages/pygalmesh)
[![Downloads](https://pepy.tech/badge/pygalmesh/month?style=flat-square)](https://pepy.tech/project/pygalmesh)
<!--[![PyPi downloads](https://img.shields.io/pypi/dm/pygalmesh.svg?style=flat-square)](https://pypistats.org/packages/pygalmesh)-->

[![Discord](https://img.shields.io/static/v1?logo=discord&label=chat&message=on%20discord&color=7289da&style=flat-square)](https://discord.gg/Z6DMsJh4Hr)

Expand Down Expand Up @@ -295,7 +296,7 @@ mesh = pygalmesh.generate_surface_mesh(
```

Refer to [CGAL's
documention](https://doc.cgal.org/latest/Surface_mesher/index.html) for the
documentation](https://doc.cgal.org/latest/Surface_mesher/index.html) for the
options.

#### Periodic volume meshes
Expand Down
12 changes: 12 additions & 0 deletions pygalmesh/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def generate_mesh(
max_facet_distance: float = 0.0,
max_circumradius_edge_ratio: float = 0.0,
max_cell_circumradius: float | Callable[..., float] = 0.0,
exude_time_limit: float = 0.0,
exude_sliver_bound: float = 0.0,
verbose: bool = True,
seed: int = 0,
):
Expand Down Expand Up @@ -121,6 +123,8 @@ def _select(obj):
max_circumradius_edge_ratio=max_circumradius_edge_ratio,
max_cell_circumradius_value=max_cell_circumradius_value,
max_cell_circumradius_field=max_cell_circumradius_field,
exude_time_limit=exude_time_limit,
exude_sliver_bound=exude_sliver_bound,
verbose=verbose,
seed=seed,
)
Expand Down Expand Up @@ -244,6 +248,8 @@ def generate_volume_mesh_from_surface_mesh(
max_facet_distance: float = 0.0,
max_circumradius_edge_ratio: float = 0.0,
max_cell_circumradius: float = 0.0,
exude_time_limit: float = 0.0,
exude_sliver_bound: float = 0.0,
verbose: bool = True,
reorient: bool = False,
seed: int = 0,
Expand All @@ -270,6 +276,8 @@ def generate_volume_mesh_from_surface_mesh(
max_facet_distance=max_facet_distance,
max_circumradius_edge_ratio=max_circumradius_edge_ratio,
max_cell_circumradius=max_cell_circumradius,
exude_time_limit=exude_time_limit,
exude_sliver_bound=exude_sliver_bound,
verbose=verbose,
reorient=reorient,
seed=seed,
Expand All @@ -293,6 +301,8 @@ def generate_from_inr(
max_facet_distance: float = 0.0,
max_circumradius_edge_ratio: float = 0.0,
max_cell_circumradius: float | dict[int | str, float] = 0.0,
exude_time_limit: float = 0.0,
exude_sliver_bound: float = 0.0,
verbose: bool = True,
seed: int = 0,
):
Expand All @@ -313,6 +323,8 @@ def generate_from_inr(
max_facet_distance=max_facet_distance,
max_circumradius_edge_ratio=max_circumradius_edge_ratio,
max_cell_circumradius=max_cell_circumradius,
exude_time_limit=exude_time_limit,
exude_sliver_bound=exude_sliver_bound,
verbose=verbose,
seed=seed,
)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pygalmesh
version = 0.10.5
version = 0.10.6
author = Nico Schlömer
author_email = [email protected]
description = Python frontend to CGAL's mesh generation capabilities
Expand Down
10 changes: 9 additions & 1 deletion src/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ generate_mesh(
const double max_cell_circumradius_value,
const std::shared_ptr<pygalmesh::SizingFieldBase> & max_cell_circumradius_field,
//
const double exude_time_limit,
const double exude_sliver_bound,
//
const bool verbose,
const int seed
)
Expand Down Expand Up @@ -166,7 +169,12 @@ generate_mesh(
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude()
exude ?
CGAL::parameters::exude(
CGAL::parameters::time_limit = exude_time_limit,
CGAL::parameters::sliver_bound = exude_sliver_bound
) :
CGAL::parameters::no_exude()
);
if (!verbose) {
std::cerr.clear();
Expand Down
3 changes: 3 additions & 0 deletions src/generate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ void generate_mesh(
const double max_cell_circumradius_value = 0.0,
const std::shared_ptr<pygalmesh::SizingFieldBase> & max_cell_circumradius_field = nullptr,
//
const double exude_time_limit = 0.0,
const double exude_sliver_bound = 0.0,
//
const bool verbose = true,
const int seed = 0
);
Expand Down
18 changes: 16 additions & 2 deletions src/generate_from_inr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ generate_from_inr(
const double max_facet_distance,
const double max_circumradius_edge_ratio,
const double max_cell_circumradius,
const double exude_time_limit,
const double exude_sliver_bound,
const bool verbose,
const int seed
)
Expand Down Expand Up @@ -80,7 +82,12 @@ generate_from_inr(
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude()
exude ?
CGAL::parameters::exude(
CGAL::parameters::time_limit = exude_time_limit,
CGAL::parameters::sliver_bound = exude_sliver_bound
) :
CGAL::parameters::no_exude()
);
if (!verbose) {
std::cerr.clear();
Expand Down Expand Up @@ -110,6 +117,8 @@ generate_from_inr_with_subdomain_sizing(
const double max_radius_surface_delaunay_ball,
const double max_facet_distance,
const double max_circumradius_edge_ratio,
const double exude_time_limit,
const double exude_sliver_bound,
const bool verbose,
const int seed
)
Expand Down Expand Up @@ -148,7 +157,12 @@ generate_from_inr_with_subdomain_sizing(
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude()
exude ?
CGAL::parameters::exude(
CGAL::parameters::time_limit = exude_time_limit,
CGAL::parameters::sliver_bound = exude_sliver_bound
) :
CGAL::parameters::no_exude()
);
if (!verbose) {
std::cerr.clear();
Expand Down
6 changes: 5 additions & 1 deletion src/generate_from_inr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ void generate_from_inr(
const double max_facet_distance = 0.0,
const double max_circumradius_edge_ratio = 0.0,
const double max_cell_circumradius = 0.0,
const double exude_time_limit = 0.0,
const double exude_sliver_bound = 0.0,
const bool verbose = true,
const int seed = 0
);
Expand All @@ -39,7 +41,9 @@ generate_from_inr_with_subdomain_sizing(
const double max_radius_surface_delaunay_ball = 0.0,
const double max_facet_distance = 0.0,
const double max_circumradius_edge_ratio = 0.0,
const bool verbose = true,
const double exude_time_limit = 0.0,
const double exude_sliver_bound = 0.0,
const bool verbose = true,
const int seed = 0
);

Expand Down
10 changes: 9 additions & 1 deletion src/generate_from_off.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ void generate_from_off(
const double max_facet_distance,
const double max_circumradius_edge_ratio,
const double max_cell_circumradius,
const double exude_time_limit,
const double exude_sliver_bound,
const bool verbose,
const bool reorient,
const int seed
Expand Down Expand Up @@ -135,7 +137,13 @@ void generate_from_off(
lloyd ? CGAL::parameters::lloyd() : CGAL::parameters::no_lloyd(),
odt ? CGAL::parameters::odt() : CGAL::parameters::no_odt(),
perturb ? CGAL::parameters::perturb() : CGAL::parameters::no_perturb(),
exude ? CGAL::parameters::exude() : CGAL::parameters::no_exude());
exude ?
CGAL::parameters::exude(
CGAL::parameters::time_limit = exude_time_limit,
CGAL::parameters::sliver_bound = exude_sliver_bound
) :
CGAL::parameters::no_exude()
);
if (!verbose) {
std::cerr.clear();
}
Expand Down
2 changes: 2 additions & 0 deletions src/generate_from_off.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ generate_from_off(
const double max_facet_distance = 0.0,
const double max_circumradius_edge_ratio = 0.0,
const double max_cell_circumradius = 0.0,
const double exude_time_limit = 0.0,
const double exude_sliver_bound = 0.0,
const bool verbose = true,
const bool reorient = false,
const int seed = 0
Expand Down
8 changes: 8 additions & 0 deletions src/pybind11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
py::arg("max_circumradius_edge_ratio") = 0.0,
py::arg("max_cell_circumradius_value") = 0.0,
py::arg("max_cell_circumradius_field") = nullptr,
py::arg("exude_time_limit") = 0.0,
py::arg("exude_sliver_bound") = 0.0,
py::arg("verbose") = true,
py::arg("seed") = 0
);
Expand Down Expand Up @@ -333,6 +335,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
py::arg("max_facet_distance") = 0.0,
py::arg("max_circumradius_edge_ratio") = 0.0,
py::arg("max_cell_circumradius") = 0.0,
py::arg("exude_time_limit") = 0.0,
py::arg("exude_sliver_bound") = 0.0,
py::arg("verbose") = true,
py::arg("reorient") = false,
py::arg("seed") = 0
Expand All @@ -351,6 +355,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
py::arg("max_facet_distance") = 0.0,
py::arg("max_circumradius_edge_ratio") = 0.0,
py::arg("max_cell_circumradius") = 0.0,
py::arg("exude_time_limit") = 0.0,
py::arg("exude_sliver_bound") = 0.0,
py::arg("verbose") = true,
py::arg("seed") = 0
);
Expand All @@ -370,6 +376,8 @@ PYBIND11_MODULE(_pygalmesh, m) {
py::arg("max_radius_surface_delaunay_ball") = 0.0,
py::arg("max_facet_distance") = 0.0,
py::arg("max_circumradius_edge_ratio") = 0.0,
py::arg("exude_time_limit") = 0.0,
py::arg("exude_sliver_bound") = 0.0,
py::arg("verbose") = true,
py::arg("seed") = 0
);
Expand Down

0 comments on commit 0ddcb67

Please sign in to comment.