30 <<
"x[" << arg1 <<
"] = " << arg2 <<
" is not in [0,1]");
41 for (
unsigned int d = 0;
d < dim; ++
d)
43 const double x = 2.0 * (x_q[
d] - 0.5);
44 Assert((x_q[d] <= 1.0) && (x_q[d] >= 0.), ExcLegendre(d, x_q[d]));
45 const unsigned int ind = indices[
d];
61 for (
unsigned int d = 0;
d < dim; ++
d)
62 res *= (0.5 + indices[d]);
69 template <
int dim,
int spacedim>
74 const unsigned int dof,
75 const unsigned int component)
78 for (
unsigned int q = 0; q < quadrature.
size(); ++q)
81 sum += Lh(x_q, indices) *
85 return sum * multiplier(indices);
94 template <
int spacedim>
97 const std::vector<unsigned int> &n_coefficients_per_direction,
100 const unsigned int fe,
101 const unsigned int component,
106 if (legendre_transform_matrices[fe].m() == 0)
108 legendre_transform_matrices[fe].reinit(
109 n_coefficients_per_direction[fe],
110 fe_collection[fe].n_dofs_per_cell());
112 for (
unsigned int k = 0; k < n_coefficients_per_direction[fe]; ++k)
113 for (
unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell(); ++j)
114 legendre_transform_matrices[fe](k, j) =
115 integrate(fe_collection[fe],
123 template <
int spacedim>
126 const std::vector<unsigned int> &n_coefficients_per_direction,
129 const unsigned int fe,
130 const unsigned int component,
135 if (legendre_transform_matrices[fe].m() == 0)
137 legendre_transform_matrices[fe].reinit(
139 fe_collection[fe].n_dofs_per_cell());
142 for (
unsigned int k1 = 0; k1 < n_coefficients_per_direction[fe]; ++k1)
143 for (
unsigned int k2 = 0; k2 < n_coefficients_per_direction[fe];
145 for (
unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell();
147 legendre_transform_matrices[fe](k, j) =
148 integrate(fe_collection[fe],
156 template <
int spacedim>
159 const std::vector<unsigned int> &n_coefficients_per_direction,
162 const unsigned int fe,
163 const unsigned int component,
168 if (legendre_transform_matrices[fe].m() == 0)
170 legendre_transform_matrices[fe].reinit(
172 fe_collection[fe].n_dofs_per_cell());
175 for (
unsigned int k1 = 0; k1 < n_coefficients_per_direction[fe]; ++k1)
176 for (
unsigned int k2 = 0; k2 < n_coefficients_per_direction[fe]; ++k2)
177 for (
unsigned int k3 = 0; k3 < n_coefficients_per_direction[fe];
179 for (
unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell();
181 legendre_transform_matrices[fe](k, j) =
182 integrate(fe_collection[fe],
195 template <
int dim,
int spacedim>
200 const unsigned int component_)
209 ExcMessage(
"All parameters are supposed to have the same size."));
215 "For vector-valued problems, you need to explicitly specify for "
216 "which vector component you will want to do a Legendre decomposition "
217 "by setting the 'component' argument of this constructor."));
222 const unsigned int max_n_coefficients_per_direction =
231 template <
int dim,
int spacedim>
246 template <
int dim,
int spacedim>
261 task_group.join_all();
266 template <
int dim,
int spacedim>
269 const unsigned int index)
const
276 template <
int dim,
int spacedim>
277 template <
typename Number>
280 const ::Vector<Number> &local_dof_values,
281 const unsigned int cell_active_fe_index,
284 for (
unsigned int d = 0; d < dim; ++d)
291 cell_active_fe_index,
306 Assert(local_dof_values.size() == matrix.n(),
310 for (
unsigned int j = 0; j < local_dof_values.size(); ++j)
319#include "fe/fe_series_legendre.inst"
const std::vector< unsigned int > n_coefficients_per_direction
ObserverPointer< const hp::FECollection< dim, spacedim > > fe_collection
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
Legendre(const std::vector< unsigned int > &n_coefficients_per_direction, const hp::FECollection< dim, spacedim > &fe_collection, const hp::QCollection< dim > &q_collection, const unsigned int component=numbers::invalid_unsigned_int)
void precalculate_all_transformation_matrices()
unsigned int get_n_coefficients_per_direction(const unsigned int index) const
std::vector< CoefficientType > unrolled_coefficients
void calculate(const ::Vector< Number > &local_dof_values, const unsigned int cell_active_fe_index, Table< dim, CoefficientType > &legendre_coefficients)
virtual double shape_value_component(const unsigned int i, const Point< dim > &p, const unsigned int component) const
const Point< dim > & point(const unsigned int i) const
double weight(const unsigned int i) const
unsigned int size() const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define DeclException2(Exception2, type1, type2, outsequence)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
Task< RT > new_task(const std::function< RT()> &function)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
T sum(const T &t, const MPI_Comm mpi_communicator)
constexpr T fixed_power(const T t)
constexpr unsigned int invalid_unsigned_int
double legendre(unsigned int l, double x)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)