From 720b0df90768668bd3f10ce8012a42fa6711aad3 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 15 Dec 2011 19:31:40 +0000 Subject: [PATCH] Make FE_Nothing work with SolutionTransfer. git-svn-id: https://svn.dealii.org/trunk@24830 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 8 +++++++- deal.II/source/fe/fe.cc | 4 ++-- deal.II/source/fe/fe_nothing.cc | 8 +++++++- deal.II/source/fe/fe_system.cc | 4 ++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 0425b486e4..7ccff517e2 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -73,7 +73,13 @@ enabled due to a missing include file in file

Specific improvements

    -
  1. Fixed: DerivativeApproximation for distributed computations. +
  2. Fixed: Restriction and prolongation didn't work for elements of +kind FE_Nothing. Consequently, many other parts of the library also +didn't work, such as the SolutionTransfer class. This is now fixed. +
    +(Wolfgang Bangerth, 2011/12/15) + +
  3. Fixed: The DerivativeApproximation class now works for distributed computations.
    (Timo Heister, 2011/12/15) diff --git a/deal.II/source/fe/fe.cc b/deal.II/source/fe/fe.cc index 2c6b3d2a6f..1f6340aa4b 100644 --- a/deal.II/source/fe/fe.cc +++ b/deal.II/source/fe/fe.cc @@ -343,7 +343,7 @@ FiniteElement::get_restriction_matrix (const unsigned int child, // RefinementCase::no_refinement (=0) there is no // data available and so the vector indices // are shifted - Assert (restriction[refinement_case-1][child].n() != 0, ExcProjectionVoid()); + Assert (restriction[refinement_case-1][child].n() == this->dofs_per_cell, ExcProjectionVoid()); return restriction[refinement_case-1][child]; } @@ -365,7 +365,7 @@ FiniteElement::get_prolongation_matrix (const unsigned int child, // RefinementCase::no_refinement (=0) there is no // data available and so the vector indices // are shifted - Assert (prolongation[refinement_case-1][child].n() != 0, ExcEmbeddingVoid()); + Assert (prolongation[refinement_case-1][child].n() == this->dofs_per_cell, ExcEmbeddingVoid()); return prolongation[refinement_case-1][child]; } diff --git a/deal.II/source/fe/fe_nothing.cc b/deal.II/source/fe/fe_nothing.cc index 8b5d72c909..39eb591b35 100644 --- a/deal.II/source/fe/fe_nothing.cc +++ b/deal.II/source/fe/fe_nothing.cc @@ -33,7 +33,13 @@ FE_Nothing::FE_Nothing (const unsigned n_components) FiniteElementData::unknown), std::vector(), std::vector >() ) -{} +{ +// in most other elements we have to set up all sorts of stuff +// here. there isn't much that we have to do here; in particular, +// we can simply leave the restriction and prolongation matrices +// empty since their proper size is in fact zero given that the +// element here has no degrees of freedom +} template diff --git a/deal.II/source/fe/fe_system.cc b/deal.II/source/fe/fe_system.cc index 9f3caf63ac..054846bf93 100644 --- a/deal.II/source/fe/fe_system.cc +++ b/deal.II/source/fe/fe_system.cc @@ -1890,9 +1890,9 @@ void FESystem::initialize () for (unsigned int i=0; in_base_elements(); ++i) { - if (base_element(i).restriction[ref_case-1][0].n() == 0) + if (base_element(i).restriction[ref_case-1][0].n() != base_element(i).dofs_per_cell) do_restriction = false; - if (base_element(i).prolongation[ref_case-1][0].n() == 0) + if (base_element(i).prolongation[ref_case-1][0].n() != base_element(i).dofs_per_cell) do_prolongation = false; } -- 2.39.5