From 10309cfa83ea6582364af2cac15187a8161ecb72 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 28 Jun 2004 14:49:21 +0000 Subject: [PATCH] Remove two controversial functions again. Untemplatify other functions. git-svn-id: https://svn.dealii.org/trunk@9476 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_tools.h | 44 +----- deal.II/deal.II/source/fe/fe_tools.cc | 204 +------------------------- 2 files changed, 9 insertions(+), 239 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe_tools.h b/deal.II/deal.II/include/fe/fe_tools.h index 8072d3dbad..da4b702484 100644 --- a/deal.II/deal.II/include/fe/fe_tools.h +++ b/deal.II/deal.II/include/fe/fe_tools.h @@ -219,15 +219,13 @@ class FETools * object. */ template class DH1, - template class DH2, class InVector, class OutVector> static void - interpolate (const DH1 &dof1, - const InVector &u1, - const DH2 &dof2, - OutVector &u2); + interpolate (const DoFHandler &dof1, + const InVector &u1, + const DoFHandler &dof2, + OutVector &u2); /** * Gives the interpolation of a @@ -267,25 +265,7 @@ class FETools const InVector& u1, const DoFHandler& dof2, const ConstraintMatrix& constraints, - OutVector& u2); - - - /** - * Same as last function, except - * that one or both of the dof - * handler objects might be of - * type @p hpDoFHandler. - */ - template class DH1, - template class DH2, - class InVector, class OutVector> - static void interpolate (const DH1 &dof1, - const InVector &u1, - const DH2 &dof2, - const ConstraintMatrix &constraints, - OutVector& u2); - + OutVector& u2); /** * Gives the interpolation of the @@ -315,20 +295,6 @@ class FETools */ template static void back_interpolate (const DoFHandler &dof1, - const InVector &u1, - const FiniteElement &fe2, - OutVector &u1_interpolated); - - /** - * Same as last function, except - * that the dof handler objects - * might be of type - * @p hpDoFHandler. - */ - template class DH, - class InVector, class OutVector> - static void back_interpolate (const DH &dof1, const InVector &u1, const FiniteElement &fe2, OutVector &u1_interpolated); diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index c6117959e6..12ed9265aa 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -471,14 +471,12 @@ void FETools::get_projection_matrix (const FiniteElement &fe1, template class DH1, - template class DH2, class InVector, class OutVector> void -FETools::interpolate(const DH1 &dof1, - const InVector &u1, - const DH2 &dof2, - OutVector &u2) +FETools::interpolate(const DoFHandler &dof1, + const InVector &u1, + const DoFHandler &dof2, + OutVector &u2) { ConstraintMatrix dummy; dummy.close(); @@ -569,128 +567,6 @@ FETools::interpolate(const DoFHandler &dof1, -template class DH1, - template class DH2, - class InVector, class OutVector> -void -FETools::interpolate (const DH1 &dof1, - const InVector &u1, - const DH2 &dof2, - const ConstraintMatrix &constraints, - OutVector &u2) -{ - Assert(&dof1.get_tria()==&dof2.get_tria(), ExcTriangulationMismatch()); - - Assert(u1.size()==dof1.n_dofs(), - ExcDimensionMismatch(u1.size(), dof1.n_dofs())); - Assert(u2.size()==dof2.n_dofs(), - ExcDimensionMismatch(u2.size(), dof2.n_dofs())); - - // allocate vectors at maximal - // size. will be reinited in inner - // cell, but Vector makes sure that - // this does not lead to - // reallocation of memory - Vector u1_local(max_dofs_per_cell(dof1)); - Vector u2_local(max_dofs_per_cell(dof2)); - - // have a map for interpolation - // matrices. shared_ptr make sure - // that memory is released again - std::map *, - std::map *, - boost::shared_ptr > > > - interpolation_matrices; - - typename DH1::active_cell_iterator cell1 = dof1.begin_active(), - endc1 = dof1.end(); - typename DH2::active_cell_iterator cell2 = dof2.begin_active(), - endc2 = dof2.end(); - - std::vector touch_count(dof2.n_dofs(),0); - std::vector dofs; - dofs.reserve (max_dofs_per_cell (dof2)); - u2.clear (); - - for (; cell1!=endc1; ++cell1, ++cell2) - { - Assert(cell1->get_fe().n_components() == cell2->get_fe().n_components(), - ExcDimensionMismatch (cell1->get_fe().n_components(), - cell2->get_fe().n_components())); - - // for continuous elements on - // grids with hanging nodes we - // need hanging node - // constraints. Consequentely, - // if there are no constraints - // then hanging nodes are not - // allowed. - const bool hanging_nodes_not_allowed - = ((cell2->get_fe().dofs_per_vertex != 0) && - (constraints.n_constraints() == 0)); - - if (hanging_nodes_not_allowed) - for (unsigned int face=0; face::faces_per_cell; ++face) - Assert (cell1->at_boundary(face) || - cell1->neighbor(face)->level() == cell1->level(), - ExcHangingNodesNotAllowed(0)); - - - const unsigned int dofs_per_cell1 = cell1->get_fe().dofs_per_cell; - const unsigned int dofs_per_cell2 = cell2->get_fe().dofs_per_cell; - u1_local.reinit (dofs_per_cell1); - u2_local.reinit (dofs_per_cell2); - - // check if interpolation - // matrix for this particular - // pair of elements is already - // there - if (interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()] == 0) - { - boost::shared_ptr > - interpolation_matrix (new FullMatrix (dofs_per_cell2, - dofs_per_cell1)); - interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()] - = interpolation_matrix; - - FETools::get_interpolation_matrix(cell1->get_fe(), - cell2->get_fe(), - *interpolation_matrix); - } - - cell1->get_dof_values(u1, u1_local); - interpolation_matrices[&cell1->get_fe()][&cell2->get_fe()] - ->vmult(u2_local, u1_local); - - dofs.resize (dofs_per_cell2); - cell2->get_dof_indices(dofs); - - for (unsigned int i=0; i void FETools::back_interpolate(const DoFHandler &dof1, @@ -741,78 +617,6 @@ FETools::back_interpolate(const DoFHandler &dof1, -template class DH, - class InVector, class OutVector> -void -FETools::back_interpolate(const DH &dof1, - const InVector &u1, - const FiniteElement &fe2, - OutVector &u1_interpolated) -{ - Assert(u1.size() == dof1.n_dofs(), - ExcDimensionMismatch(u1.size(), dof1.n_dofs())); - Assert(u1_interpolated.size() == dof1.n_dofs(), - ExcDimensionMismatch(u1_interpolated.size(), dof1.n_dofs())); - - Vector u1_local(max_dofs_per_cell(dof1)); - Vector u1_int_local(max_dofs_per_cell(dof1)); - - typename DH::active_cell_iterator cell = dof1.begin_active(), - endc = dof1.end(); - - // map from possible fe objects in - // dof1 to the back_interpolation - // matrices - std::map *, - boost::shared_ptr > > interpolation_matrices; - - for (; cell!=endc; ++cell) - { - Assert(cell->get_fe().n_components() == fe2.n_components(), - ExcDimensionMismatch(cell->get_fe().n_components(), - fe2.n_components())); - - // For continuous elements on - // grids with hanging nodes we - // need hanging node - // constraints. Consequently, - // when the elements are - // continuous no hanging node - // constraints are allowed. - const bool hanging_nodes_not_allowed= - (cell->get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0); - - if (hanging_nodes_not_allowed) - for (unsigned int face=0; face::faces_per_cell; ++face) - Assert (cell->at_boundary(face) || - cell->neighbor(face)->level() == cell->level(), - ExcHangingNodesNotAllowed(0)); - - const unsigned int dofs_per_cell1 = cell->get_fe().dofs_per_cell; - - // make sure back_interpolation - // matrix is available - if (interpolation_matrices[&cell->get_fe()] != 0) - { - interpolation_matrices[&cell->get_fe()] = - boost::shared_ptr > - (new FullMatrix(dofs_per_cell1, dofs_per_cell1)); - get_back_interpolation_matrix(dof1.get_fe(), fe2, - *interpolation_matrices[&cell->get_fe()]); - } - - u1_local.reinit (dofs_per_cell1); - u1_int_local.reinit (dofs_per_cell1); - - cell->get_dof_values(u1, u1_local); - interpolation_matrices[&cell->get_fe()]->vmult(u1_int_local, u1_local); - cell->set_dof_values(u1_int_local, u1_interpolated); - } -} - - - template void FETools::back_interpolate(const DoFHandler &dof1, const ConstraintMatrix &constraints1, -- 2.39.5