*/
virtual ~InternalDataBase ();
- /**
- * Values updated by the constructor or by reinit.
- */
- UpdateFlags update_flags;
-
- /**
- * Values computed by constructor.
- */
- UpdateFlags update_once;
-
/**
* A set of update flags specifying the kind of information that
* an implementation of the FiniteElement interface needs to compute on
*/
UpdateFlags update_each;
- /**
- * If <tt>first_cell==true</tt> this function returns @p update_flags,
- * i.e. <tt>update_once|update_each</tt>. If <tt>first_cell==false</tt> it
- * returns @p update_each.
- */
- UpdateFlags current_update_flags() const;
-
- /**
- * Set the @p first_cell flag to @p false. Used by the @p FEValues class
- * to indicate that we have already done the work on the first cell.
- */
- virtual void clear_first_cell ();
-
/**
* Return an estimate (in bytes) or the memory consumption of this object.
*/
virtual std::size_t memory_consumption () const;
-
- private:
- /**
- * Initially set to true, but reset to false when clear_first_cell()
- * is called.
- */
- bool first_cell;
};
public:
// generate a new data object and initialize some fields
typename FiniteElement<1,spacedim>::InternalDataBase *data =
new typename FiniteElement<1,spacedim>::InternalDataBase;
+ data->update_each = update_once(update_flags) | update_each(update_flags); // FIX: only update_each required
- // check what needs to be initialized only once and what on every
- // cell/face/subface we visit
- data->update_once = update_once(update_flags);
- data->update_each = update_each(update_flags);
- data->update_flags = data->update_once | data->update_each;
-
- const UpdateFlags flags(data->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 (flags & update_gradients || flags & update_hessians)
+ if (data->update_each & update_gradients || data->update_each & update_hessians)
{
Assert(false, ExcNotImplemented());
}
// generate a new data object and
// initialize some fields
InternalData *data = new InternalData;
+ data->update_each = update_each(update_flags) | update_once(update_flags); // FIX: only update_each required
- // check what needs to be
- // initialized only once and what
- // on every cell/face/subface we
- // visit
- data->update_once = update_once(update_flags);
- data->update_each = update_each(update_flags);
- data->update_flags = data->update_once | data->update_each;
-
- const UpdateFlags flags(data->update_flags);
const unsigned int n_q_points = quadrature.size();
// some scratch arrays
// initialize fields only if really
// necessary. otherwise, don't
// allocate memory
- if (flags & update_values)
+ if (update_flags & update_values)
{
values.resize (this->dofs_per_cell);
data->shape_values.resize (this->dofs_per_cell,
std::vector<double> (n_q_points));
}
- if (flags & update_gradients)
+ if (update_flags & update_gradients)
{
grads.resize (this->dofs_per_cell);
data->shape_gradients.resize (this->dofs_per_cell,
std::vector<Tensor<1,dim> > (n_q_points));
}
- if (flags & update_hessians)
+ if (update_flags & update_hessians)
{
grad_grads.resize (this->dofs_per_cell);
data->shape_hessians.resize (this->dofs_per_cell,
std::vector<Tensor<2,dim> > (n_q_points));
}
- if (flags & update_3rd_derivatives)
+ if (update_flags & update_3rd_derivatives)
{
third_derivatives.resize (this->dofs_per_cell);
data->shape_3rd_derivatives.resize (this->dofs_per_cell,
// unit cell, and need to be
// transformed when visiting an
// actual cell
- if (flags & (update_values | update_gradients
- | update_hessians | update_3rd_derivatives) )
+ if (update_flags & (update_values | update_gradients
+ | update_hessians | update_3rd_derivatives) )
for (unsigned int i=0; i<n_q_points; ++i)
{
poly_space.compute(quadrature.point(i),
third_derivatives,
fourth_derivatives);
- if (flags & update_values)
+ if (update_flags & update_values)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
data->shape_values[k][i] = values[k];
- if (flags & update_gradients)
+ if (update_flags & update_gradients)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
data->shape_gradients[k][i] = grads[k];
- if (flags & update_hessians)
+ if (update_flags & update_hessians)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
data->shape_hessians[k][i] = grad_grads[k];
- if (flags & update_3rd_derivatives)
+ 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];
}
Assert (dynamic_cast<const InternalData *> (&fedata) != 0, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
- const UpdateFlags flags(fe_data.current_update_flags());
+ const UpdateFlags flags(fe_data.update_each);
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
cell->face_rotation(face),
quadrature.size());
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
+ const UpdateFlags flags(fe_data.update_each);
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
quadrature.size(),
cell->subface_case(face));
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
+ const UpdateFlags flags(fe_data.update_each);
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
// generate a new data object and
// initialize some fields
InternalData *data = new InternalData;
+ data->update_each = update_once(update_flags) | update_each(update_flags); // FIX: only update_each required
- // check what needs to be
- // initialized only once and what
- // on every cell/face/subface we
- // visit
- data->update_once = update_once(update_flags);
- data->update_each = update_each(update_flags);
- data->update_flags = data->update_once | data->update_each;
-
- const UpdateFlags flags(data->update_flags);
const unsigned int n_q_points = quadrature.size();
// some scratch arrays
// initialize fields only if really
// necessary. otherwise, don't
// allocate memory
- if (flags & update_values)
+ if (data->update_each & update_values)
{
values.resize (poly_space.n());
data->shape_values.resize (poly_space.n(),
}
// No derivatives of this element
// are implemented.
- if (flags & update_gradients || flags & update_hessians)
+ if (data->update_each & update_gradients || data->update_each & update_hessians)
{
Assert(false, ExcNotImplemented());
}
Assert (dynamic_cast<const InternalData *> (&fedata) != 0, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
-
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
for (unsigned int i=0; i<quadrature.size(); ++i)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
for (unsigned int k=0; k<this->dofs_per_quad; ++k)
output_data.shape_values(foffset+k,i) = fe_data.shape_values[k+this->first_face_quad_index][i];
}
+
+ // fall through...
}
+
case 2:
{
// Fill data for line shape functions
= fe_data.shape_values[k+(line*this->dofs_per_line)+this->first_face_line_index][i];
}
}
+
+ // fall through...
}
+
case 1:
{
// Fill data for vertex shape functions
Assert (dynamic_cast<const InternalData *> (&fedata) != 0, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
-
const unsigned int foffset = fe_data.shape_values.size() * face;
const unsigned int offset = subface*quadrature.size();
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
for (unsigned int i=0; i<quadrature.size(); ++i)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
output_data.shape_values(foffset+k,i) = fe_data.shape_values[k][i+offset];
}
- Assert (!(flags & update_gradients), ExcNotImplemented());
- Assert (!(flags & update_hessians), ExcNotImplemented());
+ Assert (!(fe_data.update_each & update_gradients), ExcNotImplemented());
+ Assert (!(fe_data.update_each & update_hessians), ExcNotImplemented());
}
DEAL_II_NAMESPACE_CLOSE
// generate a new data object and
// initialize some fields
InternalData *data = new InternalData;
+ data->update_each = update_each(update_flags) | update_once(update_flags); // FIX: only update_each required
- // check what needs to be
- // initialized only once and what
- // on every cell/face/subface we
- // visit
- data->update_once = update_once(update_flags);
- data->update_each = update_each(update_flags);
- data->update_flags = data->update_once | data->update_each;
-
- const UpdateFlags flags(data->update_flags);
const unsigned int n_q_points = quadrature.size();
// some scratch arrays
std::vector<Tensor<4,dim> > third_derivatives(0);
std::vector<Tensor<5,dim> > fourth_derivatives(0);
- if (flags & (update_values | update_gradients | update_hessians) )
+ if (update_flags & (update_values | update_gradients | update_hessians) )
data->sign_change.resize (this->dofs_per_cell);
// initialize fields only if really
// necessary. otherwise, don't
// allocate memory
- if (flags & update_values)
+ if (update_flags & update_values)
{
values.resize (this->dofs_per_cell);
data->shape_values.resize (this->dofs_per_cell);
data->transformed_shape_values.resize (n_q_points);
}
- if (flags & update_gradients)
+ if (update_flags & update_gradients)
{
grads.resize (this->dofs_per_cell);
data->shape_grads.resize (this->dofs_per_cell);
data->untransformed_shape_grads.resize(n_q_points);
}
- if (flags & update_hessians)
+ if (update_flags & update_hessians)
{
grad_grads.resize (this->dofs_per_cell);
data->shape_grad_grads.resize (this->dofs_per_cell);
// node values N_i holds
// N_i(v_j)=\delta_ij for all basis
// functions v_j
- if (flags & (update_values | update_gradients))
+ if (update_flags & (update_values | update_gradients))
for (unsigned int k=0; k<n_q_points; ++k)
{
poly_space.compute(quadrature.point(k),
third_derivatives,
fourth_derivatives);
- if (flags & update_values)
+ if (update_flags & update_values)
{
if (inverse_node_matrix.n_cols() == 0)
for (unsigned int i=0; i<this->dofs_per_cell; ++i)
}
}
- if (flags & update_gradients)
+ if (update_flags & update_gradients)
{
if (inverse_node_matrix.n_cols() == 0)
for (unsigned int i=0; i<this->dofs_per_cell; ++i)
}
}
- if (flags & update_hessians)
+ if (update_flags & update_hessians)
{
if (inverse_node_matrix.n_cols() == 0)
for (unsigned int i=0; i<this->dofs_per_cell; ++i)
internal::FEValues::FiniteElementRelatedData<dim,spacedim> &
get_fe_output_object (const unsigned int base_no) const;
- /**
- * Set the @p first_cell flag to @p false. Used by the @p FEValues class
- * to indicate that we have already done the work on the first cell.
- *
- * In addition to calling the respective function of the base class, this
- * function also calls the functions of the sub-data objects.
- */
- virtual void clear_first_cell ();
-
private:
/**
template <int dim, int spacedim>
FiniteElement<dim, spacedim>::InternalDataBase::InternalDataBase ():
- update_flags(update_default),
- update_once(update_default),
- update_each(update_default),
- first_cell(true)
+ update_each(update_default)
{}
-template <int dim, int spacedim>
-UpdateFlags
-FiniteElement<dim,spacedim>::InternalDataBase::current_update_flags () const
-{
- if (first_cell)
- {
- Assert (update_flags==(update_once|update_each),
- ExcInternalError());
- return update_flags;
- }
- else
- return update_each;
-}
-
-
-
-template <int dim, int spacedim>
-void
-FiniteElement<dim,spacedim>::InternalDataBase::clear_first_cell ()
-{
- first_cell = false;
-}
-
-
-
-
template <int dim, int spacedim>
FiniteElement<dim,spacedim>::
FiniteElement (const FiniteElementData<dim> &fe_data,
{
// generate a new data object
typename FiniteElement<dim,spacedim>::InternalDataBase *data = new typename FiniteElement<dim,spacedim>::InternalDataBase;
- // check what needs to be
- // initialized only once and what
- // on every cell/face/subface we
- // visit
- data->update_once = update_once(update_flags);
- data->update_each = update_each(update_flags);
- data->update_flags = data->update_once | data->update_each;
+ data->update_each = update_once(update_flags) | update_each(update_flags); // FIX: only update_each required
// other than that, there is nothing we can add here as discussed
// in the general documentation of this class
internal::FEValues::FiniteElementRelatedData<dim,spacedim> &output_data,
const CellSimilarity::Similarity /*cell_similarity*/) const
{
- const UpdateFlags flags(fe_data.current_update_flags());
- Assert (flags & update_quadrature_points, ExcInternalError());
+ Assert (fe_data.update_each & update_quadrature_points, ExcInternalError());
const unsigned int n_q_points = mapping_data.quadrature_points.size();
- std::vector<double> values(flags & update_values ? this->dofs_per_cell : 0);
- std::vector<Tensor<1,dim> > grads(flags & update_gradients ? this->dofs_per_cell : 0);
- std::vector<Tensor<2,dim> > grad_grads(flags & update_hessians ? this->dofs_per_cell : 0);
+ std::vector<double> values(fe_data.update_each & update_values ? this->dofs_per_cell : 0);
+ std::vector<Tensor<1,dim> > grads(fe_data.update_each & update_gradients ? this->dofs_per_cell : 0);
+ std::vector<Tensor<2,dim> > grad_grads(fe_data.update_each & update_hessians ? this->dofs_per_cell : 0);
std::vector<Tensor<3,dim> > empty_vector_of_3rd_order_tensors;
std::vector<Tensor<4,dim> > empty_vector_of_4th_order_tensors;
- if (flags & (update_values | update_gradients))
+ if (fe_data.update_each & (update_values | update_gradients))
for (unsigned int i=0; i<n_q_points; ++i)
{
polynomial_space.compute(mapping_data.quadrature_points[i],
empty_vector_of_4th_order_tensors);
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
output_data.shape_values[k][i] = values[k];
- if (flags & update_gradients)
+ if (fe_data.update_each & update_gradients)
output_data.shape_gradients[k][i] = grads[k];
- if (flags & update_hessians)
+ if (fe_data.update_each & update_hessians)
output_data.shape_hessians[k][i] = grad_grads[k];
}
}
const internal::FEValues::MappingRelatedData<dim,spacedim> &mapping_data,
internal::FEValues::FiniteElementRelatedData<dim,spacedim> &output_data) const
{
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
- Assert (flags & update_quadrature_points, ExcInternalError());
+ Assert (fe_data.update_each & update_quadrature_points, ExcInternalError());
const unsigned int n_q_points = mapping_data.quadrature_points.size();
- std::vector<double> values(flags & update_values ? this->dofs_per_cell : 0);
- std::vector<Tensor<1,dim> > grads(flags & update_gradients ? this->dofs_per_cell : 0);
- std::vector<Tensor<2,dim> > grad_grads(flags & update_hessians ? this->dofs_per_cell : 0);
+ std::vector<double> values(fe_data.update_each & update_values ? this->dofs_per_cell : 0);
+ std::vector<Tensor<1,dim> > grads(fe_data.update_each & update_gradients ? this->dofs_per_cell : 0);
+ std::vector<Tensor<2,dim> > grad_grads(fe_data.update_each & update_hessians ? this->dofs_per_cell : 0);
std::vector<Tensor<3,dim> > empty_vector_of_3rd_order_tensors;
std::vector<Tensor<4,dim> > empty_vector_of_4th_order_tensors;
- if (flags & (update_values | update_gradients))
+ if (fe_data.update_each & (update_values | update_gradients))
for (unsigned int i=0; i<n_q_points; ++i)
{
polynomial_space.compute(mapping_data.quadrature_points[i],
empty_vector_of_4th_order_tensors);
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
output_data.shape_values[k][i] = values[k];
- if (flags & update_gradients)
+ if (fe_data.update_each & update_gradients)
output_data.shape_gradients[k][i] = grads[k];
- if (flags & update_hessians)
+ if (fe_data.update_each & update_hessians)
output_data.shape_hessians[k][i] = grad_grads[k];
}
}
const internal::FEValues::MappingRelatedData<dim,spacedim> &mapping_data,
internal::FEValues::FiniteElementRelatedData<dim,spacedim> &output_data) const
{
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
- Assert (flags & update_quadrature_points, ExcInternalError());
+ Assert (fe_data.update_each & update_quadrature_points, ExcInternalError());
const unsigned int n_q_points = mapping_data.quadrature_points.size();
- std::vector<double> values(flags & update_values ? this->dofs_per_cell : 0);
- std::vector<Tensor<1,dim> > grads(flags & update_gradients ? this->dofs_per_cell : 0);
- std::vector<Tensor<2,dim> > grad_grads(flags & update_hessians ? this->dofs_per_cell : 0);
+ std::vector<double> values(fe_data.update_each & update_values ? this->dofs_per_cell : 0);
+ std::vector<Tensor<1,dim> > grads(fe_data.update_each & update_gradients ? this->dofs_per_cell : 0);
+ std::vector<Tensor<2,dim> > grad_grads(fe_data.update_each & update_hessians ? this->dofs_per_cell : 0);
std::vector<Tensor<3,dim> > empty_vector_of_3rd_order_tensors;
std::vector<Tensor<4,dim> > empty_vector_of_4th_order_tensors;
- if (flags & (update_values | update_gradients))
+ if (fe_data.update_each & (update_values | update_gradients))
for (unsigned int i=0; i<n_q_points; ++i)
{
polynomial_space.compute(mapping_data.quadrature_points[i],
empty_vector_of_4th_order_tensors);
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
output_data.shape_values[k][i] = values[k];
- if (flags & update_gradients)
+ if (fe_data.update_each & update_gradients)
output_data.shape_gradients[k][i] = grads[k];
- if (flags & update_hessians)
+ if (fe_data.update_each & update_hessians)
output_data.shape_hessians[k][i] = grad_grads[k];
}
}
const internal::FEValues::MappingRelatedData<1,spacedim> &,
internal::FEValues::FiniteElementRelatedData<1,spacedim> &output_data) const
{
- const UpdateFlags flags(fedata.update_once | fedata.update_each);
-
const unsigned int foffset = face;
- if (flags & update_values)
+ if (fedata.update_each & update_values)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
output_data.shape_values(k,0) = 0.;
Assert (dynamic_cast<const InternalData *> (&fedata) != 0, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
- const UpdateFlags flags(fe_data.current_update_flags());
-
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
for (unsigned int i=0; i<quadrature.size(); ++i)
output_data.shape_values(k,i) = fe_data.shape_values[k][i];
- if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
mapping.transform (fe_data.shape_gradients[k],
mapping_covariant,
mapping_internal,
output_data.shape_gradients[k]);
- if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_hessians[k],
mapping_covariant_gradient,
* output_data.shape_gradients[k][i][j];
}
- if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_3rd_derivatives[k],
mapping_covariant_hessian,
Assert (dynamic_cast<const InternalData *> (&fedata) != 0, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
- const UpdateFlags flags(fe_data.current_update_flags());
-
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
for (unsigned int i=0; i<quadrature.size(); ++i)
output_data.shape_values(k,i) = fe_data.shape_values[k][i];
- if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
mapping.transform (fe_data.shape_gradients[k],
mapping_covariant,
mapping_internal,
output_data.shape_gradients[k]);
- if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_hessians[k],
mapping_covariant_gradient,
* output_data.shape_gradients[k][i][j];
}
- if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_3rd_derivatives[k],
mapping_covariant_hessian,
Assert (dynamic_cast<const InternalData *> (&fedata) != 0, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
- const UpdateFlags flags(fe_data.current_update_flags());
-
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
for (unsigned int i=0; i<quadrature.size(); ++i)
output_data.shape_values(k,i) = fe_data.shape_values[k][i];
- if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
mapping.transform (fe_data.shape_gradients[k],
mapping_covariant,
mapping_internal,
output_data.shape_gradients[k]);
- if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_hessians[k],
mapping_covariant_gradient,
* output_data.shape_gradients[k][i][j];
}
- if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_3rd_derivatives[k],
mapping_covariant_hessian,
Assert (dynamic_cast<const InternalData *> (&fedata) != 0, ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
- const UpdateFlags flags(fe_data.current_update_flags());
-
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
{
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
for (unsigned int i=0; i<quadrature.size(); ++i)
output_data.shape_values(k,i) = fe_data.shape_values[k][i];
- if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
mapping.transform (fe_data.shape_gradients[k],
mapping_covariant,
mapping_internal,
output_data.shape_gradients[k]);
- if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_hessians[k],
mapping_covariant_gradient,
* output_data.shape_gradients[k][i][j];
}
- if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
+ if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
mapping.transform (fe_data.shape_3rd_derivatives[k],
mapping_covariant_hessian,
const InternalData &fe_data = static_cast<const InternalData &> (fedata);
const unsigned int n_q_points = quadrature.size();
- const UpdateFlags flags(fe_data.current_update_flags());
- Assert(!(flags & update_values) || fe_data.shape_values.size() == this->dofs_per_cell,
+ Assert(!(fe_data.update_each & 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,
+ Assert(!(fe_data.update_each & 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.
// the previous one; or, even if it is a translation, if we use mappings
// other than the standard mappings that require us to recompute values
// and derivatives because of possible sign changes
- if (flags & update_values &&
+ if (fe_data.update_each & update_values &&
((cell_similarity != CellSimilarity::translation)
||
((mapping_type == mapping_piola) || (mapping_type == mapping_raviart_thomas)
}
// update gradients. apply the same logic as above
- if (flags & update_gradients
+ if (fe_data.update_each & update_gradients
&&
((cell_similarity != CellSimilarity::translation)
||
}
// update hessians. apply the same logic as above
- if (flags & update_hessians
+ if (fe_data.update_each & update_hessians
&&
((cell_similarity != CellSimilarity::translation)
||
}
// third derivatives are not implemented
- if (flags & update_3rd_derivatives
+ if (fe_data.update_each & update_3rd_derivatives
&&
((cell_similarity != CellSimilarity::translation)
||
cell->face_rotation(face),
n_q_points);
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
-
//TODO: Size assertions
// Create table with sign changes, due to the special structure of the RT elements.
const unsigned int first = output_data.shape_function_to_row_table[i * this->n_components() +
this->get_nonzero_components(i).first_selected_component()];
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
{
switch (mapping_type)
{
}
}
- if (flags & update_gradients)
+ if (fe_data.update_each & update_gradients)
{
VectorSlice< std::vector<Tensor<2,spacedim> > >
transformed_shape_grads (fe_data.transformed_shape_grads, offset, n_q_points);
}
}
- if (flags & update_hessians)
+ if (fe_data.update_each & update_hessians)
{
}
// third derivatives are not implemented
- if (flags & update_3rd_derivatives)
+ if (fe_data.update_each & update_3rd_derivatives)
{
Assert(false, ExcNotImplemented())
}
n_q_points,
cell->subface_case(face));
- const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
-
// Assert(mapping_type == independent
// || ( mapping_type == independent_on_cartesian
// && dynamic_cast<const MappingCartesian<dim>*>(&mapping) != 0),
const unsigned int first = output_data.shape_function_to_row_table[i * this->n_components() +
this->get_nonzero_components(i).first_selected_component()];
- if (flags & update_values)
+ if (fe_data.update_each & update_values)
{
switch (mapping_type)
{
}
}
- if (flags & update_gradients)
+ if (fe_data.update_each & update_gradients)
{
VectorSlice< std::vector<Tensor<2, spacedim > > >
transformed_shape_grads (fe_data.transformed_shape_grads, offset, n_q_points);
}
}
- if (flags & update_hessians)
+ if (fe_data.update_each & update_hessians)
{
}
// third derivatives are not implemented
- if (flags & update_3rd_derivatives)
+ if (fe_data.update_each & update_3rd_derivatives)
{
Assert(false, ExcNotImplemented())
}
-template <int dim, int spacedim>
-void
-FESystem<dim,spacedim>::InternalData::clear_first_cell ()
-{
- // call respective function of base
- // class
- FiniteElement<dim,spacedim>::InternalDataBase::clear_first_cell ();
- // then the functions of all the
- // sub-objects
- for (unsigned int i=0; i<base_fe_datas.size(); ++i)
- base_fe_datas[i]->clear_first_cell ();
-}
-
-
/* ---------------------------------- FESystem ------------------- */
{
UpdateFlags flags = flags_;
InternalData *data = new InternalData(this->n_base_elements());
-
- data->update_once = update_once (flags);
- data->update_each = update_each (flags);
- flags = data->update_once | data->update_each;
+ data->update_each = update_each(flags) | update_once(flags);
// get data objects from each of the base elements and store
// them. do the creation of these objects in parallel as their
internal::FEValues::FiniteElementRelatedData<dim,spacedim> &base_fe_output_object
= data->get_fe_output_object(base_no);
base_fe_output_object.initialize (quadrature.size(), base_element(base_no),
- flags | base_fe_data->update_flags);
+ flags | base_fe_data->update_each);
// then store the pointer to the base internal object
data->set_fe_data(base_no, base_fe_data);
}
- data->update_flags = data->update_once |
- data->update_each;
return data;
}
{
UpdateFlags flags = flags_;
InternalData *data = new InternalData(this->n_base_elements());
-
- data->update_once = update_once (flags);
- data->update_each = update_each (flags);
- flags = data->update_once | data->update_each;
+ data->update_each = update_each(flags) | update_once(flags);
// get data objects from each of the base elements and store
// them. do the creation of these objects in parallel as their
internal::FEValues::FiniteElementRelatedData<dim,spacedim> &base_fe_output_object
= data->get_fe_output_object(base_no);
base_fe_output_object.initialize (quadrature.size(), base_element(base_no),
- flags | base_fe_data->update_flags);
+ flags | base_fe_data->update_each);
// then store the pointer to the base internal object
data->set_fe_data(base_no, base_fe_data);
}
- data->update_flags = data->update_once |
- data->update_each;
return data;
}
{
UpdateFlags flags = flags_;
InternalData *data = new InternalData(this->n_base_elements());
-
- data->update_once = update_once (flags);
- data->update_each = update_each (flags);
- flags = data->update_once | data->update_each;
+ data->update_each = update_each(flags) | update_once(flags);
// get data objects from each of the base elements and store
// them. do the creation of these objects in parallel as their
internal::FEValues::FiniteElementRelatedData<dim,spacedim> &base_fe_output_object
= data->get_fe_output_object(base_no);
base_fe_output_object.initialize (quadrature.size(), base_element(base_no),
- flags | base_fe_data->update_flags);
+ flags | base_fe_data->update_each);
// then store the pointer to the base internal object
data->set_fe_data(base_no, base_fe_data);
}
- data->update_flags = data->update_once |
- data->update_each;
return data;
}
// all shape functions of the composed element, and here only treat
// those shape functions that belong to a given base element
//TODO: Introduce the needed table and loop only over base element shape functions. This here is not efficient at all AND very bad style
- const UpdateFlags base_flags(dim_1==dim ?
- base_fe_data.current_update_flags() :
- base_fe_data.update_flags);
+ const UpdateFlags base_flags = base_fe_data.update_each;
// if the current cell is just a translation of the previous one,
// the underlying data has not changed, and we don't even need to
// (fill_fe_values) or dim_1==dim-1
// (fill_fe_(sub)face_values)
Assert(dim_1==dim || dim_1==dim-1, ExcInternalError());
- const UpdateFlags flags(dim_1==dim ?
- fe_data.current_update_flags() :
- fe_data.update_flags);
+ const UpdateFlags flags = fe_data.update_each;
if (flags & (update_values | update_gradients
this->mapping_output,
this->finite_element_output,
this->cell_similarity);
-
- this->fe_data->clear_first_cell ();
}
*this->fe_data,
this->mapping_output,
this->finite_element_output);
-
- this->fe_data->clear_first_cell ();
}
*this->fe_data,
this->mapping_output,
this->finite_element_output);
-
- this->fe_data->clear_first_cell ();
}