This will allow to change the underlying data type in which the data is stored because
ArrayView does not actually store this, in contrast to VectorSlice.
This patch is backward incompatible. However, this area has already been incompatibly changed
in recent months.
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
+#include <deal.II/base/array_view.h>
DEAL_II_NAMESPACE_OPEN
unsigned int start,
unsigned int length);
+ /**
+ * Conversion operator to an ArrayView object that represents
+ * an array of non-const elements pointing to the same location
+ * as the current object.
+ */
+ operator ArrayView<typename VectorType::value_type *> ();
+
+ /**
+ * Conversion operator to an ArrayView object that represents
+ * an array of const elements pointing to the same location
+ * as the current object.
+ */
+ operator ArrayView<const typename VectorType::value_type *> () const;
+
/**
* Return the length of the slice using the same interface as
* <tt>std::vector</tt>.
unsigned int size() const;
/**
- * Access an element of the slice using the same interface as
- * <tt>std::vector</tt>.
+ * Return a reference to the $i$th element of the range
+ * represented by the current object.
*/
typename VectorType::reference operator[] (unsigned int i);
/**
- * Access an element of a constant slice using the same interface as
- * <tt>std::vector</tt>.
+ * Return a @p const reference to the $i$th element of the range
+ * represented by the current object.
*/
typename VectorType::const_reference operator[] (unsigned int i) const;
}
+template <typename VectorType>
+VectorSlice<VectorType>::
+operator ArrayView<typename VectorType::value_type *> ()
+{
+ return ArrayView<typename VectorType::value_type *> (&v[start], length);
+}
+
+
+template <typename VectorType>
+VectorSlice<VectorType>::
+operator ArrayView<const typename VectorType::value_type *> () const
+{
+ return ArrayView<const typename VectorType::value_type *> (&v[start], length);
+}
+
+
template <typename VectorType>
inline
typename VectorType::reference
// we were in get_data()
if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_gradients[k],
+ mapping.transform (make_array_view(fe_data.shape_gradients[k]),
mapping_covariant,
mapping_internal,
- output_data.shape_gradients[k]);
+ make_array_view(output_data.shape_gradients[k]));
if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_hessians[k],
+ mapping.transform (make_array_view(fe_data.shape_hessians[k]),
mapping_covariant_gradient,
mapping_internal,
- output_data.shape_hessians[k]);
+ 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)
if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_3rd_derivatives[k],
+ mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
mapping_covariant_hessian,
mapping_internal,
- output_data.shape_3rd_derivatives[k]);
+ make_array_view(output_data.shape_3rd_derivatives[k]));
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
correct_third_derivatives(output_data, mapping_data, quadrature.size(), k);
if (flags & update_gradients)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (make_slice(fe_data.shape_gradients[k], offset, quadrature.size()),
+ mapping.transform (ArrayView<const Tensor<1,dim> >(&fe_data.shape_gradients[k][offset], quadrature.size()),
mapping_covariant,
mapping_internal,
- output_data.shape_gradients[k]);
+ make_array_view(output_data.shape_gradients[k]));
if (flags & update_hessians)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (make_slice(fe_data.shape_hessians[k],
- offset,
- quadrature.size()),
+ mapping.transform (ArrayView<const Tensor<2,dim> >(&fe_data.shape_hessians[k][offset],
+ quadrature.size()),
mapping_covariant_gradient,
mapping_internal,
- output_data.shape_hessians[k]);
+ 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)
if (flags & update_3rd_derivatives)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (make_slice(fe_data.shape_3rd_derivatives[k],
- offset,
- quadrature.size()),
+ mapping.transform (ArrayView<const Tensor<3,dim> >(&fe_data.shape_3rd_derivatives[k][offset],
+ quadrature.size()),
mapping_covariant_hessian,
mapping_internal,
- output_data.shape_3rd_derivatives[k]);
+ make_array_view(output_data.shape_3rd_derivatives[k]));
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
correct_third_derivatives(output_data, mapping_data, quadrature.size(), k);
}
}
+
+
template <class PolynomialType, int dim, int spacedim>
void
FE_Poly<PolynomialType,dim,spacedim>::
if (flags & update_gradients)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (make_slice(fe_data.shape_gradients[k], offset, quadrature.size()),
+ mapping.transform (ArrayView<const Tensor<1,dim> >(&fe_data.shape_gradients[k][offset],
+ quadrature.size()),
mapping_covariant,
mapping_internal,
- output_data.shape_gradients[k]);
+ make_array_view(output_data.shape_gradients[k]));
if (flags & update_hessians)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (make_slice(fe_data.shape_hessians[k],
- offset,
- quadrature.size()),
+ mapping.transform (ArrayView<const Tensor<2,dim> >(&fe_data.shape_hessians[k][offset],
+ quadrature.size()),
mapping_covariant_gradient,
mapping_internal,
- output_data.shape_hessians[k]);
+ 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)
if (flags & update_3rd_derivatives)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (make_slice(fe_data.shape_3rd_derivatives[k],
- offset,
- quadrature.size()),
+ mapping.transform (ArrayView<const Tensor<3,dim> >(&fe_data.shape_3rd_derivatives[k][offset],
+ quadrature.size()),
mapping_covariant_hessian,
mapping_internal,
- output_data.shape_3rd_derivatives[k]);
+ make_array_view(output_data.shape_3rd_derivatives[k]));
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
correct_third_derivatives(output_data, mapping_data, quadrature.size(), k);
#include <deal.II/base/config.h>
#include <deal.II/base/derivative_form.h>
#include <deal.II/base/std_cxx11/array.h>
-#include <deal.II/base/vector_slice.h>
+#include <deal.II/base/array_view.h>
#include <deal.II/grid/tria.h>
#include <deal.II/fe/fe_update_flags.h>
* this object also represents with respect to which cell the transformation
* should be applied to.
* @param[out] output An array (or part of an array) into which the transformed
- * objects should be placed.
+ * objects should be placed. (Note that the array view is @p const, but the
+ * tensors it points to are not.)
*/
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const = 0;
-
-
+ const ArrayView<Tensor<1,spacedim> > &output) const = 0;
/**
* Transform a field of differential forms from the reference cell to the
* this object also represents with respect to which cell the transformation
* should be applied to.
* @param[out] output An array (or part of an array) into which the transformed
- * objects should be placed.
+ * objects should be placed. (Note that the array view is @p const, but the
+ * tensors it points to are not.)
*/
virtual
void
- transform (const VectorSlice<const std::vector< DerivativeForm<1, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const = 0;
-
+ transform (const ArrayView<const DerivativeForm<1, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<2,spacedim> > &output) const = 0;
/**
* Transform a tensor field from the reference cell to the physical cell.
* this object also represents with respect to which cell the transformation
* should be applied to.
* @param[out] output An array (or part of an array) into which the transformed
- * objects should be placed.
+ * objects should be placed. (Note that the array view is @p const, but the
+ * tensors it points to are not.)
*/
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+ transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const = 0;
+ const ArrayView<Tensor<2,spacedim> > &output) const = 0;
/**
* Transform a tensor field from the reference cell to the physical cell.
* this object also represents with respect to which cell the transformation
* should be applied to.
* @param[out] output An array (or part of an array) into which the transformed
- * objects should be placed.
+ * objects should be placed. (Note that the array view is @p const, but the
+ * tensors it points to are not.)
*/
virtual
void
- transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const = 0;
+ transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<3,spacedim> > &output) const = 0;
/**
* Transform a field of 3-differential forms from the reference cell to the
*/
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<3, dim> > > input,
+ transform (const ArrayView<const Tensor<3, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const = 0;
+ const ArrayView<Tensor<3,spacedim> > &output) const = 0;
/**
* @}
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const;
+ const ArrayView<Tensor<1,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<DerivativeForm<1, dim,spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<1, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<2,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+ transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ const ArrayView<Tensor<2,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<3,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<3, dim> > > input,
+ transform (const ArrayView<const Tensor<3, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ const ArrayView<Tensor<3,spacedim> > &output) const;
/**
* @}
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const;
+ const ArrayView<Tensor<1,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<DerivativeForm<1, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<1, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<2,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+ transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ const ArrayView<Tensor<2,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<3,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<3, dim> > > input,
+ transform (const ArrayView<const Tensor<3, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ const ArrayView<Tensor<3,spacedim> > &output) const;
/**
* @}
transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Point<spacedim> &p) const;
- // for documentation, see the base classes
+ // for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const;
+ const ArrayView<Tensor<1,spacedim> > &output) const;
- // for documentation, see the base classes
+ // for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<DerivativeForm<1, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<1, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<2,spacedim> > &output) const;
- // for documentation, see the base classes
+ // for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+ transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ const ArrayView<Tensor<2,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<3,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<3, dim> > > input,
+ transform (const ArrayView<const Tensor<3, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ const ArrayView<Tensor<3,spacedim> > &output) const;
/**
* Return a pointer to a copy of the present object. The caller of this copy
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const;
+ const ArrayView<Tensor<1,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<DerivativeForm<1, dim,spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<1, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<2,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+ transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const;
+ const ArrayView<Tensor<2,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType type,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const ArrayView<Tensor<3,spacedim> > &output) const;
// for documentation, see the Mapping base class
virtual
void
- transform (const VectorSlice<const std::vector<Tensor<3, dim> > > input,
+ transform (const ArrayView<const Tensor<3, dim> > &input,
const MappingType type,
const typename Mapping<dim,spacedim>::InternalDataBase &internal,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const;
+ const ArrayView<Tensor<3,spacedim> > &output) const;
/**
* @}
// we were in get_data()
if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_gradients[k],
+ mapping.transform (make_array_view(fe_data.shape_gradients[k]),
mapping_covariant,
mapping_internal,
- output_data.shape_gradients[k]);
+ make_array_view(output_data.shape_gradients[k]));
if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_hessians[k],
+ mapping.transform (make_array_view(fe_data.shape_hessians[k]),
mapping_covariant_gradient,
mapping_internal,
- output_data.shape_hessians[k]);
+ 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)
if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_3rd_derivatives[k],
+ mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
mapping_covariant_hessian,
mapping_internal,
- output_data.shape_3rd_derivatives[k]);
+ make_array_view(output_data.shape_3rd_derivatives[k]));
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
correct_third_derivatives(output_data, mapping_data, quadrature.size(), k);
// we were in get_data()
if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_gradients[k],
+ mapping.transform (make_array_view(fe_data.shape_gradients[k]),
mapping_covariant,
mapping_internal,
- output_data.shape_gradients[k]);
+ make_array_view(output_data.shape_gradients[k]));
if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_hessians[k],
+ mapping.transform (make_array_view(fe_data.shape_hessians[k]),
mapping_covariant_gradient,
mapping_internal,
- output_data.shape_hessians[k]);
+ 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)
if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_3rd_derivatives[k],
+ mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
mapping_covariant_hessian,
mapping_internal,
- output_data.shape_3rd_derivatives[k]);
+ make_array_view(output_data.shape_3rd_derivatives[k]));
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
correct_third_derivatives(output_data, mapping_data, quadrature.size(), k);
// we were in get_data()
if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_gradients[k],
+ mapping.transform (make_array_view(fe_data.shape_gradients[k]),
mapping_covariant,
mapping_internal,
- output_data.shape_gradients[k]);
+ make_array_view(output_data.shape_gradients[k]));
if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_hessians[k],
+ mapping.transform (make_array_view(fe_data.shape_hessians[k]),
mapping_covariant_gradient,
mapping_internal,
- output_data.shape_hessians[k]);
+ 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)
if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_3rd_derivatives[k],
+ mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
mapping_covariant_hessian,
mapping_internal,
- output_data.shape_3rd_derivatives[k]);
+ make_array_view(output_data.shape_3rd_derivatives[k]));
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
correct_third_derivatives(output_data, mapping_data, quadrature.size(), k);
// we were in get_data()
if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_gradients[k],
+ mapping.transform (make_array_view(fe_data.shape_gradients[k]),
mapping_covariant,
mapping_internal,
- output_data.shape_gradients[k]);
+ make_array_view(output_data.shape_gradients[k]));
if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_hessians[k],
+ mapping.transform (make_array_view(fe_data.shape_hessians[k]),
mapping_covariant_gradient,
mapping_internal,
- output_data.shape_hessians[k]);
+ 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)
if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
{
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (fe_data.shape_3rd_derivatives[k],
+ mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
mapping_covariant_hessian,
mapping_internal,
- output_data.shape_3rd_derivatives[k]);
+ make_array_view(output_data.shape_3rd_derivatives[k]));
for (unsigned int k=0; k<this->dofs_per_cell; ++k)
correct_third_derivatives(output_data, mapping_data, quadrature.size(), k);
case mapping_covariant:
case mapping_contravariant:
{
- mapping.transform (fe_data.shape_values[i],
+ mapping.transform (make_array_view(fe_data.shape_values[i]),
mapping_type,
mapping_internal,
- fe_data.transformed_shape_values);
+ make_array_view(fe_data.transformed_shape_values));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
case mapping_raviart_thomas:
case mapping_piola:
{
- mapping.transform (fe_data.shape_values[i],
+ mapping.transform (make_array_view(fe_data.shape_values[i]),
mapping_piola,
mapping_internal,
- fe_data.transformed_shape_values);
+ make_array_view(fe_data.transformed_shape_values));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
output_data.shape_values(first+d,k)
case mapping_nedelec:
{
- mapping.transform (fe_data.shape_values[i],
+ mapping.transform (make_array_view(fe_data.shape_values[i]),
mapping_covariant,
mapping_internal,
- fe_data.transformed_shape_values);
+ make_array_view(fe_data.transformed_shape_values));
for (unsigned int k = 0; k < n_q_points; ++k)
for (unsigned int d = 0; d < dim; ++d)
{
case mapping_none:
{
- mapping.transform (fe_data.shape_grads[i],
+ mapping.transform (make_array_view(fe_data.shape_grads[i]),
mapping_covariant,
mapping_internal,
- fe_data.transformed_shape_grads);
+ make_array_view(fe_data.transformed_shape_grads));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
output_data.shape_gradients[first+d][k] = fe_data.transformed_shape_grads[k][d];
}
case mapping_covariant:
{
- mapping.transform (fe_data.shape_grads[i],
+ mapping.transform (make_array_view(fe_data.shape_grads[i]),
mapping_covariant_gradient,
mapping_internal,
- fe_data.transformed_shape_grads);
+ make_array_view(fe_data.transformed_shape_grads));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
{
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
- mapping.transform (fe_data.untransformed_shape_grads,
+ mapping.transform (make_array_view(fe_data.untransformed_shape_grads),
mapping_contravariant_gradient,
mapping_internal,
- fe_data.transformed_shape_grads);
+ make_array_view(fe_data.transformed_shape_grads));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
{
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
- mapping.transform (fe_data.untransformed_shape_grads,
+ mapping.transform (make_array_view(fe_data.untransformed_shape_grads),
mapping_piola_gradient,
mapping_internal,
- fe_data.transformed_shape_grads);
+ make_array_view(fe_data.transformed_shape_grads));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k] = fe_data.shape_grads[i][k];
- mapping.transform (fe_data.untransformed_shape_grads,
+ mapping.transform (make_array_view(fe_data.untransformed_shape_grads),
mapping_covariant_gradient,
mapping_internal,
- fe_data.transformed_shape_grads);
+ make_array_view(fe_data.transformed_shape_grads));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
case mapping_none:
{
- mapping.transform(fe_data.shape_grad_grads[i], mapping_covariant_gradient,
- mapping_internal, fe_data.transformed_shape_hessians);
+ mapping.transform(make_array_view(fe_data.shape_grad_grads[i]),
+ mapping_covariant_gradient,
+ mapping_internal,
+ make_array_view(fe_data.transformed_shape_hessians));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
- mapping.transform(fe_data.untransformed_shape_hessian_tensors,
+ mapping.transform(make_array_view(fe_data.untransformed_shape_hessian_tensors),
mapping_covariant_hessian, mapping_internal,
- fe_data.transformed_shape_hessians);
+ make_array_view(fe_data.transformed_shape_hessians));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
- mapping.transform(fe_data.untransformed_shape_hessian_tensors, mapping_contravariant_hessian,
- mapping_internal, fe_data.transformed_shape_hessians
- );
+ mapping.transform(make_array_view(fe_data.untransformed_shape_hessian_tensors),
+ mapping_contravariant_hessian,
+ mapping_internal,
+ make_array_view(fe_data.transformed_shape_hessians));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
- mapping.transform(fe_data.untransformed_shape_hessian_tensors, mapping_piola_hessian,
- mapping_internal, fe_data.transformed_shape_hessians
- );
+ mapping.transform(make_array_view(fe_data.untransformed_shape_hessian_tensors),
+ mapping_piola_hessian,
+ mapping_internal,
+ make_array_view(fe_data.transformed_shape_hessians));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k] = fe_data.shape_grad_grads[i][k];
- mapping.transform(fe_data.untransformed_shape_hessian_tensors,
+ mapping.transform(make_array_view(fe_data.untransformed_shape_hessian_tensors),
mapping_covariant_hessian, mapping_internal,
- fe_data.transformed_shape_hessians);
+ make_array_view(fe_data.transformed_shape_hessians));
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
case mapping_covariant:
case mapping_contravariant:
{
- VectorSlice< std::vector<Tensor<1,spacedim> > >
- transformed_shape_values(fe_data.transformed_shape_values, offset, n_q_points);
- // Use auxiliary vector
- // for transformation
- mapping.transform (make_slice(fe_data.shape_values[i], offset, n_q_points),
+ const ArrayView<Tensor<1,spacedim> > transformed_shape_values
+ = make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
+ mapping.transform (make_array_view(fe_data.shape_values[i], offset, n_q_points),
mapping_type,
mapping_internal,
transformed_shape_values);
case mapping_raviart_thomas:
case mapping_piola:
{
- VectorSlice< std::vector<Tensor<1,spacedim> > >
- transformed_shape_values(fe_data.transformed_shape_values, offset, n_q_points);
-
- mapping.transform (make_slice(fe_data.shape_values[i], offset, n_q_points),
+ const ArrayView<Tensor<1,spacedim> > transformed_shape_values
+ = make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
+ mapping.transform (make_array_view(fe_data.shape_values[i], offset, n_q_points),
mapping_piola,
mapping_internal,
transformed_shape_values);
case mapping_nedelec:
{
- VectorSlice< std::vector<Tensor<1,spacedim> > >
- transformed_shape_values(fe_data.transformed_shape_values, offset, n_q_points);
-
- mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points),
+ const ArrayView<Tensor<1,spacedim> > transformed_shape_values
+ = make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
+ mapping.transform (make_array_view (fe_data.shape_values[i], offset, n_q_points),
mapping_covariant,
mapping_internal,
transformed_shape_values);
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);
-
switch (mapping_type)
{
case mapping_none:
{
- mapping.transform (make_slice(fe_data.shape_grads[i], offset, n_q_points),
+ const ArrayView<Tensor<2,spacedim> > transformed_shape_grads
+ = make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
+ mapping.transform (make_array_view(fe_data.shape_grads[i], offset, n_q_points),
mapping_covariant,
mapping_internal,
transformed_shape_grads);
case mapping_covariant:
{
- mapping.transform (make_slice(fe_data.shape_grads[i], offset, n_q_points),
+ const ArrayView<Tensor<2,spacedim> > transformed_shape_grads
+ = make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
+ mapping.transform (make_array_view(fe_data.shape_grads[i], offset, n_q_points),
mapping_covariant_gradient,
mapping_internal,
transformed_shape_grads);
output_data.shape_gradients[first+d][k] = transformed_shape_grads[k][d];
break;
}
+
case mapping_contravariant:
{
+ const ArrayView<Tensor<2,spacedim> > transformed_shape_grads
+ = make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
- mapping.transform (make_slice(fe_data.untransformed_shape_grads, offset, n_q_points),
+ mapping.transform (make_array_view(fe_data.untransformed_shape_grads, offset, n_q_points),
mapping_contravariant_gradient,
mapping_internal,
transformed_shape_grads);
break;
}
+
case mapping_raviart_thomas:
case mapping_piola:
{
+ const ArrayView<Tensor<2,spacedim> > transformed_shape_grads
+ = make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
- mapping.transform (make_slice(fe_data.untransformed_shape_grads, offset, n_q_points),
+ mapping.transform (make_array_view(fe_data.untransformed_shape_grads, offset, n_q_points),
mapping_piola_gradient,
mapping_internal,
transformed_shape_grads);
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
- mapping.transform (make_slice (fe_data.untransformed_shape_grads, offset, n_q_points),
+ const ArrayView<Tensor<2,spacedim> > transformed_shape_grads
+ = make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
+ mapping.transform (make_array_view (fe_data.untransformed_shape_grads, offset, n_q_points),
mapping_covariant_gradient,
mapping_internal,
transformed_shape_grads);
}
if (fe_data.update_each & update_hessians)
-
{
-
- VectorSlice< std::vector<Tensor<3,spacedim> > > transformed_shape_hessians (fe_data.transformed_shape_hessians, offset, n_q_points);
-
switch (mapping_type)
{
case mapping_none:
{
-
- mapping.transform(make_slice (fe_data.shape_grad_grads[i], offset, n_q_points),
- mapping_covariant_gradient, mapping_internal, transformed_shape_hessians
- );
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.shape_grad_grads[i], offset, n_q_points),
+ mapping_covariant_gradient,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
}
case mapping_covariant:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_covariant_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_covariant_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
break;
}
+
case mapping_contravariant:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_contravariant_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_contravariant_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
output_data.shape_hessians[first+d][k] = transformed_shape_hessians[k][d];
break;
-
}
+
case mapping_raviart_thomas:
case mapping_piola:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_piola_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_piola_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
output_data.shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
break;
-
}
case mapping_nedelec:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_covariant_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_covariant_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
output_data.shape_hessians[first+d][k] = fe_data.sign_change[i] * transformed_shape_hessians[k][d];
break;
-
}
default:
case mapping_covariant:
case mapping_contravariant:
{
- VectorSlice< std::vector<Tensor<1,spacedim> > >
- transformed_shape_values (fe_data.transformed_shape_values, offset, n_q_points);
-
- // Use auxiliary vector for
- // transformation
- mapping.transform (make_slice(fe_data.shape_values[i], offset, n_q_points),
+ const ArrayView<Tensor<1,spacedim> > transformed_shape_values
+ = make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
+ mapping.transform (make_array_view(fe_data.shape_values[i], offset, n_q_points),
mapping_type,
mapping_internal,
transformed_shape_values);
break;
}
+
case mapping_raviart_thomas:
case mapping_piola:
{
- VectorSlice< std::vector<Tensor<1,spacedim> > >
- transformed_shape_values (fe_data.transformed_shape_values, offset, n_q_points);
+ const ArrayView<Tensor<1,spacedim> > transformed_shape_values
+ = make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
- mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points),
- mapping_piola, mapping_internal, transformed_shape_values);
+ mapping.transform(make_array_view(fe_data.shape_values[i], offset, n_q_points),
+ mapping_piola,
+ mapping_internal,
+ transformed_shape_values);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
output_data.shape_values(first+d,k)
= fe_data.sign_change[i] * transformed_shape_values[k][d];
break;
}
+
case mapping_nedelec:
{
- VectorSlice< std::vector<Tensor<1,spacedim> > >
- transformed_shape_values (fe_data.transformed_shape_values, offset, n_q_points);
+ const ArrayView<Tensor<1,spacedim> > transformed_shape_values
+ = make_array_view(fe_data.transformed_shape_values, offset, n_q_points);
- mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points),
+ mapping.transform (make_array_view (fe_data.shape_values[i], offset, n_q_points),
mapping_covariant,
mapping_internal,
transformed_shape_values);
break;
}
+
default:
Assert(false, ExcNotImplemented());
}
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);
+ const ArrayView<Tensor<2, spacedim> > transformed_shape_grads
+ = make_array_view(fe_data.transformed_shape_grads, offset, n_q_points);
switch (mapping_type)
{
case mapping_none:
{
- mapping.transform (make_slice(fe_data.shape_grads[i], offset, n_q_points),
+ mapping.transform (make_array_view(fe_data.shape_grads[i], offset, n_q_points),
mapping_covariant,
mapping_internal,
transformed_shape_grads);
case mapping_covariant:
{
- mapping.transform (make_slice(fe_data.shape_grads[i], offset, n_q_points),
+ mapping.transform (make_array_view(fe_data.shape_grads[i], offset, n_q_points),
mapping_covariant_gradient,
mapping_internal,
transformed_shape_grads);
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
- mapping.transform (make_slice(fe_data.untransformed_shape_grads, offset, n_q_points),
+ mapping.transform (make_array_view(fe_data.untransformed_shape_grads, offset, n_q_points),
mapping_contravariant_gradient,
mapping_internal,
transformed_shape_grads);
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
- mapping.transform (make_slice(fe_data.untransformed_shape_grads, offset, n_q_points),
+ mapping.transform (make_array_view(fe_data.untransformed_shape_grads, offset, n_q_points),
mapping_piola_gradient,
mapping_internal,
transformed_shape_grads);
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_grads[k+offset] = fe_data.shape_grads[i][k+offset];
- mapping.transform (make_slice (fe_data.untransformed_shape_grads, offset, n_q_points),
+ mapping.transform (make_array_view (fe_data.untransformed_shape_grads, offset, n_q_points),
mapping_covariant_gradient,
mapping_internal,
transformed_shape_grads);
}
if (fe_data.update_each & update_hessians)
-
{
-
- VectorSlice< std::vector<Tensor<3,dim> > > transformed_shape_hessians (fe_data.transformed_shape_hessians, offset, n_q_points);
-
switch (mapping_type)
{
case mapping_none:
{
-
- mapping.transform(make_slice (fe_data.shape_grad_grads[i], offset, n_q_points),
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.shape_grad_grads[i], offset, n_q_points),
mapping_covariant_gradient, mapping_internal,
- transformed_shape_hessians );
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
}
case mapping_covariant:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_covariant_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_covariant_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
break;
}
+
case mapping_contravariant:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_contravariant_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_contravariant_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
break;
}
+
case mapping_raviart_thomas:
case mapping_piola:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_piola_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_piola_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
case mapping_nedelec:
{
-
for (unsigned int k=0; k<n_q_points; ++k)
fe_data.untransformed_shape_hessian_tensors[k+offset] = fe_data.shape_grad_grads[i][k+offset];
- mapping.transform(make_slice (fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
- mapping_covariant_hessian, mapping_internal, transformed_shape_hessians);
+ const ArrayView<Tensor<3,spacedim> > transformed_shape_hessians
+ = make_array_view(fe_data.transformed_shape_hessians, offset, n_q_points);
+ mapping.transform(make_array_view(fe_data.untransformed_shape_hessian_tensors, offset, n_q_points),
+ mapping_covariant_hessian,
+ mapping_internal,
+ transformed_shape_hessians);
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<spacedim; ++d)
template <int dim, int spacedim>
void
-FEValuesBase<dim,spacedim>::transform (
- std::vector<Tensor<1,spacedim> > &transformed,
- const std::vector<Tensor<1,dim> > &original,
- MappingType type) const
+FEValuesBase<dim,spacedim>::
+transform (std::vector<Tensor<1,spacedim> > &transformed,
+ const std::vector<Tensor<1,dim> > &original,
+ MappingType type) const
{
- VectorSlice<const std::vector<Tensor<1,dim> > > src(original);
- VectorSlice<std::vector<Tensor<1,spacedim> > > dst(transformed);
- mapping->transform(src, type,*mapping_data, dst);
+ mapping->transform(make_array_view(original),
+ type,
+ *mapping_data,
+ make_array_view(transformed));
}
template<int dim, int spacedim>
void
MappingCartesian<dim,spacedim>::
-transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const
+ const ArrayView<Tensor<1,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
template<int dim, int spacedim>
void
MappingCartesian<dim,spacedim>::
-transform (const VectorSlice<const std::vector<DerivativeForm<1, dim,spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<1, dim,spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<2,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
template<int dim, int spacedim>
void
MappingCartesian<dim,spacedim>::
-transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2, spacedim> > > output) const
+ const ArrayView<Tensor<2, spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
template<int dim, int spacedim>
void
MappingCartesian<dim,spacedim>::
-transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
template<int dim, int spacedim>
void
MappingCartesian<dim,spacedim>::
-transform (const VectorSlice<const std::vector< Tensor<3,dim> > > input,
+transform (const ArrayView<const Tensor<3,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
data.unit_tangentials[face_no+GeometryInfo<dim>::faces_per_cell*d].size(),
ExcInternalError());
- mapping.transform (data.unit_tangentials[face_no+GeometryInfo<dim>::faces_per_cell*d],
+ mapping.transform (make_array_view(data.unit_tangentials[face_no+GeometryInfo<dim>::faces_per_cell*d]),
mapping_contravariant,
data,
- data.aux[d]);
+ make_array_view(data.aux[d]));
}
// if dim==spacedim, we can use the unit tangentials to compute the
{
template<int dim, int spacedim, int rank, typename VectorType, typename DoFHandlerType>
void
- transform_fields(const VectorSlice<const std::vector<Tensor<rank,dim> > > input,
+ transform_fields(const ArrayView<const Tensor<rank,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<rank,spacedim> > > output)
+ const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::InternalData *>(&mapping_data) != 0),
template<int dim, int spacedim, int rank, typename VectorType, typename DoFHandlerType>
void
transform_differential_forms
- (const VectorSlice<const std::vector<DerivativeForm<rank, dim,spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<rank+1, spacedim> > > output)
+ (const ArrayView<const DerivativeForm<rank, dim,spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<rank+1, spacedim> > &output)
{
AssertDimension (input.size(), output.size());
template<int dim, int spacedim, typename VectorType, typename DoFHandlerType>
void
MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::
-transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const
+ const ArrayView<Tensor<1,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
template<int dim, int spacedim, typename VectorType, typename DoFHandlerType>
void
MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::
-transform (const VectorSlice<const std::vector<DerivativeForm<1, dim ,spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<1, dim ,spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<2,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
template<int dim, int spacedim, typename VectorType, typename DoFHandlerType>
void
MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::
-transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
- const MappingType,
+transform (const ArrayView<const Tensor<2, dim> > &input,
+ const MappingType ,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const
+ const ArrayView<Tensor<2,spacedim> > &output) const
{
(void)input;
(void)output;
template<int dim, int spacedim, typename VectorType, typename DoFHandlerType>
void
MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::
-transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
-
AssertDimension (input.size(), output.size());
Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
ExcInternalError());
template<int dim, int spacedim, typename VectorType, typename DoFHandlerType>
void
MappingFEField<dim,spacedim,VectorType,DoFHandlerType>::
-transform (const VectorSlice<const std::vector< Tensor<3,dim> > > input,
+transform (const ArrayView<const Tensor<3,dim> > &input,
const MappingType /*mapping_type*/,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
(void)input;
}
+
template<int dim, int spacedim>
void
MappingQ<dim,spacedim>::
-transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+transform (const ArrayView<const Tensor<1,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<1,spacedim> > > output) const
+ const ArrayView<Tensor<1,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
template<int dim, int spacedim>
void
MappingQ<dim,spacedim>::
-transform (const VectorSlice<const std::vector<DerivativeForm<1, dim ,spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<1, dim ,spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<2,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
}
+
template<int dim, int spacedim>
-void MappingQ<dim,spacedim>::
-transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+void
+MappingQ<dim,spacedim>::
+transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2,spacedim> > > output) const
+ const ArrayView<Tensor<2,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
template<int dim, int spacedim>
void
MappingQ<dim,spacedim>::
-transform (const VectorSlice<const std::vector<DerivativeForm<2, dim ,spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<2, dim ,spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
}
+
template<int dim, int spacedim>
void MappingQ<dim,spacedim>::
-transform (const VectorSlice<const std::vector<Tensor<3, dim> > > input,
+transform (const ArrayView<const Tensor<3, dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQ<dim,spacedim>::InternalData *> (&mapping_data)
}
+
template<int dim, int spacedim>
Point<spacedim>
MappingQ<dim,spacedim>::
data.unit_tangentials[face_no+GeometryInfo<dim>::faces_per_cell*d].size(),
ExcInternalError());
- mapping.transform (data.unit_tangentials[face_no+GeometryInfo<dim>::faces_per_cell*d],
+ mapping.transform (make_array_view(data.unit_tangentials[face_no+GeometryInfo<dim>::faces_per_cell*d]),
mapping_contravariant,
data,
- data.aux[d]);
+ make_array_view(data.aux[d]));
}
// if dim==spacedim, we can use the unit tangentials to compute the
{
template <int dim, int spacedim, int rank>
void
- transform_fields(const VectorSlice<const std::vector<Tensor<rank,dim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<rank,spacedim> > > output)
+ transform_fields(const ArrayView<const Tensor<rank,dim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
template <int dim, int spacedim, int rank>
void
- transform_gradients(const VectorSlice<const std::vector<Tensor<rank,dim> > > input,
+ transform_gradients(const ArrayView<const Tensor<rank,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<rank,spacedim> > > output)
+ const ArrayView<Tensor<rank,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
template <int dim, int spacedim>
void
- transform_hessians(const VectorSlice<const std::vector<Tensor<3,dim> > > input,
+ transform_hessians(const ArrayView<const Tensor<3,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output)
+ const ArrayView<Tensor<3,spacedim> > &output)
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
template<int dim, int spacedim, int rank>
void
- transform_differential_forms(const VectorSlice<const std::vector<DerivativeForm<rank, dim,spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<rank+1, spacedim> > > output)
+ transform_differential_forms(const ArrayView<const DerivativeForm<rank, dim,spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<rank+1, spacedim> > &output)
{
AssertDimension (input.size(), output.size());
Assert ((dynamic_cast<const typename MappingQGeneric<dim,spacedim>::InternalData *>(&mapping_data) != 0),
template<int dim, int spacedim>
void
MappingQGeneric<dim,spacedim>::
-transform (const VectorSlice<const std::vector<Tensor<1, dim> > > input,
+transform (const ArrayView<const Tensor<1, dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<1, spacedim> > > output) const
+ const ArrayView<Tensor<1, spacedim> > &output) const
{
transform_fields(input, mapping_type, mapping_data, output);
}
template<int dim, int spacedim>
void
MappingQGeneric<dim,spacedim>::
-transform (const VectorSlice<const std::vector<DerivativeForm<1, dim,spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2, spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<1, dim,spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<2, spacedim> > &output) const
{
transform_differential_forms(input, mapping_type, mapping_data, output);
}
template<int dim, int spacedim>
void
MappingQGeneric<dim,spacedim>::
-transform (const VectorSlice<const std::vector<Tensor<2, dim> > > input,
+transform (const ArrayView<const Tensor<2, dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<2, spacedim> > > output) const
+ const ArrayView<Tensor<2, spacedim> > &output) const
{
switch (mapping_type)
{
template<int dim, int spacedim>
void
MappingQGeneric<dim,spacedim>::
-transform (const VectorSlice<const std::vector< DerivativeForm<2, dim, spacedim> > > input,
- const MappingType mapping_type,
- const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+transform (const ArrayView<const DerivativeForm<2, dim, spacedim> > &input,
+ const MappingType mapping_type,
+ const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
AssertDimension (input.size(), output.size());
template<int dim, int spacedim>
void
MappingQGeneric<dim,spacedim>::
-transform (const VectorSlice<const std::vector< Tensor<3,dim> > > input,
+transform (const ArrayView<const Tensor<3,dim> > &input,
const MappingType mapping_type,
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
- VectorSlice<std::vector<Tensor<3,spacedim> > > output) const
+ const ArrayView<Tensor<3,spacedim> > &output) const
{
switch (mapping_type)
{