Commit 38108746 authored by ESTERIE Pierre's avatar ESTERIE Pierre
Browse files

clean changes from previous commits

parent 961dd20b
......@@ -80,7 +80,7 @@ namespace scalfmm::interpolation
chebyshev_interpolator() = default;
chebyshev_interpolator(chebyshev_interpolator const&) = default;
chebyshev_interpolator(chebyshev_interpolator&&) noexcept = default;
// auto operators = (chebyshev_interpolator const&) -> chebyshev_interpolator& = default;
auto operator=(chebyshev_interpolator const&) -> chebyshev_interpolator& = default;
auto operator=(chebyshev_interpolator&&) noexcept -> chebyshev_interpolator& = default;
~chebyshev_interpolator() = default;
......
......@@ -96,7 +96,7 @@ namespace scalfmm::interpolation
, m_nnodes(meta::pow(order, dimension))
, m_m2l_interactions(math::pow(max_number_of_cell, dimension))
{
this->derived_cast().set_private_members_impl();
set_private_members();
set_child_parent_interpolator();
generate_interactions_matrixes(
homogeneity_tag == matrix_kernels::homogeneity::non_homogenous ? root_cell_width : value_type(2.),
......@@ -115,7 +115,7 @@ namespace scalfmm::interpolation
, m_nnodes(meta::pow(order, dimension))
, m_m2l_interactions(math::pow(max_number_of_cell, dimension))
{
this->derived_cast().set_private_members_impl();
set_private_members();
set_child_parent_interpolator();
generate_interactions_matrixes(
homogeneity_tag == matrix_kernels::homogeneity::non_homogenous ? root_cell_width : value_type(2.),
......@@ -231,6 +231,11 @@ namespace scalfmm::interpolation
return this->derived_cast().template apply_locals_preprocessing_impl<Cell>(current_cell, order);
}
auto set_private_members() -> void
{
return this->derived_cast().template set_private_members_impl();
}
// Destructor
~interpolator() = default;
......
......@@ -91,8 +91,9 @@ namespace scalfmm::interpolation
}
template<typename ComputationType>
[[nodiscard]] inline auto polynomials_impl(ComputationType x, std::size_t order, std::size_t n) const
[[nodiscard]] inline auto polynomials_impl(ComputationType x, std::size_t n) const
{
auto order{this->order()};
using value_type = ComputationType;
// assert(xsimd::any(xsimd::abs(x) - 1. < 10. * std::numeric_limits<value_type>::epsilon()));
......@@ -140,8 +141,9 @@ namespace scalfmm::interpolation
}
template<typename ComputationType>
[[nodiscard]] inline auto derivative_impl(ComputationType x, std::size_t order, std::size_t n) const
[[nodiscard]] inline auto derivative_impl(ComputationType x, std::size_t n) const
{
auto order{this->order()};
using value_type = ComputationType;
// assert(xsimd::any(xsimd::abs(x) - 1. < 10. * std::numeric_limits<value_type>::epsilon()));
......@@ -393,6 +395,7 @@ namespace scalfmm::interpolation
}
}
inline void set_private_members_impl() {}
};
// traits class to register types inside the interpolator generic class
......@@ -412,73 +415,4 @@ namespace scalfmm::interpolation
};
} // namespace scalfmm::interpolation
namespace scalfmm::component
{
// TODO : grid_cell_storage -> check if we can force the user to specify
// move in different file + comments
template<typename ValueType, std::size_t Dimension, std::size_t Inputs, std::size_t Outputs>
struct uniform_cell_storage
{
static constexpr std::size_t dimension = Dimension;
static constexpr std::size_t inputs_size = Inputs;
static constexpr std::size_t outputs_size = Outputs;
using value_type = ValueType;
using multipoles_container = xt::xtensor<value_type, dimension>;
using buffer_type = std::complex<value_type>;
using buffer_container = xt::xarray<buffer_type>;
using multipole_type = container::get_variadic_adaptor_t<multipoles_container, inputs_size>;
using local_type = container::get_variadic_adaptor_t<multipoles_container, outputs_size>;
using transformed_multipoles_type = xt::xtensor_fixed<buffer_container, xt::xshape<inputs_size>>;
uniform_cell_storage() = default;
uniform_cell_storage(uniform_cell_storage const&) = default;
uniform_cell_storage(uniform_cell_storage&&) noexcept = default;
inline auto operator=(uniform_cell_storage const&) -> uniform_cell_storage& = default;
inline auto operator=(uniform_cell_storage&&) noexcept -> uniform_cell_storage& = default;
~uniform_cell_storage() = default;
uniform_cell_storage(std::size_t order)
{
std::vector shape(dimension, order);
meta::for_each(m_multipoles, [&shape](auto& t) { t.resize(shape); });
meta::for_each(m_multipoles, [](auto& t) { std::fill(t.begin(), t.end(), value_type(0.)); });
meta::for_each(m_local_expansions, [&shape](auto& t) { t.resize(shape); });
meta::for_each(m_local_expansions, [](auto& t) { std::fill(t.begin(), t.end(), value_type(0.)); });
std::vector shape_transformed(dimension, std::size_t(2 * order - 1));
shape_transformed.at(dimension - 1) = order;
for(std::size_t m = 0; m < inputs_size; ++m)
{
m_transformed_multipoles.at(m).resize(shape_transformed);
}
}
[[nodiscard]] inline auto multipoles() -> multipole_type& { return m_multipoles; }
[[nodiscard]] inline auto multipoles() const -> multipole_type const& { return m_multipoles; }
[[nodiscard]] inline auto cmultipoles() const -> multipole_type const& { return m_multipoles; }
[[nodiscard]] inline auto locals() -> local_type& { return m_local_expansions; }
[[nodiscard]] inline auto locals() const -> local_type const& { return m_local_expansions; }
[[nodiscard]] inline auto clocals() const -> local_type const& { return m_local_expansions; }
[[nodiscard]] inline auto transformed_multipoles() -> transformed_multipoles_type&
{
return m_transformed_multipoles;
}
[[nodiscard]] inline auto transformed_multipoles() const -> transformed_multipoles_type const&
{
return m_transformed_multipoles;
}
[[nodiscard]] inline auto ctransformed_multipoles() const -> transformed_multipoles_type const&
{
return m_transformed_multipoles;
}
private:
multipole_type m_multipoles{};
local_type m_local_expansions{};
transformed_multipoles_type m_transformed_multipoles{};
};
} // namespace scalfmm::component
#endif // SCALFMM_INTERPOLATION_UNIFORM_UNIFORM_INTERPOLATOR_HPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment