// && dynamic_cast<const MappingCartesian<dim>*>(&mapping) != 0),
// ExcNotImplemented());
- const unsigned int n_dofs = this->dofs_per_cell;
- const unsigned int n_quad = quadrature.n_quadrature_points;
+ const unsigned int n_q_points = quadrature.n_quadrature_points;
const UpdateFlags flags(fe_data.current_update_flags());
- Assert(!(flags & update_values) || fe_data.shape_values.size() == n_dofs,
- ExcDimensionMismatch(fe_data.shape_values.size(), n_dofs));
- Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_quad,
- ExcDimensionMismatch(fe_data.shape_values[0].size(), n_quad));
+ Assert(!(flags & update_values) || fe_data.shape_values.size() == this->dofs_per_cell,
+ ExcDimensionMismatch(fe_data.shape_values.size(), this->dofs_per_cell));
+ Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points,
+ ExcDimensionMismatch(fe_data.shape_values[0].size(), n_q_points));
// Create table with sign changes, due to the special structure of the RT elements.
// TODO: Preliminary hack to demonstrate the overall prinicple!
// Compute eventual sign changes depending on the neighborhood
// between two faces.
- std::vector<double> sign_change (n_dofs, 1.0);
+ std::vector<double> sign_change (this->dofs_per_cell, 1.0);
get_face_sign_change (cell, this->dofs_per_face, sign_change);
- for (unsigned int i=0; i<n_dofs; ++i)
+ for (unsigned int i=0; i<this->dofs_per_cell; ++i)
{
const unsigned int first = data.shape_function_to_row_table[i];
case independent:
case independent_on_cartesian:
{
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_values(first+d,k) = fe_data.shape_values[i][k][d];
break;
}
{
// Use auxiliary vector for
// transformation
- std::vector<Tensor<1,dim> > shape_values (n_quad);
+ std::vector<Tensor<1,dim> > shape_values (n_q_points);
if (mapping_type == covariant)
mapping.transform_covariant(fe_data.shape_values[i], 0,
shape_values, mapping_data);
shape_values, mapping_data);
// then copy over to target:
- for (unsigned int k=0; k<n_quad; ++k)
+ for (unsigned int k=0; k<n_q_points; ++k)
{
// Recompute determinant
const double
if (flags & update_gradients)
{
- std::vector<Tensor<2,dim> > shape_grads1 (n_quad);
- std::vector<Tensor<2,dim> > shape_grads2 (n_quad);
+ std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
+ std::vector<Tensor<2,dim> > shape_grads2 (n_q_points);
switch (mapping_type)
{
mapping.transform_covariant(fe_data.shape_grads[i], 0,
shape_grads1,
mapping_data);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
break;
}
mapping.transform_covariant(fe_data.shape_grads[i], 0,
shape_grads1,
mapping_data);
- for (unsigned int q=0; q<n_quad; ++q)
+ for (unsigned int q=0; q<n_q_points; ++q)
shape_grads2[q] = transpose(shape_grads1[q]);
// do second transformation
mapping.transform_covariant(shape_grads2, 0, shape_grads1,
mapping_data);
// transpose back
- for (unsigned int q=0; q<n_quad; ++q)
+ for (unsigned int q=0; q<n_q_points; ++q)
shape_grads2[q] = transpose(shape_grads1[q]);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads2[k][d];
break;
shape_grads2,
mapping_data);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
{
// Recompute determinant
const double
// possible
InternalData &fe_data = dynamic_cast<InternalData &> (fedata);
- const unsigned int n_dofs = this->dofs_per_cell;
- const unsigned int n_quad = quadrature.n_quadrature_points;
+ const unsigned int n_q_points = quadrature.n_quadrature_points;
// offset determines which data set
// to take (all data sets for all
// faces are stored contiguously)
const typename QProjector<dim>::DataSetDescriptor dsd;
const typename QProjector<dim>::DataSetDescriptor offset
= dsd.face (face, cell->face_orientation(face),
- n_quad);
+ n_q_points);
const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
// Compute eventual sign changes depending
// on the neighborhood between two faces.
- std::vector<double> sign_change (n_dofs, 1.0);
+ std::vector<double> sign_change (this->dofs_per_cell, 1.0);
get_face_sign_change (cell, this->dofs_per_face, sign_change);
- for (unsigned int i=0; i<n_dofs; ++i)
+ for (unsigned int i=0; i<this->dofs_per_cell; ++i)
{
const unsigned int first = data.shape_function_to_row_table[i];
case independent:
case independent_on_cartesian:
{
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_values(first+d,k) = fe_data.shape_values[i][k+offset][d];
break;
}
{
// Use auxiliary vector
// for transformation
- std::vector<Tensor<1,dim> > shape_values (n_quad);
+ std::vector<Tensor<1,dim> > shape_values (n_q_points);
if (mapping_type == covariant)
mapping.transform_covariant(fe_data.shape_values[i], offset,
shape_values, mapping_data);
shape_values, mapping_data);
// then copy over to target:
- for (unsigned int k=0; k<n_quad; ++k)
+ for (unsigned int k=0; k<n_q_points; ++k)
{
// recompute
// determinant. note that
if (flags & update_gradients)
{
- std::vector<Tensor<2,dim> > shape_grads1 (n_quad);
- std::vector<Tensor<2,dim> > shape_grads2 (n_quad);
+ std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
+ std::vector<Tensor<2,dim> > shape_grads2 (n_q_points);
switch (mapping_type)
{
{
mapping.transform_covariant(fe_data.shape_grads[i], offset,
shape_grads1, mapping_data);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
break;
}
mapping.transform_covariant(fe_data.shape_grads[i], offset,
shape_grads1,
mapping_data);
- for (unsigned int q=0; q<n_quad; ++q)
+ for (unsigned int q=0; q<n_q_points; ++q)
shape_grads2[q] = transpose(shape_grads1[q]);
// do second transformation
mapping.transform_covariant(shape_grads2, 0, shape_grads1,
mapping_data);
// transpose back
- for (unsigned int q=0; q<n_quad; ++q)
+ for (unsigned int q=0; q<n_q_points; ++q)
shape_grads2[q] = transpose(shape_grads1[q]);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
break;
}
shape_grads2,
mapping_data);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
{
// recompute
// determinant in the
// possible
InternalData &fe_data = dynamic_cast<InternalData &> (fedata);
- const unsigned int n_dofs = this->dofs_per_cell;
- const unsigned int n_quad = quadrature.n_quadrature_points;
+ const unsigned int n_q_points = quadrature.n_quadrature_points;
// offset determines which data set
// to take (all data sets for all
// sub-faces are stored contiguously)
const typename QProjector<dim>::DataSetDescriptor dsd;
const typename QProjector<dim>::DataSetDescriptor offset
= dsd.subface (face, subface, cell->face_orientation(face),
- n_quad);
+ n_q_points);
const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
//TODO: Size assertions
//TODO: Sign change for the face DoFs!
+
+ // Compute eventual sign changes depending
+ // on the neighborhood between two faces.
+ std::vector<double> sign_change (this->dofs_per_cell, 1.0);
+ get_face_sign_change (cell, this->dofs_per_face, sign_change);
- for (unsigned int i=0; i<n_dofs; ++i)
+ for (unsigned int i=0; i<this->dofs_per_cell; ++i)
{
const unsigned int first = data.shape_function_to_row_table[i];
case independent:
case independent_on_cartesian:
{
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_values(first+d,k) = fe_data.shape_values[i][k+offset][d];
break;
}
{
// Use auxiliary vector for
// transformation
- std::vector<Tensor<1,dim> > shape_values (n_quad);
+ std::vector<Tensor<1,dim> > shape_values (n_q_points);
if (mapping_type == covariant)
mapping.transform_covariant(fe_data.shape_values[i], offset,
shape_values, mapping_data);
shape_values, mapping_data);
// then copy over to target:
- for (unsigned int k=0; k<n_quad; ++k)
+ for (unsigned int k=0; k<n_q_points; ++k)
{
// recompute
// determinant. note that
for (unsigned int d=0; d<dim; ++d)
data.shape_values(first+d,k)
- = /* sign_change[i] * */ (shape_values[k][d] / J);
+ = sign_change[i] * (shape_values[k][d] / J);
}
break;
if (flags & update_gradients)
{
- std::vector<Tensor<2,dim> > shape_grads1 (n_quad);
- std::vector<Tensor<2,dim> > shape_grads2 (n_quad);
+ std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
+ std::vector<Tensor<2,dim> > shape_grads2 (n_q_points);
switch (mapping_type)
{
{
mapping.transform_covariant(fe_data.shape_grads[i], offset,
shape_grads1, mapping_data);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
break;
}
mapping.transform_covariant(fe_data.shape_grads[i], offset,
shape_grads1,
mapping_data);
- for (unsigned int q=0; q<n_quad; ++q)
+ for (unsigned int q=0; q<n_q_points; ++q)
shape_grads2[q] = transpose(shape_grads1[q]);
// do second transformation
mapping.transform_covariant(shape_grads2, 0, shape_grads1,
mapping_data);
// transpose back
- for (unsigned int q=0; q<n_quad; ++q)
+ for (unsigned int q=0; q<n_q_points; ++q)
shape_grads2[q] = transpose(shape_grads1[q]);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
break;
}
shape_grads2,
mapping_data);
- for (unsigned int k=0; k<n_quad; ++k)
- for (unsigned int d=0;d<dim;++d)
+ for (unsigned int k=0; k<n_q_points; ++k)
+ for (unsigned int d=0; d<dim; ++d)
{
// recompute
// determinant in the
const double
J = data.cell_JxW_values[k] / quadrature.weight(k);
data.shape_gradients[first+d][k]
- = /* sign_change[i] * */ shape_grads2[k][d] / J;
+ = sign_change[i] * shape_grads2[k][d] / J;
}
break;
}