AssertDimension(dim, dim_q);
- const auto quad = Quadrature<dim>(quad_in);
- const auto fe = &fe_in.base_element(base_element_number);
+ const auto quad = Quadrature<dim>(quad_in);
+ const auto &fe = fe_in.base_element(base_element_number);
n_dimensions = dim;
n_components = fe_in.n_components();
n_q_points = quad.size();
- dofs_per_component_on_cell = fe->n_dofs_per_cell();
+ dofs_per_component_on_cell = fe.n_dofs_per_cell();
n_q_points_face = 0; // not implemented yet
dofs_per_component_on_face = 0; //
- Assert(fe->n_components() == 1,
+ Assert(fe.n_components() == 1,
ExcMessage(
"FEEvaluation only works for scalar finite elements."));
// a 1D quadrature rule. However, in this case we are not able to
// define that rule anyway so other code cannot use this information.
- univariate_shape_data.fe_degree = fe->degree;
+ univariate_shape_data.fe_degree = fe.degree;
univariate_shape_data.n_q_points_1d = quad.size();
- if ((fe->n_dofs_per_cell() == 0) || (quad.size() == 0))
+ if ((fe.n_dofs_per_cell() == 0) || (quad.size() == 0))
return;
// grant write access to common univariate shape data
auto &shape_gradients_face =
univariate_shape_data.shape_gradients_face;
- const unsigned int n_dofs = fe->n_dofs_per_cell();
+ const unsigned int n_dofs = fe.n_dofs_per_cell();
const unsigned int array_size = n_dofs * n_q_points;
for (unsigned int q = 0; q < n_q_points; ++q)
{
shape_values[i * n_q_points + q] =
- fe->shape_value(i, quad.point(q));
+ fe.shape_value(i, quad.point(q));
- const auto grad = fe->shape_grad(i, quad.point(q));
+ const auto grad = fe.shape_grad(i, quad.point(q));
for (int d = 0; d < dim; ++d)
shape_gradients[d * n_dofs * n_q_points + i * n_q_points +
projected_quad_face.point(q + offset);
shape_values_face(f, o, i * n_q_points_face + q) =
- fe->shape_value(i, point);
+ fe.shape_value(i, point);
- const auto grad = fe->shape_grad(i, point);
+ const auto grad = fe.shape_grad(i, point);
for (int d = 0; d < dim; ++d)
shape_gradients_face(
std::vector<unsigned int> scalar_lexicographic;
get_element_type_specific_information(fe_in,
- *fe,
+ fe,
base_element_number,
element_type,
scalar_lexicographic,
const auto quad = quad_in.get_tensor_basis()[0];
- const FiniteElement<dim> *fe = &fe_in.base_element(base_element_number);
+ const FiniteElement<dim> &fe = fe_in.base_element(base_element_number);
n_dimensions = dim;
n_components = fe_in.n_components();
- Assert(fe->n_components() == 1,
+ Assert(fe.n_components() == 1,
ExcMessage("FEEvaluation only works for scalar finite elements."));
// assuming isotropy of dimensions and components
data_access.reinit(n_dimensions, n_components);
data_access.fill(&univariate_shape_data);
univariate_shape_data.quadrature = quad;
- univariate_shape_data.fe_degree = fe->degree;
+ univariate_shape_data.fe_degree = fe.degree;
univariate_shape_data.n_q_points_1d = quad.size();
- if ((fe->n_dofs_per_cell() == 0) || (quad.size() == 0))
+ if ((fe.n_dofs_per_cell() == 0) || (quad.size() == 0))
return;
// grant write access to common univariate shape data
auto &nodal_at_cell_boundaries =
univariate_shape_data.nodal_at_cell_boundaries;
- const unsigned int fe_degree = fe->degree;
+ const unsigned int fe_degree = fe.degree;
const unsigned int n_q_points_1d = quad.size();
const unsigned int n_dofs_1d =
- std::min(fe->n_dofs_per_cell(), fe_degree + 1);
+ std::min(fe.n_dofs_per_cell(), fe_degree + 1);
// renumber (this is necessary for FE_Q, for example, since there the
// vertex DoFs come first, which is incompatible with the lexicographic
Point<dim> unit_point;
{
// find numbering to lexicographic
- Assert(fe->n_components() == 1,
- ExcMessage("Expected a scalar element"));
+ Assert(fe.n_components() == 1, ExcMessage("Expected a scalar element"));
get_element_type_specific_information(fe_in,
- *fe,
+ fe,
base_element_number,
element_type,
scalar_lexicographic,
// unit support point, assuming that fe.shape_value(0,unit_point) ==
// 1. otherwise, need other entry point (e.g. generating a 1D element
// by reading the name, as done before r29356)
- if (fe->has_support_points())
- unit_point = fe->get_unit_support_points()[scalar_lexicographic[0]];
- Assert(fe->n_dofs_per_cell() == 0 ||
- std::abs(fe->shape_value(scalar_lexicographic[0], unit_point) -
+ if (fe.has_support_points())
+ unit_point = fe.get_unit_support_points()[scalar_lexicographic[0]];
+ Assert(fe.n_dofs_per_cell() == 0 ||
+ std::abs(fe.shape_value(scalar_lexicographic[0], unit_point) -
1) < 1e-13,
ExcInternalError("Could not decode 1D shape functions for the "
"element " +
- fe->get_name()));
+ fe.get_name()));
}
n_q_points = Utilities::fixed_power<dim>(n_q_points_1d);
n_q_points_face =
- dim > 1 ? Utilities::fixed_power<dim - 1>(n_q_points_1d) : 1;
- dofs_per_component_on_cell = fe->n_dofs_per_cell();
+ (dim > 1 ? Utilities::fixed_power<dim - 1>(n_q_points_1d) : 1);
+ dofs_per_component_on_cell = fe.n_dofs_per_cell();
dofs_per_component_on_face =
- dim > 1 ? Utilities::fixed_power<dim - 1>(fe_degree + 1) : 1;
+ (dim > 1 ? Utilities::fixed_power<dim - 1>(fe_degree + 1) : 1);
const unsigned int array_size = n_dofs_1d * n_q_points_1d;
shape_gradients.resize_fast(array_size);
q_point[0] = quad.get_points()[q][0];
shape_values[i * n_q_points_1d + q] =
- fe->shape_value(my_i, q_point);
+ fe.shape_value(my_i, q_point);
shape_gradients[i * n_q_points_1d + q] =
- fe->shape_grad(my_i, q_point)[0];
+ fe.shape_grad(my_i, q_point)[0];
shape_hessians[i * n_q_points_1d + q] =
- fe->shape_grad_grad(my_i, q_point)[0][0];
+ fe.shape_grad_grad(my_i, q_point)[0][0];
// evaluate basis functions on the two 1D subfaces (i.e., at the
// positions divided by one half and shifted by one half,
// respectively)
q_point[0] *= 0.5;
values_within_subface[0][i * n_q_points_1d + q] =
- fe->shape_value(my_i, q_point);
+ fe.shape_value(my_i, q_point);
gradients_within_subface[0][i * n_q_points_1d + q] =
- fe->shape_grad(my_i, q_point)[0];
+ fe.shape_grad(my_i, q_point)[0];
hessians_within_subface[0][i * n_q_points_1d + q] =
- fe->shape_grad_grad(my_i, q_point)[0][0];
+ fe.shape_grad_grad(my_i, q_point)[0][0];
q_point[0] += 0.5;
values_within_subface[1][i * n_q_points_1d + q] =
- fe->shape_value(my_i, q_point);
+ fe.shape_value(my_i, q_point);
gradients_within_subface[1][i * n_q_points_1d + q] =
- fe->shape_grad(my_i, q_point)[0];
+ fe.shape_grad(my_i, q_point)[0];
hessians_within_subface[1][i * n_q_points_1d + q] =
- fe->shape_grad_grad(my_i, q_point)[0][0];
+ fe.shape_grad_grad(my_i, q_point)[0][0];
}
// evaluate basis functions on the 1D faces, i.e., in zero and one
Point<dim> q_point = unit_point;
q_point[0] = 0;
- shape_data_on_face[0][i] = fe->shape_value(my_i, q_point);
+ shape_data_on_face[0][i] = fe.shape_value(my_i, q_point);
shape_data_on_face[0][i + n_dofs_1d] =
- fe->shape_grad(my_i, q_point)[0];
+ fe.shape_grad(my_i, q_point)[0];
shape_data_on_face[0][i + 2 * n_dofs_1d] =
- fe->shape_grad_grad(my_i, q_point)[0][0];
+ fe.shape_grad_grad(my_i, q_point)[0][0];
q_point[0] = 1;
- shape_data_on_face[1][i] = fe->shape_value(my_i, q_point);
+ shape_data_on_face[1][i] = fe.shape_value(my_i, q_point);
shape_data_on_face[1][i + n_dofs_1d] =
- fe->shape_grad(my_i, q_point)[0];
+ fe.shape_grad(my_i, q_point)[0];
shape_data_on_face[1][i + 2 * n_dofs_1d] =
- fe->shape_grad_grad(my_i, q_point)[0][0];
+ fe.shape_grad_grad(my_i, q_point)[0][0];
}
if (n_q_points_1d < 200)
// errors low.
inverse_shape_values.resize_fast(array_size);
FullMatrix<double> transform_from_gauss(n_dofs_1d, n_dofs_1d);
- if (fe->has_support_points())
+ if (fe.has_support_points())
{
for (unsigned int i = 0; i < n_dofs_1d; ++i)
for (unsigned int j = 0; j < n_dofs_1d; ++j)
transform_from_gauss(i, j) = fe_project.shape_value(
j,
Point<1>(
- fe->get_unit_support_points()[scalar_lexicographic[i]]
- [0]));
+ fe.get_unit_support_points()[scalar_lexicographic[i]]
+ [0]));
FullMatrix<double> result(n_dofs_1d, n_q_points_1d);
transform_from_gauss.mmult(result, project_to_dof_space);
q_point[0] = quad_project.point(i)[0];
transform_from_gauss(i, j) =
- fe->shape_value(scalar_lexicographic[j], q_point);
+ fe.shape_value(scalar_lexicographic[j], q_point);
}
Householder<double> H(transform_from_gauss);
Vector<double> in(n_dofs_1d), out(n_dofs_1d);