* them over when visiting a
* concrete cell.
*/
- std::vector<std::vector<double> > shape_values;
+ vector2d<double> shape_values;
/**
* Array with shape function
* multiplication) when
* visiting an actual cell.
*/
- std::vector<std::vector<Tensor<1,dim> > > shape_gradients;
+ vector2d<Tensor<1,dim> > shape_gradients;
};
/**
* them over when visiting a
* concrete cell.
*/
- std::vector<std::vector<double> > shape_values;
+ vector2d<double> shape_values;
/**
* Array with shape function
* multiplication) when
* visiting an actual cell.
*/
- std::vector<std::vector<Tensor<1,dim> > > shape_gradients;
+ vector2d<Tensor<1,dim> > shape_gradients;
};
/**
* multiplication with the
* Jacobian of the mapping.
*/
- std::vector<std::vector<Tensor<1,dim> > > shape_values;
+ vector2d<Tensor<1,dim> > shape_values;
/**
* Array with shape function
* multiplication) when
* visiting an actual cell.
*/
- std::vector<std::vector<Tensor<2,dim> > > shape_gradients;
+ vector2d<Tensor<2,dim> > shape_gradients;
};
/**
* them over when visiting a
* concrete cell.
*/
- std::vector<std::vector<double> > shape_values;
+ vector2d<double> shape_values;
/**
* Array with shape function
* multiplication) when
* visiting an actual cell.
*/
- std::vector<std::vector<Tensor<1,dim> > > shape_gradients;
+ vector2d<Tensor<1,dim> > shape_gradients;
};
/**
#include <base/point.h>
#include <base/tensor.h>
#include <base/quadrature.h>
-#include <lac/full_matrix.h>
+#include <base/vector2d.h>
#include <grid/tria.h>
#include <grid/tria_iterator.h>
#include <dofs/dof_handler.h>
* thus have a row in the array
* presently under discussion.
*/
-//TODO[WB]: use vector2d here
- typedef FullMatrix<double> ShapeVector;
+ typedef vector2d<double> ShapeVector;
/**
* Storage type for
* is the same as for the
* @ref{ShapeVector} data type.
*/
-//TODO[WB]: use vector2d here
- typedef
- std::vector<std::vector<Tensor<1,dim> > >
- GradientVector;
+ typedef vector2d<Tensor<1,dim> > GradientVector;
/**
* Likewise for second order
* derivatives.
*/
-//TODO[WB]: use vector2d here
- typedef
- std::vector<std::vector<Tensor<2,dim> > >
- GradGradVector;
+ typedef vector2d<Tensor<2,dim> > GradGradVector;
/**
* Store the values of the shape
ExcAccessToUninitializedField());
Assert (fe->is_primitive (i),
ExcShapeFunctionNotPrimitive(i));
- Assert (i<this->shape_gradients.size(),
- ExcIndexRange (i, 0, this->shape_gradients.size()));
- Assert (j<this->shape_gradients[i].size(),
- ExcIndexRange (j, 0, this->shape_gradients[i].size()));
+ Assert (i<this->shape_gradients.n_rows(),
+ ExcIndexRange (i, 0, this->shape_gradients.n_rows()));
+ Assert (j<this->shape_gradients.n_cols(),
+ ExcIndexRange (j, 0, this->shape_gradients.n_cols()));
// if the entire FE is primitive,
// then we can take a short-cut:
ExcAccessToUninitializedField());
Assert (fe->is_primitive (i),
ExcShapeFunctionNotPrimitive(i));
- Assert (i<this->shape_2nd_derivatives.size(),
- ExcIndexRange (i, 0, this->shape_2nd_derivatives.size()));
- Assert (j<this->shape_2nd_derivatives[i].size(),
- ExcIndexRange (j, 0, this->shape_2nd_derivatives[i].size()));
+ Assert (i<this->shape_2nd_derivatives.n_rows(),
+ ExcIndexRange (i, 0, this->shape_2nd_derivatives.n_rows()));
+ Assert (j<this->shape_2nd_derivatives.n_cols(),
+ ExcIndexRange (j, 0, this->shape_2nd_derivatives.n_cols()));
// if the entire FE is primitive,
// then we can take a short-cut:
#include <cmath>
#include <base/point.h>
#include <base/subscriptor.h>
+#include <base/vector2d.h>
#include <grid/tria.h>
#include <dofs/dof_handler.h>
#include <fe/fe_update_flags.h>
*/
virtual
void
- transform_covariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const InternalDataBase& internal) const = 0;
+ transform_covariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const InternalDataBase &internal) const = 0;
/**
* Tranform a field of
*/
virtual
void
- transform_contravariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const InternalDataBase& internal) const = 0;
+ transform_contravariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const InternalDataBase &internal) const = 0;
/**
* Indicate fields to be updated
* @ref{Mapping}.
*/
virtual void
- transform_covariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const;
+ transform_covariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &internal) const;
/**
* Implementation of the interface in
* @ref{Mapping}.
*/
virtual void
- transform_contravariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const;
+ transform_contravariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &internal) const;
/**
* Transforms the point @p{p} on
*
* Filled once.
*/
- std::vector<std::vector<Tensor<1,dim> > > unit_tangentials;
+ vector2d<Tensor<1,dim> > unit_tangentials;
/**
* Auxiliary vectors for internal use.
*/
- std::vector<std::vector<Tensor<1,dim> > > aux;
+ vector2d<Tensor<1,dim> > aux;
};
/**
#include <base/config.h>
+#include <base/vector2d.h>
#include <fe/mapping_q1.h>
-
template <int dim> class TensorProductPolynomials;
class LagrangeEquidistant;
* @ref{Mapping}.
*/
virtual void
- transform_covariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const;
+ transform_covariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &internal) const;
/**
* Implementation of the interface in
* @ref{Mapping}.
*/
virtual void
- transform_contravariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const;
+ transform_contravariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &internal) const;
/**
* Return the degree of the
* this vector is computed.
*/
void
- set_laplace_on_quad_vector(std::vector<std::vector<double> > &loqvs) const;
+ set_laplace_on_quad_vector(vector2d<double> &loqvs) const;
/**
* This function is needed by the
* @p{degree>2} this vector is
* computed.
*/
- void set_laplace_on_hex_vector(std::vector<std::vector<double> > &lohvs) const;
+ void set_laplace_on_hex_vector(vector2d<double> &lohvs) const;
/**
* Computes the @p{laplace_on_quad(hex)_vector}.
* functions if the data is not
* yet hardcoded.
*/
- void compute_laplace_vector(std::vector<std::vector<double> > &lvs) const;
+ void compute_laplace_vector(vector2d<double> &lvs) const;
/**
* Takes a
* @p{n_inner} computed inner
* points are appended.
*/
- void apply_laplace_vector(const std::vector<std::vector<double> > &lvs,
+ void apply_laplace_vector(const vector2d<double> &lvs,
std::vector<Point<dim> > &a) const;
/**
* unit_support_points on the
* boundary of the quad
*/
- std::vector<std::vector<double> > laplace_on_quad_vector;
+ vector2d<double> laplace_on_quad_vector;
/**
* Needed by the
* (for @p{dim==3}). Filled by the
* constructor.
*/
- std::vector<std::vector<double> > laplace_on_hex_vector;
+ vector2d<double> laplace_on_hex_vector;
/**
* Exception.
const std::vector<Point<1> > &unit_points,
MappingQ1<1>::InternalData &data) const;
template <> void MappingQ<1>::set_laplace_on_quad_vector(
- std::vector<std::vector<double> > &) const;
+ vector2d<double> &) const;
template <> void MappingQ<3>::set_laplace_on_hex_vector(
- std::vector<std::vector<double> > &lohvs) const;
+ vector2d<double> &lohvs) const;
template <> void MappingQ<1>::compute_laplace_vector(
- std::vector<std::vector<double> > &) const;
+ vector2d<double> &) const;
template <> void MappingQ<1>::add_line_support_points (
const Triangulation<1>::cell_iterator &,
std::vector<Point<1> > &) const;
* @ref{Mapping}.
*/
virtual void
- transform_covariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const;
+ transform_covariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &internal) const;
/**
* Implementation of the interface in
* @ref{Mapping}.
*/
virtual void
- transform_contravariant (typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const;
+ transform_contravariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &internal) const;
/**
* Implementation of the interface in
*
* Filled once.
*/
- std::vector<std::vector<Tensor<1,dim> > > unit_tangentials;
+ vector2d<Tensor<1,dim> > unit_tangentials;
/**
* Auxuliary vectors for internal use.
*/
- std::vector<std::vector<Tensor<1,dim> > > aux;
+ vector2d<Tensor<1,dim> > aux;
/**
* Stores the support points of
Assert ((fe_internal.update_each | fe_internal.update_once)
& update_second_derivatives,
ExcInternalError());
- Assert (data.shape_2nd_derivatives.size() == this->dofs_per_cell,
+ Assert (data.shape_2nd_derivatives.n_rows() == this->dofs_per_cell,
ExcInternalError());
// Number of quadrature points
- const unsigned int n_q_points = data.shape_2nd_derivatives[0].size();
+ const unsigned int n_q_points = data.shape_2nd_derivatives.n_cols();
// first reinit the fe_values
// objects used for the finite
// quotients of gradients in each
// direction (first index) and at
// all q-points (second index)
- std::vector<std::vector<Tensor<1,dim> > > diff_quot (dim, std::vector<Tensor<1,dim> >(n_q_points));
- std::vector<Tensor<1,dim> > diff_quot2 (n_q_points);
+ vector2d<Tensor<1,dim> > diff_quot (dim, n_q_points);
+ std::vector<Tensor<1,dim> > diff_quot2 (n_q_points);
// for all shape functions at all
// quadrature points and difference
// cell
for (unsigned int d=0; d<dim; ++d)
{
- mapping.transform_covariant (diff_quot2.begin(), diff_quot2.end(),
+ mapping.transform_covariant (&*diff_quot2.begin(), &*diff_quot2.end(),
diff_quot[d].begin()+offset,
mapping_internal);
if (flags & update_values)
{
values.resize (this->dofs_per_cell);
- data->shape_values.resize(this->dofs_per_cell,
- std::vector<double>(n_q_points));
+ data->shape_values.reinit (this->dofs_per_cell,
+ n_q_points);
}
if (flags & update_gradients)
{
grads.resize (this->dofs_per_cell);
- data->shape_gradients.resize(this->dofs_per_cell,
- std::vector<Tensor<1,dim> >(n_q_points));
+ data->shape_gradients.reinit (this->dofs_per_cell,
+ n_q_points);
}
// if second derivatives through
if (flags & update_values)
{
values.resize (this->dofs_per_cell);
- data->shape_values.resize(this->dofs_per_cell,
- std::vector<double>(n_q_points));
+ data->shape_values.reinit (this->dofs_per_cell,
+ n_q_points);
}
if (flags & update_gradients)
{
grads.resize (this->dofs_per_cell);
- data->shape_gradients.resize(this->dofs_per_cell,
- std::vector<Tensor<1,dim> >(n_q_points));
+ data->shape_gradients.reinit (this->dofs_per_cell,
+ n_q_points);
}
// if second derivatives through
if (flags & update_values)
{
values.resize (this->dofs_per_cell);
- data->shape_values.resize(this->dofs_per_cell,
- std::vector<double>(n_q_points));
+ data->shape_values.reinit (this->dofs_per_cell,
+ n_q_points);
}
if (flags & update_gradients)
{
grads.resize (this->dofs_per_cell);
- data->shape_gradients.resize(this->dofs_per_cell,
- std::vector<Tensor<1,dim> >(n_q_points));
+ data->shape_gradients.reinit (this->dofs_per_cell,
+ n_q_points);
}
// if second derivatives through
// that we will need to their
// correct size
if (flags & update_values)
- this->shape_values.reinit(n_nonzero_shape_components, n_quadrature_points);
+ this->shape_values.reinit(n_nonzero_shape_components,
+ n_quadrature_points);
if (flags & update_gradients)
- {
- this->shape_gradients.resize(n_nonzero_shape_components);
- for (unsigned int i=0; i<n_nonzero_shape_components; ++i)
- this->shape_gradients[i].resize(n_quadrature_points);
- }
+ this->shape_gradients.reinit(n_nonzero_shape_components,
+ n_quadrature_points);
if (flags & update_second_derivatives)
- {
- this->shape_2nd_derivatives.resize(n_nonzero_shape_components);
- for (unsigned int i=0; i<n_nonzero_shape_components; ++i)
- this->shape_2nd_derivatives[i].resize(n_quadrature_points);
- }
+ this->shape_2nd_derivatives.reinit(n_nonzero_shape_components,
+ n_quadrature_points);
if (flags & update_q_points)
this->quadrature_points.resize(n_quadrature_points);
template <class InputVector>
void
FEValuesBase<dim>::
-get_function_grads (const InputVector &fe_function,
+get_function_grads (const InputVector &fe_function,
std::vector<std::vector<Tensor<1,dim> > > &gradients) const
{
Assert (n_quadrature_points == gradients.size(),
template <class InputVector>
void
FEValuesBase<dim>::
-get_function_2nd_derivatives (const InputVector &fe_function,
+get_function_2nd_derivatives (const InputVector &fe_function,
std::vector<std::vector<Tensor<2,dim> > > &second_derivs) const
{
Assert (n_quadrature_points == second_derivs.size(),
template <int dim>
void
-MappingCartesian<dim>::transform_covariant (
- typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const
+MappingCartesian<dim>::transform_covariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
template <int dim>
void
-MappingCartesian<dim>::transform_contravariant (
- typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
+MappingCartesian<dim>::transform_contravariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
// convert data object to internal
template <>
void
-MappingQ<1>::set_laplace_on_quad_vector(std::vector<std::vector<double> > &) const
+MappingQ<1>::set_laplace_on_quad_vector(vector2d<double> &) const
{
Assert(false, ExcInternalError());
}
template <int dim>
void
-MappingQ<dim>::set_laplace_on_quad_vector(std::vector<std::vector<double> > &loqvs) const
+MappingQ<dim>::set_laplace_on_quad_vector(vector2d<double> &loqvs) const
{
Assert(degree>1, ExcInternalError());
const unsigned int n_inner_2d=(degree-1)*(degree-1);
{
// precomputed. copy values to
// the loqvs array
- loqvs.resize(n_inner_2d);
+ loqvs.reinit(n_inner_2d, n_outer_2d);
for (unsigned int unit_point=0; unit_point<n_inner_2d; ++unit_point)
- {
- loqvs[unit_point].resize(n_outer_2d, 0);
- for (unsigned int k=0; k<n_outer_2d; ++k)
- loqvs[unit_point][k]=loqv_ptr[unit_point*n_outer_2d+k];
- }
+ for (unsigned int k=0; k<n_outer_2d; ++k)
+ loqvs[unit_point][k]=loqv_ptr[unit_point*n_outer_2d+k];
}
else
{
// the sum of weights of the points
// at the outer rim should be
// one. check this
- for (unsigned int unit_point=0; unit_point<loqvs.size(); ++unit_point)
+ for (unsigned int unit_point=0; unit_point<loqvs.n_rows(); ++unit_point)
Assert(std::fabs(std::accumulate(loqvs[unit_point].begin(),
loqvs[unit_point].end(),0.)-1)<1e-13,
ExcInternalError());
template <>
void
-MappingQ<3>::set_laplace_on_hex_vector(std::vector<std::vector<double> > &lohvs) const
+MappingQ<3>::set_laplace_on_hex_vector(vector2d<double> &lohvs) const
{
Assert(degree>1, ExcInternalError());
{
// precomputed. copy values to
// the lohvs array
- lohvs.resize(n_inner);
+ lohvs.reinit(n_inner, n_outer);
for (unsigned int unit_point=0; unit_point<n_inner; ++unit_point)
- {
- lohvs[unit_point].resize(n_outer, 0);
- for (unsigned int k=0; k<n_outer; ++k)
- lohvs[unit_point][k]=lohv_ptr[unit_point*n_outer+k];
- }
+ for (unsigned int k=0; k<n_outer; ++k)
+ lohvs[unit_point][k]=lohv_ptr[unit_point*n_outer+k];
}
else
// not precomputed, then do so now
template <int dim>
void
-MappingQ<dim>::set_laplace_on_hex_vector(std::vector<std::vector<double> > &) const
+MappingQ<dim>::set_laplace_on_hex_vector(vector2d<double> &) const
{
Assert(false, ExcInternalError());
}
template <>
void
-MappingQ<1>::compute_laplace_vector(std::vector<std::vector<double> > &) const
+MappingQ<1>::compute_laplace_vector(vector2d<double> &) const
{
Assert(false, ExcInternalError());
}
template <int dim>
void
-MappingQ<dim>::compute_laplace_vector(std::vector<std::vector<double> > &lvs) const
+MappingQ<dim>::compute_laplace_vector(vector2d<double> &lvs) const
{
- Assert(lvs.size()==0, ExcInternalError());
+ Assert(lvs.n_rows()==0, ExcInternalError());
Assert(dim==2 || dim==3, ExcNotImplemented());
Assert(degree>1, ExcInternalError());
// Resize and initialize the
// lvs
- lvs.resize(n_inner);
+ lvs.reinit (n_inner, n_outer);
for (unsigned int i=0; i<n_inner; ++i)
- lvs[i].resize(n_outer, 0);
-
- // fill this vector
- for (unsigned int i=0; i<n_inner; ++i)
- {
- std::vector<double> &lv=lvs[i];
- for (unsigned int k=0; k<n_outer; ++k)
- lv[k]=-S_1_T(i,k);
- }
+ for (unsigned int k=0; k<n_outer; ++k)
+ lvs(i,k) = -S_1_T(i,k);
}
#endif
template <int dim>
void
-MappingQ<dim>::apply_laplace_vector(const std::vector<std::vector<double> > &lvs,
+MappingQ<dim>::apply_laplace_vector(const vector2d<double> &lvs,
std::vector<Point<dim> > &a) const
{
- Assert(lvs.size()!=0, ExcLaplaceVectorNotSet(degree));
- const unsigned int n_inner_apply=lvs.size();
+ Assert(lvs.n_rows()!=0, ExcLaplaceVectorNotSet(degree));
+ const unsigned int n_inner_apply=lvs.n_rows();
Assert(n_inner_apply==n_inner || n_inner_apply==(degree-1)*(degree-1),
ExcInternalError());
- const unsigned int n_outer_apply=lvs[0].size();
- Assert(a.size()==n_outer_apply, ExcDimensionMismatch(a.size(), n_outer_apply));
+ const unsigned int n_outer_apply=lvs.n_cols();
+ Assert(a.size()==n_outer_apply,
+ ExcDimensionMismatch(a.size(), n_outer_apply));
// compute each inner point as
// linear combination of the outer
// elements of a
for (unsigned int unit_point=0; unit_point<n_inner_apply; ++unit_point)
{
- Assert(lvs[unit_point].size()==n_outer_apply, ExcInternalError());
+ Assert(lvs.n_cols()==n_outer_apply, ExcInternalError());
Point<dim> p;
for (unsigned int k=0; k<n_outer_apply; ++k)
p+=lvs[unit_point][k]*a[k];
template <int dim>
void
-MappingQ<dim>::transform_covariant (
- typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const
+MappingQ<dim>::transform_covariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
const typename MappingQ1<dim>::InternalData *q1_data =
dynamic_cast<const typename MappingQ1<dim>::InternalData *> (&mapping_data);
template <int dim>
void
-MappingQ<dim>::transform_contravariant (
- typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const
+MappingQ<dim>::transform_contravariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
const typename MappingQ1<dim>::InternalData *q1_data =
dynamic_cast<const typename MappingQ1<dim>::InternalData *> (&mapping_data);
#if (deal_II_dimension>1)
if (data.update_flags & update_boundary_forms)
{
- data.aux.resize(dim-1);
- for (unsigned int i=0;i<dim-1;++i)
- data.aux[i].resize(n_original_q_points);
+ data.aux.reinit(dim-1, n_original_q_points);
// Compute tangentials to the
// unit cell.
const unsigned int nfaces = GeometryInfo<dim>::faces_per_cell;
- data.unit_tangentials.resize(nfaces*(dim-1));
+ data.unit_tangentials.reinit(nfaces*(dim-1),
+ n_original_q_points);
for (unsigned int i=0;i<nfaces;++i)
{
// Base index of the
// non-zero in i.
Tensor<1,dim> tangential;
tangential[(nindex+1)%dim] = (this->normal_directions[i]%2) ? -1 : 1;
- data.unit_tangentials[i].resize(n_original_q_points);
std::fill (data.unit_tangentials[i].begin(),
data.unit_tangentials[i].end(),
tangential);
// right-handed system.
Tensor<1,dim> tangential;
tangential[(nindex-1)%dim] = 1.;
- data.unit_tangentials[i+nfaces].resize(n_original_q_points);
std::fill (data.unit_tangentials[i+nfaces].begin(),
data.unit_tangentials[i+nfaces].end(),
tangential);
result = boundary_forms.begin();
typename std::vector<Tensor<1,dim> >::const_iterator
end = boundary_forms.end();
- typename std::vector<Tensor<1,dim> >::const_iterator
+ const Tensor<1,dim> *
tang1 = data.aux[0].begin();
switch (dim)
data.unit_tangentials[
face_no+GeometryInfo<dim>::faces_per_cell].begin(),
data);
- typename std::vector<Tensor<1,dim> >::const_iterator
- tang2 = data.aux[1].begin();
+ const Tensor<1,dim> *tang2 = data.aux[1].begin();
for (;result != end; ++result, ++tang1, ++tang2)
cross_product (*result, *tang1, *tang2);
break;
template <int dim>
void
-MappingQ1<dim>::transform_covariant (
- typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const
+MappingQ1<dim>::transform_covariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
const InternalData *data_ptr = dynamic_cast<const InternalData *> (&mapping_data);
Assert(data_ptr!=0, ExcInternalError());
template <int dim>
void
-MappingQ1<dim>::transform_contravariant (
- typename std::vector<Tensor<1,dim> >::iterator begin,
- typename std::vector<Tensor<1,dim> >::const_iterator end,
- typename std::vector<Tensor<1,dim> >::const_iterator src,
- const typename Mapping<dim>::InternalDataBase &mapping_data) const
+MappingQ1<dim>::transform_contravariant (Tensor<1,dim> *begin,
+ Tensor<1,dim> *end,
+ const Tensor<1,dim> *src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
const InternalData* data_ptr = dynamic_cast<const InternalData *> (&mapping_data);
Assert(data_ptr!=0, ExcInternalError());