libMesh
Classes | Functions | Variables
fe_test.h File Reference

Go to the source code of this file.

Classes

class  SkewFunc
 
class  FETestBase< order, family, elem_type, build_nx >
 
class  FETest< order, family, elem_type >
 

Functions

Number linear_test (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Gradient linear_test_grad (const Point &, const Parameters &, const std::string &, const std::string &)
 
Number quadratic_test (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Gradient quadratic_test_grad (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Number fe_cubic_test (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Gradient fe_cubic_test_grad (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Number fe_quartic_test (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Gradient fe_quartic_test_grad (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Number rational_test (const Point &p, const Parameters &, const std::string &, const std::string &)
 
Gradient rational_test_grad (const Point &p, const Parameters &, const std::string &, const std::string &)
 

Variables

static const Real rational_w = 0.75
 

Function Documentation

◆ fe_cubic_test()

Number fe_cubic_test ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 131 of file fe_test.h.

References libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp(), FESideTest< order, family, elem_type >::testU(), and FETest< order, family, elem_type >::testU().

135 {
136  const Real & x = p(0);
137  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
138  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
139 
140  return x*(1-x)*(1-x) + x*x*(1-y) + x*(1-y)*(1-z) + y*(1-y)*z + z*(1-z)*(1-z);
141 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ fe_cubic_test_grad()

Gradient fe_cubic_test_grad ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 144 of file fe_test.h.

References libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp(), and FETestBase< order, family, elem_type, 1 >::true_gradient().

148 {
149  const Real & x = p(0);
150  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
151  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
152 
153  Gradient grad = 3*x*x-4*x+1 + 2*x*(1-y) + (1-y)*(1-z);
154  if (LIBMESH_DIM > 1)
155  grad(1) = -x*x - x*(1-z) + (1-2*y)*z;
156  if (LIBMESH_DIM > 2)
157  grad(2) = -x*(1-y) + y*(1-y) + 3*z*z-4*z+1;
158 
159  return grad;
160 }
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ fe_quartic_test()

Number fe_quartic_test ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 164 of file fe_test.h.

References libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp(), FESideTest< order, family, elem_type >::testU(), and FETest< order, family, elem_type >::testU().

168 {
169  const Real & x = p(0);
170  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
171  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
172 
173  return x*x*(1-x)*(1-x) + x*x*z*(1-y) + x*(1-x)*(1-y)*(1-z) + (1-x)*y*(1-y)*z + z*z*(1-z)*(1-z);
174 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ fe_quartic_test_grad()

Gradient fe_quartic_test_grad ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 177 of file fe_test.h.

References libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp(), and FETestBase< order, family, elem_type, 1 >::true_gradient().

181 {
182  const Real & x = p(0);
183  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
184  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
185 
186  Gradient grad = 4*x*x*x-6*x*x+2*x + 2*x*z*(1-y) + (1-2*x)*(1-y)*(1-z) - y*(1-y)*z;
187  if (LIBMESH_DIM > 1)
188  grad(1) = -x*x*z - x*(1-x)*(1-z) + (1-x)*(1-2*y)*z;
189  if (LIBMESH_DIM > 2)
190  grad(2) = x*x*(1-y) - x*(1-x)*(1-y) + (1-x)*y*(1-y) + 4*z*z*z-6*z*z+2*z;
191 
192  return grad;
193 }
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ linear_test()

Number linear_test ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 69 of file fe_test.h.

References libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp().

73 {
74  const Real & x = p(0);
75  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
76  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
77 
78  return x + 0.25*y + 0.0625*z;
79 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ linear_test_grad()

Gradient linear_test_grad ( const Point ,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 82 of file fe_test.h.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp().

86 {
87  Gradient grad = 1;
88  if (LIBMESH_DIM > 1)
89  grad(1) = 0.25;
90  if (LIBMESH_DIM > 2)
91  grad(2) = 0.0625;
92 
93  return grad;
94 }
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.

◆ quadratic_test()

Number quadratic_test ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 98 of file fe_test.h.

References libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp().

102 {
103  const Real & x = p(0);
104  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
105  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
106 
107  return x*x + 0.5*y*y + 0.25*z*z + 0.125*x*y + 0.0625*x*z + 0.03125*y*z;
108 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ quadratic_test_grad()

Gradient quadratic_test_grad ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 111 of file fe_test.h.

References libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp().

115 {
116  const Real & x = p(0);
117  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
118  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
119 
120  Gradient grad = 2*x + 0.125*y + 0.0625*z;
121  if (LIBMESH_DIM > 1)
122  grad(1) = y + 0.125*x + 0.03125*z;
123  if (LIBMESH_DIM > 2)
124  grad(2) = 0.5*z + 0.0625*x + 0.03125*y;
125 
126  return grad;
127 }
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ rational_test()

Number rational_test ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 203 of file fe_test.h.

References rational_w, and libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp(), FESideTest< order, family, elem_type >::testU(), and FETest< order, family, elem_type >::testU().

207 {
208  const Real & x = p(0);
209  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
210  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
211 
212  const Real denom = ((1-x)*(1-x)+x*x+2*rational_w*x*(1-x))*
213  ((1-y)*(1-y)+y*y+2*rational_w*y*(1-y))*
214  ((1-z)*(1-z)+z*z+2*rational_w*z*(1-z));
215 
216  return (x + 0.25*y + 0.0625*z)/denom;
217 }
static const Real rational_w
Definition: fe_test.h:200
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ rational_test_grad()

Gradient rational_test_grad ( const Point p,
const Parameters ,
const std::string &  ,
const std::string &   
)
inline

Definition at line 220 of file fe_test.h.

References rational_w, and libMesh::Real.

Referenced by FETestBase< order, family, elem_type, 1 >::setUp(), and FETestBase< order, family, elem_type, 1 >::true_gradient().

224 {
225  const Real & x = p(0);
226  const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
227  const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
228 
229  const Real xpoly = (1-x)*(1-x)+x*x+2*rational_w*x*(1-x);
230  const Real xderiv = -2*(1-x)+2*x+2*rational_w*(1-2*x);
231  const Real ypoly = (1-y)*(1-y)+y*y+2*rational_w*y*(1-y);
232  const Real yderiv = -2*(1-y)+2*y+2*rational_w*(1-2*y);
233  const Real zpoly = (1-z)*(1-z)+z*z+2*rational_w*z*(1-z);
234  const Real zderiv = -2*(1-z)+2*z+2*rational_w*(1-2*z);
235 
236  const Real denom = xpoly * ypoly * zpoly;
237 
238  const Real numer = (x + 0.25*y + 0.0625*z);
239 
240  Gradient grad_n = 1, grad_d = xderiv * ypoly * zpoly;
241  if (LIBMESH_DIM > 1)
242  {
243  grad_n(1) = 0.25;
244  grad_d(1) = xpoly * yderiv * zpoly;
245  }
246  if (LIBMESH_DIM > 2)
247  {
248  grad_n(2) = 0.0625;
249  grad_d(2) = xpoly * ypoly * zderiv;
250  }
251 
252  Gradient grad = (grad_n - numer * grad_d / denom) / denom;
253 
254  return grad;
255 }
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
static const Real rational_w
Definition: fe_test.h:200
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Variable Documentation

◆ rational_w

const Real rational_w = 0.75
static