$extrastylesheet
face_inf_quad.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_FACE_INF_QUAD_H
00021 #define LIBMESH_FACE_INF_QUAD_H
00022 
00023 #include "libmesh/libmesh_config.h"
00024 
00025 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
00026 
00027 // Local includes
00028 #include "libmesh/elem.h"
00029 
00030 // C++ includes
00031 
00032 namespace libMesh
00033 {
00034 
00035 
00036 // Forward declarations
00037 
00038 
00039 
00060 class InfQuad : public Elem
00061 {
00062 public:
00063 
00067   explicit
00068   InfQuad (const unsigned int nn,
00069            Elem* p,
00070            Node** nodelinkdata) :
00071     Elem(nn, InfQuad::n_sides(), p, _elemlinks_data, nodelinkdata) {}
00072 
00076   unsigned int dim() const { return 2; }
00077 
00078   //   /**
00079   //    * @returns 2 for the base, 1 otherwise
00080   //    */
00081   //   unsigned int n_children_per_side(const unsigned int s) const;
00082 
00088   unsigned int n_sides() const { return 3; }
00089 
00093   unsigned int n_vertices() const { return 4; }
00094 
00099   unsigned int n_edges() const { return 3; }
00100 
00105   unsigned int n_faces() const { return 0; }
00106 
00110   unsigned int n_children() const { return 2; }
00111 
00112   /*
00113    * @returns true iff the specified child is on the
00114    * specified side
00115    */
00116   virtual bool is_child_on_side(const unsigned int c,
00117                                 const unsigned int s) const;
00118 
00124   dof_id_type key (const unsigned int s) const;
00125 
00130   UniquePtr<Elem> side (const unsigned int i) const;
00131 
00135   UniquePtr<Elem> build_edge (const unsigned int i) const
00136   { return build_side(i); }
00137 
00138   /*
00139    * is_edge_on_side is trivial in 2D
00140    */
00141   virtual bool is_edge_on_side(const unsigned int e,
00142                                const unsigned int s) const
00143   { return (e == s); }
00144 
00149   Real quality (const ElemQuality q) const;
00150 
00156   std::pair<Real, Real> qual_bounds (const ElemQuality q) const;
00157 
00162   bool infinite () const { return true; }
00163 
00167   Point origin () const;
00168 
00169 
00170 protected:
00171 
00175   Elem* _elemlinks_data[4+(LIBMESH_DIM>2)];
00176 };
00177 
00178 
00179 
00180 // ------------------------------------------------------------
00181 // InfQuad class member functions
00182 // inline
00183 // unsigned int InfQuad::n_children_per_side(const unsigned int s) const
00184 // {
00185 //   libmesh_assert_less (s, this->n_sides());
00186 
00187 //   switch (s)
00188 //   {
00189 //     case 0:
00190 //       // every infinite face has 2 children in the base edge
00191 //       return 2;
00192 
00193 //     default:
00194 //       // on infinite edges only 1 child
00195 //       return 1;
00196 //   }
00197 // }
00198 
00199 
00200 
00201 inline
00202 Point InfQuad::origin () const
00203 {
00204   return ( this->point(0)*2 - this->point(this->n_vertices()/2) );
00205 }
00206 
00207 
00208 } // namespace libMesh
00209 
00210 
00211 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
00212 
00213 #endif // LIBMESH_FACE_INF_QUAD_H