SingleElement Namespace Reference

Helper namespace for the single element test case. More...

Functions

void face_normal (const unsigned &face, const Vector< double > &x, Vector< double > &n)
 

Detailed Description

Helper namespace for the single element test case.

Function Documentation

◆ face_normal()

void SingleElement::face_normal ( const unsigned face,
const Vector< double > &  x,
Vector< double > &  n 
)
139  {
140  double N[3] = {0.0,0.0,0.0};
141  switch(face)
142  {
143  case 0:
144  N[0] = -1.0;
145  N[1] = 0.0;
146  N[2] = 0.0;
147  break;
148 
149  case 1:
150  N[0] = 0.0;
151  N[1] = -1.0;
152  N[2] = 0.0;
153  break;
154 
155  case 2:
156  N[0] = 0.0;
157  N[1] = 0.0;
158  N[2] = -1.0;
159  break;
160 
161  case 3:
162  Vector<double> s(3);
163  //Calculate the local "bulk" (unrotated) coordinate on the face
164  for(unsigned i=0;i<3;i++)
165  {
166  s[0] = -0.5 + 0.5*sqrt(4.0*x[0] - 3);
167  s[1] = -0.5 + 0.5*sqrt(4.0*x[1] - 3);
168  s[2] = -0.5 + 0.5*sqrt(4.0*x[2] - 3);
169  }
170 
171  //Hence compute the outer normal
172  N[0] = (1.0 + 2.0*s[1])*(1.0 + 2.0*s[2]);
173  N[1] = (1.0 + 2.0*s[0])*(1.0 + 2.0*s[2]);
174  N[2] = (1.0 + 2.0*s[0])*(1.0 + 2.0*s[1]);
175  break;
176  }
177 
178  double length = sqrt(N[0]*N[0] + N[1]*N[1] + N[2]*N[2]);
179  n[0] = N[0]/length;
180  n[1] = N[1]/length;
181  n[2] = N[2]/length;
182  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
@ N
Definition: constructor.cpp:22
RealScalar s
Definition: level1_cplx_impl.h:130
list x
Definition: plotDoE.py:28

References i, n, N, s, sqrt(), and plotDoE::x.

Referenced by TFaceTestProblem< ELEMENT >::TFaceTestProblem().