edge.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_EDGE_H
21 #define LIBMESH_EDGE_H
22 
23 // Local includes
24 #include "libmesh/elem.h"
25 
26 // C++ includes
27 #include <cstddef>
28 
29 namespace libMesh
30 {
31 
32 
33 // Forward declarations
34 class Mesh;
35 
36 
37 
43 // ------------------------------------------------------------
44 // Edge class definition
45 class Edge : public Elem
46 {
47  public:
48 
53  Edge (const unsigned int nn,
54  Elem* p,
55  Node** nodelinkdata) :
56  Elem(nn, Edge::n_sides(), p, _elemlinks_data, nodelinkdata) {}
57 
61  unsigned int dim () const { return 1; }
62 
66  unsigned int n_nodes() const { return 2; }
67 
71  unsigned int n_sides() const { return 2; }
72 
76  unsigned int n_vertices() const { return 2; }
77 
81  unsigned int n_edges() const { return 0; }
82 
86  unsigned int n_faces() const { return 0; }
87 
91  unsigned int n_children() const { return 2; }
92 
93  /*
94  * @returns true iff the specified child is on the
95  * specified side
96  */
97  virtual bool is_child_on_side(const unsigned int c,
98  const unsigned int s) const;
99 
100  /*
101  * @returns true iff the specified edge is on the specified side
102  */
103  virtual bool is_edge_on_side(const unsigned int,
104  const unsigned int) const
105  { return false; }
106 
107  /*
108  * @returns the side number opposite to \p s (for a tensor product
109  * element), or throws an error otherwise.
110  */
111  virtual unsigned int opposite_side(const unsigned int s) const;
112 
113  /*
114  * @returns the local node number for the node opposite to node n
115  * on side \p opposite_side(s) (for a tensor product element), or
116  * throws an error otherwise.
117  */
118  virtual unsigned int opposite_node(const unsigned int n,
119  const unsigned int s) const;
120 
121 // /**
122 // * @returns 1
123 // */
124 // unsigned int n_children_per_side(const unsigned int) const { return 1; }
125 
131  dof_id_type key (const unsigned int s) const
132  { return this->compute_key(this->node(s)); }
133 
138  AutoPtr<Elem> side (const unsigned int i) const;
139 
144  AutoPtr<Elem> build_side (const unsigned int i,
145  bool proxy) const;
146 
150  AutoPtr<Elem> build_edge (const unsigned int) const
151  //{ libmesh_assert_less (i, n_nodes()); AutoPtr<DofObject> ap(new Node(*get_node(i))); return ap; }
152  { libmesh_error(); AutoPtr<Elem> ap(NULL); return ap; }
153 
154 
155  protected:
156 
160  Elem* _elemlinks_data[3+(LIBMESH_DIM>1)];
161 
162 #ifdef LIBMESH_ENABLE_AMR
163 
167  unsigned int side_children_matrix (const unsigned int,
168  const unsigned int) const
169  { libmesh_error(); return 0; }
170 
171 #endif
172 
173 };
174 
175 
176 
177 
178 
179 // ------------------------------------------------------------
180 // Edge class member functions
181 
182 } // namespace libMesh
183 
184 #endif // LIBMESH_EDGE_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:04 UTC

Hosted By:
SourceForge.net Logo