From b36ac804bdcd325629e1353b4814302a8d4db401 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 5 May 1998 08:53:03 +0000 Subject: [PATCH] Small changes and doc update. git-svn-id: https://svn.dealii.org/trunk@247 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe.h | 71 +++++++++++++++++- deal.II/deal.II/include/fe/fe_lib.lagrange.h | 78 ++++++++++++++++++++ deal.II/deal.II/include/fe/fe_update_flags.h | 10 +++ deal.II/deal.II/include/fe/fe_values.h | 16 ++++ 4 files changed, 172 insertions(+), 3 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe.h b/deal.II/deal.II/include/fe/fe.h index ea4ab81732..09a9dba0f2 100644 --- a/deal.II/deal.II/include/fe/fe.h +++ b/deal.II/deal.II/include/fe/fe.h @@ -572,8 +572,8 @@ class FiniteElement : public FiniteElementBase { * elements. * * This function is more or less an - * interface to the #FEValues# class and - * should not be used by users unless + * interface to the #FEFaceValues# class + * and should not be used by users unless * absolutely needed. */ virtual void fill_fe_face_values (const DoFHandler::cell_iterator &cell, @@ -592,6 +592,34 @@ class FiniteElement : public FiniteElementBase { const bool compute_normal_vectors, const Boundary &boundary) const; + /** + * This function does almost the same as + * the above one, with the difference that + * it considers the restriction of a finite + * element to a subface (the child of a + * face) rather than to a face. The number + * of the subface in the face is given by + * the #subface_no# parameter. The meaning + * of the other parameters is the same as + * for the #fill_fe_face_values# function. + * + * Since the usage of ansatz points on + * subfaces is not useful, it is excluded + * from the interface to this function. + * + * Like for the #fill_fe_face_values# + * function, there is a default + * implementation, using the + * #fill_fe_values# function. There may + * be better and more efficient solutions + * for a special finite element, which is + * why this function is made virtual. + * + * This function is more or less an + * interface to the #FESubfaceValues# class + * and should not be used by users unless + * absolutely needed. + */ virtual void fill_fe_subface_values (const DoFHandler::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, @@ -663,6 +691,23 @@ class FiniteElement : public FiniteElementBase { const vector > &unit_points, vector &face_jacobi_determinants) const =0; + /** + * Does the same as the above function, + * except that it computes the Jacobi + * determinant of the transformation from + * the unit face to the subface of #face# + * with number #subface_no#. + * + * The function needs not take special care + * about boundary approximation, since it + * must not be called for faces at the + * boundary. + */ + virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + const unsigned int subface_no, + const vector > &unit_points, + vector &face_jacobi_determinants) const =0; + /** * Compute the normal vectors to the cell * at the quadrature points. See the @@ -681,7 +726,23 @@ class FiniteElement : public FiniteElementBase { const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const =0; - + + /** + * Does the same as the above function, + * except that it refers to the + * subface #subface_no# of the given face. + * + * The function needs not take special care + * about boundary approximation, since it + * must not be called for faces at the + * boundary. + */ + virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const vector > &unit_points, + vector > &normal_vectors) const =0; + /** * Exception */ @@ -690,6 +751,10 @@ class FiniteElement : public FiniteElementBase { * Exception */ DeclException0 (ExcNotImplemented); + /** + * Exception + */ + DeclException0 (ExcBoundaryFaceUsed); }; diff --git a/deal.II/deal.II/include/fe/fe_lib.lagrange.h b/deal.II/deal.II/include/fe/fe_lib.lagrange.h index b340857559..1ffbf129b9 100644 --- a/deal.II/deal.II/include/fe/fe_lib.lagrange.h +++ b/deal.II/deal.II/include/fe/fe_lib.lagrange.h @@ -78,6 +78,9 @@ class FELinear : public FiniteElement { /** * Refer to the base class for detailed * information on this function. + * + * In two spatial dimensions, this function + * simply returns the length of the face. */ virtual void get_face_jacobians (const DoFHandler::face_iterator &face, const Boundary &boundary, @@ -85,6 +88,22 @@ class FELinear : public FiniteElement { vector &face_jacobi_determinants) const; /** + * Refer to the base class for detailed + * information on this function. + * + * In two spatial dimensions, this function + * simply returns half the length of the + * whole face. + */ + virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + const unsigned int subface_no, + const vector > &unit_points, + vector &face_jacobi_determinants) const; + + /** + * Return the normal vectors to the + * face with number #face_no# of #cell#. + * * For linear finite elements, this function * is particularly simple since all normal * vectors are equal and can easiliy be @@ -100,6 +119,27 @@ class FELinear : public FiniteElement { const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const; + + /** + * Return the normal vectors to the + * subface with number #subface_no# of + * the face with number #face_no# of #cell#. + * + * For linear finite elements, this function + * is particularly simple since all normal + * vectors are equal and can easiliy be + * computed from the direction of the face + * without using the transformation (Jacobi) + * matrix, at least for two dimensions. + * + * Refer to the base class for detailed + * information on this function. + */ + virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const vector > &unit_points, + vector > &normal_vectors) const; }; @@ -167,6 +207,15 @@ class FEQuadratic : public FiniteElement { const vector > &unit_points, vector &face_jacobi_determinants) const; + /** + * Refer to the base class for detailed + * information on this function. + */ + virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + const unsigned int subface_no, + const vector > &unit_points, + vector &face_jacobi_determinants) const; + /** * Refer to the base class for detailed * information on this function. @@ -176,6 +225,16 @@ class FEQuadratic : public FiniteElement { const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const; + + /** + * Refer to the base class for detailed + * information on this function. + */ + virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + const unsigned int subface_no, + const unsigned int face_no, + const vector > &unit_points, + vector > &normal_vectors) const; }; @@ -243,6 +302,15 @@ class FECubic : public FiniteElement { const vector > &unit_points, vector &face_jacobi_determinants) const; + /** + * Refer to the base class for detailed + * information on this function. + */ + virtual void get_subface_jacobians (const DoFHandler::face_iterator &face, + const unsigned int subface_no, + const vector > &unit_points, + vector &face_jacobi_determinants) const; + /** * Refer to the base class for detailed * information on this function. @@ -252,6 +320,16 @@ class FECubic : public FiniteElement { const Boundary &boundary, const vector > &unit_points, vector > &normal_vectors) const; + + /** + * Refer to the base class for detailed + * information on this function. + */ + virtual void get_normal_vectors (const DoFHandler::cell_iterator &cell, + const unsigned int subface_no, + const unsigned int face_no, + const vector > &unit_points, + vector > &normal_vectors) const; }; diff --git a/deal.II/deal.II/include/fe/fe_update_flags.h b/deal.II/deal.II/include/fe/fe_update_flags.h index 1a464f2878..f333d9d532 100644 --- a/deal.II/deal.II/include/fe/fe_update_flags.h +++ b/deal.II/deal.II/include/fe/fe_update_flags.h @@ -46,6 +46,11 @@ enum UpdateFlags { * Compute the points on the real cell * on which the ansatz functions are * located. + * + * Giving this flag to the + * #FESubfaceValues# class will result + * in an error, since ansatz points are + * not useful in that case. */ update_ansatz_points = 16, /** @@ -53,6 +58,11 @@ enum UpdateFlags { * to the face relative to this cell. * This flag is only evaluated by * the #FEFaceValues# class. + * + * Giving this flag to the + * #FEValues# class will result in + * an error, since normal vectors are + * not useful in that case. */ update_normal_vectors = 32 }; diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 3a527f1e22..b69eb9ba88 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -897,6 +897,17 @@ class FEFaceValues : public FEFaceValuesBase { quadrature points on the unit cell, which are stored in the #unit_quadrature_points# array. Note that #1<<(dim-1)# is the number of subfaces per face. + + One subtle problem is that if a face is at the boundary, then computation + of subfaces may be a bit tricky, since we do not know whether the user + intends to better approximate the boundary by the subfaces or only wants + to have the subfaces be one part of the mother face. However, it is hardly + conceivable what someone wants when using this class for faces at the + boundary, in the end this class was invented to facilitate integration + along faces with cells of different refinement levels on both sides, + integration along the boundary of the domain is better done through + the #FEFaceValues# class. For this reason, calling #reinit# with a + boundary face will result in an error. @author Wolfgang Bangerth, 1998 */ @@ -947,6 +958,11 @@ class FESubfaceValues : public FEFaceValuesBase { const unsigned int subface_no, const FiniteElement &fe, const Boundary &boundary); + + /** + * Exception + */ + DeclException0 (ExcReinitCalledWithBoundaryFace); }; -- 2.39.5