$extrastylesheet
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_H 00021 #define LIBMESH_EDGE_H 00022 00023 // Local includes 00024 #include "libmesh/elem.h" 00025 00026 // C++ includes 00027 #include <cstddef> 00028 00029 namespace libMesh 00030 { 00031 00032 00033 // Forward declarations 00034 class Mesh; 00035 00036 00037 00042 class Edge : public Elem 00043 { 00044 public: 00045 00050 Edge (const unsigned int nn, 00051 Elem* p, 00052 Node** nodelinkdata) : 00053 Elem(nn, Edge::n_sides(), p, _elemlinks_data, nodelinkdata) {} 00054 00058 unsigned int dim () const { return 1; } 00059 00063 unsigned int n_nodes() const { return 2; } 00064 00068 unsigned int n_sides() const { return 2; } 00069 00073 unsigned int n_vertices() const { return 2; } 00074 00078 unsigned int n_edges() const { return 0; } 00079 00083 unsigned int n_faces() const { return 0; } 00084 00088 unsigned int n_children() const { return 2; } 00089 00090 /* 00091 * @returns true iff the specified child is on the 00092 * specified side 00093 */ 00094 virtual bool is_child_on_side(const unsigned int c, 00095 const unsigned int s) const; 00096 00097 /* 00098 * @returns true iff the specified edge is on the specified side 00099 */ 00100 virtual bool is_edge_on_side(const unsigned int, 00101 const unsigned int) const 00102 { return false; } 00103 00104 /* 00105 * @returns the side number opposite to \p s (for a tensor product 00106 * element), or throws an error otherwise. 00107 */ 00108 virtual unsigned int opposite_side(const unsigned int s) const; 00109 00110 /* 00111 * @returns the local node number for the node opposite to node n 00112 * on side \p opposite_side(s) (for a tensor product element), or 00113 * throws an error otherwise. 00114 */ 00115 virtual unsigned int opposite_node(const unsigned int n, 00116 const unsigned int s) const; 00117 00118 // /** 00119 // * @returns 1 00120 // */ 00121 // unsigned int n_children_per_side(const unsigned int) const { return 1; } 00122 00128 dof_id_type key (const unsigned int s) const 00129 { return this->compute_key(this->node(s)); } 00130 00135 UniquePtr<Elem> side (const unsigned int i) const; 00136 00141 UniquePtr<Elem> build_side (const unsigned int i, 00142 bool proxy) const; 00143 00147 UniquePtr<Elem> build_edge (const unsigned int) const 00148 { libmesh_not_implemented(); return UniquePtr<Elem>(); } 00149 00150 00151 protected: 00152 00156 Elem* _elemlinks_data[3+(LIBMESH_DIM>1)]; 00157 00158 #ifdef LIBMESH_ENABLE_AMR 00159 00163 unsigned int side_children_matrix (const unsigned int, 00164 const unsigned int) const 00165 { libmesh_not_implemented(); return 0; } 00166 00167 #endif 00168 00169 }; 00170 00171 00172 00173 00174 00175 // ------------------------------------------------------------ 00176 // Edge class member functions 00177 00178 } // namespace libMesh 00179 00180 #endif // LIBMESH_EDGE_H