// ---------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2013 by the deal.II authors
//
// This file is part of the deal.II library.
//
const dealii::Tensor<1, spacedim> *shape_gradient_ptr =
&shape_gradients[snc][0];
- Assert (shape_function_data[shape_function].single_nonzero_component >= 0,
- ExcInternalError());
- // we're in 2d, so the formula for the curl is simple:
- if (shape_function_data[shape_function].single_nonzero_component_index == 0)
- for (unsigned int q_point = 0;
- q_point < n_quadrature_points; ++q_point)
- curls[q_point][0] -= value * (*shape_gradient_ptr++)[1];
- else
- for (unsigned int q_point = 0;
- q_point < n_quadrature_points; ++q_point)
- curls[q_point][0] += value * (*shape_gradient_ptr++)[0];
+ switch (shape_function_data[shape_function].single_nonzero_component_index)
+ {
+ case 0:
+ {
+ for (unsigned int q_point = 0;
+ q_point < n_quadrature_points; ++q_point)
+ curls[q_point][0] -= value * (*shape_gradient_ptr++)[1];
+
+ break;
+ }
+
+ default:
+ for (unsigned int q_point = 0;
+ q_point < n_quadrature_points; ++q_point)
+ curls[q_point][0] += value * (*shape_gradient_ptr)[0];
+ }
}
else
- // we have multiple non-zero components in the shape functions. not
- // all of them must necessarily be within the 2-component window
- // this FEValuesViews::Vector object considers, however.
{
if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
{
break;
}
- case 2:
- {
+ default:
for (unsigned int q_point = 0;
q_point < n_quadrature_points; ++q_point)
{
curls[q_point][0] += value * (*shape_gradient_ptr)[1];
curls[q_point][1] -= value * (*shape_gradient_ptr++)[0];
}
- break;
- }
-
- default:
- Assert (false, ExcInternalError());
}
}
else
- // we have multiple non-zero components in the shape functions. not
- // all of them must necessarily be within the 3-component window
- // this FEValuesViews::Vector object considers, however.
{
if (shape_function_data[shape_function].is_nonzero_shape_function_component[0])
{
template <int dim, int spacedim>
void
do_function_values (const ::dealii::Vector<double> &dof_values,
- const dealii::Table<2,double> &shape_values,
+ const Table<2,double> &shape_values,
const std::vector<typename SymmetricTensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
std::vector<dealii::SymmetricTensor<2,spacedim> > &values)
{
template <int dim, int spacedim>
void
do_function_values (const ::dealii::Vector<double> &dof_values,
- const dealii::Table<2,double> &shape_values,
+ const Table<2,double> &shape_values,
const std::vector<typename Tensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
std::vector<dealii::Tensor<2,spacedim> > &values)
{
/// @p get_interpolated_dof_values
/// of the iterator with the
/// given arguments.
- virtual
- void
- get_interpolated_dof_values (const IndexSet &in,
- Vector<double> &out) const = 0;
+// virtual
+// void
+// get_interpolated_dof_values (const IndexSet &in,
+// Vector<double> &out) const = 0;
};
/// @p get_interpolated_dof_values
/// of the iterator with the
/// given arguments.
- virtual
- void
- get_interpolated_dof_values (const IndexSet &in,
- Vector<double> &out) const;
+// virtual
+// void
+// get_interpolated_dof_values (const IndexSet &in,
+// Vector<double> &out) const;
private:
/**
/// @p get_interpolated_dof_values
/// of the iterator with the
/// given arguments.
- virtual
- void
- get_interpolated_dof_values (const IndexSet &in,
- Vector<double> &out) const;
+// virtual
+// void
+// get_interpolated_dof_values (const IndexSet &in,
+// Vector<double> &out) const;
private:
/**
#include "fe_values.impl.1.inst"
-template <int dim, int spacedim>
-template <typename CI>
-void
-FEValuesBase<dim,spacedim>::CellIterator<CI>::
-get_interpolated_dof_values (const IndexSet &in,
- Vector<double> &out) const
-{
- Assert (cell->has_children() == false, ExcNotImplemented());
-
- std::vector<types::global_dof_index> dof_indices (cell->get_fe().dofs_per_cell);
- cell->get_dof_indices (dof_indices);
-
- for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
- out[i] = (in.is_element (dof_indices[i]) ? 1 : 0);
-}
+//template <int dim, int spacedim>
+//template <typename CI>
+//void
+//FEValuesBase<dim,spacedim>::CellIterator<CI>::
+//get_interpolated_dof_values (const IndexSet &in,
+// Vector<double> &out) const
+//{
+// Assert (cell->has_children() == false, ExcNotImplemented());
+//
+// std::vector<types::global_dof_index> dof_indices (cell->get_fe().dofs_per_cell);
+// cell->get_dof_indices (dof_indices);
+//
+// for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+// out[i] = (in.is_element (dof_indices[i]) ? 1 : 0);
+//}
/* ---------------- FEValuesBase<dim,spacedim>::TriaCellIterator --------- */
#include "fe_values.impl.2.inst"
-template <int dim, int spacedim>
-void
-FEValuesBase<dim,spacedim>::TriaCellIterator::
-get_interpolated_dof_values (const IndexSet &,
- Vector<double> &) const
-{
- Assert (false, ExcMessage (message_string));
-}
+//template <int dim, int spacedim>
+//void
+//FEValuesBase<dim,spacedim>::TriaCellIterator::
+//get_interpolated_dof_values (const IndexSet &,
+// Vector<double> &) const
+//{
+// Assert (false, ExcMessage (message_string));
+//}
// compilation and reduces the size of the final file since all the
// different global vectors get channeled through the same code.
- template <typename Number>
+ template <typename Number, typename Number2>
void
- do_function_values (const double *dof_values_ptr,
- const dealii::Table<2,double> &shape_values,
+ do_function_values (const Number2 *dof_values_ptr,
+ const Table<2,double> &shape_values,
std::vector<Number> &values)
{
// scalar finite elements, so shape_values.size() == dofs_per_cell
// the shape_values data stored contiguously
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
- const double value = dof_values_ptr[shape_func];
- if (value == 0.)
+ const Number2 value = dof_values_ptr[shape_func];
+ if (value == Number2())
continue;
const double *shape_value_ptr = &shape_values(shape_func, 0);
}
}
- template <int dim, int spacedim, typename VectorType>
+ template <int dim, int spacedim, typename VectorType, typename Number>
void
- do_function_values (const double *dof_values_ptr,
- const dealii::Table<2,double> &shape_values,
+ do_function_values (const Number *dof_values_ptr,
+ const Table<2,double> &shape_values,
const FiniteElement<dim,spacedim> &fe,
const std::vector<unsigned int> &shape_function_to_row_table,
VectorSlice<std::vector<VectorType> > &values,
const bool quadrature_points_fastest = false,
const unsigned int component_multiple = 1)
{
- // initialize with zero
- for (unsigned int i=0; i<values.size(); ++i)
- std::fill_n (values[i].begin(), values[i].size(),
- typename VectorType::value_type());
-
- // see if there the current cell has DoFs at all, and if not
- // then there is nothing else to do.
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- if (dofs_per_cell == 0)
- return;
-
- const unsigned int n_quadrature_points = shape_values.n_cols();
+ const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
+ shape_values.n_cols() : 0;
const unsigned int n_components = fe.n_components();
// Assert that we can write all components into the result vectors
AssertDimension (values[i].size(), result_components);
}
+ // initialize with zero
+ for (unsigned int i=0; i<values.size(); ++i)
+ std::fill_n (values[i].begin(), values[i].size(),
+ typename VectorType::value_type());
+
// add up contributions of trial functions. now check whether the shape
// function is primitive or not. if it is, then set its only non-zero
// component, otherwise loop over components
for (unsigned int mc = 0; mc < component_multiple; ++mc)
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
- const double value = dof_values_ptr[shape_func+mc*dofs_per_cell];
- if (value == 0.)
+ const Number value = dof_values_ptr[shape_func+mc*dofs_per_cell];
+ if (value == Number())
continue;
if (fe.is_primitive(shape_func))
// use the same implementation for gradients and Hessians, distinguish them
// by the rank of the tensors
- template <int order, int spacedim>
+ template <int order, int spacedim, typename Number>
void
- do_function_derivatives (const double *dof_values_ptr,
+ do_function_derivatives (const Number *dof_values_ptr,
const std::vector<std::vector<Tensor<order,spacedim> > > &shape_derivatives,
- std::vector<Tensor<order,spacedim> > &derivatives)
+ std::vector<Tensor<order,spacedim,Number> > &derivatives)
{
const unsigned int dofs_per_cell = shape_derivatives.size();
const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
AssertDimension(derivatives.size(), n_quadrature_points);
// initialize with zero
- std::fill_n (derivatives.begin(), n_quadrature_points, Tensor<order,spacedim>());
+ std::fill_n (derivatives.begin(), n_quadrature_points, Tensor<order,spacedim,Number>());
// add up contributions of trial functions. note that here we deal with
// scalar finite elements, so no need to check for non-primitivity of
// access the shape_gradients/hessians data stored contiguously
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
- const double value = dof_values_ptr[shape_func];
- if (value == 0.)
+ const Number value = dof_values_ptr[shape_func];
+ if (value == Number())
continue;
const Tensor<order,spacedim> *shape_derivative_ptr
}
}
- template <int order, int dim, int spacedim>
+ template <int order, int dim, int spacedim, typename Number>
void
- do_function_derivatives (const double *dof_values_ptr,
+ do_function_derivatives (const Number *dof_values_ptr,
const std::vector<std::vector<Tensor<order,spacedim> > > &shape_derivatives,
const FiniteElement<dim,spacedim> &fe,
const std::vector<unsigned int> &shape_function_to_row_table,
- VectorSlice<std::vector<std::vector<Tensor<order,spacedim> > > > &derivatives,
+ VectorSlice<std::vector<std::vector<Tensor<order,spacedim,Number> > > > &derivatives,
const bool quadrature_points_fastest = false,
const unsigned int component_multiple = 1)
{
- // initialize with zero
- for (unsigned int i=0; i<derivatives.size(); ++i)
- std::fill_n (derivatives[i].begin(), derivatives[i].size(),
- Tensor<order,spacedim>());
-
- // see if there the current cell has DoFs at all, and if not
- // then there is nothing else to do.
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- if (dofs_per_cell == 0)
- return;
-
-
- const unsigned int n_quadrature_points = shape_derivatives[0].size();
+ const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
+ shape_derivatives[0].size() : 0;
const unsigned int n_components = fe.n_components();
// Assert that we can write all components into the result vectors
AssertDimension (derivatives[i].size(), result_components);
}
+ // initialize with zero
+ for (unsigned int i=0; i<derivatives.size(); ++i)
+ std::fill_n (derivatives[i].begin(), derivatives[i].size(),
+ Tensor<order,spacedim,Number>());
+
// add up contributions of trial functions. now check whether the shape
// function is primitive or not. if it is, then set its only non-zero
// component, otherwise loop over components
for (unsigned int mc = 0; mc < component_multiple; ++mc)
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
- const double value = dof_values_ptr[shape_func+mc*dofs_per_cell];
- if (value == 0.)
+ const Number value = dof_values_ptr[shape_func+mc*dofs_per_cell];
+ if (value == Number())
continue;
if (fe.is_primitive(shape_func))
}
}
- template <int spacedim, typename Number>
+ template <int spacedim, typename Number, typename Number2>
void
- do_function_laplacians (const double *dof_values_ptr,
+ do_function_laplacians (const Number2 *dof_values_ptr,
const std::vector<std::vector<Tensor<2,spacedim> > > &shape_hessians,
std::vector<Number> &laplacians)
{
// the trace of the Hessian.
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
- const double value = dof_values_ptr[shape_func];
- if (value == 0.)
+ const Number2 value = dof_values_ptr[shape_func];
+ if (value == Number2())
continue;
const Tensor<2,spacedim> *shape_hessian_ptr
}
}
- template <int dim, int spacedim, typename VectorType>
+ template <int dim, int spacedim, typename VectorType, typename Number>
void
- do_function_laplacians (const double *dof_values_ptr,
+ do_function_laplacians (const Number *dof_values_ptr,
const std::vector<std::vector<Tensor<2,spacedim> > > &shape_hessians,
const FiniteElement<dim,spacedim> &fe,
const std::vector<unsigned int> &shape_function_to_row_table,
const bool quadrature_points_fastest = false,
const unsigned int component_multiple = 1)
{
- // initialize with zero
- for (unsigned int i=0; i<laplacians.size(); ++i)
- std::fill_n (laplacians[i].begin(), laplacians[i].size(),
- typename VectorType::value_type());
-
- // see if there the current cell has DoFs at all, and if not
- // then there is nothing else to do.
const unsigned int dofs_per_cell = fe.dofs_per_cell;
- if (dofs_per_cell == 0)
- return;
-
-
- const unsigned int n_quadrature_points = shape_hessians[0].size();
+ const unsigned int n_quadrature_points = dofs_per_cell > 0 ?
+ shape_hessians[0].size() : 0;
const unsigned int n_components = fe.n_components();
// Assert that we can write all components into the result vectors
AssertDimension (laplacians[i].size(), result_components);
}
+ // initialize with zero
+ for (unsigned int i=0; i<laplacians.size(); ++i)
+ std::fill_n (laplacians[i].begin(), laplacians[i].size(),
+ typename VectorType::value_type());
+
// add up contributions of trial functions. now check whether the shape
// function is primitive or not. if it is, then set its only non-zero
// component, otherwise loop over components
for (unsigned int mc = 0; mc < component_multiple; ++mc)
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
- const double value = dof_values_ptr[shape_func+mc*dofs_per_cell];
- if (value == 0.)
+ const Number value = dof_values_ptr[shape_func+mc*dofs_per_cell];
+ if (value == Number())
continue;
if (fe.is_primitive(shape_func))
present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_values (dof_values.begin(), this->shape_values,
values);
// avoid allocation when the local size is small enough
if (dofs_per_cell <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_values(&dof_values[0], this->shape_values, values);
}
else
{
- Vector<double> dof_values(dofs_per_cell);
+ Vector<number> dof_values(dofs_per_cell);
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_values(dof_values.begin(), this->shape_values,
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
VectorSlice<std::vector<Vector<number> > > val(values);
internal::do_function_values(dof_values.begin(), this->shape_values, *fe,
VectorSlice<std::vector<Vector<number> > > val(values);
if (indices.size() <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_values(&dof_values[0], this->shape_values, *fe,
}
else
{
- Vector<double> dof_values(100);
+ Vector<number> dof_values(100);
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_values(dof_values.begin(), this->shape_values, *fe,
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void FEValuesBase<dim,spacedim>::get_function_values (
const InputVector &fe_function,
const VectorSlice<const std::vector<types::global_dof_index> > &indices,
- VectorSlice<std::vector<std::vector<double> > > values,
+ VectorSlice<std::vector<std::vector<number> > > values,
bool quadrature_points_fastest) const
{
Assert (this->update_flags & update_values,
if (indices.size() <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_values(&dof_values[0], this->shape_values, *fe,
}
else
{
- Vector<double> dof_values(indices.size());
+ Vector<number> dof_values(indices.size());
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_values(dof_values.begin(), this->shape_values, *fe,
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void
FEValuesBase<dim,spacedim>::get_function_gradients (
const InputVector &fe_function,
- std::vector<Tensor<1,spacedim> > &gradients) const
+ std::vector<Tensor<1,spacedim,number> > &gradients) const
{
Assert (this->update_flags & update_gradients,
ExcAccessToUninitializedField("update_gradients"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives(dof_values.begin(), this->shape_gradients,
gradients);
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void FEValuesBase<dim,spacedim>::get_function_gradients (
const InputVector &fe_function,
const VectorSlice<const std::vector<types::global_dof_index> > &indices,
- std::vector<Tensor<1,spacedim> > &gradients) const
+ std::vector<Tensor<1,spacedim,number> > &gradients) const
{
Assert (this->update_flags & update_gradients,
ExcAccessToUninitializedField("update_gradients"));
AssertDimension (indices.size(), dofs_per_cell);
if (dofs_per_cell <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(&dof_values[0], this->shape_gradients,
}
else
{
- Vector<double> dof_values(dofs_per_cell);
+ Vector<number> dof_values(dofs_per_cell);
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(dof_values.begin(), this->shape_gradients,
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void
FEValuesBase<dim,spacedim>::get_function_gradients (
const InputVector &fe_function,
- std::vector<std::vector<Tensor<1,spacedim> > > &gradients) const
+ std::vector<std::vector<Tensor<1,spacedim,number> > > &gradients) const
{
Assert (this->update_flags & update_gradients,
ExcAccessToUninitializedField("update_gradients"));
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
- VectorSlice<std::vector<std::vector<Tensor<1,spacedim> > > > grads(gradients);
+ VectorSlice<std::vector<std::vector<Tensor<1,spacedim,number> > > > grads(gradients);
internal::do_function_derivatives(dof_values.begin(), this->shape_gradients,
*fe, this->shape_function_to_row_table,
grads);
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void FEValuesBase<dim,spacedim>::get_function_gradients (
const InputVector &fe_function,
const VectorSlice<const std::vector<types::global_dof_index> > &indices,
- VectorSlice<std::vector<std::vector<Tensor<1,spacedim> > > > gradients,
+ VectorSlice<std::vector<std::vector<Tensor<1,spacedim,number> > > > gradients,
bool quadrature_points_fastest) const
{
// Size of indices must be a multiple of dofs_per_cell such that an integer
if (indices.size() <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(&dof_values[0], this->shape_gradients,
}
else
{
- Vector<double> dof_values(indices.size());
+ Vector<number> dof_values(indices.size());
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(dof_values.begin(),this->shape_gradients,
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void
FEValuesBase<dim,spacedim>::
get_function_hessians (const InputVector &fe_function,
- std::vector<Tensor<2,spacedim> > &hessians) const
+ std::vector<Tensor<2,spacedim,number> > &hessians) const
{
AssertDimension (fe->n_components(), 1);
Assert (this->update_flags & update_hessians,
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_derivatives(dof_values.begin(), this->shape_hessians,
hessians);
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void FEValuesBase<dim,spacedim>::get_function_hessians (
const InputVector &fe_function,
const VectorSlice<const std::vector<types::global_dof_index> > &indices,
- std::vector<Tensor<2,spacedim> > &hessians) const
+ std::vector<Tensor<2,spacedim,number> > &hessians) const
{
Assert (this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
AssertDimension (indices.size(), dofs_per_cell);
if (dofs_per_cell <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(&dof_values[0], this->shape_hessians,
}
else
{
- Vector<double> dof_values(dofs_per_cell);
+ Vector<number> dof_values(dofs_per_cell);
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(dof_values.begin(), this->shape_hessians,
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void
FEValuesBase<dim,spacedim>::
get_function_hessians (const InputVector &fe_function,
- std::vector<std::vector<Tensor<2,spacedim> > > &hessians,
+ std::vector<std::vector<Tensor<2,spacedim,number> > > &hessians,
bool quadrature_points_fastest) const
{
Assert (this->update_flags & update_hessians,
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
- VectorSlice<std::vector<std::vector<Tensor<2,spacedim> > > > hes(hessians);
+ VectorSlice<std::vector<std::vector<Tensor<2,spacedim,number> > > > hes(hessians);
internal::do_function_derivatives(dof_values.begin(), this->shape_hessians,
*fe, this->shape_function_to_row_table,
hes, quadrature_points_fastest);
template <int dim, int spacedim>
-template <class InputVector>
+template <class InputVector, typename number>
void FEValuesBase<dim, spacedim>::get_function_hessians (
const InputVector &fe_function,
const VectorSlice<const std::vector<types::global_dof_index> > &indices,
- VectorSlice<std::vector<std::vector<Tensor<2,spacedim> > > > hessians,
+ VectorSlice<std::vector<std::vector<Tensor<2,spacedim,number> > > > hessians,
bool quadrature_points_fastest) const
{
Assert (this->update_flags & update_hessians,
ExcNotMultiple(indices.size(), dofs_per_cell));
if (indices.size() <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(&dof_values[0], this->shape_hessians,
}
else
{
- Vector<double> dof_values(indices.size());
+ Vector<number> dof_values(indices.size());
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_derivatives(dof_values.begin(),this->shape_hessians,
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_laplacians(dof_values.begin(), this->shape_hessians,
laplacians);
AssertDimension (indices.size(), dofs_per_cell);
if (dofs_per_cell <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_laplacians(&dof_values[0], this->shape_hessians,
}
else
{
- Vector<double> dof_values(dofs_per_cell);
+ Vector<number> dof_values(dofs_per_cell);
for (unsigned int i=0; i<dofs_per_cell; ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_laplacians(dof_values.begin(), this->shape_hessians,
AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler());
// get function values of dofs on this cell
- Vector<double> dof_values (dofs_per_cell);
+ Vector<number> dof_values (dofs_per_cell);
present_cell->get_interpolated_dof_values(fe_function, dof_values);
internal::do_function_laplacians(dof_values.begin(), this->shape_hessians,
*fe, this->shape_function_to_row_table,
ExcAccessToUninitializedField("update_hessians"));
if (indices.size() <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_laplacians(&dof_values[0], this->shape_hessians,
}
else
{
- Vector<double> dof_values(indices.size());
+ Vector<number> dof_values(indices.size());
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_laplacians(dof_values.begin(),this->shape_hessians,
ExcAccessToUninitializedField("update_hessians"));
if (indices.size() <= 100)
{
- double dof_values[100];
+ number dof_values[100];
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_laplacians(&dof_values[0], this->shape_hessians,
}
else
{
- Vector<double> dof_values(indices.size());
+ Vector<number> dof_values(indices.size());
for (unsigned int i=0; i<indices.size(); ++i)
dof_values[i] = get_vector_element (fe_function, indices[i]);
internal::do_function_laplacians(dof_values.begin(),this->shape_hessians,