From 81308d61af11b47c914468532bce60a3be0925e1 Mon Sep 17 00:00:00 2001 From: young Date: Mon, 21 Oct 2013 22:27:38 +0000 Subject: [PATCH] Push back original compile errors in petsc_vector_base to their instantiations. Free up petsc_vector_base. git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31377 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/deal.II/lac/petsc_vector_base.h | 12 +++--------- .../deal.II/numerics/vector_tools.templates.h | 11 +++++++---- deal.II/source/dofs/dof_accessor_get.cc | 8 ++++++-- deal.II/source/fe/fe_tools_interpolate.cc | 18 ++++++++++++------ deal.II/source/fe/mapping_q1_eulerian.cc | 4 +++- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/deal.II/include/deal.II/lac/petsc_vector_base.h b/deal.II/include/deal.II/lac/petsc_vector_base.h index 010b35dc46..3a8d5be85a 100644 --- a/deal.II/include/deal.II/lac/petsc_vector_base.h +++ b/deal.II/include/deal.II/lac/petsc_vector_base.h @@ -1350,9 +1350,7 @@ namespace PETScWrappers && index(end) ) { //local entry - /* @whattodo Note: OutputIterator needs to be instantiated as PetscScalar (or std::complex) */ - /* *(values_begin+i) = *(ptr+index-begin); */ - Assert ((false), ExcMessage ("This function is corrupt: @whattodo")); + *(values_begin+i) = *(ptr+index-begin); } else { @@ -1361,9 +1359,7 @@ namespace PETScWrappers = ghost_indices.index_within_set(index); Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError()); - /* @whattodo Note: OutputIterator needs to be instantiated as PetscScalar (or std::complex) */ - /* *(values_begin+i) = *(ptr+ghostidx+end-begin); */ - Assert ((false), ExcMessage ("This function is corrupt: @whattodo")); + *(values_begin+i) = *(ptr+ghostidx+end-begin); } } @@ -1395,9 +1391,7 @@ namespace PETScWrappers Assert(index>=static_cast(begin) && index(end), ExcInternalError()); - /* @whattodo Note: OutputIterator needs to be instantiated as PetscScalar (or std::complex) */ - /* *(values_begin+i) = *(ptr+index-begin); */ - Assert ((false), ExcMessage ("This function is corrupt: @whattodo")); + *(values_begin+i) = *(ptr+index-begin); } ierr = VecRestoreArray(vector, &ptr); diff --git a/deal.II/include/deal.II/numerics/vector_tools.templates.h b/deal.II/include/deal.II/numerics/vector_tools.templates.h index 17f54d300b..640e7d6476 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.templates.h +++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h @@ -284,13 +284,13 @@ namespace VectorTools template void - interpolate (const DoFHandler &dof_1, - const DoFHandler &dof_2, + interpolate (const DoFHandler &dof_1, + const DoFHandler &dof_2, const FullMatrix &transfer, const InVector &data_1, OutVector &data_2) { - Vector cell_data_1(dof_1.get_fe().dofs_per_cell); + Vector cell_data_1(dof_1.get_fe().dofs_per_cell); // <- Vector Vector cell_data_2(dof_2.get_fe().dofs_per_cell); std::vector touch_count (dof_2.n_dofs(), 0); //TODO: check on datatype... kinda strange (UK) @@ -302,7 +302,10 @@ namespace VectorTools for (; h != endh; ++h, ++l) { - h->get_dof_values(data_1, cell_data_1); + // @whattodo Some of the problems in petsc_vector_base.h are instantiated here. + /* h->get_dof_values(data_1, cell_data_1); // <- complaint line 655 */ + Assert ((false), ExcMessage ("This function is corrupt: @whattodo")); + transfer.vmult(cell_data_2, cell_data_1); l->get_dof_indices (local_dof_indices); diff --git a/deal.II/source/dofs/dof_accessor_get.cc b/deal.II/source/dofs/dof_accessor_get.cc index 9b9ca8b7b8..40988ac4f2 100644 --- a/deal.II/source/dofs/dof_accessor_get.cc +++ b/deal.II/source/dofs/dof_accessor_get.cc @@ -46,7 +46,7 @@ get_interpolated_dof_values (const InputVector &values, Vector &interpolated_values) const { const FiniteElement &fe = this->get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.dofs_per_cell; Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject()); @@ -60,7 +60,11 @@ get_interpolated_dof_values (const InputVector &values, if (!this->has_children()) // if this cell has no children: simply return the exact values on this // cell - this->get_dof_values (values, interpolated_values); + { + // @whattodo Another contribution to the initial problems in petcs_vector_base.h. Pandora's box! + // this->get_dof_values (values, interpolated_values); + Assert ((false), ExcMessage ("This function is corrupt: @whattodo")); + } else // otherwise clobber them from the children { diff --git a/deal.II/source/fe/fe_tools_interpolate.cc b/deal.II/source/fe/fe_tools_interpolate.cc index cd69bd1a0a..405a8682a2 100644 --- a/deal.II/source/fe/fe_tools_interpolate.cc +++ b/deal.II/source/fe/fe_tools_interpolate.cc @@ -626,9 +626,9 @@ namespace FETools template void project_dg(const DoFHandler &dof1, - const InVector &u1, + const InVector &u1, const DoFHandler &dof2, - OutVector &u2) + OutVector &u2) { Assert(&dof1.get_tria()==&dof2.get_tria(), ExcTriangulationMismatch()); Assert(dof1.get_fe().n_components() == dof2.get_fe().n_components(), @@ -643,18 +643,24 @@ namespace FETools const unsigned int n1 = dof1.get_fe().dofs_per_cell; const unsigned int n2 = dof2.get_fe().dofs_per_cell; - Vector u1_local(n1); - Vector u2_local(n2); + Vector u1_local(n1); // <- Vector + Vector u2_local(n2); // <- Vector std::vector dofs(n2); - FullMatrix matrix(n2,n1); + FullMatrix matrix(n2,n1); // ? get_projection_matrix(dof1.get_fe(), dof2.get_fe(), matrix); + while (cell2 != end) { - cell1->get_dof_values(u1, u1_local); + + // @whattodo Some of the problems in petsc_vector_base.h are instantiated here. + // cell1->get_dof_values(u1, u1_local); // <- complaint line 655 + Assert ((false), ExcMessage ("This function is corrupt: @whattodo")); + matrix.vmult(u2_local, u1_local); cell2->get_dof_indices(dofs); + for (unsigned int i=0; i::cell_ // now get the values of the shift // vectors at the vertices Vector mapping_values (shiftmap_dof_handler->get_fe().dofs_per_cell); - dof_cell->get_dof_values (*euler_transform_vectors, mapping_values); + // @whattodo Some of the problems in petsc_vector_base.h are instantiated here. + // dof_cell->get_dof_values (*euler_transform_vectors, mapping_values); <- complaint line + Assert ((false), ExcMessage ("This function is corrupt: @whattodo")); for (unsigned int i=0; i::vertices_per_cell; ++i) { -- 2.39.5