From: bangerth Date: Thu, 1 Oct 2009 20:08:07 +0000 (+0000) Subject: Patch by Joshua White: Implementation of more functions of FE_Nothing. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdda4e46700d064f32e2e6c60db6e03b48001d69;p=dealii-svn.git Patch by Joshua White: Implementation of more functions of FE_Nothing. git-svn-id: https://svn.dealii.org/trunk@19649 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_nothing.h b/deal.II/deal.II/include/fe/fe_nothing.h index 02a17f4f73..a980d7cb40 100644 --- a/deal.II/deal.II/include/fe/fe_nothing.h +++ b/deal.II/deal.II/include/fe/fe_nothing.h @@ -40,9 +40,11 @@ class FE_Nothing : public FiniteElement public: /** - * Constructor. + * Constructor. Argument denotes the + * number of components to give this + * finite element (default = 1). */ - FE_Nothing (); + FE_Nothing (unsigned int n_components = 1); /** * A sort of virtual copy @@ -277,6 +279,65 @@ class FE_Nothing : public FiniteElement FiniteElementDomination::Domination compare_for_face_domination (const FiniteElement & fe_other) const; + + + virtual + std::vector > + hp_vertex_dof_identities (const FiniteElement &fe_other) const; + + virtual + std::vector > + hp_line_dof_identities (const FiniteElement &fe_other) const; + + virtual + std::vector > + hp_quad_dof_identities (const FiniteElement &fe_other) const; + + virtual + bool + hp_constraints_are_implemented () const; + + /** + * Return the matrix + * interpolating from a face of + * of one element to the face of + * the neighboring element. + * The size of the matrix is + * then source.#dofs_per_face times + * this->#dofs_per_face. + * + * Since the current finite element has no + * degrees of freedom, the interpolation + * matrix is necessarily empty. + */ + + virtual + void + get_face_interpolation_matrix (const FiniteElement &source_fe, + FullMatrix &interpolation_matrix) const; + + + /** + * Return the matrix + * interpolating from a face of + * of one element to the subface of + * the neighboring element. + * The size of the matrix is + * then source.#dofs_per_face times + * this->#dofs_per_face. + * + * Since the current finite element has no + * degrees of freedom, the interpolation + * matrix is necessarily empty. + */ + + virtual + void + get_subface_interpolation_matrix (const FiniteElement & source_fe, + const unsigned int index, + FullMatrix &interpolation_matrix) const; + + }; diff --git a/deal.II/deal.II/source/fe/fe_nothing.cc b/deal.II/deal.II/source/fe/fe_nothing.cc index eb86ec5cf1..78ea19564c 100644 --- a/deal.II/deal.II/source/fe/fe_nothing.cc +++ b/deal.II/deal.II/source/fe/fe_nothing.cc @@ -25,11 +25,11 @@ namespace template -FE_Nothing::FE_Nothing () +FE_Nothing::FE_Nothing (const unsigned n_components) : FiniteElement (FiniteElementData(std::vector(dim+1,0), - 1, 0, + n_components, 0, FiniteElementData::unknown), std::vector(), std::vector >() ) @@ -120,6 +120,9 @@ FE_Nothing::get_data (const UpdateFlags /*flags*/, const Mapping & /*mapping*/, const Quadrature & /*quadrature*/) const { + // Create a default data object. Normally we would then + // need to resize things to hold the appropriate numbers + // of dofs, but in this case all data fields are empty. typename Mapping::InternalDataBase* data = new typename Mapping::InternalDataBase(); return data; } @@ -137,7 +140,7 @@ fill_fe_values (const Mapping & /*mapping*/, FEValuesData & /*data*/, CellSimilarity::Similarity & /*cell_similarity*/) const { - Assert(false,ExcMessage(zero_dof_message)); + // leave data fields empty } @@ -153,11 +156,9 @@ fill_fe_face_values (const Mapping & /*mapping*/, typename Mapping::InternalDataBase & /*fedata*/, FEValuesData & /*data*/) const { - Assert(false,ExcMessage(zero_dof_message)); + // leave data fields empty } - - template void FE_Nothing:: @@ -170,7 +171,7 @@ fill_fe_subface_values (const Mapping & /*mapping*/, typename Mapping::InternalDataBase & /*fedata*/, FEValuesData & /*data*/) const { - Assert(false,ExcMessage(zero_dof_message)); + // leave data fields empty } @@ -181,10 +182,103 @@ compare_for_face_domination (const FiniteElement & fe_other) const { if(dynamic_cast*>(&fe_other) != 0) return FiniteElementDomination::either_element_can_dominate; + + // Question: Best to assume this element always dominates, + // since we will always no how to do deal with other elements + // regardless of type, or do we leave it up to the other + // element to handle the FENothing appropriately? Set + // to the second choice for now. else return FiniteElementDomination::other_element_dominates; + //return FiniteElementDomination::this_element_dominates; +} + + +template +std::vector > +FE_Nothing :: +hp_vertex_dof_identities (const FiniteElement &/*fe_other*/) const +{ + // the FE_Nothing has no + // degrees of freedom, so there + // are no equivalencies to be + // recorded + return std::vector > (); } + + +template +std::vector > +FE_Nothing :: +hp_line_dof_identities (const FiniteElement &/*fe_other*/) const +{ + // the FE_Nothing has no + // degrees of freedom, so there + // are no equivalencies to be + // recorded + return std::vector > (); +} + + +template +std::vector > +FE_Nothing :: +hp_quad_dof_identities (const FiniteElement &/*fe_other*/) const +{ + // the FE_Nothing has no + // degrees of freedom, so there + // are no equivalencies to be + // recorded + return std::vector > (); +} + +template +bool +FE_Nothing :: +hp_constraints_are_implemented () const +{ + return true; +} + + +template +void +FE_Nothing:: +get_face_interpolation_matrix (const FiniteElement &/*source_fe*/, + FullMatrix &interpolation_matrix) const +{ + // since this element has no face dofs, the + // interpolation matrix is necessarily empty + + Assert (interpolation_matrix.m() == 0, + ExcDimensionMismatch (interpolation_matrix.m(), + 0)); + Assert (interpolation_matrix.n() == 0, + ExcDimensionMismatch (interpolation_matrix.m(), + 0)); +} + + +template +void +FE_Nothing:: +get_subface_interpolation_matrix (const FiniteElement & /*source_fe*/, + const unsigned int /*index*/, + FullMatrix &interpolation_matrix) const +{ + // since this element has no face dofs, the + // interpolation matrix is necessarily empty + + Assert (interpolation_matrix.m() == 0, + ExcDimensionMismatch (interpolation_matrix.m(), + 0)); + Assert (interpolation_matrix.n() == 0, + ExcDimensionMismatch (interpolation_matrix.m(), + 0)); +} + + template class FE_Nothing;