edge.h
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 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 00043 // ------------------------------------------------------------ 00044 // Edge class definition 00045 class Edge : public Elem 00046 { 00047 public: 00048 00053 Edge (const unsigned int nn, 00054 Elem* p, 00055 Node** nodelinkdata) : 00056 Elem(nn, Edge::n_sides(), p, _elemlinks_data, nodelinkdata) {} 00057 00061 unsigned int dim () const { return 1; } 00062 00066 unsigned int n_nodes() const { return 2; } 00067 00071 unsigned int n_sides() const { return 2; } 00072 00076 unsigned int n_vertices() const { return 2; } 00077 00081 unsigned int n_edges() const { return 0; } 00082 00086 unsigned int n_faces() const { return 0; } 00087 00091 unsigned int n_children() const { return 2; } 00092 00093 /* 00094 * @returns true iff the specified child is on the 00095 * specified side 00096 */ 00097 virtual bool is_child_on_side(const unsigned int c, 00098 const unsigned int s) const; 00099 00100 /* 00101 * @returns true iff the specified edge is on the specified side 00102 */ 00103 virtual bool is_edge_on_side(const unsigned int, 00104 const unsigned int) const 00105 { return false; } 00106 00107 /* 00108 * @returns the side number opposite to \p s (for a tensor product 00109 * element), or throws an error otherwise. 00110 */ 00111 virtual unsigned int opposite_side(const unsigned int s) const; 00112 00113 /* 00114 * @returns the local node number for the node opposite to node n 00115 * on side \p opposite_side(s) (for a tensor product element), or 00116 * throws an error otherwise. 00117 */ 00118 virtual unsigned int opposite_node(const unsigned int n, 00119 const unsigned int s) const; 00120 00121 // /** 00122 // * @returns 1 00123 // */ 00124 // unsigned int n_children_per_side(const unsigned int) const { return 1; } 00125 00131 dof_id_type key (const unsigned int s) const 00132 { return this->compute_key(this->node(s)); } 00133 00138 AutoPtr<Elem> side (const unsigned int i) const; 00139 00144 AutoPtr<Elem> build_side (const unsigned int i, 00145 bool proxy) const; 00146 00150 AutoPtr<Elem> build_edge (const unsigned int) const 00151 //{ libmesh_assert_less (i, n_nodes()); AutoPtr<DofObject> ap(new Node(*get_node(i))); return ap; } 00152 { libmesh_error(); AutoPtr<Elem> ap(NULL); return ap; } 00153 00154 00155 protected: 00156 00160 Elem* _elemlinks_data[3+(LIBMESH_DIM>1)]; 00161 00162 #ifdef LIBMESH_ENABLE_AMR 00163 00167 unsigned int side_children_matrix (const unsigned int, 00168 const unsigned int) const 00169 { libmesh_error(); return 0; } 00170 00171 #endif 00172 00173 }; 00174 00175 00176 00177 00178 00179 // ------------------------------------------------------------ 00180 // Edge class member functions 00181 00182 } // namespace libMesh 00183 00184 #endif // LIBMESH_EDGE_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:46 UTC
Hosted By: