17 #include <deal.II/base/array_view.h> 18 #include <deal.II/base/derivative_form.h> 19 #include <deal.II/base/quadrature.h> 20 #include <deal.II/base/qprojector.h> 21 #include <deal.II/base/quadrature_lib.h> 22 #include <deal.II/base/table.h> 23 #include <deal.II/base/tensor_product_polynomials.h> 24 #include <deal.II/base/memory_consumption.h> 25 #include <deal.II/base/std_cxx14/memory.h> 26 #include <deal.II/lac/full_matrix.h> 27 #include <deal.II/lac/tensor_product_matrix.h> 28 #include <deal.II/grid/tria.h> 29 #include <deal.II/grid/tria_iterator.h> 30 #include <deal.II/grid/tria_boundary.h> 31 #include <deal.II/grid/manifold_lib.h> 32 #include <deal.II/dofs/dof_accessor.h> 33 #include <deal.II/fe/fe_tools.h> 34 #include <deal.II/fe/fe.h> 35 #include <deal.II/fe/fe_values.h> 36 #include <deal.II/fe/mapping_q_generic.h> 37 #include <deal.II/fe/mapping_q1.h> 38 #include <deal.II/matrix_free/tensor_product_kernels.h> 39 #include <deal.II/matrix_free/shape_info.h> 40 #include <deal.II/matrix_free/evaluation_kernels.h> 41 #include <deal.II/matrix_free/evaluation_selector.h> 50 DEAL_II_NAMESPACE_OPEN
55 namespace MappingQGenericImplementation
60 std::vector<unsigned int>
61 get_dpo_vector (
const unsigned int degree)
63 std::vector<unsigned int> dpo(dim+1, 1U);
64 for (
unsigned int i=1; i<dpo.size(); ++i)
65 dpo[i]=dpo[i-1]*(degree-1);
80 template <
int spacedim>
82 transform_real_to_unit_cell
87 return Point<1>((p[0] - vertices[0](0))/(vertices[1](0) - vertices[0](0)));
92 template <
int spacedim>
94 transform_real_to_unit_cell
103 const long double x = p(0);
104 const long double y = p(1);
106 const long double x0 = vertices[0](0);
107 const long double x1 = vertices[1](0);
108 const long double x2 = vertices[2](0);
109 const long double x3 = vertices[3](0);
111 const long double y0 = vertices[0](1);
112 const long double y1 = vertices[1](1);
113 const long double y2 = vertices[2](1);
114 const long double y3 = vertices[3](1);
116 const long double a = (x1 - x3)*(y0 - y2) - (x0 - x2)*(y1 - y3);
117 const long double b = -(x0 - x1 - x2 + x3)*y + (x - 2*x1 + x3)*y0 - (x - 2*x0 + x2)*y1
118 - (x - x1)*y2 + (x - x0)*y3;
119 const long double c = (x0 - x1)*y - (x - x1)*y0 + (x - x0)*y1;
121 const long double discriminant =
b*
b - 4*a*c;
129 const long double sqrt_discriminant = std::sqrt(discriminant);
132 if (b != 0.0 && std::abs(b) == sqrt_discriminant)
139 else if (std::abs(a) < 1e-8*std::abs(b))
143 eta1 = 2*c / (-
b - sqrt_discriminant);
144 eta2 = 2*c / (-
b + sqrt_discriminant);
149 eta1 = (-
b - sqrt_discriminant) / (2*a);
150 eta2 = (-
b + sqrt_discriminant) / (2*a);
153 const long double eta = (std::abs(eta1 - 0.5) < std::abs(eta2 - 0.5)) ? eta1 : eta2;
159 const long double subexpr0 = -eta*x2 + x0*(eta - 1);
160 const long double xi_denominator0 = eta*x3 - x1*(eta - 1) + subexpr0;
161 const long double max_x = std::max(std::max(std::abs(x0), std::abs(x1)),
162 std::max(std::abs(x2), std::abs(x3)));
164 if (std::abs(xi_denominator0) > 1e-10*max_x)
166 const double xi = (x + subexpr0)/xi_denominator0;
171 const long double max_y = std::max(std::max(std::abs(y0), std::abs(y1)),
172 std::max(std::abs(y2), std::abs(y3)));
173 const long double subexpr1 = -eta*y2 + y0*(eta - 1);
174 const long double xi_denominator1 = eta*y3 - y1*(eta - 1) + subexpr1;
175 if (std::abs(xi_denominator1) > 1
e-10*max_y)
177 const double xi = (subexpr1 + y)/xi_denominator1;
189 return Point<2>(std::numeric_limits<double>::quiet_NaN(),
190 std::numeric_limits<double>::quiet_NaN());
195 template <
int spacedim>
197 transform_real_to_unit_cell
208 template <
int dim,
int spacedim>
209 void compute_shape_function_values_general (
const unsigned int n_shape_functions,
211 typename ::MappingQGeneric<dim,spacedim>::InternalData &data)
213 const unsigned int n_points=unit_points.size();
219 Assert (n_shape_functions==tensor_pols.n(),
223 const std::vector<unsigned int>
225 lexicographic_to_hierarchic_numbering
227 (data.polynomial_degree), 1, data.polynomial_degree)));
229 std::vector<double> values;
230 std::vector<Tensor<1,dim> > grads;
231 if (data.shape_values.size()!=0)
233 Assert(data.shape_values.size()==n_shape_functions*n_points,
235 values.resize(n_shape_functions);
237 if (data.shape_derivatives.size()!=0)
239 Assert(data.shape_derivatives.size()==n_shape_functions*n_points,
241 grads.resize(n_shape_functions);
244 std::vector<Tensor<2,dim> > grad2;
245 if (data.shape_second_derivatives.size()!=0)
247 Assert(data.shape_second_derivatives.size()==n_shape_functions*n_points,
249 grad2.resize(n_shape_functions);
252 std::vector<Tensor<3,dim> > grad3;
253 if (data.shape_third_derivatives.size()!=0)
255 Assert(data.shape_third_derivatives.size()==n_shape_functions*n_points,
257 grad3.resize(n_shape_functions);
260 std::vector<Tensor<4,dim> > grad4;
261 if (data.shape_fourth_derivatives.size()!=0)
263 Assert(data.shape_fourth_derivatives.size()==n_shape_functions*n_points,
265 grad4.resize(n_shape_functions);
269 if (data.shape_values.size()!=0 ||
270 data.shape_derivatives.size()!=0 ||
271 data.shape_second_derivatives.size()!=0 ||
272 data.shape_third_derivatives.size()!=0 ||
273 data.shape_fourth_derivatives.size()!=0 )
274 for (
unsigned int point=0;
point<n_points; ++
point)
276 tensor_pols.compute(unit_points[point], values, grads, grad2, grad3, grad4);
278 if (data.shape_values.size()!=0)
279 for (
unsigned int i=0; i<n_shape_functions; ++i)
280 data.shape(point,renumber[i]) = values[i];
282 if (data.shape_derivatives.size()!=0)
283 for (
unsigned int i=0; i<n_shape_functions; ++i)
284 data.derivative(point,renumber[i]) = grads[i];
286 if (data.shape_second_derivatives.size()!=0)
287 for (
unsigned int i=0; i<n_shape_functions; ++i)
288 data.second_derivative(point,renumber[i]) = grad2[i];
290 if (data.shape_third_derivatives.size()!=0)
291 for (
unsigned int i=0; i<n_shape_functions; ++i)
292 data.third_derivative(point,renumber[i]) = grad3[i];
294 if (data.shape_fourth_derivatives.size()!=0)
295 for (
unsigned int i=0; i<n_shape_functions; ++i)
296 data.fourth_derivative(point,renumber[i]) = grad4[i];
302 compute_shape_function_values_hardcode (
const unsigned int n_shape_functions,
303 const std::vector<
Point<1> > &unit_points,
306 (void)n_shape_functions;
307 const unsigned int n_points=unit_points.size();
308 for (
unsigned int k = 0 ; k < n_points ; ++k)
310 double x = unit_points[k](0);
316 data.
shape(k,0) = 1.-x;
356 compute_shape_function_values_hardcode (
const unsigned int n_shape_functions,
357 const std::vector<
Point<2> > &unit_points,
361 (void)n_shape_functions;
362 const unsigned int n_points=unit_points.size();
363 for (
unsigned int k = 0 ; k < n_points ; ++k)
365 double x = unit_points[k](0);
366 double y = unit_points[k](1);
372 data.
shape(k,0) = (1.-x)*(1.-y);
373 data.
shape(k,1) = x*(1.-y);
374 data.
shape(k,2) = (1.-x)*y;
375 data.
shape(k,3) = x*y;
417 for (
unsigned int i=0; i<4; ++i)
425 for (
unsigned int i=0; i<4; ++i)
434 compute_shape_function_values_hardcode (
const unsigned int n_shape_functions,
435 const std::vector<
Point<3> > &unit_points,
438 (void)n_shape_functions;
439 const unsigned int n_points=unit_points.size();
440 for (
unsigned int k = 0 ; k < n_points ; ++k)
442 double x = unit_points[k](0);
443 double y = unit_points[k](1);
444 double z = unit_points[k](2);
450 data.
shape(k,0) = (1.-x)*(1.-y)*(1.-z);
451 data.
shape(k,1) = x*(1.-y)*(1.-z);
452 data.
shape(k,2) = (1.-x)*y*(1.-z);
453 data.
shape(k,3) = x*y*(1.-z);
454 data.
shape(k,4) = (1.-x)*(1.-y)*z;
455 data.
shape(k,5) = x*(1.-y)*z;
456 data.
shape(k,6) = (1.-x)*y*z;
457 data.
shape(k,7) = x*y*z;
573 for (
unsigned int i=0; i<3; ++i)
574 for (
unsigned int j=0; j<3; ++j)
575 for (
unsigned int l=0;
l<3; ++
l)
576 if ((i==j)||(j==
l)||(l==i))
578 for (
unsigned int m=0; m<8; ++m)
599 for (
unsigned int i=0; i<8; ++i)
610 template <
int dim,
int spacedim>
613 polynomial_degree (polynomial_degree),
614 n_shape_functions (
Utilities::fixed_power<dim>(polynomial_degree+1)),
616 tensor_product_quadrature(false)
621 template <
int dim,
int spacedim>
640 template <
int dim,
int spacedim>
645 const unsigned int n_original_q_points)
649 this->update_each = update_flags;
651 const unsigned int n_q_points = q.
size();
656 shape_values.resize(n_shape_functions * n_q_points);
671 shape_derivatives.resize(n_shape_functions * n_q_points);
674 covariant.resize(n_original_q_points);
677 contravariant.resize(n_original_q_points);
680 volume_elements.resize(n_original_q_points);
682 if (this->update_each &
684 shape_second_derivatives.resize(n_shape_functions * n_q_points);
686 if (this->update_each &
688 shape_third_derivatives.resize(n_shape_functions * n_q_points);
690 if (this->update_each &
692 shape_fourth_derivatives.resize(n_shape_functions * n_q_points);
694 const std::vector<Point<dim> > &ref_q_points = q.
get_points();
696 compute_shape_function_values (ref_q_points);
704 if (tensor_product_quadrature)
707 for (
unsigned int i=1; i<dim && tensor_product_quadrature; ++i)
709 if (quad_array[i-1].size() != quad_array[i].size())
711 tensor_product_quadrature =
false;
716 const std::vector<Point<1>> &points_1 = quad_array[i-1].get_points();
717 const std::vector<Point<1>> &points_2 = quad_array[i].get_points();
718 const std::vector<double> &weights_1 = quad_array[i-1].get_weights();
719 const std::vector<double> &weights_2 = quad_array[i].get_weights();
720 for (
unsigned int j=0; j<quad_array[i].size(); ++j)
722 if (std::abs(points_1[j][0]-points_2[j][0])>1.e-10
723 || std::abs(weights_1[j]-weights_2[j])>1.e-10)
725 tensor_product_quadrature =
false;
733 if (tensor_product_quadrature)
739 const unsigned int max_size = std::max(n_q_points,n_shape_values);
741 const unsigned int n_comp = 1+ (spacedim-1)/vec_length;
743 scratch.resize((dim-1)*max_size);
744 values_dofs.resize(n_comp*n_shape_values);
752 template <
int dim,
int spacedim>
757 const unsigned int n_original_q_points)
759 initialize (update_flags, q, n_original_q_points);
761 if (dim>1 && tensor_product_quadrature)
763 const unsigned int facedim = dim > 1 ? dim-1 : 1;
768 const unsigned int n_q_points = q.
size();
769 const unsigned int max_size = std::max(n_q_points,n_shape_values);
771 const unsigned int n_comp = 1+ (spacedim-1)/vec_length;
773 scratch.resize((dim-1)*max_size);
774 values_dofs.resize(n_comp*n_shape_values);
788 for (
unsigned int i=0; i<unit_tangentials.size(); ++i)
789 unit_tangentials[i].resize (n_original_q_points);
795 static const int tangential_orientation[4]= {-1,1,1,-1};
796 for (
unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
799 tang[1-i/2] = tangential_orientation[i];
800 std::fill (unit_tangentials[i].begin(),
801 unit_tangentials[i].end(),
810 for (
unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
814 const unsigned int nd=
826 tang2[(nd+2)%dim]=1.;
831 std::fill (unit_tangentials[i].begin(),
832 unit_tangentials[i].end(),
861 internal::MappingQ1::compute_shape_function_values_hardcode (n_shape_functions,
866 internal::MappingQ1::compute_shape_function_values_general<1,1>(n_shape_functions,
879 internal::MappingQ1::compute_shape_function_values_hardcode (n_shape_functions,
884 internal::MappingQ1::compute_shape_function_values_general<2,2>(n_shape_functions,
897 internal::MappingQ1::compute_shape_function_values_hardcode (n_shape_functions,
902 internal::MappingQ1::compute_shape_function_values_general<3,3>(n_shape_functions,
907 template <
int dim,
int spacedim>
914 internal::MappingQ1::compute_shape_function_values_general<dim,spacedim>(n_shape_functions,
921 namespace MappingQGenericImplementation
943 const unsigned int n_inner_2d = M*M;
944 const unsigned int n_outer_2d = 4 + 4*M;
947 loqvs.
reinit(n_inner_2d, n_outer_2d);
949 for (
unsigned int i=0; i<M; ++i)
950 for (
unsigned int j=0; j<M; ++j)
953 const unsigned int index_table = i*M+j;
954 for (
unsigned int v=0; v<4; ++v)
955 loqvs(index_table, v) =
957 loqvs(index_table, 4+i) = 1.-p[0];
958 loqvs(index_table, 4+i+M) = p[0];
959 loqvs(index_table, 4+j+2*M) = 1.-p[1];
960 loqvs(index_table, 4+j+3*M) = p[1];
965 for (
unsigned int unit_point=0; unit_point<n_inner_2d; ++unit_point)
966 Assert(std::fabs(std::accumulate(loqvs[unit_point].begin(),
993 const unsigned int n_inner = Utilities::fixed_power<3>(M);
994 const unsigned int n_outer = 8+12*M+6*M*M;
997 lohvs.
reinit(n_inner, n_outer);
999 for (
unsigned int i=0; i<M; ++i)
1000 for (
unsigned int j=0; j<M; ++j)
1001 for (
unsigned int k=0; k<M; ++k)
1003 const Point<3> p = gl.point((i+1)*(M+2)*(M+2)+(j+1)*(M+2)+(k+1));
1004 const unsigned int index_table = i*M*M+j*M+k;
1007 for (
unsigned int v=0; v<8; ++v)
1008 lohvs(index_table, v) =
1013 constexpr std::array<unsigned int,4> line_coordinates_y
1016 for (
unsigned int l=0;
l<4; ++
l)
1017 lohvs(index_table, 8+line_coordinates_y[l]*M+j) =
1022 constexpr std::array<unsigned int,4> line_coordinates_x
1025 for (
unsigned int l=0;
l<4; ++
l)
1026 lohvs(index_table, 8+line_coordinates_x[l]*M+k) =
1031 constexpr std::array<unsigned int,4> line_coordinates_z
1034 for (
unsigned int l=0;
l<4; ++
l)
1035 lohvs(index_table, 8+line_coordinates_z[l]*M+i) =
1040 lohvs(index_table, 8+12*M+0*M*M+i*M+j) = 1.-p[0];
1041 lohvs(index_table, 8+12*M+1*M*M+i*M+j) = p[0];
1042 lohvs(index_table, 8+12*M+2*M*M+k*M+i) = 1.-p[1];
1043 lohvs(index_table, 8+12*M+3*M*M+k*M+i) = p[1];
1044 lohvs(index_table, 8+12*M+4*M*M+j*M+k) = 1.-p[2];
1045 lohvs(index_table, 8+12*M+5*M*M+j*M+k) = p[2];
1050 for (
unsigned int unit_point=0; unit_point<n_inner; ++unit_point)
1051 Assert(std::fabs(std::accumulate(lohvs[unit_point].begin(),
1064 std::vector<::Table<2,double> >
1065 compute_support_point_weights_perimeter_to_interior(
const unsigned int polynomial_degree,
1066 const unsigned int dim)
1069 std::vector<::Table<2,double> > output(dim);
1077 for (
unsigned int i=0; i<GeometryInfo<1>::vertices_per_cell; ++i)
1099 return ::Table<2,double>();
1102 std::vector<unsigned int> h2l(quadrature.size());
1107 for (
unsigned int q=0; q<output.size(0); ++q)
1108 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
1124 template <
int dim,
int spacedim>
1126 compute_mapped_location_of_point
1127 (
const typename ::MappingQGeneric<dim,spacedim>::InternalData &data)
1130 data.mapping_support_points.size());
1134 for (
unsigned int i=0; i<data.mapping_support_points.size(); ++i)
1135 p_real += data.mapping_support_points[i] * data.shape(0,i);
1147 do_transform_real_to_unit_cell_internal
1148 (
const typename ::Triangulation<dim,dim>::cell_iterator &cell,
1151 typename ::MappingQGeneric<dim,dim>::InternalData &mdata)
1153 const unsigned int spacedim = dim;
1155 const unsigned int n_shapes=mdata.shape_values.size();
1160 std::vector<Point<spacedim> > &points=mdata.mapping_support_points;
1176 mdata.compute_shape_function_values(std::vector<
Point<dim> > (1, p_unit));
1178 Point<spacedim> p_real = compute_mapped_location_of_point<dim,spacedim>(mdata);
1182 if (f.norm_square() < 1
e-24 * cell->diameter() * cell->diameter())
1218 const double eps = 1.e-11;
1219 const unsigned int newton_iteration_limit = 20;
1221 unsigned int newton_iteration = 0;
1222 double last_f_weighted_norm;
1225 #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL 1226 std::cout <<
"Newton iteration " << newton_iteration << std::endl;
1231 for (
unsigned int k=0; k<mdata.n_shape_functions; ++k)
1236 for (
unsigned int i=0; i<spacedim; ++i)
1237 for (
unsigned int j=0; j<dim; ++j)
1238 df[i][j]+=point[i]*grad_transform[j];
1247 #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL 1248 std::cout <<
" delta=" << delta << std::endl;
1252 double step_length = 1;
1260 for (
unsigned int i=0; i<dim; ++i)
1261 p_unit_trial[i] -= step_length * delta[i];
1265 mdata.compute_shape_function_values(std::vector<
Point<dim> > (1, p_unit_trial));
1268 Point<spacedim> p_real_trial = internal::MappingQGenericImplementation::compute_mapped_location_of_point<dim,spacedim>(mdata);
1271 #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL 1272 std::cout <<
" step_length=" << step_length << std::endl
1273 <<
" ||f || =" << f.
norm() << std::endl
1274 <<
" ||f*|| =" << f_trial.norm() << std::endl
1275 <<
" ||f*||_A =" << (df_inverse * f_trial).
norm() << std::endl;
1285 if (f_trial.norm() < f.norm())
1287 p_real = p_real_trial;
1288 p_unit = p_unit_trial;
1292 else if (step_length > 0.05)
1301 if (newton_iteration > newton_iteration_limit)
1304 last_f_weighted_norm = (df_inverse * f).
norm();
1306 while (last_f_weighted_norm > eps);
1318 do_transform_real_to_unit_cell_internal_codim1
1319 (
const typename ::Triangulation<dim,dim+1>::cell_iterator &cell,
1322 typename ::MappingQGeneric<dim,dim+1>::InternalData &mdata)
1324 const unsigned int spacedim = dim+1;
1326 const unsigned int n_shapes=mdata.shape_values.size();
1332 std::vector<Point<spacedim> > &points=mdata.mapping_support_points;
1345 mdata.compute_shape_function_values(std::vector<
Point<dim> > (1, p_unit));
1347 for (
unsigned int k=0; k<mdata.n_shape_functions; ++k)
1350 const Tensor<2,dim> &hessian_k = mdata.second_derivative(0,k);
1353 for (
unsigned int j=0; j<dim; ++j)
1355 DF[j] += grad_phi_k[j] * point_k;
1356 for (
unsigned int l=0;
l<dim; ++
l)
1357 D2F[j][l] += hessian_k[j][l] * point_k;
1362 p_minus_F -= compute_mapped_location_of_point<dim,spacedim>(mdata);
1365 for (
unsigned int j=0; j<dim; ++j)
1366 f[j] = DF[j] * p_minus_F;
1368 for (
unsigned int j=0; j<dim; ++j)
1370 f[j] = DF[j] * p_minus_F;
1371 for (
unsigned int l=0;
l<dim; ++
l)
1372 df[j][l] = -DF[j]*DF[l] + D2F[j][l] * p_minus_F;
1376 const double eps = 1.e-12*cell->diameter();
1377 const unsigned int loop_limit = 10;
1379 unsigned int loop=0;
1387 for (
unsigned int j=0; j<dim; ++j)
1390 for (
unsigned int l=0;
l<dim; ++
l)
1394 mdata.compute_shape_function_values(std::vector<
Point<dim> > (1, p_unit));
1396 for (
unsigned int k=0; k<mdata.n_shape_functions; ++k)
1399 const Tensor<2,dim> &hessian_k = mdata.second_derivative(0,k);
1402 for (
unsigned int j=0; j<dim; ++j)
1404 DF[j] += grad_phi_k[j] * point_k;
1405 for (
unsigned int l=0;
l<dim; ++
l)
1406 D2F[j][l] += hessian_k[j][l] * point_k;
1413 p_minus_F -= compute_mapped_location_of_point<dim,spacedim>(mdata);
1415 for (
unsigned int j=0; j<dim; ++j)
1417 f[j] = DF[j] * p_minus_F;
1418 for (
unsigned int l=0;
l<dim; ++
l)
1419 df[j][l] = -DF[j]*DF[l] + D2F[j][l] * p_minus_F;
1439 template <
int dim,
int spacedim>
1441 maybe_update_q_points_Jacobians_and_grads_tensor
1443 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
1447 const UpdateFlags update_flags = data.update_each;
1449 const unsigned int n_shape_values = data.n_shape_functions;
1450 const unsigned int n_q_points = data.shape_info.n_q_points;
1452 const unsigned int n_comp = 1+ (spacedim-1)/vec_length;
1453 const unsigned int n_hessians = (dim*(dim+1))/2;
1462 Assert (!evaluate_values || n_q_points == quadrature_points.size(),
1465 Assert (!evaluate_gradients || n_q_points == data.contravariant.size(),
1467 Assert (!evaluate_hessians || n_q_points == jacobian_grads.size(),
1471 if (evaluate_values || evaluate_gradients || evaluate_hessians)
1473 data.values_dofs.resize(n_comp*n_shape_values);
1474 data.values_quad.resize(n_comp*n_q_points);
1475 data.gradients_quad.resize (n_comp*n_q_points*dim);
1477 if (evaluate_hessians)
1478 data.hessians_quad.resize(n_comp*n_q_points*n_hessians);
1480 const std::vector<unsigned int> &renumber_to_lexicographic
1481 = data.shape_info.lexicographic_numbering;
1482 for (
unsigned int i=0; i<n_shape_values; ++i)
1483 for (
unsigned int d=0;
d<spacedim; ++
d)
1485 const unsigned int in_comp =
d%vec_length;
1486 const unsigned int out_comp =
d/vec_length;
1487 data.values_dofs[out_comp*n_shape_values+i][in_comp]
1488 = data.mapping_support_points[renumber_to_lexicographic[i]][
d];
1493 (data.shape_info, data.values_dofs.begin(), data.values_quad.begin(),
1494 data.gradients_quad.begin(), data.hessians_quad.begin(), data.scratch.begin(),
1495 evaluate_values, evaluate_gradients, evaluate_hessians);
1499 if (evaluate_values)
1501 for (
unsigned int out_comp=0; out_comp<n_comp; ++out_comp)
1502 for (
unsigned int i=0; i<n_q_points; ++i)
1503 for (
unsigned int in_comp=0;
1504 in_comp<vec_length && in_comp<spacedim-out_comp*vec_length; ++in_comp)
1505 quadrature_points[i][out_comp*vec_length+in_comp]
1506 = data.values_quad[out_comp*n_q_points+i][in_comp];
1509 if (evaluate_gradients)
1511 std::fill(data.contravariant.begin(), data.contravariant.end(),
1514 for (
unsigned int out_comp=0; out_comp<n_comp; ++out_comp)
1515 for (
unsigned int point=0;
point<n_q_points; ++
point)
1516 for (
unsigned int j=0; j<dim; ++j)
1517 for (
unsigned int in_comp=0;
1518 in_comp<vec_length && in_comp<spacedim-out_comp*vec_length; ++in_comp)
1520 const unsigned int total_number =
point*dim+j;
1521 const unsigned int new_comp = total_number/n_q_points;
1522 const unsigned int new_point = total_number % n_q_points;
1523 data.contravariant[new_point][out_comp*vec_length+in_comp][new_comp]
1524 = data.gradients_quad[(out_comp*n_q_points+
point)*dim+j][in_comp];
1529 for (
unsigned int point=0;
point<n_q_points; ++
point)
1530 data.covariant[point] = (data.contravariant[point]).covariant_form();
1534 for (
unsigned int point=0;
point<n_q_points; ++
point)
1535 data.volume_elements[point] = data.contravariant[point].
determinant();
1537 if (evaluate_hessians)
1539 constexpr
int desymmetrize_3d [6][2] = {{0,0},{1,1},{2,2},{0,1},{0,2},{1,2}};
1540 constexpr
int desymmetrize_2d [3][2] = {{0,0},{1,1},{0,1}};
1543 for (
unsigned int out_comp=0; out_comp<n_comp; ++out_comp)
1544 for (
unsigned int point=0;
point<n_q_points; ++
point)
1545 for (
unsigned int j=0; j<n_hessians; ++j)
1546 for (
unsigned int in_comp=0;
1547 in_comp<vec_length && in_comp<spacedim-out_comp*vec_length; ++in_comp)
1549 const unsigned int total_number =
point*n_hessians+j;
1550 const unsigned int new_point = total_number % n_q_points;
1551 const unsigned int new_hessian_comp = total_number/n_q_points;
1552 const unsigned int new_hessian_comp_i = dim==2 ? desymmetrize_2d[new_hessian_comp][0]
1553 : desymmetrize_3d[new_hessian_comp][0];
1554 const unsigned int new_hessian_comp_j = dim==2 ? desymmetrize_2d[new_hessian_comp][1]
1555 : desymmetrize_3d[new_hessian_comp][1];
1556 const double value = data.hessians_quad[(out_comp*n_q_points+
point)*n_hessians+j][in_comp];
1557 jacobian_grads[new_point][out_comp*vec_length+in_comp][new_hessian_comp_i][new_hessian_comp_j] = value;
1558 jacobian_grads[new_point][out_comp*vec_length+in_comp][new_hessian_comp_j][new_hessian_comp_i] = value;
1570 template <
int dim,
int spacedim>
1572 maybe_compute_q_points
1574 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
1577 const UpdateFlags update_flags = data.update_each;
1580 for (
unsigned int point=0;
point<quadrature_points.size(); ++
point)
1582 const double *shape = &data.shape(point+data_set,0);
1584 data.mapping_support_points[0]);
1585 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
1586 for (
unsigned int i=0; i<spacedim; ++i)
1587 result[i] += shape[k] * data.mapping_support_points[k][i];
1588 quadrature_points[point] = result;
1601 template <
int dim,
int spacedim>
1603 maybe_update_Jacobians
1605 const typename ::QProjector<dim>::DataSetDescriptor data_set,
1606 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data)
1608 const UpdateFlags update_flags = data.update_each;
1616 const unsigned int n_q_points = data.contravariant.size();
1618 std::fill(data.contravariant.begin(), data.contravariant.end(),
1624 &data.mapping_support_points[0];
1626 for (
unsigned int point=0;
point<n_q_points; ++
point)
1629 &data.derivative(point+data_set, 0);
1631 double result [spacedim][dim];
1635 for (
unsigned int i=0; i<spacedim; ++i)
1636 for (
unsigned int j=0; j<dim; ++j)
1637 result[i][j] = data_derv[0][j] * supp_pts[0][i];
1638 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
1639 for (
unsigned int i=0; i<spacedim; ++i)
1640 for (
unsigned int j=0; j<dim; ++j)
1641 result[i][j] += data_derv[k][j] * supp_pts[k][i];
1648 for (
unsigned int i=0; i<spacedim; ++i)
1649 for (
unsigned int j=0; j<dim; ++j)
1650 data.contravariant[point][i][j] = result[i][j];
1657 const unsigned int n_q_points = data.contravariant.size();
1658 for (
unsigned int point=0;
point<n_q_points; ++
point)
1660 data.covariant[
point] = (data.contravariant[
point]).covariant_form();
1667 const unsigned int n_q_points = data.contravariant.size();
1668 for (
unsigned int point=0;
point<n_q_points; ++
point)
1669 data.volume_elements[point] = data.contravariant[point].
determinant();
1680 template <
int dim,
int spacedim>
1682 maybe_update_jacobian_grads
1685 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
1688 const UpdateFlags update_flags = data.update_each;
1691 const unsigned int n_q_points = jacobian_grads.size();
1694 for (
unsigned int point=0;
point<n_q_points; ++
point)
1697 &data.second_derivative(point+data_set, 0);
1698 double result [spacedim][dim][dim];
1699 for (
unsigned int i=0; i<spacedim; ++i)
1700 for (
unsigned int j=0; j<dim; ++j)
1701 for (
unsigned int l=0;
l<dim; ++
l)
1702 result[i][j][l] = (second[0][j][l] *
1703 data.mapping_support_points[0][i]);
1704 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
1705 for (
unsigned int i=0; i<spacedim; ++i)
1706 for (
unsigned int j=0; j<dim; ++j)
1707 for (
unsigned int l=0;
l<dim; ++
l)
1711 data.mapping_support_points[k][i]);
1713 for (
unsigned int i=0; i<spacedim; ++i)
1714 for (
unsigned int j=0; j<dim; ++j)
1715 for (
unsigned int l=0;
l<dim; ++
l)
1716 jacobian_grads[point][i][j][l] = result[i][j][l];
1727 template <
int dim,
int spacedim>
1729 maybe_update_jacobian_pushed_forward_grads
1732 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
1735 const UpdateFlags update_flags = data.update_each;
1738 const unsigned int n_q_points = jacobian_pushed_forward_grads.size();
1742 double tmp[spacedim][spacedim][spacedim];
1743 for (
unsigned int point=0;
point<n_q_points; ++
point)
1746 &data.second_derivative(point+data_set, 0);
1747 double result [spacedim][dim][dim];
1748 for (
unsigned int i=0; i<spacedim; ++i)
1749 for (
unsigned int j=0; j<dim; ++j)
1750 for (
unsigned int l=0;
l<dim; ++
l)
1751 result[i][j][l] = (second[0][j][l] *
1752 data.mapping_support_points[0][i]);
1753 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
1754 for (
unsigned int i=0; i<spacedim; ++i)
1755 for (
unsigned int j=0; j<dim; ++j)
1756 for (
unsigned int l=0;
l<dim; ++
l)
1760 data.mapping_support_points[k][i]);
1763 for (
unsigned int i=0; i<spacedim; ++i)
1764 for (
unsigned int j=0; j<spacedim; ++j)
1765 for (
unsigned int l=0;
l<dim; ++
l)
1767 tmp[i][j][
l] = result[i][0][
l] *
1768 data.covariant[
point][j][0];
1769 for (
unsigned int jr=1; jr<dim; ++jr)
1771 tmp[i][j][
l] += result[i][jr][
l] *
1772 data.covariant[
point][j][jr];
1777 for (
unsigned int i=0; i<spacedim; ++i)
1778 for (
unsigned int j=0; j<spacedim; ++j)
1779 for (
unsigned int l=0;
l<spacedim; ++
l)
1781 jacobian_pushed_forward_grads[
point][i][j][
l] = tmp[i][j][0] *
1782 data.covariant[
point][
l][0];
1783 for (
unsigned int lr=1; lr<dim; ++lr)
1785 jacobian_pushed_forward_grads[
point][i][j][
l] += tmp[i][j][lr] *
1786 data.covariant[
point][
l][lr];
1801 template <
int dim,
int spacedim>
1803 maybe_update_jacobian_2nd_derivatives
1806 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
1809 const UpdateFlags update_flags = data.update_each;
1812 const unsigned int n_q_points = jacobian_2nd_derivatives.size();
1816 for (
unsigned int point=0;
point<n_q_points; ++
point)
1819 &data.third_derivative(point+data_set, 0);
1820 double result [spacedim][dim][dim][dim];
1821 for (
unsigned int i=0; i<spacedim; ++i)
1822 for (
unsigned int j=0; j<dim; ++j)
1823 for (
unsigned int l=0;
l<dim; ++
l)
1824 for (
unsigned int m=0; m<dim; ++m)
1825 result[i][j][l][m] = (third[0][j][l][m] *
1826 data.mapping_support_points[0][i]);
1827 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
1828 for (
unsigned int i=0; i<spacedim; ++i)
1829 for (
unsigned int j=0; j<dim; ++j)
1830 for (
unsigned int l=0;
l<dim; ++
l)
1831 for (
unsigned int m=0; m<dim; ++m)
1833 += (third[k][j][l][m]
1835 data.mapping_support_points[k][i]);
1837 for (
unsigned int i=0; i<spacedim; ++i)
1838 for (
unsigned int j=0; j<dim; ++j)
1839 for (
unsigned int l=0;
l<dim; ++
l)
1840 for (
unsigned int m=0; m<dim; ++m)
1841 jacobian_2nd_derivatives[point][i][j][l][m] = result[i][j][l][m];
1854 template <
int dim,
int spacedim>
1856 maybe_update_jacobian_pushed_forward_2nd_derivatives
1859 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
1862 const UpdateFlags update_flags = data.update_each;
1865 const unsigned int n_q_points = jacobian_pushed_forward_2nd_derivatives.size();
1869 double tmp[spacedim][spacedim][spacedim][spacedim];
1870 for (
unsigned int point=0;
point<n_q_points; ++
point)
1873 &data.third_derivative(point+data_set, 0);
1874 double result [spacedim][dim][dim][dim];
1875 for (
unsigned int i=0; i<spacedim; ++i)
1876 for (
unsigned int j=0; j<dim; ++j)
1877 for (
unsigned int l=0;
l<dim; ++
l)
1878 for (
unsigned int m=0; m<dim; ++m)
1879 result[i][j][l][m] = (third[0][j][l][m] *
1880 data.mapping_support_points[0][i]);
1881 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
1882 for (
unsigned int i=0; i<spacedim; ++i)
1883 for (
unsigned int j=0; j<dim; ++j)
1884 for (
unsigned int l=0;
l<dim; ++
l)
1885 for (
unsigned int m=0; m<dim; ++m)
1887 += (third[k][j][l][m]
1889 data.mapping_support_points[k][i]);
1892 for (
unsigned int i=0; i<spacedim; ++i)
1893 for (
unsigned int j=0; j<spacedim; ++j)
1894 for (
unsigned int l=0;
l<dim; ++
l)
1895 for (
unsigned int m=0; m<dim; ++m)
1897 jacobian_pushed_forward_2nd_derivatives[
point][i][j][
l][m]
1898 = result[i][0][
l][m]*
1899 data.covariant[
point][j][0];
1900 for (
unsigned int jr=1; jr<dim; ++jr)
1901 jacobian_pushed_forward_2nd_derivatives[point][i][j][l][m]
1902 += result[i][jr][l][m]*
1903 data.covariant[point][j][jr];
1907 for (
unsigned int i=0; i<spacedim; ++i)
1908 for (
unsigned int j=0; j<spacedim; ++j)
1909 for (
unsigned int l=0;
l<spacedim; ++
l)
1910 for (
unsigned int m=0; m<dim; ++m)
1913 = jacobian_pushed_forward_2nd_derivatives[
point][i][j][0][m]*
1914 data.covariant[
point][
l][0];
1915 for (
unsigned int lr=1; lr<dim; ++lr)
1917 += jacobian_pushed_forward_2nd_derivatives[point][i][j][lr][m]*
1918 data.covariant[point][l][lr];
1922 for (
unsigned int i=0; i<spacedim; ++i)
1923 for (
unsigned int j=0; j<spacedim; ++j)
1924 for (
unsigned int l=0;
l<spacedim; ++
l)
1925 for (
unsigned int m=0; m<spacedim; ++m)
1927 jacobian_pushed_forward_2nd_derivatives[
point][i][j][
l][m]
1929 data.covariant[
point][m][0];
1930 for (
unsigned int mr=1; mr<dim; ++mr)
1931 jacobian_pushed_forward_2nd_derivatives[point][i][j][l][m]
1932 += tmp[i][j][l][mr]*
1933 data.covariant[point][m][mr];
1946 template <
int dim,
int spacedim>
1948 maybe_update_jacobian_3rd_derivatives
1951 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
1954 const UpdateFlags update_flags = data.update_each;
1957 const unsigned int n_q_points = jacobian_3rd_derivatives.size();
1961 for (
unsigned int point=0;
point<n_q_points; ++
point)
1964 &data.fourth_derivative(point+data_set, 0);
1965 double result [spacedim][dim][dim][dim][dim];
1966 for (
unsigned int i=0; i<spacedim; ++i)
1967 for (
unsigned int j=0; j<dim; ++j)
1968 for (
unsigned int l=0;
l<dim; ++
l)
1969 for (
unsigned int m=0; m<dim; ++m)
1970 for (
unsigned int n=0; n<dim; ++n)
1971 result[i][j][l][m][n] = (fourth[0][j][l][m][n] *
1972 data.mapping_support_points[0][i]);
1973 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
1974 for (
unsigned int i=0; i<spacedim; ++i)
1975 for (
unsigned int j=0; j<dim; ++j)
1976 for (
unsigned int l=0;
l<dim; ++
l)
1977 for (
unsigned int m=0; m<dim; ++m)
1978 for (
unsigned int n=0; n<dim; ++n)
1979 result[i][j][l][m][n]
1980 += (fourth[k][j][l][m][n]
1982 data.mapping_support_points[k][i]);
1984 for (
unsigned int i=0; i<spacedim; ++i)
1985 for (
unsigned int j=0; j<dim; ++j)
1986 for (
unsigned int l=0;
l<dim; ++
l)
1987 for (
unsigned int m=0; m<dim; ++m)
1988 for (
unsigned int n=0; n<dim; ++n)
1989 jacobian_3rd_derivatives[point][i][j][l][m][n] = result[i][j][l][m][n];
2001 template <
int dim,
int spacedim>
2003 maybe_update_jacobian_pushed_forward_3rd_derivatives
2006 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
2009 const UpdateFlags update_flags = data.update_each;
2012 const unsigned int n_q_points = jacobian_pushed_forward_3rd_derivatives.size();
2016 double tmp[spacedim][spacedim][spacedim][spacedim][spacedim];
2017 for (
unsigned int point=0;
point<n_q_points; ++
point)
2020 &data.fourth_derivative(point+data_set, 0);
2021 double result [spacedim][dim][dim][dim][dim];
2022 for (
unsigned int i=0; i<spacedim; ++i)
2023 for (
unsigned int j=0; j<dim; ++j)
2024 for (
unsigned int l=0;
l<dim; ++
l)
2025 for (
unsigned int m=0; m<dim; ++m)
2026 for (
unsigned int n=0; n<dim; ++n)
2027 result[i][j][l][m][n] = (fourth[0][j][l][m][n] *
2028 data.mapping_support_points[0][i]);
2029 for (
unsigned int k=1; k<data.n_shape_functions; ++k)
2030 for (
unsigned int i=0; i<spacedim; ++i)
2031 for (
unsigned int j=0; j<dim; ++j)
2032 for (
unsigned int l=0;
l<dim; ++
l)
2033 for (
unsigned int m=0; m<dim; ++m)
2034 for (
unsigned int n=0; n<dim; ++n)
2035 result[i][j][l][m][n]
2036 += (fourth[k][j][l][m][n]
2038 data.mapping_support_points[k][i]);
2041 for (
unsigned int i=0; i<spacedim; ++i)
2042 for (
unsigned int j=0; j<spacedim; ++j)
2043 for (
unsigned int l=0;
l<dim; ++
l)
2044 for (
unsigned int m=0; m<dim; ++m)
2045 for (
unsigned int n=0; n<dim; ++n)
2047 tmp[i][j][
l][m][n] = result[i][0][
l][m][n] *
2048 data.covariant[
point][j][0];
2049 for (
unsigned int jr=1; jr<dim; ++jr)
2050 tmp[i][j][l][m][n] += result[i][jr][l][m][n] *
2051 data.covariant[point][j][jr];
2055 for (
unsigned int i=0; i<spacedim; ++i)
2056 for (
unsigned int j=0; j<spacedim; ++j)
2057 for (
unsigned int l=0;
l<spacedim; ++
l)
2058 for (
unsigned int m=0; m<dim; ++m)
2059 for (
unsigned int n=0; n<dim; ++n)
2061 jacobian_pushed_forward_3rd_derivatives[
point][i][j][
l][m][n]
2062 = tmp[i][j][0][m][n] *
2063 data.covariant[
point][
l][0];
2064 for (
unsigned int lr=1; lr<dim; ++lr)
2065 jacobian_pushed_forward_3rd_derivatives[point][i][j][l][m][n]
2066 += tmp[i][j][lr][m][n] *
2067 data.covariant[point][l][lr];
2071 for (
unsigned int i=0; i<spacedim; ++i)
2072 for (
unsigned int j=0; j<spacedim; ++j)
2073 for (
unsigned int l=0;
l<spacedim; ++
l)
2074 for (
unsigned int m=0; m<spacedim; ++m)
2075 for (
unsigned int n=0; n<dim; ++n)
2078 = jacobian_pushed_forward_3rd_derivatives[
point][i][j][
l][0][n] *
2079 data.covariant[
point][m][0];
2080 for (
unsigned int mr=1; mr<dim; ++mr)
2082 += jacobian_pushed_forward_3rd_derivatives[point][i][j][l][mr][n] *
2083 data.covariant[point][m][mr];
2087 for (
unsigned int i=0; i<spacedim; ++i)
2088 for (
unsigned int j=0; j<spacedim; ++j)
2089 for (
unsigned int l=0;
l<spacedim; ++
l)
2090 for (
unsigned int m=0; m<spacedim; ++m)
2091 for (
unsigned int n=0; n<spacedim; ++n)
2093 jacobian_pushed_forward_3rd_derivatives[
point][i][j][
l][m][n]
2094 = tmp[i][j][
l][m][0] *
2095 data.covariant[
point][n][0];
2096 for (
unsigned int nr=1; nr<dim; ++nr)
2097 jacobian_pushed_forward_3rd_derivatives[point][i][j][l][m][n]
2098 += tmp[i][j][l][m][nr] *
2099 data.covariant[point][n][nr];
2111 template <
int dim,
int spacedim>
2120 Assert (p >= 1,
ExcMessage (
"It only makes sense to create polynomial mappings " 2121 "with a polynomial degree greater or equal to one."));
2126 template <
int dim,
int spacedim>
2129 polynomial_degree(mapping.polynomial_degree),
2130 line_support_points(mapping.line_support_points),
2131 fe_q(dim == 3 ? new
FE_Q<dim>(*mapping.fe_q) : nullptr),
2132 support_point_weights_perimeter_to_interior (mapping.support_point_weights_perimeter_to_interior),
2133 support_point_weights_cell (mapping.support_point_weights_cell)
2139 template <
int dim,
int spacedim>
2140 std::unique_ptr<Mapping<dim,spacedim> >
2143 return std_cxx14::make_unique<MappingQGeneric<dim,spacedim>>(*this);
2149 template <
int dim,
int spacedim>
2153 return polynomial_degree;
2158 template <
int dim,
int spacedim>
2167 Assert (tensor_pols.
n() == Utilities::fixed_power<dim>(polynomial_degree+1),
2171 const std::vector<unsigned int>
2173 lexicographic_to_hierarchic_numbering
2175 (polynomial_degree), 1, polynomial_degree)));
2177 const std::vector<Point<spacedim> > support_points
2178 = this->compute_mapping_support_points(cell);
2181 for (
unsigned int i=0; i<tensor_pols.
n(); ++i)
2182 mapped_point += support_points[renumber[i]] * tensor_pols.
compute_value (i, p);
2184 return mapped_point;
2207 template <
int dim,
int spacedim>
2226 const Point<1> &initial_p_unit)
const 2229 const int spacedim = 1;
2239 mdata->mapping_support_points = this->compute_mapping_support_points (cell);
2243 return internal::MappingQGenericImplementation::do_transform_real_to_unit_cell_internal<1>(cell, p, initial_p_unit, *mdata);
2252 const Point<2> &initial_p_unit)
const 2255 const int spacedim = 2;
2265 mdata->mapping_support_points = this->compute_mapping_support_points (cell);
2269 return internal::MappingQGenericImplementation::do_transform_real_to_unit_cell_internal<2>(cell, p, initial_p_unit, *mdata);
2278 const Point<3> &initial_p_unit)
const 2281 const int spacedim = 3;
2291 mdata->mapping_support_points = this->compute_mapping_support_points (cell);
2295 return internal::MappingQGenericImplementation::do_transform_real_to_unit_cell_internal<3>(cell, p, initial_p_unit, *mdata);
2306 const Point<1> &initial_p_unit)
const 2309 const int spacedim = 2;
2319 mdata->mapping_support_points = this->compute_mapping_support_points (cell);
2323 return internal::MappingQGenericImplementation::do_transform_real_to_unit_cell_internal_codim1<1>(cell, p, initial_p_unit, *mdata);
2334 const Point<2> &initial_p_unit)
const 2337 const int spacedim = 3;
2347 mdata->mapping_support_points = this->compute_mapping_support_points (cell);
2351 return internal::MappingQGenericImplementation::do_transform_real_to_unit_cell_internal_codim1<2>(cell, p, initial_p_unit, *mdata);
2368 template <
int dim,
int spacedim>
2376 if ((polynomial_degree == 1) &&
2379 ((dim == 2) && (dim == spacedim))))
2403 vertices = this->get_vertices(cell);
2412 return internal::MappingQ1::transform_real_to_unit_cell(vertices, p);
2420 = internal::MappingQ1::transform_real_to_unit_cell(vertices, p);
2425 const double eps = 1e-15;
2426 if (-eps <= point(1) && point(1) <= 1 + eps &&
2427 -eps <= point(0) && point(0) <= 1 + eps)
2457 if (this->preserves_vertex_locations())
2458 initial_p_unit = cell->real_to_unit_cell_affine_approximation(p);
2468 std::vector<Point<spacedim> > a
2469 = this->compute_mapping_support_points (cell);
2471 std::vector<CellData<dim> > cells(1);
2472 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
2473 cells[0].vertices[i] = i;
2476 initial_p_unit = tria.
begin_active()->real_to_unit_cell_affine_approximation(p);
2479 if (dim == 1 && polynomial_degree == 1)
2481 return initial_p_unit;
2494 return this->transform_real_to_unit_cell_internal(cell, p, initial_p_unit);
2500 template <
int dim,
int spacedim>
2511 for (
unsigned int i=0; i<5; ++i)
2560 template <
int dim,
int spacedim>
2561 std::unique_ptr<typename Mapping<dim,spacedim>::InternalDataBase>
2565 auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
2566 data->initialize (this->requires_update_flags(update_flags), q, q.
size());
2568 return std::move(data);
2573 template <
int dim,
int spacedim>
2574 std::unique_ptr<typename Mapping<dim,spacedim>::InternalDataBase>
2578 auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
2579 data->initialize_face (this->requires_update_flags(update_flags),
2583 return std::move(data);
2588 template <
int dim,
int spacedim>
2589 std::unique_ptr<typename Mapping<dim,spacedim>::InternalDataBase>
2593 auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
2594 data->initialize_face (this->requires_update_flags(update_flags),
2598 return std::move(data);
2603 template <
int dim,
int spacedim>
2613 Assert (dynamic_cast<const InternalData *>(&internal_data) !=
nullptr,
2617 const unsigned int n_q_points=quadrature.
size();
2641 internal::MappingQGenericImplementation::maybe_update_q_points_Jacobians_and_grads_tensor<dim, spacedim>
2642 (computed_cell_similarity,
2649 internal::MappingQGenericImplementation::maybe_compute_q_points<dim,spacedim>
2654 internal::MappingQGenericImplementation::maybe_update_Jacobians<dim,spacedim>
2655 (computed_cell_similarity,
2659 internal::MappingQGenericImplementation::maybe_update_jacobian_grads<dim,spacedim>
2660 (computed_cell_similarity,
2666 internal::MappingQGenericImplementation::maybe_update_jacobian_pushed_forward_grads<dim,spacedim>
2667 (computed_cell_similarity,
2672 internal::MappingQGenericImplementation::maybe_update_jacobian_2nd_derivatives<dim,spacedim>
2673 (computed_cell_similarity,
2678 internal::MappingQGenericImplementation::maybe_update_jacobian_pushed_forward_2nd_derivatives<dim,spacedim>
2679 (computed_cell_similarity,
2684 internal::MappingQGenericImplementation::maybe_update_jacobian_3rd_derivatives<dim,spacedim>
2685 (computed_cell_similarity,
2690 internal::MappingQGenericImplementation::maybe_update_jacobian_pushed_forward_3rd_derivatives<dim,spacedim>
2691 (computed_cell_similarity,
2696 const UpdateFlags update_flags = data.update_each;
2697 const std::vector<double> &weights=quadrature.
get_weights();
2713 for (
unsigned int point=0; point<n_q_points; ++point)
2716 if (dim == spacedim)
2718 const double det = data.contravariant[point].determinant();
2725 Assert (det > 1e-12*Utilities::fixed_power<dim>(cell->diameter()/
2726 std::sqrt(
double(dim))),
2729 output_data.
JxW_values[point] = weights[point] * det;
2737 for (
unsigned int i=0; i<spacedim; ++i)
2738 for (
unsigned int j=0; j<dim; ++j)
2739 DX_t[j][i] = data.contravariant[point][i][j];
2742 for (
unsigned int i=0; i<dim; ++i)
2743 for (
unsigned int j=0; j<dim; ++j)
2744 G[i][j] = DX_t[i] * DX_t[j];
2759 Assert(spacedim == dim+1,
2760 ExcMessage(
"There is no (unique) cell normal for " 2762 "-dimensional cells in " 2764 "-dimensional space. This only works if the " 2765 "space dimension is one greater than the " 2766 "dimensionality of the mesh cells."));
2777 if (cell->direction_flag() ==
false)
2794 for (
unsigned int point=0; point<n_q_points; ++point)
2795 output_data.
jacobians[point] = data.contravariant[point];
2803 for (
unsigned int point=0; point<n_q_points; ++point)
2807 return computed_cell_similarity;
2817 namespace MappingQGenericImplementation
2830 template <
int dim,
int spacedim>
2832 maybe_compute_face_data (const ::MappingQGeneric<dim,spacedim> &mapping,
2833 const typename ::Triangulation<dim,spacedim>::cell_iterator &cell,
2834 const unsigned int face_no,
2835 const unsigned int subface_no,
2836 const unsigned int n_q_points,
2837 const std::vector<double> &weights,
2838 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
2841 const UpdateFlags update_flags = data.update_each;
2864 for (
unsigned int d=0; d!=dim-1; ++d)
2867 data.unit_tangentials.size(),
2869 Assert (data.aux[d].size() <=
2876 make_array_view(data.aux[d]));
2883 if (dim == spacedim)
2885 for (
unsigned int i=0; i<n_q_points; ++i)
2898 cross_product_2d(data.aux[0][i]);
2902 cross_product_3d(data.aux[0][i], data.aux[1][i]);
2918 for (
unsigned int point=0;
point<n_q_points; ++
point)
2934 cross_product_3d(DX_t[0], DX_t[1]);
2935 cell_normal /= cell_normal.
norm();
2940 cross_product_3d(data.aux[0][point], cell_normal);
2965 for (
unsigned int point=0;
point<n_q_points; ++
point)
2966 output_data.
jacobians[point] = data.contravariant[point];
2969 for (
unsigned int point=0;
point<n_q_points; ++
point)
2981 template <
int dim,
int spacedim>
2983 do_fill_fe_face_values (const ::MappingQGeneric<dim,spacedim> &mapping,
2984 const typename ::Triangulation<dim,spacedim>::cell_iterator &cell,
2985 const unsigned int face_no,
2986 const unsigned int subface_no,
2989 const typename ::MappingQGeneric<dim,spacedim>::InternalData &data,
2992 if (dim>1 && data.tensor_product_quadrature)
2994 maybe_update_q_points_Jacobians_and_grads_tensor<dim, spacedim>
3002 maybe_compute_q_points<dim,spacedim> (data_set,
3034 maybe_compute_face_data (mapping,
3035 cell, face_no, subface_no, quadrature.
size(),
3045 template <
int dim,
int spacedim>
3049 const unsigned int face_no,
3055 Assert ((dynamic_cast<const InternalData *>(&internal_data) !=
nullptr),
3066 (&cell->get_triangulation() !=
3075 internal::MappingQGenericImplementation::do_fill_fe_face_values
3079 cell->face_orientation(face_no),
3080 cell->face_flip(face_no),
3081 cell->face_rotation(face_no),
3090 template <
int dim,
int spacedim>
3094 const unsigned int face_no,
3095 const unsigned int subface_no,
3101 Assert ((dynamic_cast<const InternalData *>(&internal_data) !=
nullptr),
3112 (&cell->get_triangulation() !=
3121 internal::MappingQGenericImplementation::do_fill_fe_face_values
3123 cell, face_no, subface_no,
3125 cell->face_orientation(face_no),
3126 cell->face_flip(face_no),
3127 cell->face_rotation(face_no),
3129 cell->subface_case(face_no)),
3139 namespace MappingQGenericImplementation
3143 template <
int dim,
int spacedim,
int rank>
3151 Assert ((
dynamic_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData *
>(&mapping_data) !=
nullptr),
3153 const typename ::MappingQGeneric<dim,spacedim>::InternalData
3154 &data =
static_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData &
>(mapping_data);
3156 switch (mapping_type)
3163 for (
unsigned int i=0; i<output.size(); ++i)
3164 output[i] = apply_transformation(data.contravariant[i], input[i]);
3179 for (
unsigned int i=0; i<output.size(); ++i)
3181 output[i] = apply_transformation(data.contravariant[i], input[i]);
3182 output[i] /= data.volume_elements[i];
3194 for (
unsigned int i=0; i<output.size(); ++i)
3195 output[i] = apply_transformation(data.covariant[i], input[i]);
3206 template <
int dim,
int spacedim,
int rank>
3214 Assert ((
dynamic_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData *
>(&mapping_data) !=
nullptr),
3216 const typename ::MappingQGeneric<dim,spacedim>::InternalData
3217 &data =
static_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData &
>(mapping_data);
3219 switch (mapping_type)
3229 for (
unsigned int i=0; i<output.size(); ++i)
3232 apply_transformation(data.contravariant[i],
transpose(input[i]) );
3233 output[i] = apply_transformation(data.covariant[i], A.
transpose() );
3245 for (
unsigned int i=0; i<output.size(); ++i)
3248 apply_transformation(data.covariant[i],
transpose(input[i]) );
3249 output[i] = apply_transformation(data.covariant[i], A.
transpose() );
3265 for (
unsigned int i=0; i<output.size(); ++i)
3268 apply_transformation(data.covariant[i], input[i] );
3270 apply_transformation(data.contravariant[i], A.
transpose() );
3273 output[i] /= data.volume_elements[i];
3287 template <
int dim,
int spacedim>
3295 Assert ((
dynamic_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData *
>(&mapping_data) !=
nullptr),
3297 const typename ::MappingQGeneric<dim,spacedim>::InternalData
3298 &data =
static_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData &
>(mapping_data);
3300 switch (mapping_type)
3309 for (
unsigned int q=0; q<output.size(); ++q)
3310 for (
unsigned int i=0; i<spacedim; ++i)
3312 double tmp1[dim][dim];
3313 for (
unsigned int J=0; J<dim; ++J)
3314 for (
unsigned int K=0; K<dim; ++K)
3316 tmp1[J][K] = data.contravariant[q][i][0] * input[q][0][J][K];
3317 for (
unsigned int I=1; I<dim; ++I)
3318 tmp1[J][K] += data.contravariant[q][i][I] * input[q][I][J][K];
3320 for (
unsigned int j=0; j<spacedim; ++j)
3323 for (
unsigned int K=0; K<dim; ++K)
3325 tmp2[K] = data.covariant[q][j][0] * tmp1[0][K];
3326 for (
unsigned int J=1; J<dim; ++J)
3327 tmp2[K] += data.covariant[q][j][J] * tmp1[J][K];
3329 for (
unsigned int k=0; k<spacedim; ++k)
3331 output[q][i][j][k] = data.covariant[q][k][0] * tmp2[0];
3332 for (
unsigned int K=1; K<dim; ++K)
3333 output[q][i][j][k] += data.covariant[q][k][K] * tmp2[K];
3345 for (
unsigned int q=0; q<output.size(); ++q)
3346 for (
unsigned int i=0; i<spacedim; ++i)
3348 double tmp1[dim][dim];
3349 for (
unsigned int J=0; J<dim; ++J)
3350 for (
unsigned int K=0; K<dim; ++K)
3352 tmp1[J][K] = data.covariant[q][i][0] * input[q][0][J][K];
3353 for (
unsigned int I=1; I<dim; ++I)
3354 tmp1[J][K] += data.covariant[q][i][I] * input[q][I][J][K];
3356 for (
unsigned int j=0; j<spacedim; ++j)
3359 for (
unsigned int K=0; K<dim; ++K)
3361 tmp2[K] = data.covariant[q][j][0] * tmp1[0][K];
3362 for (
unsigned int J=1; J<dim; ++J)
3363 tmp2[K] += data.covariant[q][j][J] * tmp1[J][K];
3365 for (
unsigned int k=0; k<spacedim; ++k)
3367 output[q][i][j][k] = data.covariant[q][k][0] * tmp2[0];
3368 for (
unsigned int K=1; K<dim; ++K)
3369 output[q][i][j][k] += data.covariant[q][k][K] * tmp2[K];
3386 for (
unsigned int q=0; q<output.size(); ++q)
3387 for (
unsigned int i=0; i<spacedim; ++i)
3390 for (
unsigned int I=0; I<dim; ++I)
3391 factor[I] = data.contravariant[q][i][I] / data.volume_elements[q];
3392 double tmp1[dim][dim];
3393 for (
unsigned int J=0; J<dim; ++J)
3394 for (
unsigned int K=0; K<dim; ++K)
3396 tmp1[J][K] = factor[0] * input[q][0][J][K];
3397 for (
unsigned int I=1; I<dim; ++I)
3398 tmp1[J][K] += factor[I] * input[q][I][J][K];
3400 for (
unsigned int j=0; j<spacedim; ++j)
3403 for (
unsigned int K=0; K<dim; ++K)
3405 tmp2[K] = data.covariant[q][j][0] * tmp1[0][K];
3406 for (
unsigned int J=1; J<dim; ++J)
3407 tmp2[K] += data.covariant[q][j][J] * tmp1[J][K];
3409 for (
unsigned int k=0; k<spacedim; ++k)
3411 output[q][i][j][k] = data.covariant[q][k][0] * tmp2[0];
3412 for (
unsigned int K=1; K<dim; ++K)
3413 output[q][i][j][k] += data.covariant[q][k][K] * tmp2[K];
3429 template <
int dim,
int spacedim,
int rank>
3437 Assert ((
dynamic_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData *
>(&mapping_data) !=
nullptr),
3439 const typename ::MappingQGeneric<dim,spacedim>::InternalData
3440 &data =
static_cast<const typename ::MappingQGeneric<dim,spacedim>::InternalData &
>(mapping_data);
3442 switch (mapping_type)
3449 for (
unsigned int i=0; i<output.size(); ++i)
3450 output[i] = apply_transformation(data.covariant[i], input[i]);
3464 template <
int dim,
int spacedim>
3472 internal::MappingQGenericImplementation::transform_fields(input, mapping_type, mapping_data, output);
3477 template <
int dim,
int spacedim>
3485 internal::MappingQGenericImplementation::transform_differential_forms(input, mapping_type, mapping_data, output);
3490 template <
int dim,
int spacedim>
3498 switch (mapping_type)
3501 internal::MappingQGenericImplementation::transform_fields(input, mapping_type, mapping_data, output);
3507 internal::MappingQGenericImplementation::transform_gradients(input, mapping_type, mapping_data, output);
3516 template <
int dim,
int spacedim>
3526 Assert (dynamic_cast<const InternalData *>(&mapping_data) !=
nullptr,
3530 switch (mapping_type)
3537 for (
unsigned int q=0; q<output.size(); ++q)
3538 for (
unsigned int i=0; i<spacedim; ++i)
3539 for (
unsigned int j=0; j<spacedim; ++j)
3542 for (
unsigned int K=0; K<dim; ++K)
3544 tmp[K] = data.
covariant[q][j][0] * input[q][i][0][K];
3545 for (
unsigned int J=1; J<dim; ++J)
3546 tmp[K] += data.
covariant[q][j][J] * input[q][i][J][K];
3548 for (
unsigned int k=0; k<spacedim; ++k)
3550 output[q][i][j][k] = data.
covariant[q][k][0] * tmp[0];
3551 for (
unsigned int K=1; K<dim; ++K)
3552 output[q][i][j][k] += data.
covariant[q][k][K] * tmp[K];
3565 template <
int dim,
int spacedim>
3573 switch (mapping_type)
3578 internal::MappingQGenericImplementation::transform_hessians(input, mapping_type, mapping_data, output);
3587 template <
int dim,
int spacedim>
3594 if (this->polynomial_degree==2)
3596 for (
unsigned int line_no=0; line_no<GeometryInfo<dim>::lines_per_cell; ++line_no)
3598 const typename Triangulation<dim,spacedim>::line_iterator line =
3600 static_cast<typename Triangulation<dim,spacedim>::line_iterator
>(cell) :
3601 cell->line(line_no));
3607 cell->get_manifold()
3617 std::vector<Point<spacedim> > tmp_points;
3620 for (
unsigned int line_no=0; line_no<GeometryInfo<dim>::lines_per_cell; ++line_no)
3622 const typename Triangulation<dim,spacedim>::line_iterator
3625 static_cast<typename Triangulation<dim,spacedim>::line_iterator
>(cell)
3627 cell->line(line_no));
3633 cell->get_manifold() :
3639 tmp_points.resize(this->polynomial_degree-1);
3640 boundary->get_intermediate_points_on_line(line, tmp_points);
3641 if (dim != 3 || cell->line_orientation(line_no))
3642 a.insert (a.end(), tmp_points.begin(), tmp_points.end());
3644 a.insert (a.end(), tmp_points.rbegin(), tmp_points.rend());
3648 const std::array<Point<spacedim>, 2> vertices
3656 const std::size_t n_rows = support_point_weights_perimeter_to_interior[0].size(0);
3657 a.resize(a.size() + n_rows);
3661 support_point_weights_perimeter_to_interior[0],
3679 std::vector<Point<3> > tmp_points;
3682 for (
unsigned int face_no=0; face_no<faces_per_cell; ++face_no)
3687 const bool face_orientation = cell->face_orientation(face_no),
3688 face_flip = cell->face_flip (face_no),
3689 face_rotation = cell->face_rotation (face_no);
3696 for (
unsigned int i=0; i<vertices_per_face; ++i)
3697 Assert(face->vertex_index(i)==cell->vertex_index(
3706 for (
unsigned int i=0; i<lines_per_face; ++i)
3708 face_no, i, face_orientation, face_flip, face_rotation)),
3720 if (boundary !=
nullptr &&
3721 std::string(
typeid(*boundary).name()).find(
"StraightBoundary") ==
3725 tmp_points.resize((polynomial_degree-1)*(polynomial_degree-1));
3727 for (
unsigned int i=0; i<tmp_points.size(); ++i)
3728 a.push_back(tmp_points[fe_q->adjust_quad_dof_index_for_face_orientation(i,
3738 boost::container::small_vector<Point<3>, 200>
3741 for (
unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
3743 if (polynomial_degree > 1)
3744 for (
unsigned int line=0; line<GeometryInfo<2>::lines_per_cell; ++line)
3745 for (
unsigned int i=0; i<polynomial_degree-1; ++i)
3746 tmp_points[4+line*(polynomial_degree-1)+i] =
3748 (polynomial_degree-1)*
3751 const std::size_t n_rows = support_point_weights_perimeter_to_interior[1].size(0);
3752 a.resize(a.size() + n_rows);
3754 face->get_manifold().get_new_points (
make_array_view(tmp_points.begin(),
3756 support_point_weights_perimeter_to_interior[1],
3773 std::vector<Point<3> > points((polynomial_degree-1)*(polynomial_degree-1));
3775 a.insert(a.end(), points.begin(), points.end());
3780 for (
unsigned int i=0; i<GeometryInfo<2>::vertices_per_cell; ++i)
3781 vertices[i] = cell->vertex(i);
3783 Table<2,double> weights(Utilities::fixed_power<2>(polynomial_degree-1),
3785 for (
unsigned int q=0, q2=0; q2<polynomial_degree-1; ++q2)
3786 for (
unsigned int q1=0; q1<polynomial_degree-1; ++q1, ++q)
3789 line_support_points.point(q2+1)[0]);
3790 for (
unsigned int i=0; i<GeometryInfo<2>::vertices_per_cell; ++i)
3794 const std::size_t n_rows = weights.size(0);
3795 a.resize(a.size() + n_rows);
3806 template <
int dim,
int spacedim>
3817 template <
int dim,
int spacedim>
3818 std::vector<Point<spacedim> >
3823 std::vector<Point<spacedim> > a;
3824 a.reserve(Utilities::fixed_power<dim>(polynomial_degree+1));
3825 for (
unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
3826 a.push_back(cell->vertex(i));
3828 if (this->polynomial_degree > 1)
3835 bool all_manifold_ids_are_equal = (dim == spacedim);
3836 if (all_manifold_ids_are_equal &&
3839 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
3840 if (&cell->face(f)->get_manifold() != &cell->get_manifold())
3841 all_manifold_ids_are_equal =
false;
3844 for (
unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
3845 if (&cell->line(l)->get_manifold() != &cell->get_manifold())
3846 all_manifold_ids_are_equal =
false;
3849 if (all_manifold_ids_are_equal)
3851 const std::size_t n_rows = support_point_weights_cell.size(0);
3852 a.resize(a.size() + n_rows);
3856 support_point_weights_cell,
3863 add_line_support_points(cell, a);
3868 add_line_support_points(cell, a);
3871 if (dim != spacedim)
3872 add_quad_support_points(cell, a);
3875 const std::size_t n_rows = support_point_weights_perimeter_to_interior[1].size(0);
3876 a.resize(a.size() + n_rows);
3880 support_point_weights_perimeter_to_interior[1],
3887 add_line_support_points (cell, a);
3888 add_quad_support_points (cell, a);
3892 const std::size_t n_rows = support_point_weights_perimeter_to_interior[2].size(0);
3893 a.resize(a.size() + n_rows);
3897 support_point_weights_perimeter_to_interior[2],
3914 #include "mapping_q_generic.inst" 3917 DEAL_II_NAMESPACE_CLOSE
Transformed quadrature weights.
std::vector< DerivativeForm< 1, dim, spacedim > > covariant
void loop(ITERATOR begin, typename identity< ITERATOR >::type end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(DOFINFO &, DOFINFO &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, ASSEMBLER &assembler, const LoopControl &lctrl=LoopControl())
static const unsigned int invalid_unsigned_int
#define AssertDimension(dim1, dim2)
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Quadrature< dim-1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
Number determinant(const SymmetricTensor< 2, dim, Number > &)
std::vector< Tensor< 2, dim > > shape_second_derivatives
const unsigned int polynomial_degree
Contravariant transformation.
const std::vector< Point< dim > > & get_points() const
const std::vector< double > & get_weights() const
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Point< spacedim > point(const gp_Pnt &p, const double &tolerance=1e-10)
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
std::vector< Table< 2, double > > support_point_weights_perimeter_to_interior
std::vector< Tensor< 4, dim > > shape_fourth_derivatives
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
Outer normal vector, not normalized.
std::vector< Polynomial< double > > generate_complete_Lagrange_basis(const std::vector< Point< 1 > > &points)
Table< 2, double > support_point_weights_cell
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
Determinant of the Jacobian.
active_cell_iterator begin_active(const unsigned int level=0) const
std::conditional< dim==1, std::array< Quadrature< 1 >, dim >, const std::array< Quadrature< 1 >, dim > & >::type get_tensor_basis() const
Triangulation< dim, spacedim >::cell_iterator cell_of_current_support_points
Transformed quadrature points.
const Tensor< 3, dim > & third_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
virtual CellSimilarity::Similarity fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
MappingQGeneric(const unsigned int polynomial_degree)
#define AssertThrow(cond, exc)
bool tensor_product_quadrature
numbers::NumberTraits< Number >::real_type norm() const
static DataSetDescriptor cell()
const Tensor< 4, dim > & fourth_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
const std::unique_ptr< FE_Q< dim > > fe_q
InternalData(const unsigned int polynomial_degree)
std::unique_ptr< To > dynamic_unique_cast(std::unique_ptr< From > &&p)
std::vector< Tensor< 1, dim > > shape_derivatives
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const Quadrature< dim-1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)
virtual void add_quad_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< spacedim > > &a) const
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type > make_array_view(const Iterator begin, const Iterator end)
void compute_shape_function_values(const std::vector< Point< dim > > &unit_points)
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
static ::ExceptionBase & ExcMessage(std::string arg1)
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
Tensor< 1, dim, Number > cross_product_2d(const Tensor< 1, dim, Number > &src)
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
Abstract base class for mapping classes.
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingType type, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const override
virtual void create_triangulation(const std::vector< Point< spacedim > > &vertices, const std::vector< CellData< dim > > &cells, const SubCellData &subcelldata)
std::vector< Point< spacedim > > mapping_support_points
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
SymmetricTensor< rank_, dim, Number > transpose(const SymmetricTensor< rank_, dim, Number > &t)
void initialize(const UpdateFlags update_flags, const Quadrature< dim > &quadrature, const unsigned int n_original_q_points)
Gradient of volume element.
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int size() const
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
Tensor< 1, dim, Number > cross_product_3d(const Tensor< 1, dim, Number > &src1, const Tensor< 1, dim, Number > &src2)
Point< dim > transform_real_to_unit_cell_internal(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p, const Point< dim > &initial_p_unit) const
static Point< dim > project_to_unit_cell(const Point< dim > &p)
unsigned int get_degree() const
double norm(const FEValuesBase< dim > &fe, const VectorSlice< const std::vector< std::vector< Tensor< 1, dim > > > > &Du)
virtual void get_new_points(const ArrayView< const Point< spacedim >> &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim >> new_points) const
const double & shape(const unsigned int qpoint, const unsigned int shape_nr) const
Number determinant(const SymmetricTensor< 2, dim, Number > &t)
VectorizedArray< Number > sqrt(const ::VectorizedArray< Number > &x)
const types::manifold_id invalid_manifold_id
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const Quadrature< dim-1 > &quadrature) const override
Number determinant(const Tensor< 2, dim, Number > &t)
static double d_linear_shape_function(const Point< dim > &xi, const unsigned int i)
unsigned int n_dofs_per_cell() const
virtual std::size_t memory_consumption() const override
virtual std::vector< Point< spacedim > > compute_mapping_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
virtual void add_line_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< spacedim > > &a) const
static ::ExceptionBase & ExcNotImplemented()
std::vector< Tensor< 3, dim > > shape_third_derivatives
const Tensor< 2, dim > & second_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
const Tensor< 1, dim > & derivative(const unsigned int qpoint, const unsigned int shape_nr) const
void initialize_face(const UpdateFlags update_flags, const Quadrature< dim > &quadrature, const unsigned int n_original_q_points)
double compute_value(const unsigned int i, const Point< dim > &p) const
std::vector< double > shape_values
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
static double subface_ratio(const internal::SubfaceCase< dim > &subface_case, const unsigned int subface_no)
bool is_tensor_product() const
const Manifold< dim, spacedim > & get_manifold(const types::manifold_id number) const
Covariant transformation.
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
static ::ExceptionBase & ExcInternalError()
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim-1 > &quadrature) const override