face_inf_quad.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_FACE_INF_QUAD_H
21 #define LIBMESH_FACE_INF_QUAD_H
22 
23 #include "libmesh/libmesh_config.h"
24 
25 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
26 
27 // Local includes
28 #include "libmesh/elem.h"
29 
30 // C++ includes
31 
32 namespace libMesh
33 {
34 
35 
36 // Forward declarations
37 
38 
39 
60 // ------------------------------------------------------------
61 // InfQuad class definition
62 class InfQuad : public Elem
63 {
64 public:
65 
69  explicit
70  InfQuad (const unsigned int nn,
71  Elem* p,
72  Node** nodelinkdata) :
73  Elem(nn, InfQuad::n_sides(), p, _elemlinks_data, nodelinkdata) {}
74 
78  unsigned int dim() const { return 2; }
79 
80 // /**
81 // * @returns 2 for the base, 1 otherwise
82 // */
83 // unsigned int n_children_per_side(const unsigned int s) const;
84 
90  unsigned int n_sides() const { return 3; }
91 
95  unsigned int n_vertices() const { return 4; }
96 
101  unsigned int n_edges() const { return 3; }
102 
107  unsigned int n_faces() const { return 0; }
108 
112  unsigned int n_children() const { return 2; }
113 
114  /*
115  * @returns true iff the specified child is on the
116  * specified side
117  */
118  virtual bool is_child_on_side(const unsigned int c,
119  const unsigned int s) const;
120 
126  dof_id_type key (const unsigned int s) const;
127 
132  AutoPtr<Elem> side (const unsigned int i) const;
133 
137  AutoPtr<Elem> build_edge (const unsigned int i) const
138  { return build_side(i); }
139 
140  /*
141  * is_edge_on_side is trivial in 2D
142  */
143  virtual bool is_edge_on_side(const unsigned int e,
144  const unsigned int s) const
145  { return (e == s); }
146 
151  Real quality (const ElemQuality q) const;
152 
158  std::pair<Real, Real> qual_bounds (const ElemQuality q) const;
159 
164  bool infinite () const { return true; }
165 
169  Point origin () const;
170 
171 
172 protected:
173 
177  Elem* _elemlinks_data[4+(LIBMESH_DIM>2)];
178 };
179 
180 
181 
182 // ------------------------------------------------------------
183 // InfQuad class member functions
184 // inline
185 // unsigned int InfQuad::n_children_per_side(const unsigned int s) const
186 // {
187 // libmesh_assert_less (s, this->n_sides());
188 
189 // switch (s)
190 // {
191 // case 0:
192 // // every infinite face has 2 children in the base edge
193 // return 2;
194 
195 // default:
196 // // on infinite edges only 1 child
197 // return 1;
198 // }
199 // }
200 
201 
202 
203 inline
205 {
206  return ( this->point(0)*2 - this->point(this->n_vertices()/2) );
207 }
208 
209 
210 } // namespace libMesh
211 
212 
213 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
214 
215 #endif // LIBMESH_FACE_INF_QUAD_H

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

Hosted By:
SourceForge.net Logo