*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_hessians(
- const InputVector &fe_function,
- std::vector<solution_hessian_type<typename InputVector::value_type>>
- &hessians) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_hessian_type<Number>> &hessians) const;
/**
* This function relates to get_function_hessians() in the same way
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_laplacians(
- const InputVector &fe_function,
- std::vector<solution_laplacian_type<typename InputVector::value_type>>
- &laplacians) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_laplacian_type<Number>> &laplacians) const;
/**
* This function relates to get_function_laplacians() in the same way
*
* @dealiiRequiresUpdateFlags{update_third_derivatives}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<
- solution_third_derivative_type<typename InputVector::value_type>>
- &third_derivatives) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_third_derivative_type<Number>> &third_derivatives)
+ const;
/**
* This function relates to get_function_third_derivatives() in the same way
*
* @dealiiRequiresUpdateFlags{update_gradients}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_symmetric_gradients(
- const InputVector &fe_function,
- std::vector<
- solution_symmetric_gradient_type<typename InputVector::value_type>>
+ const ReadVector<Number> &fe_function,
+ std::vector<solution_symmetric_gradient_type<Number>>
&symmetric_gradients) const;
/**
*
* @dealiiRequiresUpdateFlags{update_gradients}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_divergences(
- const InputVector &fe_function,
- std::vector<solution_divergence_type<typename InputVector::value_type>>
- &divergences) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_divergence_type<Number>> &divergences) const;
/**
* This function relates to get_function_divergences() in the same way
*
* @dealiiRequiresUpdateFlags{update_gradients}
*/
- template <class InputVector>
+ template <typename Number>
void
- get_function_curls(
- const InputVector &fe_function,
- std::vector<solution_curl_type<typename InputVector::value_type>> &curls)
- const;
+ get_function_curls(const ReadVector<Number> & fe_function,
+ std::vector<solution_curl_type<Number>> &curls) const;
/**
* This function relates to get_function_curls() in the same way
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_hessians(
- const InputVector &fe_function,
- std::vector<solution_hessian_type<typename InputVector::value_type>>
- &hessians) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_hessian_type<Number>> &hessians) const;
/**
* This function relates to get_function_hessians() in the same way
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_laplacians(
- const InputVector &fe_function,
- std::vector<solution_laplacian_type<typename InputVector::value_type>>
- &laplacians) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_laplacian_type<Number>> &laplacians) const;
/**
* This function relates to get_function_laplacians() in the same way
*
* @dealiiRequiresUpdateFlags{update_third_derivatives}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<
- solution_third_derivative_type<typename InputVector::value_type>>
- &third_derivatives) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_third_derivative_type<Number>> &third_derivatives)
+ const;
/**
* This function relates to get_function_third_derivatives() in the same way
*
* @dealiiRequiresUpdateFlags{update_gradients}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_divergences(
- const InputVector &fe_function,
- std::vector<solution_divergence_type<typename InputVector::value_type>>
- &divergences) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_divergence_type<Number>> &divergences) const;
/**
* This function relates to get_function_divergences() in the same way
*
* @dealiiRequiresUpdateFlags{update_gradients}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_divergences(
- const InputVector &fe_function,
- std::vector<solution_divergence_type<typename InputVector::value_type>>
- &divergences) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_divergence_type<Number>> &divergences) const;
/**
* This function relates to get_function_divergences() in the same way
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_hessians(
- const InputVector &fe_function,
- std::vector<Tensor<2, spacedim, typename InputVector::value_type>>
- &hessians) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<Tensor<2, spacedim, Number>> &hessians) const;
/**
* This function does the same as the other get_function_hessians(), but
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_hessians(
- const InputVector &fe_function,
- std::vector<
- std::vector<Tensor<2, spacedim, typename InputVector::value_type>>>
- & hessians,
+ const ReadVector<Number> & fe_function,
+ std::vector<std::vector<Tensor<2, spacedim, Number>>> &hessians,
const bool quadrature_points_fastest = false) const;
/**
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_hessians(
- const InputVector & fe_function,
+ const ReadVector<Number> & fe_function,
const ArrayView<const types::global_dof_index> &indices,
- std::vector<Tensor<2, spacedim, typename InputVector::value_type>>
- &hessians) const;
+ std::vector<Tensor<2, spacedim, Number>> & hessians) const;
/**
* This function relates to the first of the get_function_hessians() function
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_hessians(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> &indices,
- ArrayView<
- std::vector<Tensor<2, spacedim, typename InputVector::value_type>>>
- hessians,
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> & indices,
+ ArrayView<std::vector<Tensor<2, spacedim, Number>>> hessians,
const bool quadrature_points_fastest = false) const;
/**
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
- get_function_laplacians(
- const InputVector & fe_function,
- std::vector<typename InputVector::value_type> &laplacians) const;
+ get_function_laplacians(const ReadVector<Number> &fe_function,
+ std::vector<Number> & laplacians) const;
/**
* This function does the same as the other get_function_laplacians(), but
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
- get_function_laplacians(
- const InputVector & fe_function,
- std::vector<Vector<typename InputVector::value_type>> &laplacians) const;
+ get_function_laplacians(const ReadVector<Number> & fe_function,
+ std::vector<Vector<Number>> &laplacians) const;
/**
* This function relates to the first of the get_function_laplacians()
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_laplacians(
- const InputVector & fe_function,
+ const ReadVector<Number> & fe_function,
const ArrayView<const types::global_dof_index> &indices,
- std::vector<typename InputVector::value_type> & laplacians) const;
+ std::vector<Number> & laplacians) const;
/**
* This function relates to the first of the get_function_laplacians()
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_laplacians(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> & indices,
- std::vector<Vector<typename InputVector::value_type>> &laplacians) const;
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> &indices,
+ std::vector<Vector<Number>> & laplacians) const;
/**
* This function relates to the first of the get_function_laplacians()
*
* @dealiiRequiresUpdateFlags{update_hessians}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_laplacians(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> & indices,
- std::vector<std::vector<typename InputVector::value_type>> &laplacians,
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> &indices,
+ std::vector<std::vector<Number>> & laplacians,
const bool quadrature_points_fastest = false) const;
/** @} */
*
* @dealiiRequiresUpdateFlags{update_3rd_derivatives}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<Tensor<3, spacedim, typename InputVector::value_type>>
- &third_derivatives) const;
+ const ReadVector<Number> & fe_function,
+ std::vector<Tensor<3, spacedim, Number>> &third_derivatives) const;
/**
* This function does the same as the other
*
* @dealiiRequiresUpdateFlags{update_3rd_derivatives}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<
- std::vector<Tensor<3, spacedim, typename InputVector::value_type>>>
- & third_derivatives,
+ const ReadVector<Number> & fe_function,
+ std::vector<std::vector<Tensor<3, spacedim, Number>>> &third_derivatives,
const bool quadrature_points_fastest = false) const;
/**
*
* @dealiiRequiresUpdateFlags{update_3rd_derivatives}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_third_derivatives(
- const InputVector & fe_function,
+ const ReadVector<Number> & fe_function,
const ArrayView<const types::global_dof_index> &indices,
- std::vector<Tensor<3, spacedim, typename InputVector::value_type>>
- &third_derivatives) const;
+ std::vector<Tensor<3, spacedim, Number>> & third_derivatives) const;
/**
* This function relates to the first of the get_function_third_derivatives()
*
* @dealiiRequiresUpdateFlags{update_3rd_derivatives}
*/
- template <class InputVector>
+ template <typename Number>
void
get_function_third_derivatives(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> &indices,
- ArrayView<
- std::vector<Tensor<3, spacedim, typename InputVector::value_type>>>
- third_derivatives,
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> & indices,
+ ArrayView<std::vector<Tensor<3, spacedim, Number>>> third_derivatives,
const bool quadrature_points_fastest = false) const;
/** @} */
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/lac/block_vector.h>
-#include <deal.II/lac/la_parallel_block_vector.h>
-#include <deal.II/lac/la_parallel_vector.h>
-#include <deal.II/lac/la_vector.h>
-#include <deal.II/lac/petsc_block_vector.h>
-#include <deal.II/lac/petsc_vector.h>
-#include <deal.II/lac/trilinos_epetra_vector.h>
-#include <deal.II/lac/trilinos_parallel_block_vector.h>
-#include <deal.II/lac/trilinos_tpetra_vector.h>
-#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/vector.h>
-#include <deal.II/lac/vector_element_access.h>
#include <boost/container/small_vector.hpp>
namespace internal
{
- template <class VectorType>
- typename VectorType::value_type inline get_vector_element(
- const VectorType & vector,
- const types::global_dof_index cell_number)
- {
- return internal::ElementAccess<VectorType>::get(vector, cell_number);
- }
-
-
-
- IndexSet::value_type inline get_vector_element(
- const IndexSet & is,
- const types::global_dof_index cell_number)
- {
- return (is.is_element(cell_number) ? 1 : 0);
- }
-
-
-
template <int dim, int spacedim>
inline std::vector<unsigned int>
make_shape_function_to_row_table(const FiniteElement<dim, spacedim> &fe)
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Scalar<dim, spacedim>::get_function_hessians(
- const InputVector &fe_function,
- std::vector<solution_hessian_type<typename InputVector::value_type>>
- &hessians) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_hessian_type<Number>> &hessians) const
{
Assert(fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_derivatives<2, dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Scalar<dim, spacedim>::get_function_laplacians(
- const InputVector &fe_function,
- std::vector<solution_laplacian_type<typename InputVector::value_type>>
- &laplacians) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_laplacian_type<Number>> &laplacians) const
{
Assert(fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_laplacians<dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Scalar<dim, spacedim>::get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<
- solution_third_derivative_type<typename InputVector::value_type>>
- &third_derivatives) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_third_derivative_type<Number>> &third_derivatives)
+ const
{
Assert(fe_values->update_flags & update_3rd_derivatives,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_derivatives<3, dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Vector<dim, spacedim>::get_function_symmetric_gradients(
- const InputVector &fe_function,
- std::vector<
- solution_symmetric_gradient_type<typename InputVector::value_type>>
- &symmetric_gradients) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_symmetric_gradient_type<Number>> &symmetric_gradients)
+ const
{
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_symmetric_gradients<dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Vector<dim, spacedim>::get_function_divergences(
- const InputVector &fe_function,
- std::vector<solution_divergence_type<typename InputVector::value_type>>
- &divergences) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_divergence_type<Number>> &divergences) const
{
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
// get function values of dofs
// on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_divergences<dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Vector<dim, spacedim>::get_function_curls(
- const InputVector &fe_function,
- std::vector<solution_curl_type<typename InputVector::value_type>> &curls)
- const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_curl_type<Number>> &curls) const
{
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_curls<dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Vector<dim, spacedim>::get_function_hessians(
- const InputVector &fe_function,
- std::vector<solution_hessian_type<typename InputVector::value_type>>
- &hessians) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_hessian_type<Number>> &hessians) const
{
Assert(fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_derivatives<2, dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Vector<dim, spacedim>::get_function_laplacians(
- const InputVector &fe_function,
- std::vector<solution_value_type<typename InputVector::value_type>>
- &laplacians) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_value_type<Number>> &laplacians) const
{
Assert(fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler()));
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_laplacians<dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Vector<dim, spacedim>::get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<
- solution_third_derivative_type<typename InputVector::value_type>>
- &third_derivatives) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_third_derivative_type<Number>> &third_derivatives)
+ const
{
Assert(fe_values->update_flags & update_3rd_derivatives,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
fe_values->present_cell.n_dofs_for_dof_handler());
// get function values of dofs on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_derivatives<3, dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
SymmetricTensor<2, dim, spacedim>::get_function_divergences(
- const InputVector &fe_function,
- std::vector<solution_divergence_type<typename InputVector::value_type>>
- &divergences) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_divergence_type<Number>> &divergences) const
{
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
// get function values of dofs
// on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_divergences<dim, spacedim>(
template <int dim, int spacedim>
- template <class InputVector>
+ template <typename Number>
void
Tensor<2, dim, spacedim>::get_function_divergences(
- const InputVector &fe_function,
- std::vector<solution_divergence_type<typename InputVector::value_type>>
- &divergences) const
+ const ReadVector<Number> & fe_function,
+ std::vector<solution_divergence_type<Number>> &divergences) const
{
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
// get function values of dofs
// on this cell
- dealii::Vector<typename InputVector::value_type> dof_values(
- fe_values->dofs_per_cell);
+ dealii::Vector<Number> dof_values(fe_values->dofs_per_cell);
fe_values->present_cell.get_interpolated_dof_values(fe_function,
dof_values);
internal::do_function_divergences<dim, spacedim>(
auto view = make_array_view(dof_values.begin(), dof_values.end());
fe_function.extract_subvector_to(indices, view);
internal::do_function_derivatives(
- make_array_view(dof_values.begin(), dof_values.end()),
+ view,
this->finite_element_output.shape_gradients,
*fe,
this->finite_element_output.shape_function_to_row_table,
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_hessians(
- const InputVector &fe_function,
- std::vector<Tensor<2, spacedim, typename InputVector::value_type>> &hessians)
- const
+ const ReadVector<Number> & fe_function,
+ std::vector<Tensor<2, spacedim, Number>> &hessians) const
{
- using Number = typename InputVector::value_type;
AssertDimension(fe->n_components(), 1);
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_hessians(
- const InputVector & fe_function,
+ const ReadVector<Number> & fe_function,
const ArrayView<const types::global_dof_index> &indices,
- std::vector<Tensor<2, spacedim, typename InputVector::value_type>> &hessians)
- const
+ std::vector<Tensor<2, spacedim, Number>> & hessians) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
AssertDimension(indices.size(), dofs_per_cell);
boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
- internal::do_function_derivatives(make_array_view(dof_values.begin(),
- dof_values.end()),
+ auto view = make_array_view(dof_values.begin(), dof_values.end());
+ fe_function.extract_subvector_to(indices, view);
+ internal::do_function_derivatives(view,
this->finite_element_output.shape_hessians,
hessians);
}
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_hessians(
- const InputVector &fe_function,
- std::vector<
- std::vector<Tensor<2, spacedim, typename InputVector::value_type>>>
- & hessians,
+ const ReadVector<Number> & fe_function,
+ std::vector<std::vector<Tensor<2, spacedim, Number>>> &hessians,
const bool quadrature_points_fastest) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
Assert(present_cell.is_initialized(), ExcNotReinited());
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_hessians(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> &indices,
- ArrayView<std::vector<Tensor<2, spacedim, typename InputVector::value_type>>>
- hessians,
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> & indices,
+ ArrayView<std::vector<Tensor<2, spacedim, Number>>> hessians,
const bool quadrature_points_fastest) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
Assert(indices.size() % dofs_per_cell == 0,
ExcNotMultiple(indices.size(), dofs_per_cell));
boost::container::small_vector<Number, 200> dof_values(indices.size());
- for (unsigned int i = 0; i < indices.size(); ++i)
- dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
+ auto view = make_array_view(dof_values.begin(), dof_values.end());
+ fe_function.extract_subvector_to(indices, view);
internal::do_function_derivatives(
- make_array_view(dof_values.begin(), dof_values.end()),
+ view,
this->finite_element_output.shape_hessians,
*fe,
this->finite_element_output.shape_function_to_row_table,
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_laplacians(
- const InputVector & fe_function,
- std::vector<typename InputVector::value_type> &laplacians) const
+ const ReadVector<Number> &fe_function,
+ std::vector<Number> & laplacians) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
AssertDimension(fe->n_components(), 1);
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_laplacians(
- const InputVector & fe_function,
+ const ReadVector<Number> & fe_function,
const ArrayView<const types::global_dof_index> &indices,
- std::vector<typename InputVector::value_type> & laplacians) const
+ std::vector<Number> & laplacians) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
AssertDimension(fe->n_components(), 1);
AssertDimension(indices.size(), dofs_per_cell);
boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
- internal::do_function_laplacians(make_array_view(dof_values.begin(),
- dof_values.end()),
+ auto view = make_array_view(dof_values.begin(), dof_values.end());
+ fe_function.extract_subvector_to(indices, view);
+ internal::do_function_laplacians(view,
this->finite_element_output.shape_hessians,
laplacians);
}
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_laplacians(
- const InputVector & fe_function,
- std::vector<Vector<typename InputVector::value_type>> &laplacians) const
+ const ReadVector<Number> & fe_function,
+ std::vector<Vector<Number>> &laplacians) const
{
- using Number = typename InputVector::value_type;
Assert(present_cell.is_initialized(), ExcNotReinited());
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_laplacians(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> & indices,
- std::vector<Vector<typename InputVector::value_type>> &laplacians) const
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> &indices,
+ std::vector<Vector<Number>> & laplacians) const
{
- using Number = typename InputVector::value_type;
// Size of indices must be a multiple of dofs_per_cell such that an integer
// number of function values is generated in each point.
Assert(indices.size() % dofs_per_cell == 0,
ExcAccessToUninitializedField("update_hessians"));
boost::container::small_vector<Number, 200> dof_values(indices.size());
- for (unsigned int i = 0; i < indices.size(); ++i)
- dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
+ auto view = make_array_view(dof_values.begin(), dof_values.end());
+ fe_function.extract_subvector_to(indices, view);
internal::do_function_laplacians(
- make_array_view(dof_values.begin(), dof_values.end()),
+ view,
this->finite_element_output.shape_hessians,
*fe,
this->finite_element_output.shape_function_to_row_table,
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_laplacians(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> & indices,
- std::vector<std::vector<typename InputVector::value_type>> &laplacians,
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> &indices,
+ std::vector<std::vector<Number>> & laplacians,
const bool quadrature_points_fastest) const
{
- using Number = typename InputVector::value_type;
Assert(indices.size() % dofs_per_cell == 0,
ExcNotMultiple(indices.size(), dofs_per_cell));
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
boost::container::small_vector<Number, 200> dof_values(indices.size());
- for (unsigned int i = 0; i < indices.size(); ++i)
- dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
+ auto view = make_array_view(dof_values.begin(), dof_values.end());
+ fe_function.extract_subvector_to(indices, view);
internal::do_function_laplacians(
- make_array_view(dof_values.begin(), dof_values.end()),
+ view,
this->finite_element_output.shape_hessians,
*fe,
this->finite_element_output.shape_function_to_row_table,
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<Tensor<3, spacedim, typename InputVector::value_type>>
- &third_derivatives) const
+ const ReadVector<Number> & fe_function,
+ std::vector<Tensor<3, spacedim, Number>> &third_derivatives) const
{
- using Number = typename InputVector::value_type;
AssertDimension(fe->n_components(), 1);
Assert(this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_third_derivatives(
- const InputVector & fe_function,
+ const ReadVector<Number> & fe_function,
const ArrayView<const types::global_dof_index> &indices,
- std::vector<Tensor<3, spacedim, typename InputVector::value_type>>
- &third_derivatives) const
+ std::vector<Tensor<3, spacedim, Number>> & third_derivatives) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
AssertDimension(fe_function.size(), present_cell.n_dofs_for_dof_handler());
AssertDimension(indices.size(), dofs_per_cell);
boost::container::small_vector<Number, 200> dof_values(dofs_per_cell);
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
+ auto view = make_array_view(dof_values.begin(), dof_values.end());
+ fe_function.extract_subvector_to(indices, view);
internal::do_function_derivatives(
- make_array_view(dof_values.begin(), dof_values.end()),
- this->finite_element_output.shape_3rd_derivatives,
- third_derivatives);
+ view, this->finite_element_output.shape_3rd_derivatives, third_derivatives);
}
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_third_derivatives(
- const InputVector &fe_function,
- std::vector<
- std::vector<Tensor<3, spacedim, typename InputVector::value_type>>>
- & third_derivatives,
+ const ReadVector<Number> & fe_function,
+ std::vector<std::vector<Tensor<3, spacedim, Number>>> &third_derivatives,
const bool quadrature_points_fastest) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
Assert(present_cell.is_initialized(), ExcNotReinited());
template <int dim, int spacedim>
-template <class InputVector>
+template <typename Number>
void
FEValuesBase<dim, spacedim>::get_function_third_derivatives(
- const InputVector & fe_function,
- const ArrayView<const types::global_dof_index> &indices,
- ArrayView<std::vector<Tensor<3, spacedim, typename InputVector::value_type>>>
- third_derivatives,
+ const ReadVector<Number> & fe_function,
+ const ArrayView<const types::global_dof_index> & indices,
+ ArrayView<std::vector<Tensor<3, spacedim, Number>>> third_derivatives,
const bool quadrature_points_fastest) const
{
- using Number = typename InputVector::value_type;
Assert(this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
Assert(indices.size() % dofs_per_cell == 0,
ExcNotMultiple(indices.size(), dofs_per_cell));
boost::container::small_vector<Number, 200> dof_values(indices.size());
- for (unsigned int i = 0; i < indices.size(); ++i)
- dof_values[i] = internal::get_vector_element(fe_function, indices[i]);
+ auto view = make_array_view(dof_values.begin(), dof_values.end());
+ fe_function.extract_subvector_to(indices, view);
internal::do_function_derivatives(
- make_array_view(dof_values.begin(), dof_values.end()),
+ view,
this->finite_element_output.shape_3rd_derivatives,
*fe,
this->finite_element_output.shape_function_to_row_table,
-for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
+for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
deal_II_space_dimension : SPACE_DIMENSIONS)
{
# if deal_II_dimension <= deal_II_space_dimension
template void
FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>::
- get_function_hessians<dealii::VEC>(
- const dealii::VEC &,
+ get_function_hessians<S>(
+ const dealii::ReadVector<S> &,
std::vector<
- ProductType<dealii::VEC::value_type,
- dealii::Tensor<2, deal_II_space_dimension>>::type> &)
+ ProductType<S, dealii::Tensor<2, deal_II_space_dimension>>::type> &)
const;
template void
FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>::
- get_function_laplacians<dealii::VEC>(
- const dealii::VEC &,
- std::vector<ProductType<dealii::VEC::value_type, double>::type> &)
+ get_function_laplacians<S>(const dealii::ReadVector<S> &,
+ std::vector<ProductType<S, double>::type> &)
const;
template void
FEValuesViews::Scalar<deal_II_dimension, deal_II_space_dimension>::
- get_function_third_derivatives<dealii::VEC>(
- const dealii::VEC &,
+ get_function_third_derivatives<S>(
+ const dealii::ReadVector<S> &,
std::vector<
- ProductType<dealii::VEC::value_type,
- dealii::Tensor<3, deal_II_space_dimension>>::type> &)
+ ProductType<S, dealii::Tensor<3, deal_II_space_dimension>>::type> &)
const;
template void
FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>::
- get_function_symmetric_gradients<dealii::VEC>(
- const dealii::VEC &,
+ get_function_symmetric_gradients<S>(
+ const dealii::ReadVector<S> &,
std::vector<ProductType<
- dealii::VEC::value_type,
+ S,
dealii::SymmetricTensor<2, deal_II_space_dimension>>::type> &) const;
+ template void FEValuesViews::
+ Vector<deal_II_dimension, deal_II_space_dimension>::get_function_curls<S>(
+ const dealii::ReadVector<S> &,
+ std::vector<ProductType<S, curl_type>::type> &) const;
template void
FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>::
- get_function_curls<dealii::VEC>(
- const dealii::VEC &,
- std::vector<ProductType<dealii::VEC::value_type, curl_type>::type> &)
- const;
- template void
- FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>::
- get_function_divergences<dealii::VEC>(
- const dealii::VEC &,
- std::vector<ProductType<dealii::VEC::value_type, divergence_type>::type>
- &) const;
+ get_function_divergences<S>(
+ const dealii::ReadVector<S> &,
+ std::vector<ProductType<S, divergence_type>::type> &) const;
template void
FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>::
- get_function_hessians<dealii::VEC>(
- const dealii::VEC &,
+ get_function_hessians<S>(
+ const dealii::ReadVector<S> &,
std::vector<
- ProductType<dealii::VEC::value_type,
- dealii::Tensor<3, deal_II_space_dimension>>::type> &)
+ ProductType<S, dealii::Tensor<3, deal_II_space_dimension>>::type> &)
const;
template void
FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>::
- get_function_laplacians<dealii::VEC>(
- const dealii::VEC &,
+ get_function_laplacians<S>(
+ const dealii::ReadVector<S> &,
std::vector<
- ProductType<dealii::VEC::value_type,
- dealii::Tensor<1, deal_II_space_dimension>>::type> &)
+ ProductType<S, dealii::Tensor<1, deal_II_space_dimension>>::type> &)
const;
template void
FEValuesViews::Vector<deal_II_dimension, deal_II_space_dimension>::
- get_function_third_derivatives<dealii::VEC>(
- const dealii::VEC &,
+ get_function_third_derivatives<S>(
+ const dealii::ReadVector<S> &,
std::vector<
- ProductType<dealii::VEC::value_type,
- dealii::Tensor<4, deal_II_space_dimension>>::type> &)
+ ProductType<S, dealii::Tensor<4, deal_II_space_dimension>>::type> &)
const;
template void FEValuesViews::
SymmetricTensor<2, deal_II_dimension, deal_II_space_dimension>::
- get_function_divergences<dealii::VEC>(
- const dealii::VEC &,
+ get_function_divergences<S>(
+ const dealii::ReadVector<S> &,
std::vector<
- ProductType<dealii::VEC::value_type,
- dealii::Tensor<1, deal_II_space_dimension>>::type> &)
+ ProductType<S, dealii::Tensor<1, deal_II_space_dimension>>::type> &)
const;
template void
FEValuesViews::Tensor<2, deal_II_dimension, deal_II_space_dimension>::
- get_function_divergences<dealii::VEC>(
- const dealii::VEC &,
+ get_function_divergences<S>(
+ const dealii::ReadVector<S> &,
std::vector<
- ProductType<dealii::VEC::value_type,
- dealii::Tensor<1, deal_II_space_dimension>>::type> &)
+ ProductType<S, dealii::Tensor<1, deal_II_space_dimension>>::type> &)
const;
# endif
}
}
-for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
+for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
deal_II_space_dimension : SPACE_DIMENSIONS)
{
# if deal_II_dimension <= deal_II_space_dimension
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_hessians<VEC>(
- const VEC &,
- std::vector<dealii::Tensor<2, deal_II_space_dimension, VEC::value_type>>
- &) const;
+ get_function_hessians<S>(
+ const ReadVector<S> &,
+ std::vector<dealii::Tensor<2, deal_II_space_dimension, S>> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_hessians<VEC>(
- const VEC &,
+ get_function_hessians<S>(
+ const ReadVector<S> &,
const ArrayView<const types::global_dof_index> &,
- std::vector<dealii::Tensor<2, deal_II_space_dimension, VEC::value_type>>
- &) const;
+ std::vector<dealii::Tensor<2, deal_II_space_dimension, S>> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_hessians<VEC>(
- const VEC &,
- std::vector<std::vector<
- dealii::Tensor<2, deal_II_space_dimension, VEC::value_type>>> &,
+ get_function_hessians<S>(
+ const ReadVector<S> &,
+ std::vector<std::vector<dealii::Tensor<2, deal_II_space_dimension, S>>>
+ &,
bool) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_hessians<VEC>(
- const VEC &,
+ get_function_hessians<S>(
+ const ReadVector<S> &,
const ArrayView<const types::global_dof_index> &,
- ArrayView<std::vector<
- dealii::Tensor<2, deal_II_space_dimension, VEC::value_type>>>,
+ ArrayView<std::vector<dealii::Tensor<2, deal_II_space_dimension, S>>>,
bool) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_laplacians<VEC>(const VEC &, std::vector<VEC::value_type> &)
- const;
+ get_function_laplacians<S>(const ReadVector<S> &, std::vector<S> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_laplacians<VEC>(
- const VEC &,
+ get_function_laplacians<S>(
+ const ReadVector<S> &,
const ArrayView<const types::global_dof_index> &,
- std::vector<VEC::value_type> &) const;
+ std::vector<S> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_laplacians<VEC>(const VEC &,
- std::vector<Vector<VEC::value_type>> &)
- const;
+ get_function_laplacians<S>(const ReadVector<S> &,
+ std::vector<Vector<S>> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_laplacians<VEC>(
- const VEC &,
+ get_function_laplacians<S>(
+ const ReadVector<S> &,
const ArrayView<const types::global_dof_index> &,
- std::vector<Vector<VEC::value_type>> &) const;
+ std::vector<Vector<S>> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_laplacians<VEC>(
- const VEC &,
+ get_function_laplacians<S>(
+ const ReadVector<S> &,
const ArrayView<const types::global_dof_index> &,
- std::vector<std::vector<VEC::value_type>> &,
+ std::vector<std::vector<S>> &,
bool) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_third_derivatives<VEC>(
- const VEC &,
- std::vector<dealii::Tensor<3, deal_II_space_dimension, VEC::value_type>>
- &) const;
+ get_function_third_derivatives<S>(
+ const ReadVector<S> &,
+ std::vector<dealii::Tensor<3, deal_II_space_dimension, S>> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_third_derivatives<VEC>(
- const VEC &,
+ get_function_third_derivatives<S>(
+ const ReadVector<S> &,
const ArrayView<const types::global_dof_index> &,
- std::vector<dealii::Tensor<3, deal_II_space_dimension, VEC::value_type>>
- &) const;
+ std::vector<dealii::Tensor<3, deal_II_space_dimension, S>> &) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_third_derivatives<VEC>(
- const VEC &,
- std::vector<std::vector<
- dealii::Tensor<3, deal_II_space_dimension, VEC::value_type>>> &,
+ get_function_third_derivatives<S>(
+ const ReadVector<S> &,
+ std::vector<std::vector<dealii::Tensor<3, deal_II_space_dimension, S>>>
+ &,
bool) const;
template void FEValuesBase<deal_II_dimension, deal_II_space_dimension>::
- get_function_third_derivatives<VEC>(
- const VEC &,
+ get_function_third_derivatives<S>(
+ const ReadVector<S> &,
const ArrayView<const types::global_dof_index> &,
- ArrayView<std::vector<
- dealii::Tensor<3, deal_II_space_dimension, VEC::value_type>>>,
+ ArrayView<std::vector<dealii::Tensor<3, deal_II_space_dimension, S>>>,
bool) const;
# endif