face_inf_quad.C
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 // Local includes
20 #include "libmesh/libmesh_config.h"
21 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
22 
23 // C++ includes
24 
25 // Local includes cont'd
26 #include "libmesh/face_inf_quad.h"
27 #include "libmesh/edge_edge2.h"
28 #include "libmesh/edge_inf_edge2.h"
29 
30 namespace libMesh
31 {
32 
33 
34 // ------------------------------------------------------------
35 // InfQuad class member functions
36 dof_id_type InfQuad::key (const unsigned int s) const
37 {
38  libmesh_assert_less (s, this->n_sides());
39 
40 
41  switch (s)
42  {
43  case 0:
44 
45  return
46  this->compute_key (this->node(0),
47  this->node(1));
48 
49  case 1:
50 
51  return
52  this->compute_key (this->node(1),
53  this->node(3));
54 
55  case 2:
56 
57  return
58  this->compute_key (this->node(0),
59  this->node(2));
60  }
61 
62  // We will never get here... Look at the code above.
63  libmesh_error();
64  return 0;
65 }
66 
67 
68 
69 AutoPtr<Elem> InfQuad::side (const unsigned int i) const
70 {
71  libmesh_assert_less (i, this->n_sides());
72 
73 
74  switch (i)
75  {
76  case 0:
77  {
78  // base face
79  Edge2* edge = new Edge2;
80 
81  edge->set_node(0) = this->get_node(0);
82  edge->set_node(1) = this->get_node(1);
83 
84  AutoPtr<Elem> ap(edge); return ap;
85  }
86 
87  case 1:
88  {
89  // adjacent to another infinite element
90  InfEdge2* edge = new InfEdge2;
91 
92  edge->set_node(0) = this->get_node(1);
93  edge->set_node(1) = this->get_node(3);
94 
95  AutoPtr<Elem> ap(edge); return ap;
96  }
97 
98  case 2:
99  {
100  // adjacent to another infinite element
101  InfEdge2* edge = new InfEdge2;
102 
103  edge->set_node(0) = this->get_node(0); // be aware of swapped nodes,
104  edge->set_node(1) = this->get_node(2); // compared to conventional side numbering
105 
106  AutoPtr<Elem> ap(edge); return ap;
107  }
108 
109  default:
110  {
111  libmesh_error();
112  AutoPtr<Elem> ap(NULL); return ap;
113  }
114  }
115 
116  // We will never get here... Look at the code above.
117  libmesh_error();
118  AutoPtr<Elem> ap(NULL); return ap;
119 }
120 
121 
122 
123 bool InfQuad::is_child_on_side(const unsigned int c,
124  const unsigned int s) const
125 {
126  libmesh_assert_less (c, this->n_children());
127  libmesh_assert_less (s, this->n_sides());
128 
129  return (s == 0 || s == c+1);
130 }
131 
132 
133 
135 {
136  return 0.; // Not implemented
137 }
138 
139 
140 
141 
142 std::pair<Real, Real> InfQuad::qual_bounds (const ElemQuality q) const
143 {
144  std::pair<Real, Real> bounds;
145 
146  switch (q)
147  {
148 
149  case ASPECT_RATIO:
150  bounds.first = 1.;
151  bounds.second = 4.;
152  break;
153 
154  case SKEW:
155  bounds.first = 0.;
156  bounds.second = 0.5;
157  break;
158 
159  case TAPER:
160  bounds.first = 0.;
161  bounds.second = 0.7;
162  break;
163 
164  case WARP:
165  bounds.first = 0.9;
166  bounds.second = 1.;
167  break;
168 
169  case STRETCH:
170  bounds.first = 0.25;
171  bounds.second = 1.;
172  break;
173 
174  case MIN_ANGLE:
175  bounds.first = 45.;
176  bounds.second = 90.;
177  break;
178 
179  case MAX_ANGLE:
180  bounds.first = 90.;
181  bounds.second = 135.;
182  break;
183 
184  case CONDITION:
185  bounds.first = 1.;
186  bounds.second = 4.;
187  break;
188 
189  case JACOBIAN:
190  bounds.first = 0.5;
191  bounds.second = 1.;
192  break;
193 
194  case SHEAR:
195  case SHAPE:
196  case SIZE:
197  bounds.first = 0.3;
198  bounds.second = 1.;
199  break;
200 
201  case DISTORTION:
202  bounds.first = 0.6;
203  bounds.second = 1.;
204  break;
205 
206  default:
207  libMesh::out << "Warning: Invalid quality measure chosen." << std::endl;
208  bounds.first = -1;
209  bounds.second = -1;
210  }
211 
212  return bounds;
213 }
214 
215 } // namespace libMesh
216 
217 
218 
219 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS

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

Hosted By:
SourceForge.net Logo