16#ifndef dealii_fe_series_h
17#define dealii_fe_series_h
89 template <
int dim,
int spacedim = dim>
123 template <
typename Number>
126 const unsigned int cell_active_fe_index,
158 template <
class Archive>
166 template <
class Archive>
259 template <
int dim,
int spacedim = dim>
293 template <
typename Number>
295 calculate(const ::Vector<Number> &local_dof_values,
296 const unsigned int cell_active_fe_index,
328 template <
class Archive>
336 template <
class Archive>
399 template <
int dim,
typename CoefficientType>
400 std::pair<std::vector<unsigned int>, std::vector<double>>
402 const std::function<std::pair<bool, unsigned int>(
412 std::pair<double, double>
429 template <
int dim,
typename CoefficientType>
436 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
438 const std::pair<bool, unsigned int>
pred_pair = predicate(
ind);
452 template <
typename CoefficientType>
458 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
460 for (
unsigned int i = 0; i < coefficients.
size(0); ++i)
469 template <
typename CoefficientType>
475 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
477 for (
unsigned int i = 0; i < coefficients.
size(0); ++i)
478 for (
unsigned int j = 0;
j < coefficients.
size(1); ++
j)
487 template <
typename CoefficientType>
493 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
495 for (
unsigned int i = 0; i < coefficients.
size(0); ++i)
496 for (
unsigned int j = 0;
j < coefficients.
size(1); ++
j)
497 for (
unsigned int k = 0;
k < coefficients.
size(2); ++
k)
506 template <
typename Number>
515 template <
typename Number>
521 "FESeries::process_coefficients() can not be used with "
522 "complex-valued coefficients and VectorTools::mean norm."));
530template <
int dim,
typename CoefficientType>
531std::pair<std::vector<unsigned int>, std::vector<double>>
540 ExcMessage(
"smallest_abs_coefficient should be non-negative."));
548 std::map<unsigned int, std::vector<CoefficientType>>
pred_to_values;
549 internal::FESeriesImplementation::fill_map(coefficients,
579 norm_value = internal::FESeriesImplementation::complex_mean_value(
601template <
int dim,
int spacedim>
602template <
class Archive>
611 ar &n_coefficients_per_direction;
614 unsigned int size = fe_collection->
size();
616 for (
unsigned int i = 0; i < size; ++i)
617 ar &(*fe_collection)[i].get_name();
620 size = q_collection.
size();
622 for (
unsigned int i = 0; i < size; ++i)
626 ar &fourier_transform_matrices;
631template <
int dim,
int spacedim>
632template <
class Archive>
644 ExcMessage(
"A different number of coefficients vector has been used "
645 "to generate the transformation matrices you are about "
653 for (
unsigned int i = 0; i < size; ++i)
656 Assert(name.compare((*fe_collection)[i].get_name()) == 0,
657 ExcMessage(
"A different FECollection has been used to generate "
658 "the transformation matrices you are about to load!"));
665 for (
unsigned int i = 0; i < size; ++i)
668 Assert(quadrature == q_collection[i],
669 ExcMessage(
"A different QCollection has been used to generate "
670 "the transformation matrices you are about to load!"));
674 ar &fourier_transform_matrices;
679template <
int dim,
int spacedim>
680template <
class Archive>
689 ar &n_coefficients_per_direction;
692 unsigned int size = fe_collection->
size();
694 for (
unsigned int i = 0; i < size; ++i)
695 ar &(*fe_collection)[i].get_name();
698 size = q_collection.
size();
700 for (
unsigned int i = 0; i < size; ++i)
704 ar &legendre_transform_matrices;
709template <
int dim,
int spacedim>
710template <
class Archive>
722 ExcMessage(
"A different number of coefficients vector has been used "
723 "to generate the transformation matrices you are about "
731 for (
unsigned int i = 0; i < size; ++i)
734 Assert(name.compare((*fe_collection)[i].get_name()) == 0,
735 ExcMessage(
"A different FECollection has been used to generate "
736 "the transformation matrices you are about to load!"));
743 for (
unsigned int i = 0; i < size; ++i)
746 Assert(quadrature == q_collection[i],
747 ExcMessage(
"A different QCollection has been used to generate "
748 "the transformation matrices you are about to load!"));
752 ar &legendre_transform_matrices;
const_iterator cend() const
const_iterator cbegin() const
SmartPointer< const hp::FECollection< dim, spacedim > > fe_collection
void calculate(const ::Vector< Number > &local_dof_values, const unsigned int cell_active_fe_index, Table< dim, CoefficientType > &fourier_coefficients)
Table< dim, Tensor< 1, dim > > k_vectors
std::vector< CoefficientType > unrolled_coefficients
const unsigned int component
typename std::complex< double > CoefficientType
unsigned int get_n_coefficients_per_direction(const unsigned int index) const
const std::vector< unsigned int > n_coefficients_per_direction
bool operator==(const Fourier< dim, spacedim > &fourier) const
std::vector< FullMatrix< CoefficientType > > fourier_transform_matrices
const hp::QCollection< dim > q_collection
void precalculate_all_transformation_matrices()
void load_transformation_matrices(Archive &ar, const unsigned int version)
void save_transformation_matrices(Archive &ar, const unsigned int version)
const std::vector< unsigned int > n_coefficients_per_direction
void save_transformation_matrices(Archive &ar, const unsigned int version)
bool operator==(const Legendre< dim, spacedim > &legendre) const
const unsigned int component
std::vector< FullMatrix< CoefficientType > > legendre_transform_matrices
const hp::QCollection< dim > q_collection
void precalculate_all_transformation_matrices()
unsigned int get_n_coefficients_per_direction(const unsigned int index) const
std::vector< CoefficientType > unrolled_coefficients
SmartPointer< const hp::FECollection< dim, spacedim > > fe_collection
void load_transformation_matrices(Archive &ar, const unsigned int version)
void calculate(const ::Vector< Number > &local_dof_values, const unsigned int cell_active_fe_index, Table< dim, CoefficientType > &legendre_coefficients)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
std::pair< std::vector< unsigned int >, std::vector< double > > process_coefficients(const Table< dim, CoefficientType > &coefficients, const std::function< std::pair< bool, unsigned int >(const TableIndices< dim > &)> &predicate, const VectorTools::NormType norm_type, const double smallest_abs_coefficient=1e-10)
std::pair< double, double > linear_regression(const std::vector< double > &x, const std::vector< double > &y)
static const unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)