#include <GeneralSurfaceFill_fwd.hpp>
Implements general n
-d node placing algorithm for parametrically given d
-d surfaces, as described in https://arxiv.org/abs/2005.08767.
If you specifically use this algorithm, we would appreciate if you cite the above publication.
Given a regular parametrization surface \( \vec r: \Lambda \subseteq \mathbb{R}^d \to \partial \Omega \subseteq \mathbb{R}^n\), and a spacing function \( h: \partial \Omega \to (0, \infty)\) the algorithm fills the domain discretization with points spaced approximately \(h\) apart.
The algorithm starts from existing nodes in the parametrization function's domain, usually one random node. They are processed in a queue and for each node, new candidates are generated around it on a circle. The circle's radius is determined in way that when the new candidates are mapped by the parametrization function, their distance from the initial node is approximately equal to the supplied density function. This is done using the first degree Taylor polynomial. Candidates are then checked and some are accepted and added to the queue. This is repeated until no more nodes can be generated or the maximal number of points has been reached.
Usage example (filling the surface of a torus):
Definition at line 49 of file GeneralSurfaceFill_fwd.hpp.
Public Member Functions | |
GeneralSurfaceFill & | maxPoints (int max_points) |
Maximal number of points generated. More... | |
GeneralSurfaceFill & | seed (int seed) |
Set custom seed for the random number generator. More... | |
GeneralSurfaceFill & | proximityTolerance (scalar_t zeta) |
Set proximity tolerance. More... | |
GeneralSurfaceFill & | numSamples (int n_samples) |
Controls the number of generated candidates from each point. More... | |
template<typename param_func_t , typename jm_func_t , typename search_t , typename spacing_func_t > | |
void | operator() (domain_t &domain, param_domain_t ¶m_domain, const param_func_t ¶m_function, const jm_func_t ¶m_jacobian, const spacing_func_t &spacing_function, search_t &tree, int type=0) const |
Fills the parametrically given surface with a quality node distribution according to the spacing_function . More... | |
template<typename param_func_t , typename search_t , typename spacing_func_t > | |
void | fillParametrization (domain_t &domain, param_domain_t ¶m_domain, const param_func_t ¶m, const spacing_func_t &spacing_function, search_t &tree, int type=0) const |
Version with single function returning a pair of point and jacobian. More... | |
template<typename param_func_t , typename jm_func_t , typename spacing_func_t > | |
void | operator() (domain_t &domain, param_domain_t ¶m_domain, const param_func_t ¶m_function, const jm_func_t ¶m_jacobian, const spacing_func_t &spacing_function, int type=0) const |
Fills given surface according to the nodal spacing function spacing_function . More... | |
template<typename param_func_t , typename jm_func_t > | |
void | operator() (domain_t &domain, param_domain_t ¶m_domain, const param_func_t ¶m_function, const jm_func_t ¶m_jacobian, const scalar_t &h, int type=0) const |
Overload for constant function. More... | |
template<typename param_func_t , typename jm_func_t , typename spacing_func_t > | |
void | operator() (domain_t &domain, DomainShape< param_vec_t > ¶m_domain_shape, const param_func_t ¶m_function, const jm_func_t ¶m_jacobian, const spacing_func_t &spacing_function, int type=0) const |
Overload for Shape instead of DomainDiscretization. More... | |
template<typename param_func_t , typename jm_func_t > | |
void | operator() (domain_t &domain, DomainShape< param_vec_t > ¶m_domain_shape, const param_func_t ¶m_function, const jm_func_t ¶m_jacobian, const scalar_t &h, int type=0) const |
Overload for constant function and Shape instead of DomainDiscretization. More... | |
Public Types | |
enum | { dim = vec_t::dim, param_dim = param_vec_t::dim } |
Store dimension of the domains. More... | |
typedef DomainDiscretization< vec_t > | domain_t |
Domain discretization type. More... | |
typedef DomainDiscretization< param_vec_t > | param_domain_t |
Parametric domain discretization type. More... | |
typedef vec_t::scalar_t | scalar_t |
Scalar type. More... | |
typedef param_vec_t::scalar_t | param_scalar_t |
Parametric domain scalar type. More... | |
Private Attributes | |
int | max_points = 5000000 |
Maximal number of points generated. More... | |
int | seed_ |
Seed for the random number generator. More... | |
int | n_samples = 15 |
Number of samples. More... | |
scalar_t | zeta = 1 - 1e-10 |
Proximity tolerance. More... | |
anonymous enum |
Store dimension of the domains.
Enumerator | |
---|---|
dim | Dimensionality of the domain. |
param_dim | Dimensionality of the parametric domain. |
Definition at line 57 of file GeneralSurfaceFill_fwd.hpp.
void mm::GeneralSurfaceFill< vec_t, param_vec_t >::fillParametrization | ( | domain_t & | domain, |
param_domain_t & | param_domain, | ||
const param_func_t & | param, | ||
const spacing_func_t & | spacing_function, | ||
search_t & | tree, | ||
int | type = 0 |
||
) | const |
Version with single function returning a pair of point and jacobian.
Definition at line 59 of file GeneralSurfaceFill.hpp.
|
inline |
Maximal number of points generated.
Definition at line 73 of file GeneralSurfaceFill_fwd.hpp.
|
inline |
Controls the number of generated candidates from each point.
For 2-D it is the actual number of candidates, for 3-D it is the number of candidates on the great circle. Its value is ignored in 1-D.
Definition at line 84 of file GeneralSurfaceFill_fwd.hpp.
|
inline |
Overload for constant function and Shape instead of DomainDiscretization.
Definition at line 139 of file GeneralSurfaceFill_fwd.hpp.
void mm::GeneralSurfaceFill< vec_t, param_vec_t >::operator() | ( | domain_t & | domain, |
DomainShape< param_vec_t > & | param_domain_shape, | ||
const param_func_t & | param_function, | ||
const jm_func_t & | param_jacobian, | ||
const spacing_func_t & | spacing_function, | ||
int | type = 0 |
||
) | const |
Overload for Shape instead of DomainDiscretization.
Definition at line 38 of file GeneralSurfaceFill.hpp.
|
inline |
Overload for constant function.
Definition at line 124 of file GeneralSurfaceFill_fwd.hpp.
void mm::GeneralSurfaceFill< vec_t, param_vec_t >::operator() | ( | domain_t & | domain, |
param_domain_t & | param_domain, | ||
const param_func_t & | param_function, | ||
const jm_func_t & | param_jacobian, | ||
const spacing_func_t & | spacing_function, | ||
int | type = 0 |
||
) | const |
Fills given surface according to the nodal spacing function spacing_function
.
Definition at line 27 of file GeneralSurfaceFill.hpp.
void mm::GeneralSurfaceFill< vec_t, param_vec_t >::operator() | ( | domain_t & | domain, |
param_domain_t & | param_domain, | ||
const param_func_t & | param_function, | ||
const jm_func_t & | param_jacobian, | ||
const spacing_func_t & | spacing_function, | ||
search_t & | tree, | ||
int | type = 0 |
||
) | const |
Fills the parametrically given surface with a quality node distribution according to the spacing_function
.
domain | Domain \(\Omega\) to fill with nodes. Can be partially filled. |
param_domain | Domain \(\Lambda\) of the parametrization function. Can be partially filled with parameters, which are taken as seeds. It is assumed that all parameters have a corresponding node in domain (but domain can contain other nodes as well). |
param_function | Parametrization function \(\vec r\). |
param_jacobian | Jacobian matrix \(\nabla \vec r\) of the parametrization function. Must have full rank. |
spacing_function | Nodal spacing function \(h\). |
tree | Search structure on domain. This can be used if the domain already has some nodes, such as when filling different patches separately. |
type | Type of the nodes. If 0, the engines default value is used. |
#include <medusa/bits/domains/GeneralSurfaceFill.hpp>
must be included additionally to #include <medusa/Medusa_fwd.hpp>
. Definition at line 47 of file GeneralSurfaceFill.hpp.
GeneralSurfaceFill< vec_t, param_vec_t > & mm::GeneralSurfaceFill< vec_t, param_vec_t >::proximityTolerance | ( | scalar_t | zeta | ) |
Set proximity tolerance.
A new candidate mush be at least zeta*h(p)
away. It should hold that 0 < zeta < 1
.
Definition at line 149 of file GeneralSurfaceFill.hpp.
|
inline |
Set custom seed for the random number generator.
Definition at line 75 of file GeneralSurfaceFill_fwd.hpp.
|
private |
Maximal number of points generated.
Definition at line 61 of file GeneralSurfaceFill_fwd.hpp.
|
private |
Number of samples.
Definition at line 63 of file GeneralSurfaceFill_fwd.hpp.
|
private |
Seed for the random number generator.
Definition at line 62 of file GeneralSurfaceFill_fwd.hpp.
|
private |
Proximity tolerance.
Definition at line 64 of file GeneralSurfaceFill_fwd.hpp.