& /*output_data*/) const override
{
// generate a new data object and initialize some fields
- auto data = std_cxx14::make_unique<
+ auto data_ptr = std_cxx14::make_unique<
typename FiniteElement<1, spacedim>::InternalDataBase>();
- data->update_each = requires_update_flags(update_flags);
+ data_ptr->update_each = requires_update_flags(update_flags);
const unsigned int n_q_points = quadrature.size();
AssertDimension(n_q_points, 1);
(void)n_q_points;
// No derivatives of this element are implemented.
- if (data->update_each & update_gradients ||
- data->update_each & update_hessians)
+ if (data_ptr->update_each & update_gradients ||
+ data_ptr->update_each & update_hessians)
{
Assert(false, ExcNotImplemented());
}
- return std::move(data);
+ return data_ptr;
}
std::unique_ptr<typename FiniteElement<1, spacedim>::InternalDataBase>
{
// generate a new data object and
// initialize some fields
- auto data = std_cxx14::make_unique<InternalData>();
- data->update_each = requires_update_flags(update_flags);
+ std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.update_each = requires_update_flags(update_flags);
const unsigned int n_q_points = quadrature.size();
if ((update_flags & update_values) &&
!((output_data.shape_values.n_rows() > 0) &&
(output_data.shape_values.n_cols() == n_q_points)))
- data->shape_values.reinit(this->dofs_per_cell, n_q_points);
+ data.shape_values.reinit(this->dofs_per_cell, n_q_points);
if (update_flags & update_gradients)
- data->shape_gradients.reinit(this->dofs_per_cell, n_q_points);
+ data.shape_gradients.reinit(this->dofs_per_cell, n_q_points);
if (update_flags & update_hessians)
- data->shape_hessians.reinit(this->dofs_per_cell, n_q_points);
+ data.shape_hessians.reinit(this->dofs_per_cell, n_q_points);
if (update_flags & update_3rd_derivatives)
- data->shape_3rd_derivatives.reinit(this->dofs_per_cell, n_q_points);
+ data.shape_3rd_derivatives.reinit(this->dofs_per_cell, n_q_points);
// next already fill those fields of which we have information by
// now. note that the shape gradients are only those on the unit
output_data.shape_values[k][i] = values[k];
else
for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
- data->shape_values[k][i] = values[k];
+ data.shape_values[k][i] = values[k];
}
// for everything else, derivatives need to be transformed,
// copy stuff into where FEValues wants it
if (update_flags & update_gradients)
for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
- data->shape_gradients[k][i] = grads[k];
+ data.shape_gradients[k][i] = grads[k];
if (update_flags & update_hessians)
for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
- data->shape_hessians[k][i] = grad_grads[k];
+ data.shape_hessians[k][i] = grad_grads[k];
if (update_flags & update_3rd_derivatives)
for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
- data->shape_3rd_derivatives[k][i] = third_derivatives[k];
+ data.shape_3rd_derivatives[k][i] = third_derivatives[k];
}
- return std::move(data);
+ return data_ptr;
}
virtual void
{
// generate a new data object and
// initialize some fields
- auto data = std_cxx14::make_unique<InternalData>();
- data->update_each = requires_update_flags(update_flags);
+ std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.update_each = requires_update_flags(update_flags);
const unsigned int n_q_points = quadrature.size();
// initialize fields only if really
// necessary. otherwise, don't
// allocate memory
- if (data->update_each & update_values)
+ if (data.update_each & update_values)
{
values.resize(poly_space.n());
- data->shape_values.resize(poly_space.n(),
- std::vector<double>(n_q_points));
+ data.shape_values.resize(poly_space.n(),
+ std::vector<double>(n_q_points));
for (unsigned int i = 0; i < n_q_points; ++i)
{
poly_space.compute(quadrature.point(i),
empty_vector_of_4th_order_tensors);
for (unsigned int k = 0; k < poly_space.n(); ++k)
- data->shape_values[k][i] = values[k];
+ data.shape_values[k][i] = values[k];
}
}
// No derivatives of this element
// are implemented.
- if (data->update_each & update_gradients ||
- data->update_each & update_hessians)
+ if (data.update_each & update_gradients ||
+ data.update_each & update_hessians)
{
Assert(false, ExcNotImplemented());
}
- return std::move(data);
+ return data_ptr;
}
std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
{
// generate a new data object and
// initialize some fields
- auto data = std_cxx14::make_unique<InternalData>();
- data->update_each = requires_update_flags(update_flags);
+ std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.update_each = requires_update_flags(update_flags);
const unsigned int n_q_points = quadrature.size();
std::vector<Tensor<5, dim>> fourth_derivatives(0);
if (update_flags & (update_values | update_gradients | update_hessians))
- data->sign_change.resize(this->dofs_per_cell);
+ data.sign_change.resize(this->dofs_per_cell);
// initialize fields only if really
// necessary. otherwise, don't
if (update_flags & update_values)
{
values.resize(this->dofs_per_cell);
- data->shape_values.reinit(this->dofs_per_cell, n_q_points);
+ data.shape_values.reinit(this->dofs_per_cell, n_q_points);
if (mapping_type != mapping_none)
- data->transformed_shape_values.resize(n_q_points);
+ data.transformed_shape_values.resize(n_q_points);
}
if (update_flags & update_gradients)
{
grads.resize(this->dofs_per_cell);
- data->shape_grads.reinit(this->dofs_per_cell, n_q_points);
- data->transformed_shape_grads.resize(n_q_points);
+ data.shape_grads.reinit(this->dofs_per_cell, n_q_points);
+ data.transformed_shape_grads.resize(n_q_points);
if ((mapping_type == mapping_raviart_thomas) ||
(mapping_type == mapping_piola) ||
(mapping_type == mapping_nedelec) ||
(mapping_type == mapping_contravariant))
- data->untransformed_shape_grads.resize(n_q_points);
+ data.untransformed_shape_grads.resize(n_q_points);
}
if (update_flags & update_hessians)
{
grad_grads.resize(this->dofs_per_cell);
- data->shape_grad_grads.reinit(this->dofs_per_cell, n_q_points);
- data->transformed_shape_hessians.resize(n_q_points);
+ data.shape_grad_grads.reinit(this->dofs_per_cell, n_q_points);
+ data.transformed_shape_hessians.resize(n_q_points);
if (mapping_type != mapping_none)
- data->untransformed_shape_hessian_tensors.resize(n_q_points);
+ data.untransformed_shape_hessian_tensors.resize(n_q_points);
}
// Compute shape function values
{
if (inverse_node_matrix.n_cols() == 0)
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
- data->shape_values[i][k] = values[i];
+ data.shape_values[i][k] = values[i];
else
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
{
Tensor<1, dim> add_values;
for (unsigned int j = 0; j < this->dofs_per_cell; ++j)
add_values += inverse_node_matrix(j, i) * values[j];
- data->shape_values[i][k] = add_values;
+ data.shape_values[i][k] = add_values;
}
}
{
if (inverse_node_matrix.n_cols() == 0)
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
- data->shape_grads[i][k] = grads[i];
+ data.shape_grads[i][k] = grads[i];
else
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
{
Tensor<2, dim> add_grads;
for (unsigned int j = 0; j < this->dofs_per_cell; ++j)
add_grads += inverse_node_matrix(j, i) * grads[j];
- data->shape_grads[i][k] = add_grads;
+ data.shape_grads[i][k] = add_grads;
}
}
{
if (inverse_node_matrix.n_cols() == 0)
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
- data->shape_grad_grads[i][k] = grad_grads[i];
+ data.shape_grad_grads[i][k] = grad_grads[i];
else
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
{
for (unsigned int j = 0; j < this->dofs_per_cell; ++j)
add_grad_grads +=
inverse_node_matrix(j, i) * grad_grads[j];
- data->shape_grad_grads[i][k] = add_grad_grads;
+ data.shape_grad_grads[i][k] = add_grad_grads;
}
}
}
- return std::move(data);
+ return data_ptr;
}
virtual void
& /*output_data*/) const
{
// generate a new data object
- auto data = std_cxx14::make_unique<
+ auto data_ptr = std_cxx14::make_unique<
typename FiniteElement<dim, spacedim>::InternalDataBase>();
- data->update_each = requires_update_flags(update_flags);
+ data_ptr->update_each = requires_update_flags(update_flags);
// other than that, there is nothing we can add here as discussed
// in the general documentation of this class
- return std::move(data);
+ return data_ptr;
}
// Pass ownership of the FiniteElement::InternalDataBase object
// that fes_data points to, to the new InternalData object.
auto update_each_flags = fes_data->update_each;
- auto data = std_cxx14::make_unique<InternalData>(std::move(fes_data));
+ std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>(std::move(fes_data));
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
// copy update_each from FESystem data:
- data->update_each = update_each_flags;
+ data.update_each = update_each_flags;
// resize cache array according to requested flags
- data->enrichment.resize(this->n_base_elements());
+ data.enrichment.resize(this->n_base_elements());
const unsigned int n_q_points = quadrature.size();
for (unsigned int base = 0; base < this->n_base_elements(); ++base)
{
- data->enrichment[base].resize(this->element_multiplicity(base));
+ data.enrichment[base].resize(this->element_multiplicity(base));
for (unsigned int m = 0; m < this->element_multiplicity(base); ++m)
{
if (flags & update_values)
- data->enrichment[base][m].values.resize(n_q_points);
+ data.enrichment[base][m].values.resize(n_q_points);
if (flags & update_gradients)
- data->enrichment[base][m].gradients.resize(n_q_points);
+ data.enrichment[base][m].gradients.resize(n_q_points);
if (flags & update_hessians)
- data->enrichment[base][m].hessians.resize(n_q_points);
+ data.enrichment[base][m].hessians.resize(n_q_points);
}
}
- return std::move(data);
+ return data_ptr;
}
spacedim>
& /*output_data*/) const
{
- auto data = std_cxx14::make_unique<InternalData>();
- data->update_each = update_each(update_flags) | update_once(update_flags);
+ std::unique_ptr<
+ typename dealii::FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.update_each = update_each(update_flags) | update_once(update_flags);
// Useful quantities:
const unsigned int degree(this->degree - 1); // Note: FE holds input degree+1
const unsigned int n_line_dofs = this->dofs_per_line * lines_per_cell;
const unsigned int n_face_dofs = this->dofs_per_quad * faces_per_cell;
- const UpdateFlags flags(data->update_each);
+ const UpdateFlags flags(data.update_each);
const unsigned int n_q_points = quadrature.size();
// Resize the internal data storage:
- data->sigma_imj_values.resize(
+ data.sigma_imj_values.resize(
n_q_points,
std::vector<std::vector<double>>(vertices_per_cell,
std::vector<double>(vertices_per_cell)));
- data->sigma_imj_grads.resize(vertices_per_cell,
- std::vector<std::vector<double>>(
- vertices_per_cell, std::vector<double>(dim)));
+ data.sigma_imj_grads.resize(vertices_per_cell,
+ std::vector<std::vector<double>>(
+ vertices_per_cell, std::vector<double>(dim)));
// Resize shape function arrays according to update flags:
if (flags & update_values)
{
- data->shape_values.resize(this->dofs_per_cell,
- std::vector<Tensor<1, dim>>(n_q_points));
+ data.shape_values.resize(this->dofs_per_cell,
+ std::vector<Tensor<1, dim>>(n_q_points));
}
if (flags & update_gradients)
{
- data->shape_grads.resize(this->dofs_per_cell,
- std::vector<DerivativeForm<1, dim, dim>>(
- n_q_points));
+ data.shape_grads.resize(this->dofs_per_cell,
+ std::vector<DerivativeForm<1, dim, dim>>(
+ n_q_points));
}
// Not implementing second derivatives yet:
if (flags & update_hessians)
{
for (unsigned int j = 0; j < vertices_per_cell; ++j)
{
- data->sigma_imj_values[q][i][j] =
+ data.sigma_imj_values[q][i][j] =
sigma[q][i] - sigma[q][j];
}
}
// Can now calculate the gradient, only non-zero in the
// component given: Note some i,j combinations will be
// incorrect, but only on invalid edges.
- data->sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
+ data.sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
2.0 * sigma_imj_sign[i][j];
}
}
// with global numbering matching that of the reference element:
// Resize the edge parameterisations
- data->edge_sigma_values.resize(lines_per_cell);
- data->edge_sigma_grads.resize(lines_per_cell);
+ data.edge_sigma_values.resize(lines_per_cell);
+ data.edge_sigma_grads.resize(lines_per_cell);
for (unsigned int m = 0; m < lines_per_cell; ++m)
{
- data->edge_sigma_values[m].resize(n_q_points);
+ data.edge_sigma_values[m].resize(n_q_points);
// sigma grads are constant in a cell (no need for quad points)
- data->edge_sigma_grads[m].resize(dim);
+ data.edge_sigma_grads[m].resize(dim);
}
// Fill the values for edge lambda and edge sigma:
0,
0};
- data->edge_lambda_values.resize(lines_per_cell,
- std::vector<double>(n_q_points));
- data->edge_lambda_grads_2d.resize(lines_per_cell,
- std::vector<double>(dim));
+ data.edge_lambda_values.resize(lines_per_cell,
+ std::vector<double>(n_q_points));
+ data.edge_lambda_grads_2d.resize(lines_per_cell,
+ std::vector<double>(dim));
for (unsigned int m = 0; m < lines_per_cell; ++m)
{
// e1=max(reference vertex numbering on this edge)
GeometryInfo<dim>::line_to_cell_vertices(m, 0));
for (unsigned int q = 0; q < n_q_points; ++q)
{
- data->edge_sigma_values[m][q] =
- data->sigma_imj_values[q][e2][e1];
- data->edge_lambda_values[m][q] =
- lambda[q][e1] + lambda[q][e2];
+ data.edge_sigma_values[m][q] =
+ data.sigma_imj_values[q][e2][e1];
+ data.edge_lambda_values[m][q] = lambda[q][e1] + lambda[q][e2];
}
- data->edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
+ data.edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
}
- data->edge_lambda_grads_2d[0] = {-1.0, 0.0};
- data->edge_lambda_grads_2d[1] = {1.0, 0.0};
- data->edge_lambda_grads_2d[2] = {0.0, -1.0};
- data->edge_lambda_grads_2d[3] = {0.0, 1.0};
+ data.edge_lambda_grads_2d[0] = {-1.0, 0.0};
+ data.edge_lambda_grads_2d[1] = {1.0, 0.0};
+ data.edge_lambda_grads_2d[2] = {0.0, -1.0};
+ data.edge_lambda_grads_2d[3] = {0.0, 1.0};
// If the polynomial order is 0, then no more work to do:
if (degree < 1)
// Type 1:
const unsigned int dof_index1(cell_type1_offset +
shift_ij);
- data->shape_values[dof_index1][q][0] =
+ data.shape_values[dof_index1][q][0] =
2.0 * polyx[i][1] * polyy[j][0];
- data->shape_values[dof_index1][q][1] =
+ data.shape_values[dof_index1][q][1] =
2.0 * polyx[i][0] * polyy[j][1];
// Type 2:
const unsigned int dof_index2(cell_type2_offset +
shift_ij);
- data->shape_values[dof_index2][q][0] =
- data->shape_values[dof_index1][q][0];
- data->shape_values[dof_index2][q][1] =
- -1.0 * data->shape_values[dof_index1][q][1];
+ data.shape_values[dof_index2][q][0] =
+ data.shape_values[dof_index1][q][0];
+ data.shape_values[dof_index2][q][1] =
+ -1.0 * data.shape_values[dof_index1][q][1];
}
// Type 3:
const unsigned int dof_index3_1(cell_type3_offset1 +
j);
- data->shape_values[dof_index3_1][q][0] = polyy[j][0];
- data->shape_values[dof_index3_1][q][1] = 0.0;
+ data.shape_values[dof_index3_1][q][0] = polyy[j][0];
+ data.shape_values[dof_index3_1][q][1] = 0.0;
const unsigned int dof_index3_2(cell_type3_offset2 +
j);
- data->shape_values[dof_index3_2][q][0] = 0.0;
- data->shape_values[dof_index3_2][q][1] = polyx[j][0];
+ data.shape_values[dof_index3_2][q][0] = 0.0;
+ data.shape_values[dof_index3_2][q][1] = polyx[j][0];
}
}
if (flags & update_gradients)
// Type 1:
const unsigned int dof_index1(cell_type1_offset +
shift_ij);
- data->shape_grads[dof_index1][q][0][0] =
+ data.shape_grads[dof_index1][q][0][0] =
4.0 * polyx[i][2] * polyy[j][0];
- data->shape_grads[dof_index1][q][0][1] =
+ data.shape_grads[dof_index1][q][0][1] =
4.0 * polyx[i][1] * polyy[j][1];
- data->shape_grads[dof_index1][q][1][0] =
- data->shape_grads[dof_index1][q][0][1];
- data->shape_grads[dof_index1][q][1][1] =
+ data.shape_grads[dof_index1][q][1][0] =
+ data.shape_grads[dof_index1][q][0][1];
+ data.shape_grads[dof_index1][q][1][1] =
4.0 * polyx[i][0] * polyy[j][2];
// Type 2:
const unsigned int dof_index2(cell_type2_offset +
shift_ij);
- data->shape_grads[dof_index2][q][0][0] =
- data->shape_grads[dof_index1][q][0][0];
- data->shape_grads[dof_index2][q][0][1] =
- data->shape_grads[dof_index1][q][0][1];
- data->shape_grads[dof_index2][q][1][0] =
- -1.0 * data->shape_grads[dof_index1][q][1][0];
- data->shape_grads[dof_index2][q][1][1] =
- -1.0 * data->shape_grads[dof_index1][q][1][1];
+ data.shape_grads[dof_index2][q][0][0] =
+ data.shape_grads[dof_index1][q][0][0];
+ data.shape_grads[dof_index2][q][0][1] =
+ data.shape_grads[dof_index1][q][0][1];
+ data.shape_grads[dof_index2][q][1][0] =
+ -1.0 * data.shape_grads[dof_index1][q][1][0];
+ data.shape_grads[dof_index2][q][1][1] =
+ -1.0 * data.shape_grads[dof_index1][q][1][1];
}
// Type 3:
const unsigned int dof_index3_1(cell_type3_offset1 +
j);
- data->shape_grads[dof_index3_1][q][0][0] = 0.0;
- data->shape_grads[dof_index3_1][q][0][1] =
+ data.shape_grads[dof_index3_1][q][0][0] = 0.0;
+ data.shape_grads[dof_index3_1][q][0][1] =
2.0 * polyy[j][1];
- data->shape_grads[dof_index3_1][q][1][0] = 0.0;
- data->shape_grads[dof_index3_1][q][1][1] = 0.0;
+ data.shape_grads[dof_index3_1][q][1][0] = 0.0;
+ data.shape_grads[dof_index3_1][q][1][1] = 0.0;
const unsigned int dof_index3_2(cell_type3_offset2 +
j);
- data->shape_grads[dof_index3_2][q][0][0] = 0.0;
- data->shape_grads[dof_index3_2][q][0][1] = 0.0;
- data->shape_grads[dof_index3_2][q][1][0] =
+ data.shape_grads[dof_index3_2][q][0][0] = 0.0;
+ data.shape_grads[dof_index3_2][q][0][1] = 0.0;
+ data.shape_grads[dof_index3_2][q][1][0] =
2.0 * polyx[j][1];
- data->shape_grads[dof_index3_2][q][1][1] = 0.0;
+ data.shape_grads[dof_index3_2][q][1][1] = 0.0;
}
}
}
{
for (unsigned int j = 0; j < vertices_per_cell; ++j)
{
- data->sigma_imj_values[q][i][j] =
+ data.sigma_imj_values[q][i][j] =
sigma[q][i] - sigma[q][j];
}
}
// Can now calculate the gradient, only non-zero in the
// component given: Note some i,j combinations will be
// incorrect, but only on invalid edges.
- data->sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
+ data.sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
2.0 * sigma_imj_sign[i][j];
}
}
// with global numbering matching that of the reference element:
// resize the edge parameterisations
- data->edge_sigma_values.resize(lines_per_cell);
- data->edge_lambda_values.resize(lines_per_cell);
- data->edge_sigma_grads.resize(lines_per_cell);
- data->edge_lambda_grads_3d.resize(lines_per_cell);
- data->edge_lambda_gradgrads_3d.resize(lines_per_cell);
+ data.edge_sigma_values.resize(lines_per_cell);
+ data.edge_lambda_values.resize(lines_per_cell);
+ data.edge_sigma_grads.resize(lines_per_cell);
+ data.edge_lambda_grads_3d.resize(lines_per_cell);
+ data.edge_lambda_gradgrads_3d.resize(lines_per_cell);
for (unsigned int m = 0; m < lines_per_cell; ++m)
{
- data->edge_sigma_values[m].resize(n_q_points);
- data->edge_lambda_values[m].resize(n_q_points);
+ data.edge_sigma_values[m].resize(n_q_points);
+ data.edge_lambda_values[m].resize(n_q_points);
// sigma grads are constant in a cell (no need for quad points)
- data->edge_sigma_grads[m].resize(dim);
+ data.edge_sigma_grads[m].resize(dim);
- data->edge_lambda_grads_3d[m].resize(n_q_points);
+ data.edge_lambda_grads_3d[m].resize(n_q_points);
for (unsigned int q = 0; q < n_q_points; ++q)
{
- data->edge_lambda_grads_3d[m][q].resize(dim);
+ data.edge_lambda_grads_3d[m][q].resize(dim);
}
// lambda_gradgrads are constant in a cell (no need for quad
// points)
- data->edge_lambda_gradgrads_3d[m].resize(dim);
+ data.edge_lambda_gradgrads_3d[m].resize(dim);
for (unsigned int d = 0; d < dim; ++d)
{
- data->edge_lambda_gradgrads_3d[m][d].resize(dim);
+ data.edge_lambda_gradgrads_3d[m][d].resize(dim);
}
}
for (unsigned int q = 0; q < n_q_points; ++q)
{
- data->edge_sigma_values[m][q] =
- data->sigma_imj_values[q][e2][e1];
- data->edge_lambda_values[m][q] =
- lambda[q][e1] + lambda[q][e2];
+ data.edge_sigma_values[m][q] =
+ data.sigma_imj_values[q][e2][e1];
+ data.edge_lambda_values[m][q] = lambda[q][e1] + lambda[q][e2];
}
- data->edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
+ data.edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
}
// edge_lambda_grads
for (unsigned int q = 0; q < n_q_points; ++q)
double x(p_list[q][0]);
double y(p_list[q][1]);
double z(p_list[q][2]);
- data->edge_lambda_grads_3d[0][q] = {z - 1.0, 0.0, x - 1.0};
- data->edge_lambda_grads_3d[1][q] = {1.0 - z, 0.0, -x};
- data->edge_lambda_grads_3d[2][q] = {0.0, z - 1.0, y - 1.0};
- data->edge_lambda_grads_3d[3][q] = {0.0, 1.0 - z, -y};
- data->edge_lambda_grads_3d[4][q] = {-z, 0.0, 1.0 - x};
- data->edge_lambda_grads_3d[5][q] = {z, 0.0, x};
- data->edge_lambda_grads_3d[6][q] = {0.0, -z, 1.0 - y};
- data->edge_lambda_grads_3d[7][q] = {0.0, z, y};
- data->edge_lambda_grads_3d[8][q] = {y - 1.0, x - 1.0, 0.0};
- data->edge_lambda_grads_3d[9][q] = {1.0 - y, -x, 0.0};
- data->edge_lambda_grads_3d[10][q] = {-y, 1.0 - x, 0.0};
- data->edge_lambda_grads_3d[11][q] = {y, x, 0.0};
+ data.edge_lambda_grads_3d[0][q] = {z - 1.0, 0.0, x - 1.0};
+ data.edge_lambda_grads_3d[1][q] = {1.0 - z, 0.0, -x};
+ data.edge_lambda_grads_3d[2][q] = {0.0, z - 1.0, y - 1.0};
+ data.edge_lambda_grads_3d[3][q] = {0.0, 1.0 - z, -y};
+ data.edge_lambda_grads_3d[4][q] = {-z, 0.0, 1.0 - x};
+ data.edge_lambda_grads_3d[5][q] = {z, 0.0, x};
+ data.edge_lambda_grads_3d[6][q] = {0.0, -z, 1.0 - y};
+ data.edge_lambda_grads_3d[7][q] = {0.0, z, y};
+ data.edge_lambda_grads_3d[8][q] = {y - 1.0, x - 1.0, 0.0};
+ data.edge_lambda_grads_3d[9][q] = {1.0 - y, -x, 0.0};
+ data.edge_lambda_grads_3d[10][q] = {-y, 1.0 - x, 0.0};
+ data.edge_lambda_grads_3d[11][q] = {y, x, 0.0};
}
// edge_lambda gradgrads:
const int edge_lambda_sign[GeometryInfo<3>::lines_per_cell] = {
{0, 1}}; // component which edge_lambda[m] depends on.
for (unsigned int m = 0; m < lines_per_cell; ++m)
{
- data->edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][0]]
- [edge_lambda_directions[m][1]] =
+ data.edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][0]]
+ [edge_lambda_directions[m][1]] =
edge_lambda_sign[m];
- data->edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][1]]
- [edge_lambda_directions[m][0]] =
+ data.edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][1]]
+ [edge_lambda_directions[m][0]] =
edge_lambda_sign[m];
}
// Precomputation for higher order shape functions,
if (degree > 0)
{
// resize required data:
- data->face_lambda_values.resize(faces_per_cell);
- data->face_lambda_grads.resize(faces_per_cell);
+ data.face_lambda_values.resize(faces_per_cell);
+ data.face_lambda_grads.resize(faces_per_cell);
// for face-based shape functions:
for (unsigned int m = 0; m < faces_per_cell; ++m)
{
- data->face_lambda_values[m].resize(n_q_points);
- data->face_lambda_grads[m].resize(3);
+ data.face_lambda_values[m].resize(n_q_points);
+ data.face_lambda_grads[m].resize(3);
}
// Fill in the values (these don't change between cells).
for (unsigned int q = 0; q < n_q_points; ++q)
double x(p_list[q][0]);
double y(p_list[q][1]);
double z(p_list[q][2]);
- data->face_lambda_values[0][q] = 1.0 - x;
- data->face_lambda_values[1][q] = x;
- data->face_lambda_values[2][q] = 1.0 - y;
- data->face_lambda_values[3][q] = y;
- data->face_lambda_values[4][q] = 1.0 - z;
- data->face_lambda_values[5][q] = z;
+ data.face_lambda_values[0][q] = 1.0 - x;
+ data.face_lambda_values[1][q] = x;
+ data.face_lambda_values[2][q] = 1.0 - y;
+ data.face_lambda_values[3][q] = y;
+ data.face_lambda_values[4][q] = 1.0 - z;
+ data.face_lambda_values[5][q] = z;
}
// gradients are constant:
- data->face_lambda_grads[0] = {-1.0, 0.0, 0.0};
- data->face_lambda_grads[1] = {1.0, 0.0, 0.0};
- data->face_lambda_grads[2] = {0.0, -1.0, 0.0};
- data->face_lambda_grads[3] = {0.0, 1.0, 0.0};
- data->face_lambda_grads[4] = {0.0, 0.0, -1.0};
- data->face_lambda_grads[5] = {0.0, 0.0, 1.0};
+ data.face_lambda_grads[0] = {-1.0, 0.0, 0.0};
+ data.face_lambda_grads[1] = {1.0, 0.0, 0.0};
+ data.face_lambda_grads[2] = {0.0, -1.0, 0.0};
+ data.face_lambda_grads[3] = {0.0, 1.0, 0.0};
+ data.face_lambda_grads[4] = {0.0, 0.0, -1.0};
+ data.face_lambda_grads[5] = {0.0, 0.0, 1.0};
// for cell-based shape functions:
// these don't depend on the cell, so can precompute all here:
const unsigned int dof_index1(
cell_type1_offset + shift_ijk);
- data->shape_values[dof_index1][q][0] =
+ data.shape_values[dof_index1][q][0] =
2.0 * polyx[i][1] * polyy[j][0] *
polyz[k][0];
- data->shape_values[dof_index1][q][1] =
+ data.shape_values[dof_index1][q][1] =
2.0 * polyx[i][0] * polyy[j][1] *
polyz[k][0];
- data->shape_values[dof_index1][q][2] =
+ data.shape_values[dof_index1][q][2] =
2.0 * polyx[i][0] * polyy[j][0] *
polyz[k][1];
const unsigned int dof_index2_2(
cell_type2_offset2 + shift_ijk);
- data->shape_values[dof_index2_1][q][0] =
- data->shape_values[dof_index1][q][0];
- data->shape_values[dof_index2_1][q][1] =
+ data.shape_values[dof_index2_1][q][0] =
+ data.shape_values[dof_index1][q][0];
+ data.shape_values[dof_index2_1][q][1] =
-1.0 *
- data->shape_values[dof_index1][q][1];
- data->shape_values[dof_index2_1][q][2] =
- data->shape_values[dof_index1][q][2];
+ data.shape_values[dof_index1][q][1];
+ data.shape_values[dof_index2_1][q][2] =
+ data.shape_values[dof_index1][q][2];
- data->shape_values[dof_index2_2][q][0] =
- data->shape_values[dof_index1][q][0];
- data->shape_values[dof_index2_2][q][1] =
+ data.shape_values[dof_index2_2][q][0] =
+ data.shape_values[dof_index1][q][0];
+ data.shape_values[dof_index2_2][q][1] =
-1.0 *
- data->shape_values[dof_index1][q][1];
- data->shape_values[dof_index2_2][q][2] =
+ data.shape_values[dof_index1][q][1];
+ data.shape_values[dof_index2_2][q][2] =
-1.0 *
- data->shape_values[dof_index1][q][2];
+ data.shape_values[dof_index1][q][2];
}
// Type 3: (note we re-use k and j for
// convenience):
const unsigned int dof_index3_3(
cell_type3_offset3 + shift_ij);
- data->shape_values[dof_index3_1][q][0] =
+ data.shape_values[dof_index3_1][q][0] =
polyy[j][0] * polyz[k][0];
- data->shape_values[dof_index3_1][q][1] = 0.0;
- data->shape_values[dof_index3_1][q][2] = 0.0;
+ data.shape_values[dof_index3_1][q][1] = 0.0;
+ data.shape_values[dof_index3_1][q][2] = 0.0;
- data->shape_values[dof_index3_2][q][0] = 0.0;
- data->shape_values[dof_index3_2][q][1] =
+ data.shape_values[dof_index3_2][q][0] = 0.0;
+ data.shape_values[dof_index3_2][q][1] =
polyx[j][0] * polyz[k][0];
- data->shape_values[dof_index3_2][q][2] = 0.0;
+ data.shape_values[dof_index3_2][q][2] = 0.0;
- data->shape_values[dof_index3_3][q][0] = 0.0;
- data->shape_values[dof_index3_3][q][1] = 0.0;
- data->shape_values[dof_index3_3][q][2] =
+ data.shape_values[dof_index3_3][q][0] = 0.0;
+ data.shape_values[dof_index3_3][q][1] = 0.0;
+ data.shape_values[dof_index3_3][q][2] =
polyx[j][0] * polyy[k][0];
}
}
const unsigned int dof_index1(
cell_type1_offset + shift_ijk);
- data->shape_grads[dof_index1][q][0][0] =
+ data.shape_grads[dof_index1][q][0][0] =
4.0 * polyx[i][2] * polyy[j][0] *
polyz[k][0];
- data->shape_grads[dof_index1][q][0][1] =
+ data.shape_grads[dof_index1][q][0][1] =
4.0 * polyx[i][1] * polyy[j][1] *
polyz[k][0];
- data->shape_grads[dof_index1][q][0][2] =
+ data.shape_grads[dof_index1][q][0][2] =
4.0 * polyx[i][1] * polyy[j][0] *
polyz[k][1];
- data->shape_grads[dof_index1][q][1][0] =
- data->shape_grads[dof_index1][q][0][1];
- data->shape_grads[dof_index1][q][1][1] =
+ data.shape_grads[dof_index1][q][1][0] =
+ data.shape_grads[dof_index1][q][0][1];
+ data.shape_grads[dof_index1][q][1][1] =
4.0 * polyx[i][0] * polyy[j][2] *
polyz[k][0];
- data->shape_grads[dof_index1][q][1][2] =
+ data.shape_grads[dof_index1][q][1][2] =
4.0 * polyx[i][0] * polyy[j][1] *
polyz[k][1];
- data->shape_grads[dof_index1][q][2][0] =
- data->shape_grads[dof_index1][q][0][2];
- data->shape_grads[dof_index1][q][2][1] =
- data->shape_grads[dof_index1][q][1][2];
- data->shape_grads[dof_index1][q][2][2] =
+ data.shape_grads[dof_index1][q][2][0] =
+ data.shape_grads[dof_index1][q][0][2];
+ data.shape_grads[dof_index1][q][2][1] =
+ data.shape_grads[dof_index1][q][1][2];
+ data.shape_grads[dof_index1][q][2][2] =
4.0 * polyx[i][0] * polyy[j][0] *
polyz[k][2];
for (unsigned int d = 0; d < dim; ++d)
{
- data->shape_grads[dof_index2_1][q][0]
- [d] =
- data->shape_grads[dof_index1][q][0]
- [d];
- data->shape_grads[dof_index2_1][q][1]
- [d] =
- -1.0 * data->shape_grads[dof_index1]
- [q][1][d];
- data->shape_grads[dof_index2_1][q][2]
- [d] =
- data->shape_grads[dof_index1][q][2]
- [d];
-
- data->shape_grads[dof_index2_2][q][0]
- [d] =
- data->shape_grads[dof_index1][q][0]
- [d];
- data->shape_grads[dof_index2_2][q][1]
- [d] =
- -1.0 * data->shape_grads[dof_index1]
- [q][1][d];
- data->shape_grads[dof_index2_2][q][2]
- [d] =
- -1.0 * data->shape_grads[dof_index1]
- [q][2][d];
+ data.shape_grads[dof_index2_1][q][0]
+ [d] =
+ data
+ .shape_grads[dof_index1][q][0][d];
+ data.shape_grads[dof_index2_1][q][1]
+ [d] =
+ -1.0 *
+ data
+ .shape_grads[dof_index1][q][1][d];
+ data.shape_grads[dof_index2_1][q][2]
+ [d] =
+ data
+ .shape_grads[dof_index1][q][2][d];
+
+ data.shape_grads[dof_index2_2][q][0]
+ [d] =
+ data
+ .shape_grads[dof_index1][q][0][d];
+ data.shape_grads[dof_index2_2][q][1]
+ [d] =
+ -1.0 *
+ data
+ .shape_grads[dof_index1][q][1][d];
+ data.shape_grads[dof_index2_2][q][2]
+ [d] =
+ -1.0 *
+ data
+ .shape_grads[dof_index1][q][2][d];
}
}
// Type 3: (note we re-use k and j for
{
for (unsigned int d2 = 0; d2 < dim; ++d2)
{
- data->shape_grads[dof_index3_1][q][d1]
- [d2] = 0.0;
- data->shape_grads[dof_index3_2][q][d1]
- [d2] = 0.0;
- data->shape_grads[dof_index3_3][q][d1]
- [d2] = 0.0;
+ data.shape_grads[dof_index3_1][q][d1]
+ [d2] = 0.0;
+ data.shape_grads[dof_index3_2][q][d1]
+ [d2] = 0.0;
+ data.shape_grads[dof_index3_3][q][d1]
+ [d2] = 0.0;
}
}
- data->shape_grads[dof_index3_1][q][0][1] =
+ data.shape_grads[dof_index3_1][q][0][1] =
2.0 * polyy[j][1] * polyz[k][0];
- data->shape_grads[dof_index3_1][q][0][2] =
+ data.shape_grads[dof_index3_1][q][0][2] =
2.0 * polyy[j][0] * polyz[k][1];
- data->shape_grads[dof_index3_2][q][1][0] =
+ data.shape_grads[dof_index3_2][q][1][0] =
2.0 * polyx[j][1] * polyz[k][0];
- data->shape_grads[dof_index3_2][q][1][2] =
+ data.shape_grads[dof_index3_2][q][1][2] =
2.0 * polyx[j][0] * polyz[k][1];
- data->shape_grads[dof_index3_3][q][2][0] =
+ data.shape_grads[dof_index3_3][q][2][0] =
2.0 * polyx[j][1] * polyy[k][0];
- data->shape_grads[dof_index3_3][q][2][1] =
+ data.shape_grads[dof_index3_3][q][2][1] =
2.0 * polyx[j][0] * polyy[k][1];
}
}
Assert(false, ExcNotImplemented());
}
}
- return std::move(data);
+ return data_ptr;
}
template <int dim, int spacedim>
dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2>
&output_data) const
{
- auto data = std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
+ auto data_ptr =
+ std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
- data->update_each = requires_update_flags(update_flags);
+ data_ptr->update_each = requires_update_flags(update_flags);
const unsigned int n_q_points = quadrature.size();
- output_data.initialize(n_q_points, FE_P1NC(), data->update_each);
+ output_data.initialize(n_q_points, FE_P1NC(), data_ptr->update_each);
// this is a linear element, so its second derivatives are zero
- if (data->update_each & update_hessians)
+ if (data_ptr->update_each & update_hessians)
output_data.shape_hessians.fill(Tensor<2, 2>());
- return data;
+ return data_ptr;
}
dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2>
&output_data) const
{
- auto data = std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
+ auto data_ptr =
+ std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
- data->update_each = requires_update_flags(update_flags);
+ data_ptr->update_each = requires_update_flags(update_flags);
const unsigned int n_q_points = quadrature.size();
- output_data.initialize(n_q_points, FE_P1NC(), data->update_each);
+ output_data.initialize(n_q_points, FE_P1NC(), data_ptr->update_each);
// this is a linear element, so its second derivatives are zero
- if (data->update_each & update_hessians)
+ if (data_ptr->update_each & update_hessians)
output_data.shape_hessians.fill(Tensor<2, 2>());
- return data;
+ return data_ptr;
}
dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2>
&output_data) const
{
- auto data = std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
+ auto data_ptr =
+ std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
- data->update_each = requires_update_flags(update_flags);
+ data_ptr->update_each = requires_update_flags(update_flags);
const unsigned int n_q_points = quadrature.size();
- output_data.initialize(n_q_points, FE_P1NC(), data->update_each);
+ output_data.initialize(n_q_points, FE_P1NC(), data_ptr->update_each);
// this is a linear element, so its second derivatives are zero
- if (data->update_each & update_hessians)
+ if (data_ptr->update_each & update_hessians)
output_data.shape_hessians.fill(Tensor<2, 2>());
- return data;
+ return data_ptr;
}
// and so the current object's update_each flag needs to be
// correct in case the current FESystem is a base element for another,
// higher-level FESystem itself.
- auto data = std_cxx14::make_unique<InternalData>(this->n_base_elements());
- data->update_each = requires_update_flags(flags);
+ std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>(this->n_base_elements());
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.update_each = requires_update_flags(flags);
// get data objects from each of the base elements and store
// them. one might think that doing this in parallel (over the
for (unsigned int base_no = 0; base_no < this->n_base_elements(); ++base_no)
{
internal::FEValuesImplementation::FiniteElementRelatedData<dim, spacedim>
- &base_fe_output_object = data->get_fe_output_object(base_no);
+ &base_fe_output_object = data.get_fe_output_object(base_no);
base_fe_output_object.initialize(
quadrature.size(),
base_element(base_no),
quadrature,
base_fe_output_object);
- data->set_fe_data(base_no, std::move(base_fe_data));
+ data.set_fe_data(base_no, std::move(base_fe_data));
}
- return std::move(data);
+ return data_ptr;
}
// The following function is a clone of get_data, with the exception
// and so the current object's update_each flag needs to be
// correct in case the current FESystem is a base element for another,
// higher-level FESystem itself.
- auto data = std_cxx14::make_unique<InternalData>(this->n_base_elements());
- data->update_each = requires_update_flags(flags);
+ std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>(this->n_base_elements());
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.update_each = requires_update_flags(flags);
// get data objects from each of the base elements and store
// them. one might think that doing this in parallel (over the
for (unsigned int base_no = 0; base_no < this->n_base_elements(); ++base_no)
{
internal::FEValuesImplementation::FiniteElementRelatedData<dim, spacedim>
- &base_fe_output_object = data->get_fe_output_object(base_no);
+ &base_fe_output_object = data.get_fe_output_object(base_no);
base_fe_output_object.initialize(
quadrature.size(),
base_element(base_no),
auto base_fe_data = base_element(base_no).get_face_data(
flags, mapping, quadrature, base_fe_output_object);
- data->set_fe_data(base_no, std::move(base_fe_data));
+ data.set_fe_data(base_no, std::move(base_fe_data));
}
- return std::move(data);
+ return data_ptr;
}
// and so the current object's update_each flag needs to be
// correct in case the current FESystem is a base element for another,
// higher-level FESystem itself.
- auto data = std_cxx14::make_unique<InternalData>(this->n_base_elements());
- data->update_each = requires_update_flags(flags);
+ std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+ data_ptr = std_cxx14::make_unique<InternalData>(this->n_base_elements());
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+
+ data.update_each = requires_update_flags(flags);
// get data objects from each of the base elements and store
// them. one might think that doing this in parallel (over the
for (unsigned int base_no = 0; base_no < this->n_base_elements(); ++base_no)
{
internal::FEValuesImplementation::FiniteElementRelatedData<dim, spacedim>
- &base_fe_output_object = data->get_fe_output_object(base_no);
+ &base_fe_output_object = data.get_fe_output_object(base_no);
base_fe_output_object.initialize(
quadrature.size(),
base_element(base_no),
auto base_fe_data = base_element(base_no).get_subface_data(
flags, mapping, quadrature, base_fe_output_object);
- data->set_fe_data(base_no, std::move(base_fe_data));
+ data.set_fe_data(base_no, std::move(base_fe_data));
}
- return std::move(data);
+ return data_ptr;
}
MappingCartesian<dim, spacedim>::get_data(const UpdateFlags update_flags,
const Quadrature<dim> &q) const
{
- auto data = std_cxx14::make_unique<InternalData>(q);
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>(q);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
// store the flags in the internal data object so we can access them
// in fill_fe_*_values(). use the transitive hull of the required
// flags
- data->update_each = requires_update_flags(update_flags);
+ data.update_each = requires_update_flags(update_flags);
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>(
- QProjector<dim>::project_to_all_faces(quadrature));
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>(
+ QProjector<dim>::project_to_all_faces(quadrature));
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
// verify that we have computed the transitive hull of the required
// flags and that FEValues has faithfully passed them on to us
// store the flags in the internal data object so we can access them
// in fill_fe_*_values()
- data->update_each = update_flags;
+ data.update_each = update_flags;
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>(
- QProjector<dim>::project_to_all_subfaces(quadrature));
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>(
+ QProjector<dim>::project_to_all_subfaces(quadrature));
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
// verify that we have computed the transitive hull of the required
// flags and that FEValues has faithfully passed them on to us
// store the flags in the internal data object so we can access them
// in fill_fe_*_values()
- data->update_each = update_flags;
+ data.update_each = update_flags;
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim> &quadrature) const
{
- auto data =
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
std_cxx14::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
- this->compute_data(update_flags, quadrature, quadrature.size(), *data);
- return std::move(data);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ this->compute_data(update_flags, quadrature, quadrature.size(), data);
+
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data =
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
std_cxx14::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
+ auto & data = dynamic_cast<InternalData &>(*data_ptr);
const Quadrature<dim> q(QProjector<dim>::project_to_all_faces(quadrature));
- this->compute_face_data(update_flags, q, quadrature.size(), *data);
+ this->compute_face_data(update_flags, q, quadrature.size(), data);
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data =
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
std_cxx14::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
+ auto & data = dynamic_cast<InternalData &>(*data_ptr);
const Quadrature<dim> q(QProjector<dim>::project_to_all_subfaces(quadrature));
- this->compute_face_data(update_flags, q, quadrature.size(), *data);
+ this->compute_face_data(update_flags, q, quadrature.size(), data);
- return std::move(data);
+ return data_ptr;
}
MappingManifold<dim, spacedim>::get_data(const UpdateFlags update_flags,
const Quadrature<dim> &q) const
{
- auto data = std_cxx14::make_unique<InternalData>();
- data->initialize(this->requires_update_flags(update_flags), q, q.size());
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize(this->requires_update_flags(update_flags), q, q.size());
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>();
- data->initialize_face(this->requires_update_flags(update_flags),
- QProjector<dim>::project_to_all_faces(quadrature),
- quadrature.size());
-
- return std::move(data);
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize_face(this->requires_update_flags(update_flags),
+ QProjector<dim>::project_to_all_faces(quadrature),
+ quadrature.size());
+
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>();
- data->initialize_face(this->requires_update_flags(update_flags),
- QProjector<dim>::project_to_all_subfaces(quadrature),
- quadrature.size());
-
- return std::move(data);
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize_face(this->requires_update_flags(update_flags),
+ QProjector<dim>::project_to_all_subfaces(quadrature),
+ quadrature.size());
+
+ return data_ptr;
}
MappingQ<dim, spacedim>::get_data(const UpdateFlags update_flags,
const Quadrature<dim> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>();
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
// build the Q1 and Qp internal data objects in parallel
Threads::Task<
quadrature);
if (!use_mapping_q_on_all_cells)
- data->mapping_q1_data = Utilities::dynamic_unique_cast<
+ data.mapping_q1_data = Utilities::dynamic_unique_cast<
typename MappingQGeneric<dim, spacedim>::InternalData>(
std::move(q1_mapping->get_data(update_flags, quadrature)));
// wait for the task above to finish and use returned value
- data->mapping_qp_data = Utilities::dynamic_unique_cast<
+ data.mapping_qp_data = Utilities::dynamic_unique_cast<
typename MappingQGeneric<dim, spacedim>::InternalData>(
std::move(do_get_data.return_value()));
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>();
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
// build the Q1 and Qp internal data objects in parallel
Threads::Task<
quadrature);
if (!use_mapping_q_on_all_cells)
- data->mapping_q1_data = Utilities::dynamic_unique_cast<
+ data.mapping_q1_data = Utilities::dynamic_unique_cast<
typename MappingQGeneric<dim, spacedim>::InternalData>(
std::move(q1_mapping->get_face_data(update_flags, quadrature)));
// wait for the task above to finish and use returned value
- data->mapping_qp_data = Utilities::dynamic_unique_cast<
+ data.mapping_qp_data = Utilities::dynamic_unique_cast<
typename MappingQGeneric<dim, spacedim>::InternalData>(
std::move(do_get_data.return_value()));
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>();
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>();
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
// build the Q1 and Qp internal data objects in parallel
Threads::Task<
quadrature);
if (!use_mapping_q_on_all_cells)
- data->mapping_q1_data = Utilities::dynamic_unique_cast<
+ data.mapping_q1_data = Utilities::dynamic_unique_cast<
typename MappingQGeneric<dim, spacedim>::InternalData>(
std::move(q1_mapping->get_subface_data(update_flags, quadrature)));
// wait for the task above to finish and use returned value
- data->mapping_qp_data = Utilities::dynamic_unique_cast<
+ data.mapping_qp_data = Utilities::dynamic_unique_cast<
typename MappingQGeneric<dim, spacedim>::InternalData>(
std::move(do_get_data.return_value()));
- return std::move(data);
+ return data_ptr;
}
MappingQGeneric<dim, spacedim>::get_data(const UpdateFlags update_flags,
const Quadrature<dim> &q) const
{
- auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
- data->initialize(this->requires_update_flags(update_flags), q, q.size());
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>(polynomial_degree);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize(this->requires_update_flags(update_flags), q, q.size());
- return std::move(data);
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
- data->initialize_face(this->requires_update_flags(update_flags),
- QProjector<dim>::project_to_all_faces(quadrature),
- quadrature.size());
-
- return std::move(data);
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>(polynomial_degree);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize_face(this->requires_update_flags(update_flags),
+ QProjector<dim>::project_to_all_faces(quadrature),
+ quadrature.size());
+
+ return data_ptr;
}
const UpdateFlags update_flags,
const Quadrature<dim - 1> &quadrature) const
{
- auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
- data->initialize_face(this->requires_update_flags(update_flags),
- QProjector<dim>::project_to_all_subfaces(quadrature),
- quadrature.size());
-
- return std::move(data);
+ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+ std_cxx14::make_unique<InternalData>(polynomial_degree);
+ auto &data = dynamic_cast<InternalData &>(*data_ptr);
+ data.initialize_face(this->requires_update_flags(update_flags),
+ QProjector<dim>::project_to_all_subfaces(quadrature),
+ quadrature.size());
+
+ return data_ptr;
}