15#ifndef dealii_fe_series_h
16#define dealii_fe_series_h
88 template <
int dim,
int spacedim = dim>
122 template <
typename Number>
125 const unsigned int cell_active_fe_index,
157 template <
class Archive>
165 template <
class Archive>
258 template <
int dim,
int spacedim = dim>
292 template <
typename Number>
294 calculate(const ::Vector<Number> &local_dof_values,
295 const unsigned int cell_active_fe_index,
327 template <
class Archive>
335 template <
class Archive>
398 template <
int dim,
typename CoefficientType>
399 std::pair<std::vector<unsigned int>, std::vector<double>>
401 const std::function<std::pair<bool, unsigned int>(
411 std::pair<double, double>
428 template <
int dim,
typename CoefficientType>
435 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
437 const std::pair<bool, unsigned int>
pred_pair = predicate(
ind);
451 template <
typename CoefficientType>
457 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
459 for (
unsigned int i = 0; i < coefficients.size(0); ++i)
468 template <
typename CoefficientType>
474 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
476 for (
unsigned int i = 0; i < coefficients.size(0); ++i)
477 for (
unsigned int j = 0;
j < coefficients.size(1); ++
j)
486 template <
typename CoefficientType>
492 std::map<
unsigned int, std::vector<CoefficientType>> &
pred_to_values)
494 for (
unsigned int i = 0; i < coefficients.size(0); ++i)
495 for (
unsigned int j = 0;
j < coefficients.size(1); ++
j)
496 for (
unsigned int k = 0;
k < coefficients.size(2); ++
k)
505 template <
typename Number>
514 template <
typename Number>
520 "FESeries::process_coefficients() can not be used with "
521 "complex-valued coefficients and VectorTools::mean norm."));
529template <
int dim,
typename CoefficientType>
530std::pair<std::vector<unsigned int>, std::vector<double>>
539 ExcMessage(
"smallest_abs_coefficient should be non-negative."));
547 std::map<unsigned int, std::vector<CoefficientType>>
pred_to_values;
548 internal::FESeriesImplementation::fill_map(coefficients,
578 norm_value = internal::FESeriesImplementation::complex_mean_value(
600template <
int dim,
int spacedim>
601template <
class Archive>
610 ar &n_coefficients_per_direction;
613 unsigned int size = fe_collection->size();
615 for (
unsigned int i = 0; i <
size; ++i)
616 ar &(*fe_collection)[i].get_name();
619 size = q_collection.size();
621 for (
unsigned int i = 0; i <
size; ++i)
625 ar &fourier_transform_matrices;
630template <
int dim,
int spacedim>
631template <
class Archive>
643 ExcMessage(
"A different number of coefficients vector has been used "
644 "to generate the transformation matrices you are about "
652 for (
unsigned int i = 0; i <
size; ++i)
655 Assert(name.compare((*fe_collection)[i].get_name()) == 0,
656 ExcMessage(
"A different FECollection has been used to generate "
657 "the transformation matrices you are about to load!"));
664 for (
unsigned int i = 0; i <
size; ++i)
667 Assert(quadrature == q_collection[i],
668 ExcMessage(
"A different QCollection has been used to generate "
669 "the transformation matrices you are about to load!"));
673 ar &fourier_transform_matrices;
678template <
int dim,
int spacedim>
679template <
class Archive>
688 ar &n_coefficients_per_direction;
691 unsigned int size = fe_collection->size();
693 for (
unsigned int i = 0; i <
size; ++i)
694 ar &(*fe_collection)[i].get_name();
697 size = q_collection.size();
699 for (
unsigned int i = 0; i <
size; ++i)
703 ar &legendre_transform_matrices;
708template <
int dim,
int spacedim>
709template <
class Archive>
721 ExcMessage(
"A different number of coefficients vector has been used "
722 "to generate the transformation matrices you are about "
730 for (
unsigned int i = 0; i <
size; ++i)
733 Assert(name.compare((*fe_collection)[i].get_name()) == 0,
734 ExcMessage(
"A different FECollection has been used to generate "
735 "the transformation matrices you are about to load!"));
742 for (
unsigned int i = 0; i <
size; ++i)
745 Assert(quadrature == q_collection[i],
746 ExcMessage(
"A different QCollection has been used to generate "
747 "the transformation matrices you are about to load!"));
751 ar &legendre_transform_matrices;
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
ObserverPointer< const hp::FECollection< dim, spacedim > > fe_collection
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
ObserverPointer< const hp::FECollection< dim, spacedim > > fe_collection
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
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)
constexpr unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)