From: Denis Davydov Date: Thu, 23 Feb 2017 16:00:52 +0000 (+0100) Subject: change MatrixFreeOperators from Number to VectorType template X-Git-Tag: v8.5.0-rc1~85^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1145e09f0278fbb218e3fa276b519cff93e596eb;p=dealii.git change MatrixFreeOperators from Number to VectorType template --- diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index 72e7c170eb..2cf53e665f 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -44,21 +44,23 @@ namespace MatrixFreeOperators * In case of a non-symmetric operator, Tapply_add() should be additionally * implemented. * + * Currently, the only supported vector is LinearAlgebra::distributed::Vector. + * * @author Denis Davydov, 2016 */ - template + template > class Base : public Subscriptor { public: /** * Number typedef. */ - typedef Number value_type; + typedef typename VectorType::value_type value_type; /** * size_type needed for preconditioner classes. */ - typedef typename LinearAlgebra::distributed::Vector::size_type size_type; + typedef typename VectorType::size_type size_type; /** * Default constructor. @@ -79,12 +81,12 @@ namespace MatrixFreeOperators /** * Initialize operator on fine scale. */ - void initialize (std_cxx11::shared_ptr > data); + void initialize (std_cxx11::shared_ptr > data); /** * Initialize operator on a level @p level. */ - void initialize (std_cxx11::shared_ptr > data, + void initialize (std_cxx11::shared_ptr > data, const MGConstrainedDoFs &mg_constrained_dofs, const unsigned int level); @@ -101,45 +103,45 @@ namespace MatrixFreeOperators /** * vmult operator for interface. */ - void vmult_interface_down(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + void vmult_interface_down(VectorType &dst, + const VectorType &src) const; /** * vmult operator for interface. */ - void vmult_interface_up(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + void vmult_interface_up(VectorType &dst, + const VectorType &src) const; /** * Matrix-vector multiplication. */ - void vmult (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + void vmult (VectorType &dst, + const VectorType &src) const; /** * Transpose matrix-vector multiplication. */ - void Tvmult (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + void Tvmult (VectorType &dst, + const VectorType &src) const; /** * Adding Matrix-vector multiplication. */ - void vmult_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + void vmult_add (VectorType &dst, + const VectorType &src) const; /** * Adding transpose matrix-vector multiplication. */ - void Tvmult_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + void Tvmult_add (VectorType &dst, + const VectorType &src) const; /** * Returns the value of the matrix entry (row,col). In matrix-free context * this function is valid only for row==col when diagonal is initialized. */ - Number el (const unsigned int row, - const unsigned int col) const; + value_type el (const unsigned int row, + const unsigned int col) const; /** * Determine an estimate for the memory consumption (in bytes) of this object. @@ -149,7 +151,7 @@ namespace MatrixFreeOperators /** * A wrapper for initialize_dof_vector() of MatrixFree object. */ - void initialize_dof_vector (LinearAlgebra::distributed::Vector &vec) const; + void initialize_dof_vector (VectorType &vec) const; /** * Compute diagonal of this operator. @@ -162,13 +164,13 @@ namespace MatrixFreeOperators /** * Get read access to the MatrixFree object stored with this operator. */ - std_cxx11::shared_ptr > + std_cxx11::shared_ptr > get_matrix_free () const; /** * Get read access to the inverse diagonal of this operator. */ - const std_cxx11::shared_ptr > > & + const std_cxx11::shared_ptr > & get_matrix_diagonal_inverse() const; /** @@ -176,9 +178,9 @@ namespace MatrixFreeOperators * src vector by the inverse of the respective diagonal element and * multiplies the result with the relaxation factor omega. */ - void precondition_Jacobi(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, - const Number omega) const; + void precondition_Jacobi(VectorType &dst, + const VectorType &src, + const value_type omega) const; protected: @@ -186,32 +188,32 @@ namespace MatrixFreeOperators * Set constrained entries (both from hanging nodes and edge constraints) * of @p dst to one. */ - void set_constrained_entries_to_one (LinearAlgebra::distributed::Vector &dst) const; + void set_constrained_entries_to_one (VectorType &dst) const; /** * Apply operator to @p src and add result in @p dst. */ - virtual void apply_add(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const = 0; + virtual void apply_add(VectorType &dst, + const VectorType &src) const = 0; /** * Apply transpose operator to @p src and add result in @p dst. * * Default implementation is to call apply_add(). */ - virtual void Tapply_add(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + virtual void Tapply_add(VectorType &dst, + const VectorType &src) const; /** * MatrixFree object to be used with this operator. */ - std_cxx11::shared_ptr > data; + std_cxx11::shared_ptr > data; /** * A shared pointer to a diagonal matrix that stores the inverse of * diagonal elements as a vector. */ - std_cxx11::shared_ptr > > inverse_diagonal_entries; + std_cxx11::shared_ptr > inverse_diagonal_entries; private: @@ -223,7 +225,7 @@ namespace MatrixFreeOperators /** * Auxiliary vector. */ - mutable std::vector > edge_constrained_values; + mutable std::vector > edge_constrained_values; /** * A flag which determines whether or not this operator has interface @@ -235,8 +237,8 @@ namespace MatrixFreeOperators * Function which implements vmult_add (@p transpose = false) and * Tvmult_add (@p transpose = true). */ - void mult_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, + void mult_add (VectorType &dst, + const VectorType &src, const bool transpose) const; /** @@ -246,7 +248,7 @@ namespace MatrixFreeOperators * order to ensure that the cell loops will be able to access the ghost * indices with the correct local indices. */ - void adjust_ghost_range_if_necessary(const LinearAlgebra::distributed::Vector &vec) const; + void adjust_ghost_range_if_necessary(const VectorType &vec) const; }; @@ -401,19 +403,19 @@ namespace MatrixFreeOperators * * @author Daniel Arndt, 2016 */ - template - class MassOperator : public Base + template > + class MassOperator : public Base { public: /** * Number typedef. */ - typedef typename Base::value_type value_type; + typedef typename Base::value_type value_type; /** * size_type needed for preconditioner classes. */ - typedef typename Base::size_type size_type; + typedef typename Base::size_type size_type; /** * Constructor. @@ -431,15 +433,15 @@ namespace MatrixFreeOperators * assumed that the passed input and output vector are correctly initialized * using initialize_dof_vector(). */ - virtual void apply_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + virtual void apply_add (VectorType &dst, + const VectorType &src) const; /** * For this operator, there is just a cell contribution. */ - void local_apply_cell (const MatrixFree &data, - LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, + void local_apply_cell (const MatrixFree &data, + VectorType &dst, + const VectorType &src, const std::pair &cell_range) const; }; @@ -452,19 +454,19 @@ namespace MatrixFreeOperators * * @author Denis Davydov, 2016 */ - template - class LaplaceOperator : public Base + template > + class LaplaceOperator : public Base { public: /** * Number typedef. */ - typedef typename Base::value_type value_type; + typedef typename Base::value_type value_type; /** * size_type needed for preconditioner classes. */ - typedef typename Base::size_type size_type; + typedef typename Base::size_type size_type; /** * Constructor. @@ -522,7 +524,7 @@ namespace MatrixFreeOperators * of scope in user code and the clear() command or destructor of this class * will delete the table. */ - void set_coefficient(const std_cxx11::shared_ptr > > &scalar_coefficient ); + void set_coefficient(const std_cxx11::shared_ptr > > &scalar_coefficient ); virtual void clear(); @@ -532,7 +534,7 @@ namespace MatrixFreeOperators * The function will throw an error if coefficients are not previously set * by set_coefficient() function. */ - std_cxx11::shared_ptr< Table<2, VectorizedArray > > get_coefficient(); + std_cxx11::shared_ptr< Table<2, VectorizedArray > > get_coefficient(); private: /** @@ -540,35 +542,35 @@ namespace MatrixFreeOperators * assumed that the passed input and output vector are correctly initialized * using initialize_dof_vector(). */ - virtual void apply_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const; + virtual void apply_add (VectorType &dst, + const VectorType &src) const; /** * Applies the Laplace operator on a cell. */ - void local_apply_cell (const MatrixFree &data, - LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, + void local_apply_cell (const MatrixFree &data, + VectorType &dst, + const VectorType &src, const std::pair &cell_range) const; /** * Apply diagonal part of the Laplace operator on a cell. */ - void local_diagonal_cell (const MatrixFree &data, - LinearAlgebra::distributed::Vector &dst, + void local_diagonal_cell (const MatrixFree &data, + VectorType &dst, const unsigned int &, const std::pair &cell_range) const; /** * Apply Laplace operator on a cell @p cell. */ - void do_operation_on_cell(FEEvaluation &phi, + void do_operation_on_cell(FEEvaluation &phi, const unsigned int cell) const; /** * User-provided heterogeneity coefficient. */ - std_cxx11::shared_ptr< Table<2, VectorizedArray > > scalar_coefficient; + std_cxx11::shared_ptr< Table<2, VectorizedArray > > scalar_coefficient; }; @@ -687,15 +689,15 @@ namespace MatrixFreeOperators } //----------------- Base operator ----------------------------- - template - Base::~Base () + template + Base::~Base () { } - template - Base::Base () + template + Base::Base () : Subscriptor(), have_interface_matrices(false) @@ -704,9 +706,9 @@ namespace MatrixFreeOperators - template - typename Base::size_type - Base::m () const + template + typename Base::size_type + Base::m () const { Assert(data.get() != NULL, ExcNotInitialized()); @@ -715,18 +717,18 @@ namespace MatrixFreeOperators - template - typename Base::size_type - Base::n () const + template + typename Base::size_type + Base::n () const { return m(); } - template + template void - Base::clear () + Base::clear () { data.reset(); inverse_diagonal_entries.reset(); @@ -734,10 +736,10 @@ namespace MatrixFreeOperators - template - Number - Base::el (const unsigned int row, - const unsigned int col) const + template + typename Base::value_type + Base::el (const unsigned int row, + const unsigned int col) const { (void) col; Assert (row == col, ExcNotImplemented()); @@ -748,9 +750,9 @@ namespace MatrixFreeOperators - template + template void - Base::initialize_dof_vector (LinearAlgebra::distributed::Vector &vec) const + Base::initialize_dof_vector (VectorType &vec) const { Assert(data.get() != NULL, ExcNotInitialized()); @@ -762,10 +764,10 @@ namespace MatrixFreeOperators - template + template void - Base:: - initialize (std_cxx11::shared_ptr > data_) + Base:: + initialize (std_cxx11::shared_ptr::value_type> > data_) { data = data_; edge_constrained_indices.clear(); @@ -774,10 +776,10 @@ namespace MatrixFreeOperators - template + template void - Base:: - initialize (std_cxx11::shared_ptr > data_, + Base:: + initialize (std_cxx11::shared_ptr::value_type> > data_, const MGConstrainedDoFs &mg_constrained_dofs, const unsigned int level) { @@ -807,9 +809,9 @@ namespace MatrixFreeOperators - template + template void - Base::set_constrained_entries_to_one (LinearAlgebra::distributed::Vector &dst) const + Base::set_constrained_entries_to_one (VectorType &dst) const { const std::vector & constrained_dofs = data->get_constrained_dofs(); @@ -821,41 +823,43 @@ namespace MatrixFreeOperators - template + template void - Base::vmult (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + Base::vmult (VectorType &dst, + const VectorType &src) const { + typedef typename Base::value_type Number; dst = Number(0.); vmult_add (dst, src); } - template + template void - Base::vmult_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + Base::vmult_add (VectorType &dst, + const VectorType &src) const { mult_add (dst, src, false); } - template + template void - Base::Tvmult_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + Base::Tvmult_add (VectorType &dst, + const VectorType &src) const { mult_add (dst, src, true); } - template + template void - Base::adjust_ghost_range_if_necessary(const LinearAlgebra::distributed::Vector &src) const + Base::adjust_ghost_range_if_necessary(const VectorType &src) const { + typedef typename Base::value_type Number; // If both vectors use the same partitioner -> done if (src.get_partitioner().get() == data->get_dof_info(0).vector_partitioner.get()) @@ -872,7 +876,7 @@ namespace MatrixFreeOperators // lost VectorView view_src_in(src.local_size(), src.begin()); Vector copy_vec = view_src_in; - const_cast &>(src). + const_cast(src). reinit(data->get_dof_info(0).vector_partitioner); VectorView view_src_out(src.local_size(), src.begin()); static_cast&>(view_src_out) = copy_vec; @@ -880,12 +884,13 @@ namespace MatrixFreeOperators - template + template void - Base::mult_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, - const bool transpose) const + Base::mult_add (VectorType &dst, + const VectorType &src, + const bool transpose) const { + typedef typename Base::value_type Number; adjust_ghost_range_if_necessary(src); adjust_ghost_range_if_necessary(dst); @@ -896,7 +901,7 @@ namespace MatrixFreeOperators edge_constrained_values[i] = std::pair(src.local_element(edge_constrained_indices[i]), dst.local_element(edge_constrained_indices[i])); - const_cast&>(src).local_element(edge_constrained_indices[i]) = 0.; + const_cast(src).local_element(edge_constrained_indices[i]) = 0.; } if (transpose) @@ -913,19 +918,20 @@ namespace MatrixFreeOperators // destination for (unsigned int i=0; i&>(src).local_element(edge_constrained_indices[i]) = edge_constrained_values[i].first; + const_cast(src).local_element(edge_constrained_indices[i]) = edge_constrained_values[i].first; dst.local_element(edge_constrained_indices[i]) = edge_constrained_values[i].second + edge_constrained_values[i].first; } } - template + template void - Base:: - vmult_interface_down(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + Base:: + vmult_interface_down(VectorType &dst, + const VectorType &src) const { + typedef typename Base::value_type Number; adjust_ghost_range_if_necessary(src); adjust_ghost_range_if_necessary(dst); @@ -941,7 +947,7 @@ namespace MatrixFreeOperators edge_constrained_values[i] = std::pair(src.local_element(edge_constrained_indices[i]), dst.local_element(edge_constrained_indices[i])); - const_cast&>(src).local_element(edge_constrained_indices[i]) = 0.; + const_cast(src).local_element(edge_constrained_indices[i]) = 0.; } apply_add(dst,src); @@ -954,7 +960,7 @@ namespace MatrixFreeOperators ++c; // reset the src values - const_cast&>(src).local_element(edge_constrained_indices[i]) = edge_constrained_values[i].first; + const_cast(src).local_element(edge_constrained_indices[i]) = edge_constrained_values[i].first; } for ( ; c + template void - Base:: - vmult_interface_up(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + Base:: + vmult_interface_up(VectorType &dst, + const VectorType &src) const { + typedef typename Base::value_type Number; adjust_ghost_range_if_necessary(src); adjust_ghost_range_if_necessary(dst); @@ -976,7 +983,7 @@ namespace MatrixFreeOperators if (!have_interface_matrices) return; - LinearAlgebra::distributed::Vector src_cpy (src); + VectorType src_cpy (src); unsigned int c=0; for (unsigned int i=0; i + template void - Base::Tvmult (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + Base::Tvmult (VectorType &dst, + const VectorType &src) const { + typedef typename Base::value_type Number; dst = Number(0.); Tvmult_add (dst,src); } - template + template std::size_t - Base::memory_consumption () const + Base::memory_consumption () const { return inverse_diagonal_entries.get() != NULL ? inverse_diagonal_entries->memory_consumption() : sizeof(*this); } - template - std_cxx11::shared_ptr > - Base::get_matrix_free() const + template + std_cxx11::shared_ptr::value_type> > + Base::get_matrix_free() const { return data; } - template - const std_cxx11::shared_ptr > > & - Base::get_matrix_diagonal_inverse() const + template + const std_cxx11::shared_ptr > & + Base::get_matrix_diagonal_inverse() const { Assert(inverse_diagonal_entries.get() != NULL && inverse_diagonal_entries->m() > 0, ExcNotInitialized()); @@ -1037,21 +1045,21 @@ namespace MatrixFreeOperators - template + template void - Base::Tapply_add(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + Base::Tapply_add(VectorType &dst, + const VectorType &src) const { apply_add(dst,src); } - template + template void - Base::precondition_Jacobi(LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, - const Number omega) const + Base::precondition_Jacobi(VectorType &dst, + const VectorType &src, + const typename Base::value_type omega) const { Assert(inverse_diagonal_entries.get() && inverse_diagonal_entries->m() > 0, ExcNotInitialized()); @@ -1137,26 +1145,27 @@ namespace MatrixFreeOperators //-----------------------------MassOperator---------------------------------- - template - MassOperator:: + template + MassOperator:: MassOperator () : - Base() + Base() {} - template + template void - MassOperator:: + MassOperator:: compute_diagonal() { - Assert((Base::data.get() != NULL), ExcNotInitialized()); + typedef typename Base::value_type Number; + Assert((Base::data.get() != NULL), ExcNotInitialized()); this->inverse_diagonal_entries. - reset(new DiagonalMatrix >()); - LinearAlgebra::distributed::Vector &inverse_diagonal_vector = this->inverse_diagonal_entries->get_vector(); - LinearAlgebra::distributed::Vector ones; + reset(new DiagonalMatrix()); + VectorType &inverse_diagonal_vector = this->inverse_diagonal_entries->get_vector(); + VectorType ones; this->initialize_dof_vector(ones); this->initialize_dof_vector(inverse_diagonal_vector); ones = Number(1.); @@ -1174,26 +1183,27 @@ namespace MatrixFreeOperators - template + template void - MassOperator:: - apply_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + MassOperator:: + apply_add (VectorType &dst, + const VectorType &src) const { - Base::data->cell_loop (&MassOperator::local_apply_cell, - this, dst, src); + Base::data->cell_loop (&MassOperator::local_apply_cell, + this, dst, src); } - template + template void - MassOperator:: - local_apply_cell (const MatrixFree &data, - LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, + MassOperator:: + local_apply_cell (const MatrixFree::value_type> &data, + VectorType &dst, + const VectorType &src, const std::pair &cell_range) const { + typedef typename Base::value_type Number; FEEvaluation phi(data); for (unsigned int cell=cell_range.first; cell - LaplaceOperator:: + template + LaplaceOperator:: LaplaceOperator () : - Base() + Base() { } - template + template void - LaplaceOperator:: + LaplaceOperator:: clear () { - Base::clear(); + Base::clear(); scalar_coefficient.reset(); } - template + template void - LaplaceOperator:: - set_coefficient(const std_cxx11::shared_ptr > > &scalar_coefficient_ ) + LaplaceOperator:: + set_coefficient(const std_cxx11::shared_ptr::value_type> > > &scalar_coefficient_ ) { scalar_coefficient = scalar_coefficient_; } - template - std_cxx11::shared_ptr< Table<2, VectorizedArray > > - LaplaceOperator:: + template + std_cxx11::shared_ptr< Table<2, VectorizedArray::value_type> > > + LaplaceOperator:: get_coefficient() { Assert (scalar_coefficient.get(), @@ -1253,17 +1263,18 @@ namespace MatrixFreeOperators - template + template void - LaplaceOperator:: + LaplaceOperator:: compute_diagonal() { - Assert((Base::data.get() != NULL), ExcNotInitialized()); + typedef typename Base::value_type Number; + Assert((Base::data.get() != NULL), ExcNotInitialized()); unsigned int dummy = 0; this->inverse_diagonal_entries. - reset(new DiagonalMatrix >()); - LinearAlgebra::distributed::Vector &inverse_diagonal_vector = this->inverse_diagonal_entries->get_vector(); + reset(new DiagonalMatrix()); + VectorType &inverse_diagonal_vector = this->inverse_diagonal_entries->get_vector(); this->initialize_dof_vector(inverse_diagonal_vector); this->data->cell_loop (&LaplaceOperator::local_diagonal_cell, @@ -1281,14 +1292,14 @@ namespace MatrixFreeOperators - template + template void - LaplaceOperator:: - apply_add (LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src) const + LaplaceOperator:: + apply_add (VectorType &dst, + const VectorType &src) const { - Base::data->cell_loop (&LaplaceOperator::local_apply_cell, - this, dst, src); + Base::data->cell_loop (&LaplaceOperator::local_apply_cell, + this, dst, src); } namespace @@ -1307,10 +1318,10 @@ namespace MatrixFreeOperators - template + template void - LaplaceOperator:: - do_operation_on_cell(FEEvaluation &phi, + LaplaceOperator:: + do_operation_on_cell(FEEvaluation::value_type> &phi, const unsigned int cell) const { phi.evaluate (false,true,false); @@ -1336,14 +1347,15 @@ namespace MatrixFreeOperators - template + template void - LaplaceOperator:: - local_apply_cell (const MatrixFree &data, - LinearAlgebra::distributed::Vector &dst, - const LinearAlgebra::distributed::Vector &src, + LaplaceOperator:: + local_apply_cell (const MatrixFree::value_type> &data, + VectorType &dst, + const VectorType &src, const std::pair &cell_range) const { + typedef typename Base::value_type Number; FEEvaluation phi (data); for (unsigned int cell=cell_range.first; cell + template void - LaplaceOperator:: - local_diagonal_cell (const MatrixFree &data, - LinearAlgebra::distributed::Vector &dst, + LaplaceOperator:: + local_diagonal_cell (const MatrixFree::value_type> &data, + VectorType &dst, const unsigned int &, const std::pair &cell_range) const { + typedef typename Base::value_type Number; FEEvaluation phi (data); for (unsigned int cell=cell_range.first; cell ()); matrix_free->reinit (mapping, dof, constraints, QGauss<1>(dof.get_fe().degree+2), additional_data); - typedef MatrixFreeOperators::MassOperator MatrixType; + typedef MatrixFreeOperators::MassOperator > MatrixType; MatrixType mass_matrix; mass_matrix.initialize(matrix_free); mass_matrix.compute_diagonal(); @@ -1168,7 +1168,7 @@ namespace VectorTools new MatrixFree()); matrix_free->reinit (mapping, dof, constraints, QGauss<1>(dof.get_fe().degree+2), additional_data); - typedef MatrixFreeOperators::MassOperator MatrixType; + typedef MatrixFreeOperators::MassOperator > MatrixType; MatrixType mass_matrix; mass_matrix.initialize(matrix_free); mass_matrix.compute_diagonal(); @@ -1259,7 +1259,7 @@ namespace VectorTools dof.get_fe().degree == static_cast(fe_degree), ExcDimensionMismatch(fe_degree, dof.get_fe().degree)); - typedef MatrixFreeOperators::MassOperator MatrixType; + typedef MatrixFreeOperators::MassOperator > MatrixType; MatrixType mass_matrix; mass_matrix.initialize(matrix_free); mass_matrix.compute_diagonal(); diff --git a/tests/arpack/step-36_parpack_mf.cc b/tests/arpack/step-36_parpack_mf.cc index ec4812594b..f167333266 100644 --- a/tests/arpack/step-36_parpack_mf.cc +++ b/tests/arpack/step-36_parpack_mf.cc @@ -104,8 +104,8 @@ void test () std::vector > eigenfunctions; std::vector eigenvalues; - MatrixFreeOperators::MassOperator mass; - MatrixFreeOperators::LaplaceOperator laplace; + MatrixFreeOperators::MassOperator mass; + MatrixFreeOperators::LaplaceOperator laplace; mass.initialize(mf_data); laplace.initialize(mf_data); diff --git a/tests/matrix_free/laplace_operator_01.cc b/tests/matrix_free/laplace_operator_01.cc index dc46c7b70f..ac854b7f0f 100644 --- a/tests/matrix_free/laplace_operator_01.cc +++ b/tests/matrix_free/laplace_operator_01.cc @@ -107,7 +107,7 @@ void test () mf_data->reinit (dof, constraints, quad, data); } - MatrixFreeOperators::LaplaceOperator mf; + MatrixFreeOperators::LaplaceOperator > mf; mf.initialize(mf_data); mf.compute_diagonal(); LinearAlgebra::distributed::Vector in, out, ref; diff --git a/tests/matrix_free/laplace_operator_02.cc b/tests/matrix_free/laplace_operator_02.cc index 2bd3657246..6323d8ab07 100644 --- a/tests/matrix_free/laplace_operator_02.cc +++ b/tests/matrix_free/laplace_operator_02.cc @@ -169,7 +169,7 @@ void test () } } - MatrixFreeOperators::LaplaceOperator mf; + MatrixFreeOperators::LaplaceOperator > mf; mf.initialize(mf_data); mf.set_coefficient(coefficient); mf.compute_diagonal(); diff --git a/tests/matrix_free/mass_operator_01.cc b/tests/matrix_free/mass_operator_01.cc index 6d8db2a358..e04c248f2d 100644 --- a/tests/matrix_free/mass_operator_01.cc +++ b/tests/matrix_free/mass_operator_01.cc @@ -115,7 +115,7 @@ void test () mf_data->reinit (dof, constraints, quad, data); } - MatrixFreeOperators::MassOperator mf; + MatrixFreeOperators::MassOperator > mf; mf.initialize(mf_data); mf.compute_diagonal(); LinearAlgebra::distributed::Vector in, out, ref; diff --git a/tests/matrix_free/mass_operator_02.cc b/tests/matrix_free/mass_operator_02.cc index 4504061770..ede1dfafba 100644 --- a/tests/matrix_free/mass_operator_02.cc +++ b/tests/matrix_free/mass_operator_02.cc @@ -79,7 +79,7 @@ void test () mf_data->reinit (dof, constraints, quad, data); } - MatrixFreeOperators::MassOperator mf; + MatrixFreeOperators::MassOperator > mf; mf.initialize(mf_data); mf.compute_diagonal(); const LinearAlgebra::distributed::Vector &diagonal diff --git a/tests/matrix_free/mass_operator_03.cc b/tests/matrix_free/mass_operator_03.cc index 3de18fe067..9248062ec4 100644 --- a/tests/matrix_free/mass_operator_03.cc +++ b/tests/matrix_free/mass_operator_03.cc @@ -78,7 +78,7 @@ void test () mf_data->reinit (dof, constraints, quad, data); } - MatrixFreeOperators::MassOperator mf; + MatrixFreeOperators::MassOperator > mf; mf.initialize(mf_data); mf.compute_diagonal(); const LinearAlgebra::distributed::Vector &diagonal diff --git a/tests/matrix_free/parallel_multigrid_02.cc b/tests/matrix_free/parallel_multigrid_02.cc index 653fa4918f..183f0df4bc 100644 --- a/tests/matrix_free/parallel_multigrid_02.cc +++ b/tests/matrix_free/parallel_multigrid_02.cc @@ -113,7 +113,7 @@ void do_test (const DoFHandler &dof) MappingQ mapping(fe_degree+1); - LaplaceOperator fine_matrix; + LaplaceOperator > fine_matrix; std_cxx11::shared_ptr > fine_level_data(new MatrixFree ()); typename MatrixFree::AdditionalData fine_level_additional_data; @@ -133,7 +133,7 @@ void do_test (const DoFHandler &dof) in = 1.; // set up multigrid in analogy to step-37 - typedef LaplaceOperator LevelMatrixType; + typedef LaplaceOperator > LevelMatrixType; MGLevelObject mg_matrices; MGLevelObject > mg_level_data; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_02.cc b/tests/matrix_free/parallel_multigrid_adaptive_02.cc index 4105d03a80..4bae59d981 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_02.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_02.cc @@ -150,7 +150,7 @@ void do_test (const DoFHandler &dof) MappingQ mapping(fe_degree+1); - LaplaceOperator fine_matrix; + LaplaceOperator > fine_matrix; std_cxx11::shared_ptr > fine_level_data(new MatrixFree ()); typename MatrixFree::AdditionalData fine_level_additional_data; @@ -181,7 +181,7 @@ void do_test (const DoFHandler &dof) } // set up multigrid in analogy to step-37 - typedef LaplaceOperator LevelMatrixType; + typedef LaplaceOperator > LevelMatrixType; MGLevelObject mg_matrices; MGLevelObject > mg_level_data; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_04.cc b/tests/matrix_free/parallel_multigrid_adaptive_04.cc index e11ff631db..800fffae33 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_04.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_04.cc @@ -150,7 +150,7 @@ void do_test (const DoFHandler &dof) MappingQ mapping(fe_degree+1); - LaplaceOperator fine_matrix; + LaplaceOperator > fine_matrix; std_cxx11::shared_ptr > fine_level_data(new MatrixFree ()); typename MatrixFree::AdditionalData fine_level_additional_data; @@ -181,7 +181,7 @@ void do_test (const DoFHandler &dof) } // set up multigrid in analogy to step-37 - typedef LaplaceOperator LevelMatrixType; + typedef LaplaceOperator > LevelMatrixType; MGLevelObject mg_matrices; MGLevelObject > mg_level_data;