5#ifndef OPENFPM_PDATA_VANDERMONDE_HPP
6#define OPENFPM_PDATA_VANDERMONDE_HPP
8#include "MonomialBasis.hpp"
9#include "VandermondeRowBuilder.hpp"
12template<
unsigned int dim,
typename T,
typename MatrixType>
19 T eps,HOverEpsilon,minSpacing;
31 : point(particlesTo.
getPosOrig(support.getReferencePointKey())),
32 monomialBasis(monomialBasis),HOverEpsilon(HOverEpsilon)
34 initialize(support,particlesFrom,particlesTo);
38 MatrixType &getMatrix(MatrixType &M)
44 size_t N = offsets.
size();
45 for (
size_t i = 0; i < N; ++i)
47 const auto& offset = offsets.get(i);
48 vrb.buildRow(M, row, offset, eps);
66 void computeEps(T factor)
68 T avgNeighbourSpacing = 0;
69 minSpacing=std::numeric_limits<T>::max();
70 size_t N = offsets.
size();
71 for (
size_t i = 0; i < N; ++i)
73 const auto& offset = offsets.get(i);
74 double dist=norm(offset);
75 avgNeighbourSpacing += computeAbsSum(offset);
81 avgNeighbourSpacing /= offsets.
size();
82 eps = avgNeighbourSpacing/factor;
89 for (
unsigned int i = 0; i < dim; ++i)
91 absSum += fabs(x.value(i));
96 template<
typename vector_type,
typename vector_type2>
99 auto & keys = sup.getKeys();
101 for (
int i = 0 ; i < keys.size() ; i++)
109 if (offsets.
size() < monomialBasis.size())
111 ACTION_ON_ERROR(std::length_error(
"Not enough neighbour points passed for Vandermonde matrix construction!"));
115 computeEps(HOverEpsilon);
This class implement the point shape in an N-dimensional space.
Implementation of 1-D std::vector like structure.
auto getPosOrig(vect_dist_key_dx vec_key) -> decltype(vd.getPos(vec_key))
Get the position of an element.
auto getPosOrig(vect_dist_key_dx vec_key) const -> decltype(v_pos.template get< 0 >(vec_key.getKey()))
Get the position of an element.