68 throw std::runtime_error(
"not valid order");
77 result.
NumDofs2D = (order - 1) * (order - 1);
78 result.
NumDofs3D = (order - 1) * (order - 1) * (order - 1);
82 {{0, 1}, {0,
true}}, {{1, 0}, {0,
false}}, {{1, 2}, {1,
true}}, {{2, 1}, {1,
false}},
83 {{2, 3}, {2,
false}}, {{3, 2}, {2,
true}}, {{3, 0}, {3,
false}}, {{0, 3}, {3,
true}},
84 {{4, 5}, {4,
true}}, {{5, 4}, {4,
false}}, {{5, 6}, {5,
true}}, {{6, 5}, {5,
false}},
85 {{6, 7}, {6,
false}}, {{7, 6}, {6,
true}}, {{7, 4}, {7,
false}}, {{4, 7}, {7,
true}},
86 {{0, 4}, {8,
true}}, {{4, 0}, {8,
false}}, {{1, 5}, {9,
true}}, {{5, 1}, {9,
false}},
87 {{3, 7}, {10,
true}}, {{7, 3}, {10,
false}}, {{2, 6}, {11,
true}}, {{6, 2}, {11,
false}}};
89 result.
Faces_by_edges = {{{0, 2}, 0}, {{2, 0}, 0}, {{1, 3}, 0}, {{3, 1}, 0}, {{4, 6}, 1}, {{6, 4}, 1},
90 {{5, 7}, 1}, {{7, 5}, 1}, {{0, 4}, 2}, {{4, 0}, 2}, {{8, 9}, 2}, {{9, 8}, 2},
91 {{2, 6}, 3}, {{6, 2}, 3}, {{10, 11}, 3}, {{11, 10}, 3}, {{7, 3}, 4}, {{3, 7}, 4},
92 {{8, 10}, 4}, {{10, 8}, 4}, {{1, 5}, 5}, {{9, 11}, 5}, {{11, 9}, 5}, {{5, 1}, 5}};
102 for (
unsigned int d3 = 0; d3 < 2; d3++)
104 for (
unsigned int d1 = 0; d1 < 2; d1++)
108 for (
unsigned int d2 = 0; d2 < 2; d2++)
110 result.
DofPositions.col(4 * d3 + 2 * d1 + d2) << reference_edge_dofs_poisitions(d2),
111 reference_edge_dofs_poisitions(d1), reference_edge_dofs_poisitions(d3);
112 result.
DofTypes[4 * d3 + 2 * d1 + d2] = {d2, d1, d3};
117 for (
unsigned int d2 = 0; d2 < 2; d2++)
119 const unsigned int index = (d2 == 0) ? 1 : 0;
120 result.
DofPositions.col(4 * d3 + 2 * d1 + d2) << reference_edge_dofs_poisitions(index),
121 reference_edge_dofs_poisitions(d1), reference_edge_dofs_poisitions(d3);
122 result.
DofTypes[4 * d3 + 2 * d1 + d2] = {index, d1, d3};
130 for (
unsigned int d3 = 0; d3 < 2; d3++)
132 for (
unsigned int d1 = 0; d1 < 2; d1++)
136 reference_edge_dofs_poisitions.segment(2, result.
NumDofs1D);
139 Eigen::VectorXd::Ones(result.
NumDofs1D) * reference_edge_dofs_poisitions(d1);
142 Eigen::VectorXd::Ones(result.
NumDofs1D) * reference_edge_dofs_poisitions(d3);
149 for (
unsigned int d3 = 0; d3 < 2; d3++)
151 for (
unsigned int d1 = 0; d1 < 2; d1++)
153 const unsigned index = (d1 == 1) ? 0 : 1;
156 Eigen::VectorXd::Ones(result.
NumDofs1D) * reference_edge_dofs_poisitions(index);
159 reference_edge_dofs_poisitions.segment(2, result.
NumDofs1D);
162 Eigen::VectorXd::Ones(result.
NumDofs1D) * reference_edge_dofs_poisitions(d3);
170 for (
unsigned int d3 = 0; d3 < 2; d3++)
172 for (
unsigned int d1 = 0; d1 < 2; d1++)
176 Eigen::VectorXd::Ones(result.
NumDofs1D) * reference_edge_dofs_poisitions(d1);
179 Eigen::VectorXd::Ones(result.
NumDofs1D) * reference_edge_dofs_poisitions(d3);
182 reference_edge_dofs_poisitions.segment(2, result.
NumDofs1D);
192 for (
unsigned int d3 = 0; d3 < 2; d3++)
198 result.
DofPositions.col(dof) << reference_edge_dofs_poisitions(d1),
199 reference_edge_dofs_poisitions(d2), reference_edge_dofs_poisitions(d3);
200 result.
DofTypes[dof] = {d1, d2, d3};
206 for (
unsigned int d3 = 0; d3 < 2; d3++)
212 result.
DofPositions.col(dof) << reference_edge_dofs_poisitions(d1),
213 reference_edge_dofs_poisitions(d3), reference_edge_dofs_poisitions(d2);
214 result.
DofTypes[dof] = {d1, d3, d2};
220 for (
unsigned int d3 = 0; d3 < 2; d3++)
226 result.
DofPositions.col(dof) << reference_edge_dofs_poisitions(d3),
227 reference_edge_dofs_poisitions(d1), reference_edge_dofs_poisitions(d2);
228 result.
DofTypes[dof] = {d3, d1, d2};
241 result.
DofPositions.col(dof) << reference_edge_dofs_poisitions(d3),
242 reference_edge_dofs_poisitions(d1), reference_edge_dofs_poisitions(d2);
243 result.
DofTypes[dof] = {d3, d1, d2};
267 const unsigned int num_points = points.cols();
268 Eigen::MatrixXd x = Eigen::MatrixXd::Zero(3, num_points);
269 x.row(0) = points.row(0);
270 Eigen::MatrixXd y = Eigen::MatrixXd::Zero(3, num_points);
271 y.row(0) = points.row(1);
272 Eigen::MatrixXd z = Eigen::MatrixXd::Zero(3, num_points);
273 z.row(0) = points.row(2);
276 const Eigen::MatrixXd values_x =
278 const Eigen::MatrixXd values_y =
280 const Eigen::MatrixXd values_z =
283 Eigen::MatrixXd values = Eigen::MatrixXd::Ones(num_points, reference_element_data.
NumBasisFunctions);
287 const auto &dofType = reference_element_data.
DofTypes[d];
289 values_x.col(dofType[0]).array() * values_y.col(dofType[1]).array() * values_z.col(dofType[2]).array();
298 const unsigned int num_points = points.cols();
299 Eigen::MatrixXd x = Eigen::MatrixXd::Zero(3, num_points);
300 x.row(0) = points.row(0);
301 Eigen::MatrixXd y = Eigen::MatrixXd::Zero(3, num_points);
302 y.row(0) = points.row(1);
303 Eigen::MatrixXd z = Eigen::MatrixXd::Zero(3, num_points);
304 z.row(0) = points.row(2);
307 const Eigen::MatrixXd values_x =
309 const Eigen::MatrixXd values_y =
311 const Eigen::MatrixXd values_z =
314 const std::vector<Eigen::MatrixXd> values_x_dx =
316 const std::vector<Eigen::MatrixXd> values_y_dy =
318 const std::vector<Eigen::MatrixXd> values_z_dz =
321 std::vector<Eigen::MatrixXd> grad_values(3, Eigen::MatrixXd::Ones(num_points, reference_element_data.
NumBasisFunctions));
325 const auto &dofType = reference_element_data.
DofTypes[d];
326 grad_values[0].col(d) = values_x_dx[0].col(dofType[0]).array() * values_y.col(dofType[1]).array() *
327 values_z.col(dofType[2]).array();
328 grad_values[1].col(d) = values_x.col(dofType[0]).array() * values_y_dy[0].col(dofType[1]).array() *
329 values_z.col(dofType[2]).array();
330 grad_values[2].col(d) = values_x.col(dofType[0]).array() * values_y.col(dofType[1]).array() *
331 values_z_dz[0].col(dofType[2]).array();