// initialize shape gradient
if (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);
+ data->transformed_shape_gradients.resize (n_q_points);
+ }
// update
}
}
+
+
+ // initialize shape hessian
+ if (flags & update_hessians)
+ data->shape_hessians.reinit (this->dofs_per_cell,
+ n_q_points);
+ // update
+ if (flags & update_hessians)
+ for (unsigned int i=0; i<n_q_points; ++i)
+ {
+ for (unsigned int k=0; k<this->dofs_per_cell; ++k)
+ {
+ data->shape_hessians[k][i] = shape_grad_grad(k,quadrature.point(i));
+ }
+ }
+
+
return data;
}
const Quadrature<2> &quadrature,
const Mapping<2,2> &mapping,
const Mapping<2,2>::InternalDataBase &mapping_internal,
- const internal::FEValues::MappingRelatedData<2,2> &,
+ const internal::FEValues::MappingRelatedData<2,2> &mapping_data,
const FiniteElement<2,2>::InternalDataBase &fe_internal,
internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const
}
+
+ // shape hessian
+ if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
+ {
+ for (unsigned int k=0; k<this->dofs_per_cell; ++k)
+ mapping.transform (make_array_view(fe_data.shape_hessians, k),
+ mapping_covariant_gradient,
+ mapping_internal,
+ make_array_view(output_data.shape_hessians, k));
+
+ for (unsigned int k=0; k<this->dofs_per_cell; ++k)
+ for (unsigned int i=0; i<quadrature.size(); ++i)
+ for (unsigned int j=0; j<2; ++j)
+ output_data.shape_hessians[k][i] -=
+ mapping_data.jacobian_pushed_forward_grads[i][j]
+ * output_data.shape_gradients[k][i][j];
+ }
+
}
if (flags & update_gradients)
{
- const ArrayView<Tensor<1,2> > transformed_shape_gradients
- = make_array_view(fe_data.transformed_shape_gradients, offset, quadrature.size());
+ const ArrayView<Tensor<1,2> > transformed_shape_gradients
+ = make_array_view(fe_data.transformed_shape_gradients, offset, quadrature.size());
mapping.transform(make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()),
mapping_covariant,
if (flags & update_gradients)
{
- const ArrayView<Tensor<1,2> > transformed_shape_gradients
- = make_array_view(fe_data.transformed_shape_gradients, offset, quadrature.size());
+ const ArrayView<Tensor<1,2> > transformed_shape_gradients
+ = make_array_view(fe_data.transformed_shape_gradients, offset, quadrature.size());
mapping.transform(make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()),
mapping_covariant,
out |= update_gradients | update_covariant_transformation;
if (flags & update_cell_normal_vectors)
out |= update_cell_normal_vectors | update_JxW_values;
+ if (flags & update_hessians)
+ out |= update_hessians | update_gradients | update_covariant_transformation | update_jacobian_pushed_forward_grads;
return out;
}
}
+Tensor<2,2> FE_P1NCParametric::shape_grad_grad (const unsigned int i,
+ const Point<2> &p) const
+{
+ Tensor<2,2> grad_grad ;
+
+
+ switch (i)
+ {
+ case 0:
+ grad_grad[0][0] = 0.0 ;
+ grad_grad[0][1] = 0.0 ;
+ grad_grad[1][0] = 0.0 ;
+ grad_grad[1][1] = 0.0 ;
+ return grad_grad ;
+ case 1:
+ grad_grad[0][0] = 0.0 ;
+ grad_grad[0][1] = 0.0 ;
+ grad_grad[1][0] = 0.0 ;
+ grad_grad[1][1] = 0.0 ;
+ return grad_grad ;
+ case 2:
+ grad_grad[0][0] = 0.0 ;
+ grad_grad[0][1] = 0.0 ;
+ grad_grad[1][0] = 0.0 ;
+ grad_grad[1][1] = 0.0 ;
+ return grad_grad ;
+ case 3:
+ grad_grad[0][0] = 0.0 ;
+ grad_grad[0][1] = 0.0 ;
+ grad_grad[1][0] = 0.0 ;
+ grad_grad[1][1] = 0.0 ;
+ return grad_grad ;
+ default:
+ return grad_grad ;
+ };
+
+}
+
+
void FE_P1NCParametric::initialize_constraints ()
{
out |= update_cell_normal_vectors | update_JxW_values;
if (flags & update_hessians)
out |= update_hessians;
+ if (flags & update_hessians)
+ out |= update_hessians;
return out;
}