Medusa  1.1
Coordinate Free Mehless Method implementation
GeneralSurfaceFill_fwd.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_DOMAINS_GENERALSURFACEFILL_FWD_HPP_
2 #define MEDUSA_BITS_DOMAINS_GENERALSURFACEFILL_FWD_HPP_
3 
11 #include <medusa/Config.hpp>
12 #include <functional>
13 
14 namespace mm {
15 
16 template <typename vec_t>
17 class DomainDiscretization;
18 
19 template <typename vec_t>
20 class DomainShape;
21 
48 template <typename vec_t, typename param_vec_t>
50  public:
54  typedef typename vec_t::scalar_t scalar_t;
59 
60  private:
61  int max_points = 5000000;
62  int seed_;
63  int n_samples = 15;
64  scalar_t zeta = 1 - 1e-10;
65 
66  public:
68 
73  GeneralSurfaceFill& maxPoints(int max_points) { this->max_points = max_points; return *this; }
75  GeneralSurfaceFill& seed(int seed) { seed_ = seed; return *this; }
84  GeneralSurfaceFill& numSamples(int n_samples) { this->n_samples = n_samples; return *this; }
85 
104  template <typename param_func_t, typename jm_func_t, typename search_t, typename spacing_func_t>
105  void operator()(domain_t& domain, param_domain_t& param_domain,
106  const param_func_t& param_function, const jm_func_t& param_jacobian,
107  const spacing_func_t& spacing_function,
108  search_t& tree, int type = 0) const;
109 
111  template <typename param_func_t, typename search_t, typename spacing_func_t>
112  void fillParametrization(domain_t& domain, param_domain_t& param_domain,
113  const param_func_t& param, const spacing_func_t& spacing_function,
114  search_t& tree, int type = 0) const;
115 
117  template <typename param_func_t, typename jm_func_t, typename spacing_func_t>
118  void operator()(domain_t& domain, param_domain_t& param_domain,
119  const param_func_t& param_function, const jm_func_t& param_jacobian,
120  const spacing_func_t& spacing_function, int type = 0) const;
121 
123  template <typename param_func_t, typename jm_func_t>
124  void operator()(domain_t& domain, param_domain_t& param_domain,
125  const param_func_t& param_function, const jm_func_t& param_jacobian,
126  const scalar_t& h, int type = 0) const {
127  this->operator()(domain, param_domain, param_function, param_jacobian,
128  [=] (const vec_t&) { return h; }, type);
129  }
130 
132  template <typename param_func_t, typename jm_func_t, typename spacing_func_t>
133  void operator()(domain_t& domain, DomainShape<param_vec_t>& param_domain_shape,
134  const param_func_t& param_function, const jm_func_t& param_jacobian,
135  const spacing_func_t& spacing_function, int type = 0) const;
136 
138  template <typename param_func_t, typename jm_func_t>
139  void operator()(domain_t& domain, DomainShape<param_vec_t>& param_domain_shape,
140  const param_func_t& param_function, const jm_func_t& param_jacobian,
141  const scalar_t& h, int type = 0) const {
142  this->operator()(domain, param_domain_shape, param_function, param_jacobian,
143  [=] (const vec_t&) { return h; }, type);
144  }
145 };
146 } // namespace mm
147 
148 #endif // MEDUSA_BITS_DOMAINS_GENERALSURFACEFILL_FWD_HPP_
mm::GeneralSurfaceFill::operator()
void 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_func...
Definition: GeneralSurfaceFill.hpp:47
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
mm::GeneralSurfaceFill::operator()
void operator()(domain_t &domain, DomainShape< param_vec_t > &param_domain_shape, const param_func_t &param_function, const jm_func_t &param_jacobian, const scalar_t &h, int type=0) const
Overload for constant function and Shape instead of DomainDiscretization.
Definition: GeneralSurfaceFill_fwd.hpp:139
scalar_t
Scalar scalar_t
Type of the elements, alias of Scalar.
Definition: MatrixBaseAddons.hpp:16
mm::DomainDiscretization
Class representing domain discretization along with an associated shape.
Definition: DomainDiscretization_fwd.hpp:46
dim
@ dim
Number of elements of this matrix.
Definition: MatrixBaseAddons.hpp:14
mm::GeneralSurfaceFill::max_points
int max_points
Maximal number of points generated.
Definition: GeneralSurfaceFill_fwd.hpp:61
mm::GeneralSurfaceFill::scalar_t
vec_t::scalar_t scalar_t
Scalar type.
Definition: GeneralSurfaceFill_fwd.hpp:54
mm::GeneralSurfaceFill::seed_
int seed_
Seed for the random number generator.
Definition: GeneralSurfaceFill_fwd.hpp:62
mm::DomainShape
Base class for geometric shapes of domains.
Definition: DomainShape_fwd.hpp:52
Config.hpp
mm::GeneralSurfaceFill::dim
@ dim
Dimensionality of the domain.
Definition: GeneralSurfaceFill_fwd.hpp:57
mm::GeneralSurfaceFill::n_samples
int n_samples
Number of samples.
Definition: GeneralSurfaceFill_fwd.hpp:63
mm::GeneralSurfaceFill::param_domain_t
DomainDiscretization< param_vec_t > param_domain_t
Parametric domain discretization type.
Definition: GeneralSurfaceFill_fwd.hpp:53
mm::GeneralSurfaceFill::operator()
void operator()(domain_t &domain, param_domain_t &param_domain, const param_func_t &param_function, const jm_func_t &param_jacobian, const scalar_t &h, int type=0) const
Overload for constant function.
Definition: GeneralSurfaceFill_fwd.hpp:124
mm::GeneralSurfaceFill::domain_t
DomainDiscretization< vec_t > domain_t
Domain discretization type.
Definition: GeneralSurfaceFill_fwd.hpp:51
mm::GeneralSurfaceFill::zeta
scalar_t zeta
Proximity tolerance.
Definition: GeneralSurfaceFill_fwd.hpp:64
mm::GeneralSurfaceFill::proximityTolerance
GeneralSurfaceFill & proximityTolerance(scalar_t zeta)
Set proximity tolerance.
Definition: GeneralSurfaceFill.hpp:149
mm::GeneralSurfaceFill::param_scalar_t
param_vec_t::scalar_t param_scalar_t
Parametric domain scalar type.
Definition: GeneralSurfaceFill_fwd.hpp:55
mm::GeneralSurfaceFill::fillParametrization
void 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: GeneralSurfaceFill.hpp:59
mm::GeneralSurfaceFill::numSamples
GeneralSurfaceFill & numSamples(int n_samples)
Controls the number of generated candidates from each point.
Definition: GeneralSurfaceFill_fwd.hpp:84
mm::GeneralSurfaceFill::param_dim
@ param_dim
Dimensionality of the parametric domain.
Definition: GeneralSurfaceFill_fwd.hpp:58
mm::GeneralSurfaceFill::maxPoints
GeneralSurfaceFill & maxPoints(int max_points)
Maximal number of points generated.
Definition: GeneralSurfaceFill_fwd.hpp:73
mm::GeneralSurfaceFill
Implements general n-d node placing algorithm for parametrically given d-d surfaces,...
Definition: GeneralSurfaceFill_fwd.hpp:49
mm::GeneralSurfaceFill::seed
GeneralSurfaceFill & seed(int seed)
Set custom seed for the random number generator.
Definition: GeneralSurfaceFill_fwd.hpp:75