From: Wolfgang Bangerth Date: Thu, 30 Apr 1998 14:13:48 +0000 (+0000) Subject: Move diameter function to where it really belongs. X-Git-Tag: v8.0.0~23027 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f8e6cda72a2a172f2c40b8f19df37d4b6d10920;p=dealii.git Move diameter function to where it really belongs. git-svn-id: https://svn.dealii.org/trunk@227 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index 2b2679072c..ab626c4301 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -208,15 +208,6 @@ class DoFLineAccessor : public DoFAccessor, public BaseClass { */ void get_dof_indices (vector &dof_indices) const; - /** - * Return the length of the line. If the - * line describes part of the boundary - * and is not a straight one, ask the - * finite element class for the correct - * length! - */ - double diameter () const; - /** * Return the #i#th child as a DoF line * iterator. This function is needed since @@ -303,18 +294,6 @@ class DoFQuadAccessor : public DoFAccessor, public BaseClass { */ void get_dof_indices (vector &dof_indices) const; - /** - * Return the diameter of the quad. If the - * quad describes part of the boundary - * and is not a plane one, ask the - * finite element class for the correct - * length! - * - * The diameter of a quad is computed to - * be the larger of the two diagonals. - */ - double diameter () const; - /** * Return a pointer to the #i#th line * bounding this #Quad#. diff --git a/deal.II/deal.II/include/grid/tria_accessor.h b/deal.II/deal.II/include/grid/tria_accessor.h index 14f4040a1c..16e94db21a 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.h +++ b/deal.II/deal.II/include/grid/tria_accessor.h @@ -413,6 +413,15 @@ class LineAccessor : public TriaAccessor { * boundary or not. */ bool at_boundary () const; + + /** + * Return the length of the line. If the + * line describes part of the boundary + * and is not a straight one, ask the + * finite element class for the correct + * length! + */ + double diameter () const; private: /** @@ -637,7 +646,23 @@ class QuadAccessor : public TriaAccessor { * boundary or not. */ bool at_boundary () const; - + /** + * Return the diameter of the quad. If the + * quad describes part of the boundary + * and is not a plane one, ask the + * finite element class for the correct + * length! + * + * The diameter of a quad is computed to + * be the larger of the two diagonals. You + * should absolutely be clear about the + * fact that this definitely is not the + * diameter of all quadrilaterals; however + * it may serve as an approximation and + * is exact in many cases. + */ + double diameter () const; + private: /** * Copy operator. This is normally diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index d64c873881..e2e620dc0a 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -101,14 +101,6 @@ DoFLineAccessor::get_dof_indices (vector &dof_indices) const -template -double -DoFLineAccessor::diameter () const { - return sqrt((vertex(1)-vertex(0)).square()); -}; - - - template TriaIterator > DoFLineAccessor::child (const unsigned int i) const { @@ -223,16 +215,6 @@ DoFQuadAccessor::get_dof_indices (vector &dof_indices) const -template -double -DoFQuadAccessor::diameter () const { - return sqrt(max((vertex(2)-vertex(0)).square(), - (vertex(3)-vertex(1)).square())); -}; - - - - template TriaIterator > > DoFQuadAccessor::line (const unsigned int i) const { diff --git a/deal.II/deal.II/source/grid/tria_accessor.cc b/deal.II/deal.II/source/grid/tria_accessor.cc index b95739c01b..cd609f7d7c 100644 --- a/deal.II/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/deal.II/source/grid/tria_accessor.cc @@ -270,6 +270,15 @@ bool LineAccessor::at_boundary () const { +template +double LineAccessor::diameter () const { + return sqrt((vertex(1)-vertex(0)).square()); +}; + + + + + template class LineAccessor<1>; template class LineAccessor<2>; @@ -497,6 +506,18 @@ bool QuadAccessor::at_boundary () const { }; + +template +double QuadAccessor::diameter () const { + return sqrt(max((vertex(2)-vertex(0)).square(), + (vertex(3)-vertex(1)).square())); +}; + + + + + + template class QuadAccessor<2>;