$extrastylesheet
edge_edge2.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_EDGE_EDGE2_H
00021 #define LIBMESH_EDGE_EDGE2_H
00022 
00023 // Local includes
00024 #include "libmesh/libmesh_common.h"
00025 #include "libmesh/edge.h"
00026 
00027 // C++ includes
00028 #include <cstddef>
00029 
00030 namespace libMesh
00031 {
00032 
00033 
00043 class Edge2 : public Edge
00044 {
00045 public:
00046 
00050   explicit
00051   Edge2 (Elem* p=NULL) :
00052     Edge(Edge2::n_nodes(), p, _nodelinks_data) {}
00053 
00057   unsigned int n_sub_elem() const { return 1; }
00058 
00062   virtual bool is_vertex(const unsigned int i) const;
00063 
00067   virtual bool is_edge(const unsigned int i) const;
00068 
00072   virtual bool is_face(const unsigned int i) const;
00073 
00074   /*
00075    * @returns true iff the specified (local) node number is on the
00076    * specified side
00077    */
00078   virtual bool is_node_on_side(const unsigned int n,
00079                                const unsigned int s) const;
00080 
00081   /*
00082    * @returns true iff the specified (local) node number is on the
00083    * specified edge (i.e. "returns true" in 1D)
00084    */
00085   virtual bool is_node_on_edge(const unsigned int n,
00086                                const unsigned int e) const;
00087 
00088   /*
00089    * @returns true iff the element map is definitely affine within
00090    * numerical tolerances
00091    */
00092   virtual bool has_affine_map () const { return true; }
00093 
00098   virtual bool is_linear () const { return true; }
00099 
00103   ElemType type()  const { return EDGE2; }
00104 
00108   Order default_order() const { return FIRST; }
00109 
00110   virtual void connectivity(const unsigned int sc,
00111                             const IOPackage iop,
00112                             std::vector<dof_id_type>& conn) const;
00113 
00117   virtual Real volume () const;
00118 
00119 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
00120 
00124   bool infinite () const { return false; }
00125 
00126 #endif
00127 
00128 
00129 protected:
00130 
00134   Node* _nodelinks_data[2];
00135 
00136 
00137 
00138 #ifdef LIBMESH_ENABLE_AMR
00139 
00143   float embedding_matrix (const unsigned int i,
00144                           const unsigned int j,
00145                           const unsigned int k) const
00146   { return _embedding_matrix[i][j][k]; }
00147 
00152   static const float _embedding_matrix[2][2][2];
00153 
00154 #endif
00155 };
00156 
00157 } // namespace libMesh
00158 
00159 
00160 #endif // LIBMESH_EDGE_EDGE2_H