8 #ifndef OPENFPM_NUMERICS_POLYLEVELSET_HPP
9 #define OPENFPM_NUMERICS_POLYLEVELSET_HPP
11 #include "Vector/map_vector.hpp"
12 #include "Space/Shape/Point.hpp"
13 #include "DMatrix/EMatrix.hpp"
15 #include "minter/minter.h"
18 template<
int spatial_dim,
typename MatType = EMatrixXd,
typename VecType = EVectorXd>
21 minter::LevelsetPoly<spatial_dim, MatType, VecType> *model;
24 template<
typename vector_type>
36 for(
int j = 0;j < dim;++j)
37 points(i,j) = vd.
getPos(key)[j];
44 model =
new minter::LevelsetPoly<spatial_dim, MatType, VecType>(points, tol);
60 for(
int j = 0;j < dim;++j)
61 point(0,j) = pos.get(j);
63 return model->eval(point)(0);
68 template<
typename T1,
typename T2>
69 double deriv(T1 pos, T2 deriv_order)
73 for(
int j = 0;j < dim;++j)
74 point(0,j) = pos.get(j);
76 std::vector<int> order;
77 for(
int j = 0;j < dim;++j)
78 order.push_back(deriv_order.get(j));
80 return model->deriv_eval(point, order)(0);
85 T estimate_normals_at(T pos)
89 for(
int j = 0;j < dim;++j)
90 point(0,j) = pos.get(j);
93 auto normal_minter = model->estimate_normals_at(point);
95 for(
int j = 0;j < dim;++j)
96 normal.get(j) = normal_minter(0,j);
103 double estimate_mean_curvature_at(T pos)
106 MatType point(1,dim);
107 for(
int j = 0;j < dim;++j)
108 point(0,j) = pos.get(j);
110 auto mc = model->estimate_mean_curvature_at(point);
vect_dist_key_dx get()
Get the actual key.
size_t size_local() const
return the local size of the vector
static const unsigned int dims
template parameters typedefs
auto getPos(vect_dist_key_dx vec_key) -> decltype(vPos.template get< 0 >(vec_key.getKey()))
Get the position of an element.
vector_dist_iterator getDomainIterator() const
Get an iterator that traverse the particles in the domain.