From b5117b007368db0182f6c44afdebb469d330a841 Mon Sep 17 00:00:00 2001 From: David Wells <wellsd2@rpi.edu> Date: Sun, 1 Nov 2015 15:22:51 -0500 Subject: [PATCH] More VECTOR -> VectorType --- .../deal.II/base/time_stepping.templates.h | 4 +- include/deal.II/lac/pointer_matrix.h | 8 +- include/deal.II/lac/precondition.h | 4 +- .../lac/precondition_block.templates.h | 4 +- include/deal.II/lac/solver.h | 6 +- include/deal.II/lac/solver_cg.h | 4 +- include/deal.II/lac/solver_gmres.h | 2 +- include/deal.II/lac/solver_minres.h | 2 +- include/deal.II/meshworker/integration_info.h | 2 +- include/deal.II/meshworker/simple.h | 12 +- include/deal.II/multigrid/mg_block_smoother.h | 12 +- include/deal.II/multigrid/mg_matrix.h | 2 +- include/deal.II/multigrid/mg_smoother.h | 4 +- .../deal.II/multigrid/mg_transfer.templates.h | 4 +- include/deal.II/multigrid/multigrid.h | 16 +- include/deal.II/numerics/vector_tools.h | 12 +- source/distributed/solution_transfer.cc | 111 ++++--- source/fe/mapping_fe_field.cc | 272 +++++++++--------- source/multigrid/mg_base.cc | 16 +- source/multigrid/mg_transfer_prebuilt.cc | 74 +++-- source/numerics/data_out_dof_data.cc | 92 +++--- source/numerics/point_value_history.cc | 44 +-- source/numerics/solution_transfer.cc | 78 ++--- tests/multigrid/cycles.cc | 2 +- tests/petsc/solver_12.cc | 10 +- 25 files changed, 400 insertions(+), 397 deletions(-) diff --git a/include/deal.II/base/time_stepping.templates.h b/include/deal.II/base/time_stepping.templates.h index 165bc94a08..d36af60f43 100644 --- a/include/deal.II/base/time_stepping.templates.h +++ b/include/deal.II/base/time_stepping.templates.h @@ -202,8 +202,8 @@ namespace TimeStepping template <typename VectorType> ImplicitRungeKutta<VectorType>::ImplicitRungeKutta(runge_kutta_method method, - unsigned int max_it, - double tolerance) + unsigned int max_it, + double tolerance) : RungeKutta<VectorType> (), skip_linear_combi(false), diff --git a/include/deal.II/lac/pointer_matrix.h b/include/deal.II/lac/pointer_matrix.h index d778c60b28..8fc7ddcff2 100644 --- a/include/deal.II/lac/pointer_matrix.h +++ b/include/deal.II/lac/pointer_matrix.h @@ -742,7 +742,7 @@ PointerMatrixAux<MatrixType, VectorType>::empty () const template<typename MatrixType, typename VectorType> inline void PointerMatrixAux<MatrixType, VectorType>::vmult (VectorType &dst, - const VectorType &src) const + const VectorType &src) const { if (mem == 0) mem = &my_memory; @@ -755,7 +755,7 @@ PointerMatrixAux<MatrixType, VectorType>::vmult (VectorType &dst, template<typename MatrixType, typename VectorType> inline void PointerMatrixAux<MatrixType, VectorType>::Tvmult (VectorType &dst, - const VectorType &src) const + const VectorType &src) const { if (mem == 0) mem = &my_memory; @@ -768,7 +768,7 @@ PointerMatrixAux<MatrixType, VectorType>::Tvmult (VectorType &dst, template<typename MatrixType, typename VectorType> inline void PointerMatrixAux<MatrixType, VectorType>::vmult_add (VectorType &dst, - const VectorType &src) const + const VectorType &src) const { if (mem == 0) mem = &my_memory; @@ -785,7 +785,7 @@ PointerMatrixAux<MatrixType, VectorType>::vmult_add (VectorType &dst, template<typename MatrixType, typename VectorType> inline void PointerMatrixAux<MatrixType, VectorType>::Tvmult_add (VectorType &dst, - const VectorType &src) const + const VectorType &src) const { if (mem == 0) mem = &my_memory; diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index c55d6ec85e..f2e6c0e82e 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -1335,7 +1335,7 @@ PreconditionSOR<MatrixType>::Tstep (VectorType &dst, const VectorType &src) cons template <typename MatrixType> inline void PreconditionSSOR<MatrixType>::initialize (const MatrixType &rA, - const typename BaseClass::AdditionalData ¶meters) + const typename BaseClass::AdditionalData ¶meters) { this->PreconditionRelaxation<MatrixType>::initialize (rA, parameters); @@ -1514,7 +1514,7 @@ PreconditionPSOR<MatrixType>::AdditionalData::AdditionalData template<typename MatrixType, class VectorType> PreconditionUseMatrix<MatrixType,VectorType>::PreconditionUseMatrix(const MatrixType &M, - const function_ptr method) + const function_ptr method) : matrix(M), precondition(method) {} diff --git a/include/deal.II/lac/precondition_block.templates.h b/include/deal.II/lac/precondition_block.templates.h index 468815acb8..410620c7ac 100644 --- a/include/deal.II/lac/precondition_block.templates.h +++ b/include/deal.II/lac/precondition_block.templates.h @@ -979,7 +979,7 @@ PreconditionBlockSSOR<MatrixType,inverse_type>::PreconditionBlockSSOR () template <typename MatrixType, typename inverse_type> template <typename number2> void PreconditionBlockSSOR<MatrixType,inverse_type>::vmult (Vector<number2> &dst, - const Vector<number2> &src) const + const Vector<number2> &src) const { Vector<number2> help; help.reinit(dst); @@ -1010,7 +1010,7 @@ void PreconditionBlockSSOR<MatrixType,inverse_type>::vmult (Vector<number2> template <typename MatrixType, typename inverse_type> template <typename number2> void PreconditionBlockSSOR<MatrixType,inverse_type>::Tvmult (Vector<number2> &dst, - const Vector<number2> &src) const + const Vector<number2> &src) const { Vector<number2> help; help.reinit(dst); diff --git a/include/deal.II/lac/solver.h b/include/deal.II/lac/solver.h index cdca1a8194..f0851e8b24 100644 --- a/include/deal.II/lac/solver.h +++ b/include/deal.II/lac/solver.h @@ -456,7 +456,7 @@ template <class VectorType> inline SolverControl::State Solver<VectorType>::StateCombiner::operator ()(const SolverControl::State state1, - const SolverControl::State state2) const + const SolverControl::State state2) const { if ((state1 == SolverControl::failure) || @@ -476,7 +476,7 @@ template <typename Iterator> inline SolverControl::State Solver<VectorType>::StateCombiner::operator ()(const Iterator begin, - const Iterator end) const + const Iterator end) const { Assert (begin != end, ExcMessage ("You can't combine iterator states if no state is given.")); @@ -494,7 +494,7 @@ Solver<VectorType>::StateCombiner::operator ()(const Iterator begin, template<class VectorType> inline Solver<VectorType>::Solver (SolverControl &solver_control, - VectorMemory<VectorType> &vector_memory) + VectorMemory<VectorType> &vector_memory) : memory(vector_memory) { diff --git a/include/deal.II/lac/solver_cg.h b/include/deal.II/lac/solver_cg.h index 942ca5429b..61d1734521 100644 --- a/include/deal.II/lac/solver_cg.h +++ b/include/deal.II/lac/solver_cg.h @@ -339,8 +339,8 @@ AdditionalData () template <typename VectorType> SolverCG<VectorType>::SolverCG (SolverControl &cn, - VectorMemory<VectorType> &mem, - const AdditionalData &data) + VectorMemory<VectorType> &mem, + const AdditionalData &data) : Solver<VectorType>(cn,mem), additional_data(data) diff --git a/include/deal.II/lac/solver_gmres.h b/include/deal.II/lac/solver_gmres.h index 2a9ec8ce1d..5a29a11b3c 100644 --- a/include/deal.II/lac/solver_gmres.h +++ b/include/deal.II/lac/solver_gmres.h @@ -524,7 +524,7 @@ namespace internal template <class VectorType> inline VectorType & TmpVectors<VectorType>::operator() (const unsigned int i, - const VectorType &temp) + const VectorType &temp) { Assert (i+offset<data.size(), ExcIndexRange(i,-offset, data.size()-offset)); diff --git a/include/deal.II/lac/solver_minres.h b/include/deal.II/lac/solver_minres.h index c334cd7f21..0b37270d3d 100644 --- a/include/deal.II/lac/solver_minres.h +++ b/include/deal.II/lac/solver_minres.h @@ -156,7 +156,7 @@ protected: template<class VectorType> SolverMinRes<VectorType>::SolverMinRes (SolverControl &cn, VectorMemory<VectorType> &mem, - const AdditionalData &) + const AdditionalData &) : Solver<VectorType>(cn,mem) {} diff --git a/include/deal.II/meshworker/integration_info.h b/include/deal.II/meshworker/integration_info.h index c516b06570..35d14b27c8 100644 --- a/include/deal.II/meshworker/integration_info.h +++ b/include/deal.II/meshworker/integration_info.h @@ -779,7 +779,7 @@ namespace MeshWorker (const FiniteElement<dim,sdim> &el, const Mapping<dim,sdim> &mapping, const AnyData &data, - const VectorType &, + const VectorType &, const BlockInfo *block_info) { initialize(el, mapping, block_info); diff --git a/include/deal.II/meshworker/simple.h b/include/deal.II/meshworker/simple.h index 8fc1d01009..bf8993b31c 100644 --- a/include/deal.II/meshworker/simple.h +++ b/include/deal.II/meshworker/simple.h @@ -632,9 +632,9 @@ namespace MeshWorker template <typename MatrixType> inline void MatrixSimple<MatrixType>::assemble(const FullMatrix<double> &M, - const unsigned int index, - const std::vector<types::global_dof_index> &i1, - const std::vector<types::global_dof_index> &i2) + const unsigned int index, + const std::vector<types::global_dof_index> &i1, + const std::vector<types::global_dof_index> &i2) { AssertDimension(M.m(), i1.size()); AssertDimension(M.n(), i2.size()); @@ -1036,7 +1036,7 @@ namespace MeshWorker template <class DOFINFO> inline void MGMatrixSimple<MatrixType>::assemble(const DOFINFO &info1, - const DOFINFO &info2) + const DOFINFO &info2) { Assert(info1.level_cell, ExcMessage("Cell must access level dofs")); Assert(info2.level_cell, ExcMessage("Cell must access level dofs")); @@ -1129,7 +1129,7 @@ namespace MeshWorker template <class DOFINFO> inline void SystemSimple<MatrixType,VectorType>::initialize_info(DOFINFO &info, - bool face) const + bool face) const { MatrixSimple<MatrixType>::initialize_info(info, face); ResidualSimple<VectorType>::initialize_info(info, face); @@ -1150,7 +1150,7 @@ namespace MeshWorker template <class DOFINFO> inline void SystemSimple<MatrixType,VectorType>::assemble(const DOFINFO &info1, - const DOFINFO &info2) + const DOFINFO &info2) { MatrixSimple<MatrixType>::assemble(info1, info2); ResidualSimple<VectorType>::assemble(info1, info2); diff --git a/include/deal.II/multigrid/mg_block_smoother.h b/include/deal.II/multigrid/mg_block_smoother.h index a39ef8ee7e..53ae1fe224 100644 --- a/include/deal.II/multigrid/mg_block_smoother.h +++ b/include/deal.II/multigrid/mg_block_smoother.h @@ -52,11 +52,11 @@ public: * Constructor. Sets memory and smoothing parameters. */ MGSmootherBlock (VectorMemory<BlockVector<number> > &mem, - const unsigned int steps = 1, - const bool variable = false, - const bool symmetric = false, - const bool transpose = false, - const bool reverse = false); + const unsigned int steps = 1, + const bool variable = false, + const bool symmetric = false, + const bool transpose = false, + const bool reverse = false); /** * Initialize for matrices. The parameter <tt>matrices</tt> can be any @@ -263,7 +263,7 @@ template <typename MatrixType, class RELAX, typename number> inline void MGSmootherBlock<MatrixType, RELAX, number>::smooth(const unsigned int level, BlockVector<number> &u, - const BlockVector<number> &rhs) const + const BlockVector<number> &rhs) const { deallog.push("Smooth"); diff --git a/include/deal.II/multigrid/mg_matrix.h b/include/deal.II/multigrid/mg_matrix.h index 6301fbda9d..ec4f28673c 100644 --- a/include/deal.II/multigrid/mg_matrix.h +++ b/include/deal.II/multigrid/mg_matrix.h @@ -177,7 +177,7 @@ namespace mg matrices.resize(p.min_level(), p.max_level()); for (unsigned int level=p.min_level(); level <= p.max_level(); ++level) matrices[level] = std_cxx11::shared_ptr<PointerMatrixBase<VectorType> > - (new_pointer_matrix_base(p[level], VectorType())); + (new_pointer_matrix_base(p[level], VectorType())); } diff --git a/include/deal.II/multigrid/mg_smoother.h b/include/deal.II/multigrid/mg_smoother.h index 4d999ea068..ebc9a66ac6 100644 --- a/include/deal.II/multigrid/mg_smoother.h +++ b/include/deal.II/multigrid/mg_smoother.h @@ -797,8 +797,8 @@ MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize template <typename MatrixType, class RELAX, typename VectorType> inline void MGSmootherRelaxation<MatrixType, RELAX, VectorType>::smooth (const unsigned int level, - VectorType &u, - const VectorType &rhs) const + VectorType &u, + const VectorType &rhs) const { unsigned int maxlevel = smoothers.max_level(); unsigned int steps2 = this->steps; diff --git a/include/deal.II/multigrid/mg_transfer.templates.h b/include/deal.II/multigrid/mg_transfer.templates.h index 6f634159d5..b7b1d44835 100644 --- a/include/deal.II/multigrid/mg_transfer.templates.h +++ b/include/deal.II/multigrid/mg_transfer.templates.h @@ -170,8 +170,8 @@ template <int dim, class InVector, int spacedim> void MGTransferPrebuilt<VectorType>::copy_to_mg (const DoFHandler<dim,spacedim> &mg_dof_handler, - MGLevelObject<VectorType> &dst, - const InVector &src) const + MGLevelObject<VectorType> &dst, + const InVector &src) const { reinit_vector(mg_dof_handler, component_to_block_map, dst); bool first = true; diff --git a/include/deal.II/multigrid/multigrid.h b/include/deal.II/multigrid/multigrid.h index df0c9d31a9..21596f2f1a 100644 --- a/include/deal.II/multigrid/multigrid.h +++ b/include/deal.II/multigrid/multigrid.h @@ -424,12 +424,12 @@ private: template <typename VectorType> template <int dim> Multigrid<VectorType>::Multigrid (const DoFHandler<dim> &mg_dof_handler, - const MGMatrixBase<VectorType> &matrix, - const MGCoarseGridBase<VectorType> &coarse, - const MGTransferBase<VectorType> &transfer, - const MGSmootherBase<VectorType> &pre_smooth, - const MGSmootherBase<VectorType> &post_smooth, - Cycle cycle) + const MGMatrixBase<VectorType> &matrix, + const MGCoarseGridBase<VectorType> &coarse, + const MGTransferBase<VectorType> &transfer, + const MGSmootherBase<VectorType> &pre_smooth, + const MGSmootherBase<VectorType> &post_smooth, + Cycle cycle) : cycle_type(cycle), minlevel(0), @@ -529,7 +529,7 @@ template<int dim, typename VectorType, class TRANSFER> template<class OtherVectorType> void PreconditionMG<dim, VectorType, TRANSFER>::Tvmult -(OtherVectorType &, +(OtherVectorType &, const OtherVectorType &) const { Assert(false, ExcNotImplemented()); @@ -540,7 +540,7 @@ template<int dim, typename VectorType, class TRANSFER> template<class OtherVectorType> void PreconditionMG<dim, VectorType, TRANSFER>::Tvmult_add -(OtherVectorType &, +(OtherVectorType &, const OtherVectorType &) const { Assert(false, ExcNotImplemented()); diff --git a/include/deal.II/numerics/vector_tools.h b/include/deal.II/numerics/vector_tools.h index 82b37ba285..6b94eb7af9 100644 --- a/include/deal.II/numerics/vector_tools.h +++ b/include/deal.II/numerics/vector_tools.h @@ -595,8 +595,8 @@ namespace VectorTools VectorType &vec, const bool enforce_zero_boundary = false, const Quadrature<dim-1> &q_boundary = (dim > 1 ? - QGauss<dim-1>(2) : - Quadrature<dim-1>(0)), + QGauss<dim-1>(2) : + Quadrature<dim-1>(0)), const bool project_to_boundary_first = false); /** @@ -611,8 +611,8 @@ namespace VectorTools VectorType &vec, const bool enforce_zero_boundary = false, const Quadrature<dim-1> &q_boundary = (dim > 1 ? - QGauss<dim-1>(2) : - Quadrature<dim-1>(0)), + QGauss<dim-1>(2) : + Quadrature<dim-1>(0)), const bool project_to_boundary_first = false); /** @@ -644,8 +644,8 @@ namespace VectorTools VectorType &vec, const bool enforce_zero_boundary = false, const hp::QCollection<dim-1> &q_boundary = hp::QCollection<dim-1>(dim > 1 ? - QGauss<dim-1>(2) : - Quadrature<dim-1>(0)), + QGauss<dim-1>(2) : + Quadrature<dim-1>(0)), const bool project_to_boundary_first = false); /** diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index 49b077c429..8829a486e9 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -43,8 +43,8 @@ namespace parallel namespace distributed { - template<int dim, typename VECTOR, class DH> - SolutionTransfer<dim, VECTOR, DH>::SolutionTransfer(const DH &dof) + template<int dim, typename VectorType, class DH> + SolutionTransfer<dim, VectorType, DH>::SolutionTransfer (const DH &dof) : dof_handler(&dof, typeid(*this).name()) { @@ -55,16 +55,16 @@ namespace parallel - template<int dim, typename VECTOR, class DH> - SolutionTransfer<dim, VECTOR, DH>::~SolutionTransfer() + template<int dim, typename VectorType, class DH> + SolutionTransfer<dim, VectorType, DH>::~SolutionTransfer () {} - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - prepare_for_coarsening_and_refinement (const std::vector<const VECTOR *> &all_in) + SolutionTransfer<dim, VectorType, DH>:: + prepare_for_coarsening_and_refinement (const std::vector<const VectorType *> &all_in) { input_vectors = all_in; register_data_attach( get_data_size() * input_vectors.size() ); @@ -72,10 +72,9 @@ namespace parallel - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - register_data_attach(const std::size_t size) + SolutionTransfer<dim, VectorType, DH>::register_data_attach (const std::size_t size) { Assert(size > 0, ExcMessage("Please transfer at least one vector!")); @@ -88,7 +87,7 @@ namespace parallel offset = tria->register_data_attach(size, - std_cxx11::bind(&SolutionTransfer<dim, VECTOR, DH>::pack_callback, + std_cxx11::bind(&SolutionTransfer<dim, VectorType, DH>::pack_callback, this, std_cxx11::_1, std_cxx11::_2, @@ -98,53 +97,50 @@ namespace parallel - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - prepare_for_coarsening_and_refinement (const VECTOR &in) + SolutionTransfer<dim, VectorType, DH>:: + prepare_for_coarsening_and_refinement (const VectorType &in) { - std::vector<const VECTOR *> all_in(1, &in); + std::vector<const VectorType *> all_in(1, &in); prepare_for_coarsening_and_refinement(all_in); } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - prepare_serialization(const VECTOR &in) + SolutionTransfer<dim, VectorType, DH>::prepare_serialization (const VectorType &in) { - std::vector<const VECTOR *> all_in(1, &in); + std::vector<const VectorType *> all_in(1, &in); prepare_serialization(all_in); } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - prepare_serialization(const std::vector<const VECTOR *> &all_in) + SolutionTransfer<dim, VectorType, DH>::prepare_serialization + (const std::vector<const VectorType *> &all_in) { prepare_for_coarsening_and_refinement (all_in); } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - deserialize(VECTOR &in) + SolutionTransfer<dim, VectorType, DH>::deserialize (VectorType &in) { - std::vector<VECTOR *> all_in(1, &in); + std::vector<VectorType *> all_in(1, &in); deserialize(all_in); } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - deserialize(std::vector<VECTOR *> &all_in) + SolutionTransfer<dim, VectorType, DH>::deserialize (std::vector<VectorType *> &all_in) { register_data_attach( get_data_size() * all_in.size() ); @@ -155,10 +151,9 @@ namespace parallel } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - interpolate (std::vector<VECTOR *> &all_out) + SolutionTransfer<dim, VectorType, DH>::interpolate (std::vector<VectorType *> &all_out) { Assert(input_vectors.size()==all_out.size(), ExcDimensionMismatch(input_vectors.size(), all_out.size()) ); @@ -171,7 +166,7 @@ namespace parallel Assert (tria != 0, ExcInternalError()); tria->notify_ready_to_unpack(offset, - std_cxx11::bind(&SolutionTransfer<dim, VECTOR, DH>::unpack_callback, + std_cxx11::bind(&SolutionTransfer<dim, VectorType, DH>::unpack_callback, this, std_cxx11::_1, std_cxx11::_2, @@ -179,7 +174,7 @@ namespace parallel std_cxx11::ref(all_out))); - for (typename std::vector<VECTOR *>::iterator it=all_out.begin(); + for (typename std::vector<VectorType *>::iterator it=all_out.begin(); it !=all_out.end(); ++it) (*it)->compress(::dealii::VectorOperation::insert); @@ -189,72 +184,70 @@ namespace parallel - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - interpolate (VECTOR &out) + SolutionTransfer<dim, VectorType, DH>::interpolate (VectorType &out) { - std::vector<VECTOR *> all_out(1, &out); + std::vector<VectorType *> all_out(1, &out); interpolate(all_out); } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> unsigned int - SolutionTransfer<dim, VECTOR, DH>:: - get_data_size() const + SolutionTransfer<dim, VectorType, DH>::get_data_size() const { return sizeof(double)* DoFTools::max_dofs_per_cell(*dof_handler); } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: + SolutionTransfer<dim, VectorType, DH>:: pack_callback(const typename Triangulation<dim,dim>::cell_iterator &cell_, const typename Triangulation<dim,dim>::CellStatus /*status*/, void *data) { - typename VECTOR::value_type *data_store = reinterpret_cast<typename VECTOR::value_type *>(data); + typename VectorType::value_type *data_store = reinterpret_cast<typename VectorType::value_type *>(data); typename DH::cell_iterator cell(*cell_, dof_handler); const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell; - ::dealii::Vector<typename VECTOR::value_type> dofvalues(dofs_per_cell); - for (typename std::vector<const VECTOR *>::iterator it=input_vectors.begin(); + ::dealii::Vector<typename VectorType::value_type> dofvalues(dofs_per_cell); + for (typename std::vector<const VectorType *>::iterator it=input_vectors.begin(); it !=input_vectors.end(); ++it) { cell->get_interpolated_dof_values(*(*it), dofvalues); - Assert (typeid(typename VECTOR::value_type) == typeid(double), ExcNotImplemented()); - std::memcpy(data_store, &dofvalues(0), sizeof(typename VECTOR::value_type)*dofs_per_cell); + Assert (typeid(typename VectorType::value_type) == typeid(double), ExcNotImplemented()); + std::memcpy(data_store, &dofvalues(0), sizeof(typename VectorType::value_type)*dofs_per_cell); data_store += dofs_per_cell; } } - template<int dim, typename VECTOR, class DH> + template<int dim, typename VectorType, class DH> void - SolutionTransfer<dim, VECTOR, DH>:: - unpack_callback(const typename Triangulation<dim,dim>::cell_iterator &cell_, - const typename Triangulation<dim,dim>::CellStatus /*status*/, - const void *data, - std::vector<VECTOR *> &all_out) + SolutionTransfer<dim, VectorType, DH>::unpack_callback + (const typename Triangulation<dim,dim>::cell_iterator &cell_, + const typename Triangulation<dim,dim>::CellStatus /*status*/, + const void *data, + std::vector<VectorType *> &all_out) { typename DH::cell_iterator cell(*cell_, dof_handler); const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell; - ::dealii::Vector<typename VECTOR::value_type> dofvalues(dofs_per_cell); - const typename VECTOR::value_type *data_store = reinterpret_cast<const typename VECTOR::value_type *>(data); + ::dealii::Vector<typename VectorType::value_type> dofvalues(dofs_per_cell); + const typename VectorType::value_type *data_store = reinterpret_cast<const typename VectorType::value_type *>(data); - for (typename std::vector<VECTOR *>::iterator it = all_out.begin(); + for (typename std::vector<VectorType *>::iterator it = all_out.begin(); it != all_out.end(); ++it) { - Assert (typeid(typename VECTOR::value_type) == typeid(double), ExcNotImplemented()); - std::memcpy(&dofvalues(0), data_store, sizeof(typename VECTOR::value_type)*dofs_per_cell); + Assert (typeid(typename VectorType::value_type) == typeid(double), ExcNotImplemented()); + std::memcpy(&dofvalues(0), data_store, sizeof(typename VectorType::value_type)*dofs_per_cell); cell->set_dof_values_by_interpolation(dofvalues, *(*it)); data_store += dofs_per_cell; } diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index bc6157a737..2cc3e5da28 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -44,10 +44,10 @@ DEAL_II_NAMESPACE_OPEN -template<int dim, int spacedim, class VECTOR, class DH> -MappingFEField<dim,spacedim,VECTOR,DH>::InternalData:: -InternalData (const FiniteElement<dim,spacedim> &fe, - const ComponentMask mask) +template<int dim, int spacedim, typename VectorType, class DH> +MappingFEField<dim,spacedim,VectorType,DH>::InternalData::InternalData +(const FiniteElement<dim,spacedim> &fe, + const ComponentMask mask) : n_shape_functions (fe.dofs_per_cell), mask (mask), @@ -57,10 +57,9 @@ InternalData (const FiniteElement<dim,spacedim> &fe, -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> std::size_t -MappingFEField<dim,spacedim,VECTOR,DH>::InternalData:: -memory_consumption () const +MappingFEField<dim,spacedim,VectorType,DH>::InternalData::memory_consumption () const { Assert (false, ExcNotImplemented()); return 0; @@ -68,11 +67,11 @@ memory_consumption () const -template<int dim, int spacedim, class DH, class VECTOR> +template<int dim, int spacedim, class DH, typename VectorType> double & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -shape (const unsigned int qpoint, - const unsigned int shape_nr) +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::shape +(const unsigned int qpoint, + const unsigned int shape_nr) { Assert(qpoint*n_shape_functions + shape_nr < shape_values.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -81,11 +80,11 @@ shape (const unsigned int qpoint, } -template<int dim, int spacedim, class DH, class VECTOR> +template<int dim, int spacedim, class DH, typename VectorType> const Tensor<1,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -derivative (const unsigned int qpoint, - const unsigned int shape_nr) const +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::derivative +(const unsigned int qpoint, + const unsigned int shape_nr) const { Assert(qpoint*n_shape_functions + shape_nr < shape_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -95,11 +94,11 @@ derivative (const unsigned int qpoint, -template<int dim, int spacedim, class DH, class VECTOR> +template<int dim, int spacedim, class DH, typename VectorType> Tensor<1,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -derivative (const unsigned int qpoint, - const unsigned int shape_nr) +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::derivative +(const unsigned int qpoint, + const unsigned int shape_nr) { Assert(qpoint*n_shape_functions + shape_nr < shape_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -108,11 +107,11 @@ derivative (const unsigned int qpoint, } -template <int dim, int spacedim, class DH, class VECTOR> +template <int dim, int spacedim, class DH, typename VectorType> const Tensor<2,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -second_derivative (const unsigned int qpoint, - const unsigned int shape_nr) const +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::second_derivative +(const unsigned int qpoint, + const unsigned int shape_nr) const { Assert(qpoint*n_shape_functions + shape_nr < shape_second_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -122,11 +121,11 @@ second_derivative (const unsigned int qpoint, -template <int dim, int spacedim, class DH, class VECTOR> +template <int dim, int spacedim, class DH, typename VectorType> Tensor<2,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -second_derivative (const unsigned int qpoint, - const unsigned int shape_nr) +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::second_derivative +(const unsigned int qpoint, + const unsigned int shape_nr) { Assert(qpoint*n_shape_functions + shape_nr < shape_second_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -135,11 +134,11 @@ second_derivative (const unsigned int qpoint, } -template <int dim, int spacedim, class DH, class VECTOR> +template <int dim, int spacedim, class DH, typename VectorType> const Tensor<3,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -third_derivative (const unsigned int qpoint, - const unsigned int shape_nr) const +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::third_derivative +(const unsigned int qpoint, + const unsigned int shape_nr) const { Assert(qpoint*n_shape_functions + shape_nr < shape_third_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -149,11 +148,11 @@ third_derivative (const unsigned int qpoint, -template <int dim, int spacedim, class DH, class VECTOR> +template <int dim, int spacedim, class DH, typename VectorType> Tensor<3,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -third_derivative (const unsigned int qpoint, - const unsigned int shape_nr) +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::third_derivative +(const unsigned int qpoint, + const unsigned int shape_nr) { Assert(qpoint*n_shape_functions + shape_nr < shape_third_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -162,11 +161,11 @@ third_derivative (const unsigned int qpoint, } -template <int dim, int spacedim, class DH, class VECTOR> +template <int dim, int spacedim, class DH, typename VectorType> const Tensor<4,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -fourth_derivative (const unsigned int qpoint, - const unsigned int shape_nr) const +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::fourth_derivative +(const unsigned int qpoint, + const unsigned int shape_nr) const { Assert(qpoint*n_shape_functions + shape_nr < shape_fourth_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -176,11 +175,11 @@ fourth_derivative (const unsigned int qpoint, -template <int dim, int spacedim, class DH, class VECTOR> +template <int dim, int spacedim, class DH, typename VectorType> Tensor<4,dim> & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData:: -fourth_derivative (const unsigned int qpoint, - const unsigned int shape_nr) +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::fourth_derivative +(const unsigned int qpoint, + const unsigned int shape_nr) { Assert(qpoint*n_shape_functions + shape_nr < shape_fourth_derivatives.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -190,10 +189,11 @@ fourth_derivative (const unsigned int qpoint, -template<int dim, int spacedim, class VECTOR, class DH> -MappingFEField<dim,spacedim,VECTOR,DH>::MappingFEField (const DH &euler_dof_handler, - const VECTOR &euler_vector, - const ComponentMask mask) +template<int dim, int spacedim, typename VectorType, class DH> +MappingFEField<dim,spacedim,VectorType,DH>::MappingFEField +(const DH &euler_dof_handler, + const VectorType &euler_vector, + const ComponentMask mask) : euler_vector(&euler_vector), fe(&euler_dof_handler.get_fe()), @@ -212,8 +212,9 @@ MappingFEField<dim,spacedim,VECTOR,DH>::MappingFEField (const DH &euler_dof } -template<int dim, int spacedim, class VECTOR, class DH> -MappingFEField<dim,spacedim,VECTOR,DH>::MappingFEField (const MappingFEField<dim,spacedim,VECTOR,DH> &mapping) +template<int dim, int spacedim, typename VectorType, class DH> +MappingFEField<dim,spacedim,VectorType,DH>::MappingFEField +(const MappingFEField<dim,spacedim,VectorType,DH> &mapping) : euler_vector(mapping.euler_vector), fe(mapping.fe), @@ -224,11 +225,12 @@ MappingFEField<dim,spacedim,VECTOR,DH>::MappingFEField (const MappingFEField<dim -template<int dim, int spacedim, class DH, class VECTOR> +template<int dim, int spacedim, class DH, typename VectorType> inline const double & -MappingFEField<dim,spacedim,DH,VECTOR>::InternalData::shape (const unsigned int qpoint, - const unsigned int shape_nr) const +MappingFEField<dim,spacedim,DH,VectorType>::InternalData::shape +(const unsigned int qpoint, + const unsigned int shape_nr) const { Assert(qpoint*n_shape_functions + shape_nr < shape_values.size(), ExcIndexRange(qpoint*n_shape_functions + shape_nr, 0, @@ -238,19 +240,19 @@ MappingFEField<dim,spacedim,DH,VECTOR>::InternalData::shape (const unsigned int -template <int dim, int spacedim, class DH, class VECTOR> +template <int dim, int spacedim, class DH, typename VectorType> bool -MappingFEField<dim,spacedim,DH,VECTOR>::preserves_vertex_locations () const +MappingFEField<dim,spacedim,DH,VectorType>::preserves_vertex_locations () const { return false; } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: -compute_shapes_virtual (const std::vector<Point<dim> > &unit_points, +MappingFEField<dim,spacedim,VectorType,DH>:: +compute_shapes_virtual (const std::vector<Point<dim> > &unit_points, typename MappingFEField<dim, spacedim>::InternalData &data) const { const unsigned int n_points=unit_points.size(); @@ -280,9 +282,9 @@ compute_shapes_virtual (const std::vector<Point<dim> > &unit_points, } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> UpdateFlags -MappingFEField<dim,spacedim,VECTOR,DH>::requires_update_flags (const UpdateFlags in) const +MappingFEField<dim,spacedim,VectorType,DH>::requires_update_flags (const UpdateFlags in) const { // add flags if the respective quantities are necessary to compute // what we need. note that some flags appear in both conditions and @@ -339,12 +341,13 @@ MappingFEField<dim,spacedim,VECTOR,DH>::requires_update_flags (const UpdateFlags -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>::compute_data (const UpdateFlags update_flags, - const Quadrature<dim> &q, - const unsigned int n_original_q_points, - InternalData &data) const +MappingFEField<dim,spacedim,VectorType,DH>::compute_data +(const UpdateFlags update_flags, + const Quadrature<dim> &q, + const unsigned int n_original_q_points, + InternalData &data) const { // store the flags in the internal data object so we can access them // in fill_fe_*_values(). use the transitive hull of the required @@ -390,12 +393,13 @@ MappingFEField<dim,spacedim,VECTOR,DH>::compute_data (const UpdateFlags upd } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>::compute_face_data (const UpdateFlags update_flags, - const Quadrature<dim> &q, - const unsigned int n_original_q_points, - InternalData &data) const +MappingFEField<dim,spacedim,VectorType,DH>::compute_face_data +(const UpdateFlags update_flags, + const Quadrature<dim> &q, + const unsigned int n_original_q_points, + InternalData &data) const { compute_data (update_flags, q, n_original_q_points, data); @@ -457,11 +461,11 @@ MappingFEField<dim,spacedim,VECTOR,DH>::compute_face_data (const UpdateFlags upd } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> typename -MappingFEField<dim,spacedim,VECTOR,DH>::InternalData * -MappingFEField<dim,spacedim,VECTOR,DH>::get_data (const UpdateFlags update_flags, - const Quadrature<dim> &quadrature) const +MappingFEField<dim,spacedim,VectorType,DH>::InternalData * +MappingFEField<dim,spacedim,VectorType,DH>::get_data (const UpdateFlags update_flags, + const Quadrature<dim> &quadrature) const { InternalData *data = new InternalData(*fe, fe_mask); this->compute_data (update_flags, quadrature, @@ -471,10 +475,11 @@ MappingFEField<dim,spacedim,VECTOR,DH>::get_data (const UpdateFlags update_flags -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> typename Mapping<dim,spacedim>::InternalDataBase * -MappingFEField<dim,spacedim,VECTOR,DH>::get_face_data (const UpdateFlags update_flags, - const Quadrature<dim-1>& quadrature) const +MappingFEField<dim,spacedim,VectorType,DH>::get_face_data +(const UpdateFlags update_flags, + const Quadrature<dim-1> &quadrature) const { InternalData *data = new InternalData(*fe, fe_mask); const Quadrature<dim> q (QProjector<dim>::project_to_all_faces(quadrature)); @@ -485,10 +490,11 @@ MappingFEField<dim,spacedim,VECTOR,DH>::get_face_data (const UpdateFlags update_ } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> typename Mapping<dim,spacedim>::InternalDataBase * -MappingFEField<dim,spacedim,VECTOR,DH>::get_subface_data (const UpdateFlags update_flags, - const Quadrature<dim-1>& quadrature) const +MappingFEField<dim,spacedim,VectorType,DH>::get_subface_data +(const UpdateFlags update_flags, + const Quadrature<dim-1> &quadrature) const { InternalData *data = new InternalData(*fe, fe_mask); const Quadrature<dim> q (QProjector<dim>::project_to_all_subfaces(quadrature)); @@ -1267,9 +1273,9 @@ namespace internal // Note that the CellSimilarity flag is modifiable, since MappingFEField can need to // recalculate data even when cells are similar. -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> CellSimilarity::Similarity -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature<dim> &quadrature, @@ -1439,9 +1445,9 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell, -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell, const unsigned int face_no, const Quadrature<dim-1> &quadrature, @@ -1471,9 +1477,9 @@ fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator & } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, @@ -1507,7 +1513,7 @@ fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterato namespace { - template<int dim, int spacedim, int rank, class VECTOR, class DH> + template<int dim, int spacedim, int rank, typename VectorType, class DH> void transform_fields(const VectorSlice<const std::vector<Tensor<rank,dim> > > input, const MappingType mapping_type, @@ -1515,10 +1521,10 @@ namespace VectorSlice<std::vector<Tensor<rank,spacedim> > > output) { AssertDimension (input.size(), output.size()); - Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VECTOR,DH>::InternalData *>(&mapping_data) != 0), + Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VectorType,DH>::InternalData *>(&mapping_data) != 0), ExcInternalError()); - const typename MappingFEField<dim,spacedim,VECTOR,DH>::InternalData - &data = static_cast<const typename MappingFEField<dim,spacedim,VECTOR,DH>::InternalData &>(mapping_data); + const typename MappingFEField<dim,spacedim,VectorType,DH>::InternalData + &data = static_cast<const typename MappingFEField<dim,spacedim,VectorType,DH>::InternalData &>(mapping_data); switch (mapping_type) { @@ -1569,19 +1575,19 @@ namespace } - template<int dim, int spacedim, int rank, class VECTOR, class DH> + template<int dim, int spacedim, int rank, typename VectorType, class DH> void - transform_differential_forms(const VectorSlice<const std::vector<DerivativeForm<rank, dim,spacedim> > > input, - const MappingType mapping_type, - const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data, - VectorSlice<std::vector<Tensor<rank+1, spacedim> > > output) + transform_differential_forms(const VectorSlice<const std::vector<DerivativeForm<rank, dim,spacedim> > > input, + const MappingType mapping_type, + const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data, + VectorSlice<std::vector<Tensor<rank+1, spacedim> > > output) { AssertDimension (input.size(), output.size()); - Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VECTOR,DH>::InternalData *>(&mapping_data) != 0), + Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VectorType,DH>::InternalData *>(&mapping_data) != 0), ExcInternalError()); - const typename MappingFEField<dim,spacedim,VECTOR,DH>::InternalData - &data = static_cast<const typename MappingFEField<dim,spacedim,VECTOR,DH>::InternalData &>(mapping_data); + const typename MappingFEField<dim,spacedim,VectorType,DH>::InternalData + &data = static_cast<const typename MappingFEField<dim,spacedim,VectorType,DH>::InternalData &>(mapping_data); switch (mapping_type) { @@ -1604,9 +1610,9 @@ namespace -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input, const MappingType mapping_type, const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data, @@ -1614,14 +1620,14 @@ transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input, { AssertDimension (input.size(), output.size()); - transform_fields<dim,spacedim,1,VECTOR,DH>(input, mapping_type, mapping_data, output); + transform_fields<dim,spacedim,1,VectorType,DH>(input, mapping_type, mapping_data, output); } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: transform (const VectorSlice<const std::vector<DerivativeForm<1, dim ,spacedim> > > input, const MappingType mapping_type, const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data, @@ -1629,14 +1635,14 @@ transform (const VectorSlice<const std::vector<DerivativeForm<1, dim ,spacedim> { AssertDimension (input.size(), output.size()); - transform_differential_forms<dim,spacedim,1,VECTOR,DH>(input, mapping_type, mapping_data, output); + transform_differential_forms<dim,spacedim,1,VectorType,DH>(input, mapping_type, mapping_data, output); } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input, const MappingType, const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data, @@ -1652,9 +1658,9 @@ transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input, -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input, const MappingType mapping_type, const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data, @@ -1702,9 +1708,9 @@ transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: transform (const VectorSlice<const std::vector< Tensor<3,dim> > > input, const MappingType /*mapping_type*/, const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data, @@ -1722,11 +1728,11 @@ transform (const VectorSlice<const std::vector< Tensor<3,dim> > > input, -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> Point<spacedim> -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: transform_unit_to_real_cell (const typename Triangulation<dim,spacedim>::cell_iterator &cell, - const Point<dim> &p) const + const Point<dim> &p) const { // Use the get_data function to create an InternalData with data vectors of // the right size and transformation shape values already computed at point @@ -1741,9 +1747,9 @@ transform_unit_to_real_cell (const typename Triangulation<dim,spacedim>::cell_it } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> Point<spacedim> -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: do_transform_unit_to_real_cell (const InternalData &data) const { Point<spacedim> p_real; @@ -1760,11 +1766,11 @@ do_transform_unit_to_real_cell (const InternalData &data) const -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> Point<dim> -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_iterator &cell, - const Point<spacedim> &p) const + const Point<spacedim> &p) const { // first a Newton iteration based on the real mapping. It uses the center // point of the cell as a starting point @@ -1803,14 +1809,14 @@ transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_it } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> Point<dim> -MappingFEField<dim,spacedim,VECTOR,DH>:: +MappingFEField<dim,spacedim,VectorType,DH>:: do_transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_iterator &cell, - const Point<spacedim> &p, - const Point<dim> &initial_p_unit, - InternalData &mdata) const + const Point<spacedim> &p, + const Point<dim> &initial_p_unit, + InternalData &mdata) const { const unsigned int n_shapes=mdata.shape_values.size(); (void)n_shapes; @@ -1911,35 +1917,35 @@ failure: } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> unsigned int -MappingFEField<dim,spacedim,VECTOR,DH>::get_degree() const +MappingFEField<dim,spacedim,VectorType,DH>::get_degree() const { return fe->degree; } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> ComponentMask -MappingFEField<dim,spacedim,VECTOR,DH>::get_component_mask() const +MappingFEField<dim,spacedim,VectorType,DH>::get_component_mask() const { return this->fe_mask; } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> Mapping<dim,spacedim> * -MappingFEField<dim,spacedim,VECTOR,DH>::clone () const +MappingFEField<dim,spacedim,VectorType,DH>::clone () const { - return new MappingFEField<dim,spacedim,VECTOR,DH>(*this); + return new MappingFEField<dim,spacedim,VectorType,DH>(*this); } -template<int dim, int spacedim, class VECTOR, class DH> +template<int dim, int spacedim, typename VectorType, class DH> void -MappingFEField<dim,spacedim,VECTOR,DH>::update_internal_dofs ( - const typename Triangulation<dim,spacedim>::cell_iterator &cell, - const typename MappingFEField<dim, spacedim>::InternalData &data) const +MappingFEField<dim,spacedim,VectorType,DH>::update_internal_dofs +(const typename Triangulation<dim,spacedim>::cell_iterator &cell, + const typename MappingFEField<dim, spacedim>::InternalData &data) const { Assert(euler_dof_handler != 0, ExcMessage("euler_dof_handler is empty")); diff --git a/source/multigrid/mg_base.cc b/source/multigrid/mg_base.cc index a591e28f76..6c94eb0448 100644 --- a/source/multigrid/mg_base.cc +++ b/source/multigrid/mg_base.cc @@ -27,23 +27,23 @@ DEAL_II_NAMESPACE_OPEN -template <class VECTOR> -MGTransferBase<VECTOR>::~MGTransferBase() +template <typename VectorType> +MGTransferBase<VectorType>::~MGTransferBase() {} -template <class VECTOR> -MGMatrixBase<VECTOR>::~MGMatrixBase() +template <typename VectorType> +MGMatrixBase<VectorType>::~MGMatrixBase() {} -template <class VECTOR> -MGSmootherBase<VECTOR>::~MGSmootherBase() +template <typename VectorType> +MGSmootherBase<VectorType>::~MGSmootherBase() {} -template <class VECTOR> -MGCoarseGridBase<VECTOR>::~MGCoarseGridBase() +template <typename VectorType> +MGCoarseGridBase<VectorType>::~MGCoarseGridBase() {} diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index 823ab0cb8c..9b89e0166c 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -42,35 +42,35 @@ DEAL_II_NAMESPACE_OPEN -template<class VECTOR> -MGTransferPrebuilt<VECTOR>::MGTransferPrebuilt () +template<typename VectorType> +MGTransferPrebuilt<VectorType>::MGTransferPrebuilt () {} -template<class VECTOR> -MGTransferPrebuilt<VECTOR>::MGTransferPrebuilt (const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c) +template<typename VectorType> +MGTransferPrebuilt<VectorType>::MGTransferPrebuilt (const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c) : constraints(&c), mg_constrained_dofs(&mg_c) {} -template <class VECTOR> -MGTransferPrebuilt<VECTOR>::~MGTransferPrebuilt () +template <typename VectorType> +MGTransferPrebuilt<VectorType>::~MGTransferPrebuilt () {} -template <class VECTOR> -void MGTransferPrebuilt<VECTOR>::initialize_constraints ( - const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c) +template <typename VectorType> +void MGTransferPrebuilt<VectorType>::initialize_constraints +(const ConstraintMatrix &c, const MGConstrainedDoFs &mg_c) { constraints = &c; mg_constrained_dofs = &mg_c; } -template <class VECTOR> -void MGTransferPrebuilt<VECTOR>::clear () +template <typename VectorType> +void MGTransferPrebuilt<VectorType>::clear () { sizes.resize(0); prolongation_matrices.resize(0); @@ -85,11 +85,10 @@ void MGTransferPrebuilt<VECTOR>::clear () } -template <class VECTOR> -void MGTransferPrebuilt<VECTOR>::prolongate ( - const unsigned int to_level, - VECTOR &dst, - const VECTOR &src) const +template <typename VectorType> +void MGTransferPrebuilt<VectorType>::prolongate (const unsigned int to_level, + VectorType &dst, + const VectorType &src) const { Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()), ExcIndexRange (to_level, 1, prolongation_matrices.size()+1)); @@ -98,11 +97,10 @@ void MGTransferPrebuilt<VECTOR>::prolongate ( } -template <class VECTOR> -void MGTransferPrebuilt<VECTOR>::restrict_and_add ( - const unsigned int from_level, - VECTOR &dst, - const VECTOR &src) const +template <typename VectorType> +void MGTransferPrebuilt<VectorType>::restrict_and_add (const unsigned int from_level, + VectorType &dst, + const VectorType &src) const { Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()), ExcIndexRange (from_level, 1, prolongation_matrices.size()+1)); @@ -112,10 +110,10 @@ void MGTransferPrebuilt<VECTOR>::restrict_and_add ( } -template <typename VECTOR> +template <typename VectorType> template <int dim, int spacedim> -void MGTransferPrebuilt<VECTOR>::build_matrices ( - const DoFHandler<dim,spacedim> &mg_dof) +void MGTransferPrebuilt<VectorType>::build_matrices +(const DoFHandler<dim,spacedim> &mg_dof) { const unsigned int n_levels = mg_dof.get_tria().n_global_levels(); const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell; @@ -140,9 +138,9 @@ void MGTransferPrebuilt<VECTOR>::build_matrices ( for (unsigned int i=0; i<n_levels-1; ++i) { prolongation_sparsities.push_back - (std_cxx11::shared_ptr<typename internal::MatrixSelector<VECTOR>::Sparsity> (new typename internal::MatrixSelector<VECTOR>::Sparsity)); + (std_cxx11::shared_ptr<typename internal::MatrixSelector<VectorType>::Sparsity> (new typename internal::MatrixSelector<VectorType>::Sparsity)); prolongation_matrices.push_back - (std_cxx11::shared_ptr<typename internal::MatrixSelector<VECTOR>::Matrix> (new typename internal::MatrixSelector<VECTOR>::Matrix)); + (std_cxx11::shared_ptr<typename internal::MatrixSelector<VectorType>::Matrix> (new typename internal::MatrixSelector<VectorType>::Matrix)); } // two fields which will store the @@ -209,11 +207,11 @@ void MGTransferPrebuilt<VECTOR>::build_matrices ( } } - internal::MatrixSelector<VECTOR>::reinit(*prolongation_matrices[level], - *prolongation_sparsities[level], - level, - dsp, - mg_dof); + internal::MatrixSelector<VectorType>::reinit(*prolongation_matrices[level], + *prolongation_sparsities[level], + level, + dsp, + mg_dof); dsp.reinit(0,0); FullMatrix<double> prolongation; @@ -284,11 +282,11 @@ namespace }; } -template <class VECTOR> +template <typename VectorType> template <int dim, int spacedim> void -MGTransferPrebuilt<VECTOR>::fill_and_communicate_copy_indices( - const DoFHandler<dim,spacedim> &mg_dof) +MGTransferPrebuilt<VectorType>::fill_and_communicate_copy_indices +(const DoFHandler<dim,spacedim> &mg_dof) { // Now we are filling the variables copy_indices*, which are essentially // maps from global to mgdof for each level stored as a std::vector of @@ -473,9 +471,9 @@ MGTransferPrebuilt<VECTOR>::fill_and_communicate_copy_indices( std::sort(copy_indices_global_mine[level].begin(), copy_indices_global_mine[level].end(), compare); } -template <class VECTOR> +template <typename VectorType> void -MGTransferPrebuilt<VECTOR>::print_matrices (std::ostream &os) const +MGTransferPrebuilt<VectorType>::print_matrices (std::ostream &os) const { for (unsigned int level = 0; level<prolongation_matrices.size(); ++level) { @@ -485,9 +483,9 @@ MGTransferPrebuilt<VECTOR>::print_matrices (std::ostream &os) const } } -template <class VECTOR> +template <typename VectorType> void -MGTransferPrebuilt<VECTOR>::print_indices (std::ostream &os) const +MGTransferPrebuilt<VectorType>::print_indices (std::ostream &os) const { for (unsigned int level = 0; level<copy_indices.size(); ++level) { diff --git a/source/numerics/data_out_dof_data.cc b/source/numerics/data_out_dof_data.cc index fc8aede4c2..dad80cdfa9 100644 --- a/source/numerics/data_out_dof_data.cc +++ b/source/numerics/data_out_dof_data.cc @@ -484,7 +484,7 @@ namespace internal - template <class DH, class VectorType> + template <class DH, typename VectorType> DataEntry<DH,VectorType>:: DataEntry (const DH *dofs, const VectorType *data, @@ -497,7 +497,7 @@ namespace internal - template <class DH, class VectorType> + template <class DH, typename VectorType> DataEntry<DH,VectorType>:: DataEntry (const DH *dofs, const VectorType *data, @@ -510,10 +510,10 @@ namespace internal namespace { - template <class VectorType> + template <typename VectorType> double - get_vector_element (const VectorType &vector, - const unsigned int cell_number) + get_vector_element (const VectorType &vector, + const unsigned int cell_number) { return vector[cell_number]; } @@ -529,7 +529,7 @@ namespace internal - template <class DH, class VectorType> + template <class DH, typename VectorType> double DataEntry<DH,VectorType>:: get_cell_data_value (const unsigned int cell_number) const @@ -539,11 +539,11 @@ namespace internal - template <class DH, class VectorType> + template <class DH, typename VectorType> void - DataEntry<DH,VectorType>:: - get_function_values (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, - std::vector<dealii::Vector<double> > &patch_values_system) const + DataEntry<DH,VectorType>::get_function_values + (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, + std::vector<dealii::Vector<double> > &patch_values_system) const { // FIXME: FEValuesBase gives us data in types that match that of // the solution vector. but this function needs to pass it back @@ -584,9 +584,9 @@ namespace internal template <class DH, typename VectorType> void - DataEntry<DH,VectorType>:: - get_function_values (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, - std::vector<double> &patch_values) const + DataEntry<DH,VectorType>::get_function_values + (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, + std::vector<double> &patch_values) const { // FIXME: FEValuesBase gives us data in types that match that of // the solution vector. but this function needs to pass it back @@ -623,11 +623,11 @@ namespace internal - template <class DH, class VectorType> + template <class DH, typename VectorType> void - DataEntry<DH,VectorType>:: - get_function_gradients (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, - std::vector<std::vector<Tensor<1,DH::space_dimension> > > &patch_gradients_system) const + DataEntry<DH,VectorType>::get_function_gradients + (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, + std::vector<std::vector<Tensor<1,DH::space_dimension> > > &patch_gradients_system) const { // FIXME: FEValuesBase gives us data in types that match that of // the solution vector. but this function needs to pass it back @@ -669,9 +669,9 @@ namespace internal template <class DH, typename VectorType> void - DataEntry<DH,VectorType>:: - get_function_gradients (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, - std::vector<Tensor<1,DH::space_dimension> > &patch_gradients) const + DataEntry<DH,VectorType>::get_function_gradients + (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, + std::vector<Tensor<1,DH::space_dimension> > &patch_gradients) const { // FIXME: FEValuesBase gives us data in types that match that of // the solution vector. but this function needs to pass it back @@ -709,11 +709,11 @@ namespace internal - template <class DH, class VectorType> + template <class DH, typename VectorType> void - DataEntry<DH,VectorType>:: - get_function_hessians (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, - std::vector<std::vector<Tensor<2,DH::space_dimension> > > &patch_hessians_system) const + DataEntry<DH,VectorType>::get_function_hessians + (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, + std::vector<std::vector<Tensor<2,DH::space_dimension> > > &patch_hessians_system) const { // FIXME: FEValuesBase gives us data in types that match that of // the solution vector. but this function needs to pass it back @@ -755,9 +755,9 @@ namespace internal template <class DH, typename VectorType> void - DataEntry<DH,VectorType>:: - get_function_hessians (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, - std::vector<Tensor<2,DH::space_dimension> > &patch_hessians) const + DataEntry<DH,VectorType>::get_function_hessians + (const FEValuesBase<DH::dimension,DH::space_dimension> &fe_patch_values, + std::vector<Tensor<2,DH::space_dimension> > &patch_hessians) const { // FIXME: FEValuesBase gives us data in types that match that of // the solution vector. but this function needs to pass it back @@ -804,7 +804,7 @@ namespace internal - template <class DH, class VectorType> + template <class DH, typename VectorType> void DataEntry<DH,VectorType>::clear () { @@ -868,10 +868,10 @@ attach_triangulation (const Triangulation<DH::dimension,DH::space_dimension> &tr template <class DH, int patch_dim, int patch_space_dim> -template <class VECTOR> +template <typename VectorType> void DataOut_DoFData<DH,patch_dim,patch_space_dim>:: -add_data_vector (const VECTOR &vec, +add_data_vector (const VectorType &vec, const std::string &name, const DataVectorType type, const std::vector<DataComponentInterpretation::DataComponentInterpretation> &data_component_interpretation) @@ -907,10 +907,10 @@ add_data_vector (const VECTOR &vec, template <class DH, int patch_dim, int patch_space_dim> -template <class VECTOR> +template <typename VectorType> void DataOut_DoFData<DH,patch_dim,patch_space_dim>:: -add_data_vector (const VECTOR &vec, +add_data_vector (const VectorType &vec, const std::vector<std::string> &names, const DataVectorType type, const std::vector<DataComponentInterpretation::DataComponentInterpretation> &data_component_interpretation_) @@ -971,8 +971,8 @@ add_data_vector (const VECTOR &vec, } internal::DataOut::DataEntryBase<DH> *new_entry - = new internal::DataOut::DataEntry<DH,VECTOR>(dofs, &vec, names, - data_component_interpretation); + = new internal::DataOut::DataEntry<DH,VectorType>(dofs, &vec, names, + data_component_interpretation); if (actual_type == type_dof_data) dof_data.push_back (std_cxx11::shared_ptr<internal::DataOut::DataEntryBase<DH> >(new_entry)); else @@ -983,10 +983,10 @@ add_data_vector (const VECTOR &vec, template <class DH, int patch_dim, int patch_space_dim> -template <class VECTOR> +template <typename VectorType> void DataOut_DoFData<DH,patch_dim,patch_space_dim>:: -add_data_vector (const VECTOR &vec, +add_data_vector (const VectorType &vec, const DataPostprocessor<DH::space_dimension> &data_postprocessor) { // this is a specialized version of the other function where we have a @@ -1003,7 +1003,7 @@ add_data_vector (const VECTOR &vec, dofs->get_tria().n_active_cells())); internal::DataOut::DataEntryBase<DH> *new_entry - = new internal::DataOut::DataEntry<DH,VECTOR>(dofs, &vec, &data_postprocessor); + = new internal::DataOut::DataEntry<DH,VectorType>(dofs, &vec, &data_postprocessor); dof_data.push_back (std_cxx11::shared_ptr<internal::DataOut::DataEntryBase<DH> >(new_entry)); } @@ -1011,11 +1011,11 @@ add_data_vector (const VECTOR &vec, template <class DH, int patch_dim, int patch_space_dim> -template <class VECTOR> +template <typename VectorType> void DataOut_DoFData<DH,patch_dim,patch_space_dim>:: add_data_vector (const DH &dof_handler, - const VECTOR &vec, + const VectorType &vec, const DataPostprocessor<DH::space_dimension> &data_postprocessor) { // this is a specialized version of the other function where we have a @@ -1026,7 +1026,7 @@ add_data_vector (const DH &dof_handler, AssertDimension (vec.size(), dof_handler.n_dofs()); internal::DataOut::DataEntryBase<DH> *new_entry - = new internal::DataOut::DataEntry<DH,VECTOR>(&dof_handler, &vec, &data_postprocessor); + = new internal::DataOut::DataEntry<DH,VectorType>(&dof_handler, &vec, &data_postprocessor); dof_data.push_back (std_cxx11::shared_ptr<internal::DataOut::DataEntryBase<DH> >(new_entry)); } @@ -1034,11 +1034,11 @@ add_data_vector (const DH &dof_handler, template <class DH, int patch_dim, int patch_space_dim> -template <class VECTOR> +template <typename VectorType> void DataOut_DoFData<DH,patch_dim,patch_space_dim>:: add_data_vector (const DH &dof_handler, - const VECTOR &data, + const VectorType &data, const std::string &name, const std::vector<DataComponentInterpretation::DataComponentInterpretation> &data_component_interpretation) { @@ -1067,11 +1067,11 @@ add_data_vector (const DH &dof_handler, template <class DH, int patch_dim, int patch_space_dim> -template <class VECTOR> +template <typename VectorType> void DataOut_DoFData<DH,patch_dim,patch_space_dim>:: add_data_vector (const DH &dof_handler, - const VECTOR &data, + const VectorType &data, const std::vector<std::string> &names, const std::vector<DataComponentInterpretation::DataComponentInterpretation> &data_component_interpretation_) { @@ -1098,8 +1098,8 @@ add_data_vector (const DH &dof_handler, (names.size(), DataComponentInterpretation::component_is_scalar)); internal::DataOut::DataEntryBase<DH> *new_entry - = new internal::DataOut::DataEntry<DH,VECTOR>(&dof_handler, &data, names, - data_component_interpretation); + = new internal::DataOut::DataEntry<DH,VectorType>(&dof_handler, &data, names, + data_component_interpretation); dof_data.push_back (std_cxx11::shared_ptr<internal::DataOut::DataEntryBase<DH> >(new_entry)); } diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index 018ca17ce9..4ece1fcb96 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -562,9 +562,9 @@ void PointValueHistory<dim> template <int dim> -template <class VECTOR> +template <typename VectorType> void PointValueHistory<dim> -::evaluate_field (const std::string &vector_name, const VECTOR &solution) +::evaluate_field (const std::string &vector_name, const VectorType &solution) { // must be closed to add data to internal // members. @@ -615,9 +615,12 @@ void PointValueHistory<dim> template <int dim> -template <class VECTOR> +template <typename VectorType> void PointValueHistory<dim> -::evaluate_field(const std::vector <std::string> &vector_names, const VECTOR &solution, const DataPostprocessor< dim> &data_postprocessor, const Quadrature<dim> &quadrature) +::evaluate_field (const std::vector <std::string> &vector_names, + const VectorType &solution, + const DataPostprocessor< dim> &data_postprocessor, + const Quadrature<dim> &quadrature) { // must be closed to add data to internal // members. @@ -658,9 +661,9 @@ void PointValueHistory<dim> { // Extract data for the // PostProcessor object - std::vector< typename VECTOR::value_type > uh (n_quadrature_points, 0.0); - std::vector< Tensor< 1, dim, typename VECTOR::value_type > > duh (n_quadrature_points, Tensor <1, dim, typename VECTOR::value_type> ()); - std::vector< Tensor< 2, dim, typename VECTOR::value_type > > dduh (n_quadrature_points, Tensor <2, dim, typename VECTOR::value_type> ()); + std::vector< typename VectorType::value_type > uh (n_quadrature_points, 0.0); + std::vector< Tensor< 1, dim, typename VectorType::value_type > > duh (n_quadrature_points, Tensor <1, dim, typename VectorType::value_type> ()); + std::vector< Tensor< 2, dim, typename VectorType::value_type > > dduh (n_quadrature_points, Tensor <2, dim, typename VectorType::value_type> ()); std::vector<Point<dim> > dummy_normals (1, Point<dim> ()); std::vector<Point<dim> > evaluation_points; // at each point there is @@ -691,7 +694,7 @@ void PointValueHistory<dim> // Call compute_derived_quantities_vector // or compute_derived_quantities_scalar - // TODO this function should also operate with typename VECTOR::value_type + // TODO this function should also operate with typename VectorType::value_type data_postprocessor. compute_derived_quantities_scalar(std::vector< double > (1, uh[selected_point]), std::vector< Tensor< 1, dim > > (1, Tensor< 1, dim >(duh[selected_point]) ), @@ -704,9 +707,9 @@ void PointValueHistory<dim> else // The case of a vector FE { // Extract data for the PostProcessor object - std::vector< Vector< typename VECTOR::value_type > > uh (n_quadrature_points, Vector <typename VECTOR::value_type> (n_components)); - std::vector< std::vector< Tensor< 1, dim, typename VECTOR::value_type > > > duh (n_quadrature_points, std::vector< Tensor< 1, dim, typename VECTOR::value_type > > (n_components, Tensor< 1, dim, typename VECTOR::value_type >())); - std::vector< std::vector< Tensor< 2, dim, typename VECTOR::value_type > > > dduh (n_quadrature_points, std::vector< Tensor< 2, dim, typename VECTOR::value_type > > (n_components, Tensor< 2, dim, typename VECTOR::value_type >())); + std::vector< Vector< typename VectorType::value_type > > uh (n_quadrature_points, Vector <typename VectorType::value_type> (n_components)); + std::vector< std::vector< Tensor< 1, dim, typename VectorType::value_type > > > duh (n_quadrature_points, std::vector< Tensor< 1, dim, typename VectorType::value_type > > (n_components, Tensor< 1, dim, typename VectorType::value_type >())); + std::vector< std::vector< Tensor< 2, dim, typename VectorType::value_type > > > dduh (n_quadrature_points, std::vector< Tensor< 2, dim, typename VectorType::value_type > > (n_components, Tensor< 2, dim, typename VectorType::value_type >())); std::vector<Point<dim> > dummy_normals (1, Point<dim> ()); std::vector<Point<dim> > evaluation_points; // at each point there is @@ -739,9 +742,9 @@ void PointValueHistory<dim> // FIXME: We need tmp vectors below because the data // postprocessors are not equipped to deal with anything but // doubles (scalars and tensors). - const Vector< typename VECTOR::value_type > &uh_s = uh[selected_point]; - const std::vector< Tensor< 1, dim, typename VECTOR::value_type > > &duh_s = duh[selected_point]; - const std::vector< Tensor< 2, dim, typename VECTOR::value_type > > &dduh_s = dduh[selected_point]; + const Vector< typename VectorType::value_type > &uh_s = uh[selected_point]; + const std::vector< Tensor< 1, dim, typename VectorType::value_type > > &duh_s = duh[selected_point]; + const std::vector< Tensor< 2, dim, typename VectorType::value_type > > &dduh_s = dduh[selected_point]; std::vector< Tensor< 1, dim > > tmp_d (duh_s.size()); for (unsigned int i = 0; i < duh_s.size(); i++) tmp_d[i] = duh_s[i]; @@ -794,9 +797,12 @@ void PointValueHistory<dim> template <int dim> -template <class VECTOR> +template <typename VectorType> void PointValueHistory<dim> -::evaluate_field(const std::string &vector_name, const VECTOR &solution, const DataPostprocessor<dim> &data_postprocessor, const Quadrature<dim> &quadrature) +::evaluate_field (const std::string &vector_name, + const VectorType &solution, + const DataPostprocessor<dim> &data_postprocessor, + const Quadrature<dim> &quadrature) { std::vector <std::string> vector_names; vector_names.push_back (vector_name); @@ -806,9 +812,10 @@ void PointValueHistory<dim> template <int dim> -template <class VECTOR> +template <typename VectorType> void PointValueHistory<dim> -::evaluate_field_at_requested_location(const std::string &vector_name, const VECTOR &solution) +::evaluate_field_at_requested_location (const std::string &vector_name, + const VectorType &solution) { // must be closed to add data to internal // members. @@ -1349,4 +1356,3 @@ void PointValueHistory<dim> DEAL_II_NAMESPACE_CLOSE - diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 4bdc71814e..425ff48948 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -34,8 +34,8 @@ DEAL_II_NAMESPACE_OPEN -template<int dim, typename VECTOR, class DH> -SolutionTransfer<dim, VECTOR, DH>::SolutionTransfer(const DH &dof) +template<int dim, typename VectorType, class DH> +SolutionTransfer<dim, VectorType, DH>::SolutionTransfer(const DH &dof) : dof_handler(&dof, typeid(*this).name()), n_dofs_old(0), @@ -44,16 +44,16 @@ SolutionTransfer<dim, VECTOR, DH>::SolutionTransfer(const DH &dof) -template<int dim, typename VECTOR, class DH> -SolutionTransfer<dim, VECTOR, DH>::~SolutionTransfer() +template<int dim, typename VectorType, class DH> +SolutionTransfer<dim, VectorType, DH>::~SolutionTransfer() { clear (); } -template<int dim, typename VECTOR, class DH> -void SolutionTransfer<dim, VECTOR, DH>::clear () +template<int dim, typename VectorType, class DH> +void SolutionTransfer<dim, VectorType, DH>::clear () { indices_on_cell.clear(); dof_values_on_cell.clear(); @@ -64,8 +64,8 @@ void SolutionTransfer<dim, VECTOR, DH>::clear () -template<int dim, typename VECTOR, class DH> -void SolutionTransfer<dim, VECTOR, DH>::prepare_for_pure_refinement() +template<int dim, typename VectorType, class DH> +void SolutionTransfer<dim, VectorType, DH>::prepare_for_pure_refinement() { Assert(prepared_for!=pure_refinement, ExcAlreadyPrepForRef()); Assert(prepared_for!=coarsening_and_refinement, @@ -101,10 +101,10 @@ void SolutionTransfer<dim, VECTOR, DH>::prepare_for_pure_refinement() -template<int dim, typename VECTOR, class DH> +template<int dim, typename VectorType, class DH> void -SolutionTransfer<dim, VECTOR, DH>::refine_interpolate(const VECTOR &in, - VECTOR &out) const +SolutionTransfer<dim, VectorType, DH>::refine_interpolate (const VectorType &in, + VectorType &out) const { Assert(prepared_for==pure_refinement, ExcNotPrepared()); Assert(in.size()==n_dofs_old, ExcDimensionMismatch(in.size(),n_dofs_old)); @@ -114,7 +114,7 @@ SolutionTransfer<dim, VECTOR, DH>::refine_interpolate(const VECTOR &in, ExcMessage ("Vectors cannot be used as input and output" " at the same time!")); - Vector<typename VECTOR::value_type> local_values(0); + Vector<typename VectorType::value_type> local_values(0); typename DH::cell_iterator cell = dof_handler->begin(), endc = dof_handler->end(); @@ -226,10 +226,10 @@ namespace internal -template<int dim, typename VECTOR, class DH> +template<int dim, typename VectorType, class DH> void -SolutionTransfer<dim, VECTOR, DH>:: -prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in) +SolutionTransfer<dim, VectorType, DH>:: +prepare_for_coarsening_and_refinement(const std::vector<VectorType> &all_in) { Assert (prepared_for!=pure_refinement, ExcAlreadyPrepForRef()); Assert (prepared_for!=coarsening_and_refinement, @@ -281,9 +281,9 @@ prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in) std::vector<std::vector<types::global_dof_index> >(n_cells_to_stay_or_refine) .swap(indices_on_cell); - std::vector<std::vector<Vector<typename VECTOR::value_type> > > + std::vector<std::vector<Vector<typename VectorType::value_type> > > (n_coarsen_fathers, - std::vector<Vector<typename VECTOR::value_type> > (in_size)) + std::vector<Vector<typename VectorType::value_type> > (in_size)) .swap(dof_values_on_cell); Table<2,FullMatrix<double> > interpolation_hp; @@ -353,8 +353,8 @@ prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in) const unsigned int dofs_per_cell=cell->get_dof_handler().get_fe()[target_fe_index].dofs_per_cell; - std::vector<Vector<typename VECTOR::value_type> >(in_size, - Vector<typename VECTOR::value_type>(dofs_per_cell)) + std::vector<Vector<typename VectorType::value_type> >(in_size, + Vector<typename VectorType::value_type>(dofs_per_cell)) .swap(dof_values_on_cell[n_cf]); @@ -379,20 +379,20 @@ prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in) -template<int dim, typename VECTOR, class DH> +template<int dim, typename VectorType, class DH> void -SolutionTransfer<dim, VECTOR, DH>::prepare_for_coarsening_and_refinement(const VECTOR &in) +SolutionTransfer<dim, VectorType, DH>::prepare_for_coarsening_and_refinement (const VectorType &in) { - std::vector<VECTOR> all_in=std::vector<VECTOR>(1, in); + std::vector<VectorType> all_in=std::vector<VectorType>(1, in); prepare_for_coarsening_and_refinement(all_in); } -template<int dim, typename VECTOR, class DH> -void SolutionTransfer<dim, VECTOR, DH>:: -interpolate (const std::vector<VECTOR> &all_in, - std::vector<VECTOR> &all_out) const +template<int dim, typename VectorType, class DH> +void SolutionTransfer<dim, VectorType, DH>:: +interpolate (const std::vector<VectorType> &all_in, + std::vector<VectorType> &all_out) const { Assert(prepared_for==coarsening_and_refinement, ExcNotPrepared()); const unsigned int size=all_in.size(); @@ -409,7 +409,7 @@ interpolate (const std::vector<VECTOR> &all_in, ExcMessage ("Vectors cannot be used as input and output" " at the same time!")); - Vector<typename VECTOR::value_type> local_values; + Vector<typename VectorType::value_type> local_values; std::vector<types::global_dof_index> dofs; typename std::map<std::pair<unsigned int, unsigned int>, Pointerstruct>::const_iterator @@ -418,7 +418,7 @@ interpolate (const std::vector<VECTOR> &all_in, Table<2,FullMatrix<double> > interpolation_hp; internal::extract_interpolation_matrices (*dof_handler, interpolation_hp); - Vector<typename VECTOR::value_type> tmp, tmp2; + Vector<typename VectorType::value_type> tmp, tmp2; typename DH::cell_iterator cell = dof_handler->begin(), endc = dof_handler->end(); @@ -431,7 +431,7 @@ interpolate (const std::vector<VECTOR> &all_in, const std::vector<types::global_dof_index> *const indexptr =pointerstruct->second.indices_ptr; - const std::vector<Vector<typename VECTOR::value_type> > *const valuesptr + const std::vector<Vector<typename VectorType::value_type> > *const valuesptr =pointerstruct->second.dof_values_ptr; // cell stayed as it was or was refined @@ -488,7 +488,7 @@ interpolate (const std::vector<VECTOR> &all_in, // test we would have to // store the fe_index of all // cells - const Vector<typename VECTOR::value_type> *data = 0; + const Vector<typename VectorType::value_type> *data = 0; const unsigned int active_fe_index = cell->active_fe_index(); if (active_fe_index != pointerstruct->second.active_fe_index) { @@ -518,18 +518,18 @@ interpolate (const std::vector<VECTOR> &all_in, -template<int dim, typename VECTOR, class DH> -void SolutionTransfer<dim, VECTOR, DH>::interpolate(const VECTOR &in, - VECTOR &out) const +template<int dim, typename VectorType, class DH> +void SolutionTransfer<dim, VectorType, DH>::interpolate (const VectorType &in, + VectorType &out) const { Assert (in.size()==n_dofs_old, ExcDimensionMismatch(in.size(), n_dofs_old)); Assert (out.size()==dof_handler->n_dofs(), ExcDimensionMismatch(out.size(), dof_handler->n_dofs())); - std::vector<VECTOR> all_in(1); + std::vector<VectorType> all_in(1); all_in[0] = in; - std::vector<VECTOR> all_out(1); + std::vector<VectorType> all_out(1); all_out[0] = out; interpolate(all_in, all_out); @@ -538,9 +538,9 @@ void SolutionTransfer<dim, VECTOR, DH>::interpolate(const VECTOR &in, -template<int dim, typename VECTOR, class DH> +template<int dim, typename VectorType, class DH> std::size_t -SolutionTransfer<dim, VECTOR, DH>::memory_consumption () const +SolutionTransfer<dim, VectorType, DH>::memory_consumption () const { // at the moment we do not include the memory // consumption of the cell_map as we have no @@ -555,9 +555,9 @@ SolutionTransfer<dim, VECTOR, DH>::memory_consumption () const -template<int dim, typename VECTOR, class DH> +template<int dim, typename VectorType, class DH> std::size_t -SolutionTransfer<dim, VECTOR, DH>::Pointerstruct::memory_consumption () const +SolutionTransfer<dim, VectorType, DH>::Pointerstruct::memory_consumption () const { return sizeof(*this); } diff --git a/tests/multigrid/cycles.cc b/tests/multigrid/cycles.cc index eb2026e42f..8333afacc7 100644 --- a/tests/multigrid/cycles.cc +++ b/tests/multigrid/cycles.cc @@ -73,7 +73,7 @@ void test_cycles(unsigned int minlevel, unsigned int maxlevel) mg::Matrix<VectorType> mgmatrix(level_matrices); Multigrid<VectorType> mg1(minlevel, maxlevel, mgmatrix, all, all, all, all, - Multigrid<VectorType>::v_cycle); + Multigrid<VectorType>::v_cycle); mg1.set_debug(3); for (unsigned int i=minlevel; i<=maxlevel; ++i) mg1.defect[i].reinit(N); diff --git a/tests/petsc/solver_12.cc b/tests/petsc/solver_12.cc index d85c7c8ade..9a248ce3d6 100644 --- a/tests/petsc/solver_12.cc +++ b/tests/petsc/solver_12.cc @@ -34,11 +34,11 @@ template<class SOLVER, class MATRIX, typename VectorType, class PRECONDITION> void check_solve(SOLVER &solver, - const SolverControl &solver_control, - const MATRIX &A, - VectorType &u, - VectorType &f, - const PRECONDITION &P) + const SolverControl &solver_control, + const MATRIX &A, + VectorType &u, + VectorType &f, + const PRECONDITION &P) { deallog << "Solver type: " << typeid(solver).name() << std::endl; -- 2.39.5