v0.14.0
Functions
DemkowiczHexAndQuad Namespace Reference

Functions

MoFEMErrorCode monom_ordering (int *perm, int p, int q, int r=0)
 
static void get_ksi_hex (int shift, double *N, double *N_diff, double ksi[3], double diff_ksi[3][3])
 

Function Documentation

◆ get_ksi_hex()

static void DemkowiczHexAndQuad::get_ksi_hex ( int  shift,
double N,
double N_diff,
double  ksi[3],
double  diff_ksi[3][3] 
)
inlinestatic

Definition at line 103 of file EdgeQuadHexPolynomials.cpp.

104  {
105 
106  constexpr std::array<size_t, 4> ksi_nodes[2][3] = {
107 
108  {{1, 2, 6, 5}, {3, 2, 6, 7}, {4, 5, 6, 7}},
109 
110  {{0, 3, 7, 4}, {0, 1, 5, 4}, {0, 1, 2, 3}}
111 
112  };
113 
114  for (size_t i = 0; i != 3; ++i) {
115  for (auto n : ksi_nodes[0][i])
116  ksi[i] += N[shift + n];
117  for (auto n : ksi_nodes[1][i])
118  ksi[i] -= N[shift + n];
119  }
120 
121  for (size_t i = 0; i != 3; ++i) {
122  for (auto d = 0; d != 3; ++d) {
123  for (auto n : ksi_nodes[0][i]) {
124 
125  diff_ksi[i][d] += N_diff[3 * (shift + n) + d];
126  }
127  }
128  for (auto n : ksi_nodes[1][i]) {
129  for (auto d = 0; d != 3; ++d) {
130  diff_ksi[i][d] -= N_diff[3 * (shift + n) + d];
131  }
132  }
133  }
134 }

◆ monom_ordering()

MoFEMErrorCode DemkowiczHexAndQuad::monom_ordering ( int *  perm,
int  p,
int  q,
int  r = 0 
)

Definition at line 11 of file EdgeQuadHexPolynomials.cpp.

11  {
13 
14  if (r > 0) {
15 
16  for (int m = 0; m != std::max(std::max(p, q), r) + 1; ++m) {
17 
18  const int i = std::min(m, p);
19  const int j = std::min(m, q);
20  const int k = std::min(m, r);
21 
22  if (i == m)
23  for (int jj = 0; jj != j; ++jj) {
24  for (int kk = 0; kk != k; ++kk) {
25  *(perm++) = i;
26  *(perm++) = jj;
27  *(perm++) = kk;
28  }
29  }
30 
31  if (j == m)
32  for (int ii = 0; ii != i; ++ii) {
33  for (int kk = 0; kk != k; ++kk) {
34  *(perm++) = ii;
35  *(perm++) = j;
36  *(perm++) = kk;
37  }
38  }
39 
40  if (k == m)
41  for (int ii = 0; ii != i; ++ii) {
42  for (int jj = 0; jj != j; ++jj) {
43  *(perm++) = ii;
44  *(perm++) = jj;
45  *(perm++) = k;
46  }
47  }
48 
49  if (j == m || k == m)
50  for (int ii = 0; ii != i; ++ii) {
51  *(perm++) = ii;
52  *(perm++) = j;
53  *(perm++) = k;
54  }
55 
56  if (i == m || k == m)
57  for (int jj = 0; jj != j; ++jj) {
58  *(perm++) = i;
59  *(perm++) = jj;
60  *(perm++) = k;
61  }
62 
63  if (i == m || j == m)
64  for (int kk = 0; kk != k; ++kk) {
65  *(perm++) = i;
66  *(perm++) = j;
67  *(perm++) = kk;
68  }
69 
70  *(perm++) = i;
71  *(perm++) = j;
72  *(perm++) = k;
73  }
74  } else {
75 
76  for (int m = 0; m != std::max(p, q) + 1; ++m) {
77 
78  const int i = std::min(m, p);
79  const int j = std::min(m, q);
80 
81  if (j == m)
82  for (int ii = 0; ii != i; ++ii) {
83  *(perm++) = ii;
84  *(perm++) = j;
85  *(perm++) = 0;
86  }
87 
88  if (i == m)
89  for (int jj = 0; jj != j; ++jj) {
90  *(perm++) = i;
91  *(perm++) = jj;
92  *(perm++) = 0;
93  }
94 
95  *(perm++) = i;
96  *(perm++) = j;
97  *(perm++) = 0;
98  }
99  }
101 }
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
sdf.r
int r
Definition: sdf.py:8
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
convert.n
n
Definition: convert.py:82
N
const int N
Definition: speed_test.cpp:3
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20