EFAFuncs.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7
8 #include "EFAFuncs.h"
9
10 namespace Efa
11 {
12
13 double
14 linearQuadShape2D(unsigned int node_id, std::vector<double> & xi_2d)
15 {
16  double node_xi[4][2] = {{-1.0, -1.0}, {1.0, -1.0}, {1.0, 1.0}, {-1.0, 1.0}};
17  return 0.25 * (1.0 + node_xi[node_id][0] * xi_2d[0]) * (1.0 + node_xi[node_id][1] * xi_2d[1]);
18 }
19
20 double
21 linearTriShape2D(unsigned int node_id, std::vector<double> & xi_2d)
22 {
23  std::vector<double> area_xi(3, 0.0);
24  area_xi[0] = xi_2d[0];
25  area_xi[1] = xi_2d[1];
26  area_xi[2] = 1.0 - xi_2d[0] - xi_2d[1];
27  return area_xi[node_id];
28 }
29
30 double
31 linearHexShape3D(unsigned int node_id, std::vector<double> & xi_3d)
32 {
33  double node_xi[8][3] = {{-1.0, -1.0, -1.0},
34  {1.0, -1.0, -1.0},
35  {1.0, 1.0, -1.0},
36  {-1.0, 1.0, -1.0},
37  {-1.0, -1.0, 1.0},
38  {1.0, -1.0, 1.0},
39  {1.0, 1.0, 1.0},
40  {-1.0, 1.0, 1.0}};
41  return 0.125 * (1.0 + node_xi[node_id][0] * xi_3d[0]) * (1.0 + node_xi[node_id][1] * xi_3d[1]) *
42  (1.0 + node_xi[node_id][2] * xi_3d[2]);
43 }
44
45 double
46 linearTetShape3D(unsigned int node_id, std::vector<double> & xi_3d)
47 {
48  std::vector<double> vol_xi(4, 0.0);
49  for (unsigned int i = 0; i < 3; ++i)
50  vol_xi[i] = xi_3d[i];
51  vol_xi[3] = 1.0 - xi_3d[0] - xi_3d[1] - xi_3d[2];
52  return vol_xi[node_id];
53 }
54
55 } // namespace Efa
double linearTetShape3D(unsigned int node_id, std::vector< double > &xi_3d)
Definition: EFAFuncs.C:46
double linearHexShape3D(unsigned int node_id, std::vector< double > &xi_3d)
Definition: EFAFuncs.C:31
Definition: EFAFuncs.h:16
double linearQuadShape2D(unsigned int node_id, std::vector< double > &xi_2d)
Definition: EFAFuncs.C:14
double linearTriShape2D(unsigned int node_id, std::vector< double > &xi_2d)
Definition: EFAFuncs.C:21