]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement face_interpolation and subface_interpolation matrices for discontinuous...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Aug 2006 21:19:24 +0000 (21:19 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Aug 2006 21:19:24 +0000 (21:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@13648 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_dgp.h
deal.II/deal.II/include/fe/fe_dgp_monomial.h
deal.II/deal.II/include/fe/fe_dgp_nonparametric.h
deal.II/deal.II/include/fe/fe_dgq.h
deal.II/deal.II/source/fe/fe_dgp.cc
deal.II/deal.II/source/fe/fe_dgp_monomial.cc
deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc
deal.II/deal.II/source/fe/fe_dgq.cc

index 3a8df6724a77bc66e3eacfd08b3285f61810e93d..da97d7799728054a1c75e3956c17b48ef1a95aea 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -59,7 +59,72 @@ class FE_DGP : public FE_Poly<PolynomialSpace<dim>,dim>
                                      */
     virtual std::string get_name () const;
     
+                                     /**
+                                      * Return whether this element
+                                      * implements its hanging node
+                                      * constraints in the new way,
+                                     * which has to be used to make
+                                     * elements "hp compatible".
+                                      *
+                                     * For the FE_DGP class the result is
+                                     * always true (independent of the degree
+                                     * of the element), as it has no hanging
+                                     * nodes (being a discontinuous element).
+                                      */
+    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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_face_interpolation_matrix (const FiniteElement<dim> &source,
+                                  FullMatrix<double>       &matrix) 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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_subface_interpolation_matrix (const FiniteElement<dim> &source,
+                                     const unsigned int        subface,
+                                     FullMatrix<double>       &matrix) const;
+
+                                    /**
                                      * Check for non-zero values on a face.
                                      *
                                      * This function returns
index 5698ce39fb6cc679f76632499beb0aee55ae9a0e..6e041c822d27f8ba198450a8e768015ad5057590 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -55,6 +55,21 @@ class FE_DGPMonomial : public FE_Poly<PolynomialsP<dim>,dim>
                                      */
     virtual std::string get_name () const;
     
+                                     /**
+                                      * Return whether this element
+                                      * implements its hanging node
+                                      * constraints in the new way,
+                                     * which has to be used to make
+                                     * elements "hp compatible".
+                                      *
+                                     * For the FE_DGPMonomial class the
+                                     * result is always true (independent of
+                                     * the degree of the element), as it has
+                                     * no hanging nodes (being a
+                                     * discontinuous element).
+                                      */
+    virtual bool hp_constraints_are_implemented () const;
+
                                     /**
                                      * Return the matrix
                                      * interpolating from the given
@@ -75,6 +90,57 @@ class FE_DGPMonomial : public FE_Poly<PolynomialsP<dim>,dim>
     get_interpolation_matrix (const FiniteElement<dim> &source,
                              FullMatrix<double>           &matrix) 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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_face_interpolation_matrix (const FiniteElement<dim> &source,
+                                  FullMatrix<double>       &matrix) 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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_subface_interpolation_matrix (const FiniteElement<dim> &source,
+                                     const unsigned int        subface,
+                                     FullMatrix<double>       &matrix) const;
+
                                     /**
                                      * Check for non-zero values on a face.
                                      *
index f2a489a86c52e48184befcbca2a7ba9ad98fc579..30f6c6727f0cc6887582b7aa6721f692ac287006 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -205,6 +205,72 @@ class FE_DGPNonparametric : public FiniteElement<dim>
                                       */
     virtual unsigned int element_multiplicity (const unsigned int index) 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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_face_interpolation_matrix (const FiniteElement<dim> &source,
+                                  FullMatrix<double>       &matrix) 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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_subface_interpolation_matrix (const FiniteElement<dim> &source,
+                                     const unsigned int        subface,
+                                     FullMatrix<double>       &matrix) const;
+
+                                     /**
+                                      * Return whether this element
+                                      * implements its hanging node
+                                      * constraints in the new way,
+                                     * which has to be used to make
+                                     * elements "hp compatible".
+                                      *
+                                     * For the FE_DGPNonparametric class the
+                                     * result is always true (independent of
+                                     * the degree of the element), as it has
+                                     * no hanging nodes (being a
+                                     * discontinuous element).
+                                      */
+    virtual bool hp_constraints_are_implemented () const;
+
                                     /**
                                      * Check for non-zero values on a face.
                                      *
@@ -235,6 +301,7 @@ class FE_DGPNonparametric : public FiniteElement<dim>
     virtual unsigned int memory_consumption () const;
 
 
+  private:
                                     /**
                                      * Declare a nested class which
                                      * will hold static definitions of
index f59435a9ebf858d1849a4c6e8e9631e6afd76e36..2f3f252dc2216d00621cd69317901dec6037fdf3 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -122,6 +122,71 @@ class FE_DGQ : public FE_Poly<TensorProductPolynomials<dim>,dim>
     get_interpolation_matrix (const FiniteElement<dim> &source,
                              FullMatrix<double>           &matrix) 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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_face_interpolation_matrix (const FiniteElement<dim> &source,
+                                  FullMatrix<double>       &matrix) 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 @p dofs_per_face times
+                                     * <tt>source.dofs_per_face</tt>.
+                                     *
+                                     * Derived elements will have to
+                                     * implement this function. They
+                                     * may only provide interpolation
+                                     * matrices for certain source
+                                     * finite elements, for example
+                                     * those from the same family. If
+                                     * they don't implement
+                                     * interpolation from a given
+                                     * element, then they must throw
+                                     * an exception of type
+                                     * FiniteElement<dim>::ExcInterpolationNotImplemented.
+                                     */
+    virtual void
+    get_subface_interpolation_matrix (const FiniteElement<dim> &source,
+                                     const unsigned int        subface,
+                                     FullMatrix<double>       &matrix) const;
+
+                                     /**
+                                      * Return whether this element
+                                      * implements its hanging node
+                                      * constraints in the new way,
+                                     * which has to be used to make
+                                     * elements "hp compatible".
+                                      *
+                                     * For the FE_DGQ class the result is
+                                     * always true (independent of the degree
+                                     * of the element), as it has no hanging
+                                     * nodes (being a discontinuous element).
+                                      */
+    virtual bool hp_constraints_are_implemented () const;
+
                                     /**
                                      * Check for non-zero values on a face.
                                      *
index 6cc154f601f4a41918a91bcfc9e28f812909b75d..e2a987bf9596ff1efe893255b11106f24136627d 100644 (file)
@@ -88,6 +88,73 @@ FE_DGP<dim>::get_dpo_vector (const unsigned int deg)
 }
 
 
+
+template <int dim>
+void
+FE_DGP<dim>::
+get_face_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                              FullMatrix<double>       &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGP element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGP<") == 0)
+               ||
+               (dynamic_cast<const FE_DGP<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+void
+FE_DGP<dim>::
+get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                                 const unsigned int ,
+                                 FullMatrix<double>           &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGP element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGP<") == 0)
+               ||
+               (dynamic_cast<const FE_DGP<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+bool
+FE_DGP<dim>::hp_constraints_are_implemented () const
+{
+  return true;
+}
+
+
+
 template <int dim>
 bool
 FE_DGP<dim>::has_support_on_face (const unsigned int,
index 841f588535cc00c6fad52adc5a3fcce80fd73ea2..dc192ea69609121fe2ea507895bb6f7ce0c77b0a 100644 (file)
@@ -250,6 +250,72 @@ FE_DGPMonomial<dim>::get_dpo_vector(unsigned int deg)
 }
 
 
+template <int dim>
+void
+FE_DGPMonomial<dim>::
+get_face_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                              FullMatrix<double>       &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGPMonomial element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGPMonomial<") == 0)
+               ||
+               (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+void
+FE_DGPMonomial<dim>::
+get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                                 const unsigned int ,
+                                 FullMatrix<double>           &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGPMonomial element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGPMonomial<") == 0)
+               ||
+               (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+bool
+FE_DGPMonomial<dim>::hp_constraints_are_implemented () const
+{
+  return true;
+}
+
+
+
 #if deal_II_dimension == 1
 
 template <>
index fe355eccc4c01a9a44ac1a4f676286339ff1294f..f1bc7cc882e42bcdd7f148264cba42c86cc0c6dd 100644 (file)
@@ -419,6 +419,72 @@ FE_DGPNonparametric<dim>::element_multiplicity (const unsigned int index) const
 
 
 
+template <int dim>
+void
+FE_DGPNonparametric<dim>::
+get_face_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                              FullMatrix<double>       &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGPNonparametric element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGPNonparametric<") == 0)
+               ||
+               (dynamic_cast<const FE_DGPNonparametric<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+void
+FE_DGPNonparametric<dim>::
+get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                                 const unsigned int ,
+                                 FullMatrix<double>           &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGPNonparametric element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGPNonparametric<") == 0)
+               ||
+               (dynamic_cast<const FE_DGPNonparametric<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+bool
+FE_DGPNonparametric<dim>::hp_constraints_are_implemented () const
+{
+  return true;
+}
+
+
+
 template <int dim>
 bool
 FE_DGPNonparametric<dim>::has_support_on_face (const unsigned int,
index c7d9df570d46d307f0954a348796e0af23a184bf..e14c20e5240b2110c277390e424b2666f5e37735 100644 (file)
@@ -426,9 +426,71 @@ get_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
 
 
 
-//---------------------------------------------------------------------------
-// Fill data of FEValues
-//---------------------------------------------------------------------------
+template <int dim>
+void
+FE_DGQ<dim>::
+get_face_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                              FullMatrix<double>       &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGQ element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGQ<") == 0)
+               ||
+               (dynamic_cast<const FE_DGQ<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+void
+FE_DGQ<dim>::
+get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
+                                 const unsigned int ,
+                                 FullMatrix<double>           &interpolation_matrix) const
+{
+                                  // this is only implemented, if the source
+                                  // FE is also a DGQ element. in that case,
+                                  // both elements have no dofs on their
+                                  // faces and the face interpolation matrix
+                                  // is necessarily empty -- i.e. there isn't
+                                  // much we need to do here.
+  AssertThrow ((x_source_fe.get_name().find ("FE_DGQ<") == 0)
+               ||
+               (dynamic_cast<const FE_DGQ<dim>*>(&x_source_fe) != 0),
+               typename FiniteElement<dim>::
+               ExcInterpolationNotImplemented());
+  
+  Assert (interpolation_matrix.m() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+  Assert (interpolation_matrix.n() == 0,
+         ExcDimensionMismatch (interpolation_matrix.m(),
+                               0));
+}
+
+
+
+template <int dim>
+bool
+FE_DGQ<dim>::hp_constraints_are_implemented () const
+{
+  return true;
+}
+
+
 
 template <int dim>
 bool

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.