*
* @author Daniel Arndt, 2016
*/
- template <int dim, int fe_degree, int n_components = 1, typename Number = double>
+ template <int dim, int fe_degree, int n_q_points_1d = fe_degree+1, int n_components = 1, typename Number = double>
class MassOperator : public Base<dim, Number>
{
public:
//-----------------------------MassOperator----------------------------------
- template <int dim, int fe_degree, int n_components, typename Number>
- MassOperator<dim, fe_degree, n_components, Number>::
+ template <int dim, int fe_degree, int n_q_points_1d, int n_components, typename Number>
+ MassOperator<dim, fe_degree, n_q_points_1d, n_components, Number>::
MassOperator ()
:
Base<dim, Number>()
- template <int dim, int fe_degree, int n_components, typename Number>
+ template <int dim, int fe_degree, int n_q_points_1d, int n_components, typename Number>
void
- MassOperator<dim, fe_degree, n_components, Number>::
+ MassOperator<dim, fe_degree, n_q_points_1d, n_components, Number>::
compute_diagonal()
{
Assert((Base<dim, Number>::data != NULL), ExcNotInitialized());
- template <int dim, int fe_degree, int n_components, typename Number>
+ template <int dim, int fe_degree, int n_q_points_1d, int n_components, typename Number>
void
- MassOperator<dim, fe_degree, n_components, Number>::
+ MassOperator<dim, fe_degree, n_q_points_1d, n_components, Number>::
apply_add (LinearAlgebra::distributed::Vector<Number> &dst,
const LinearAlgebra::distributed::Vector<Number> &src) const
{
- template <int dim, int fe_degree, int n_components, typename Number>
+ template <int dim, int fe_degree, int n_q_points_1d, int n_components, typename Number>
void
- MassOperator<dim, fe_degree, n_components, Number>::
+ MassOperator<dim, fe_degree, n_q_points_1d, n_components, Number>::
local_apply_cell (const MatrixFree<dim,Number> &data,
LinearAlgebra::distributed::Vector<Number> &dst,
const LinearAlgebra::distributed::Vector<Number> &src,
const std::pair<unsigned int,unsigned int> &cell_range) const
{
- FEEvaluation<dim, fe_degree, fe_degree+1, n_components, Number> phi(data);
+ FEEvaluation<dim, fe_degree, n_q_points_1d, n_components, Number> phi(data);
for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
{
phi.reinit (cell);
additional_data.mapping_update_flags = (update_values | update_JxW_values);
MatrixFree<dim, Number> matrix_free;
matrix_free.reinit (mapping, dof, constraints,
- QGauss<1>(fe_degree+1), additional_data);
- typedef MatrixFreeOperators::MassOperator<dim, fe_degree, 1, Number> MatrixType;
+ QGauss<1>(fe_degree+2), additional_data);
+ typedef MatrixFreeOperators::MassOperator<dim, fe_degree, fe_degree+2, 1, Number> MatrixType;
MatrixType mass_matrix;
mass_matrix.initialize(matrix_free);
mass_matrix.compute_diagonal();
Assert (dof.get_fe().degree == fe_degree,
ExcDimensionMismatch(fe_degree, dof.get_fe().degree));
- typedef MatrixFreeOperators::MassOperator<dim, fe_degree, 1, Number> MatrixType;
+ typedef MatrixFreeOperators::MassOperator<dim, fe_degree, n_q_points_1d, 1, Number> MatrixType;
MatrixType mass_matrix;
mass_matrix.initialize(matrix_free);
mass_matrix.compute_diagonal();