s'CC=.*'CC=gcc';
s'CVS=.*'CVS=cvs';
s'MAKE=.*'MAKE="make"';
-s'MAIL=.*'MAIL=mail';
+s'MAIL=.*'MAIL="ssh1 atlas mail"';
# Path variables
s'compiler=.*'compiler=gcc295';
+# it seems that we cannot get this from config.guess
+
+s!`./config.guess`!i686-pc-cygwin!;
+
# Commands
s'CXX=.*'CXX=g++';
s'CC=.*'CC=gcc';
s'CVS=.*'CVS=cvs';
s'MAKE=.*'MAKE="make"';
-#s'MAIL=.*'MAIL="cat > "';
-s!\$MAIL build-(.*)\@dealii.org.*!cp log > ../../$1!;
# Path variables
# Work around missing mail
-
-s'build-failure\@dealii.org'../../Failure';
-s'build-success\@dealii.org'../../Success';
+s!\$MAIL build-(.*)\@dealii.org < log 2>\&1!cp log ../../$1!;
(if ($MAKE all -k 2>&1) ; then
echo "CLEANING OBJECT FILES AT " `date '+%Y-%m-%d %T'` | tee -a log
- $MAKE clean
+ $MAKE clean -k 2>&1
echo "BUILDING EXAMPLES AT " `date '+%Y-%m-%d %T'` | tee -a log
if (cd examples ; $MAKE -k 2>&1) ; then
result=succeeded ;
/**
* Tranform a field of covariant
- * vectors. There must be one
- * vector for each quadrature
- * point. Alternatively, for
- * faces and subfaces, the number
- * of the first quadrature point
- * can be given as additional
- * argument.
- */
- virtual void transform_covariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const InternalDataBase &internal,
- const unsigned int src_offset) const = 0;
-
- /**
- * Tranform a field of
- * contravariant vectors. There
- * must be one vector for each
- * quadrature
- * point. Alternatively, for
- * faces and subfaces, the number
- * of the first quadrature point
- * can be given as additional
- * argument.
- */
- virtual
- void
- transform_contravariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const InternalDataBase &internal,
- const unsigned int src_offset) const = 0;
-
- /**
- * Tranform a field of covariant vectors.
- * There must be one vector for each quadrature
- * point. Alternatively, for faces and subfaces,
- * the first quadrature point can be
- * given as additional argument.
+ * vectors. The vector spanned by
+ * @p{begin} and @p{end} must
+ * have as many elements as there
+ * are quadrature points (not
+ * tested inside the function).
+ *
+ * The vector @p{src} must
+ * contain at least as many
+ * elements.
*/
virtual
void
- transform_covariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const InternalDataBase &internal,
- const unsigned int src_offset) const = 0;
+ transform_covariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const InternalDataBase& internal) const = 0;
/**
- * Tranform a field of contravariant vectors.
- * There must be one vector for each quadrature
- * point. Alternatively, for faces and subfaces,
- * the first quadrature point can be
- * given as additional argument.
+ * Tranform a field of
+ * contravariant vectors. The
+ * vector spanned by @p{begin}
+ * and @p{end} must have as many
+ * elements as there are
+ * quadrature points (not tested
+ * inside the function).
+ *
+ * The vector @p{src} must
+ * contain at least as many
+ * elements.
*/
virtual
void
- transform_contravariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const InternalDataBase &internal,
- const unsigned int src_offset) const = 0;
+ transform_contravariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const InternalDataBase& internal) const = 0;
/**
* Indicate fields to be updated in the
* @ref{Mapping}.
*/
virtual void
- transform_covariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
+ transform_covariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const;
/**
* Implementation of the interface in
* @ref{Mapping}.
*/
virtual void
- transform_contravariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
+ transform_contravariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const;
- /**
- * Implementation of the interface in
- * @ref{Mapping}.
- */
- virtual void
- transform_covariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
- /**
- * Implementation of the interface in
- * @ref{Mapping}.
- */
- virtual void
- transform_contravariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
/**
* Transforms the point @p{p} on
* the unit cell to the point
DeclException0 (ExcInvalidData);
protected:
- /**
- * Implementation of the
- * covariant transformation.
- */
- template <typename tensor_>
- void covariant_transformation (typename std::vector<tensor_> &dst,
- const typename std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
- /**
- * Implementation of the
- * contravariant transformation.
- */
- template <typename tensor_>
- void contravariant_transformation (typename std::vector<tensor_> &dst,
- const typename std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
/**
* Storage for internal data of
* @ref{Mapping}.
*/
virtual void
- transform_covariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
+ transform_covariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const;
/**
* Implementation of the interface in
* @ref{Mapping}.
*/
virtual void
- transform_contravariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
- /**
- * Implementation of the interface in
- * @ref{Mapping}.
- */
- virtual void
- transform_covariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
- /**
- * Implementation of the interface in
- * @ref{Mapping}.
- */
- virtual void
- transform_contravariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
+ transform_contravariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const;
/**
* Return the degree of the
* @ref{Mapping}.
*/
virtual void
- transform_covariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
+ transform_covariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const;
/**
* Implementation of the interface in
* @ref{Mapping}.
*/
virtual void
- transform_contravariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
- /**
- * Implementation of the interface in
- * @ref{Mapping}.
- */
- virtual void
- transform_covariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
- /**
- * Implementation of the interface in
- * @ref{Mapping}.
- */
- virtual void
- transform_contravariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
+ transform_contravariant (Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const;
/**
* Implementation of the interface in
typename std::vector<Tensor<1,dim> > &boundary_form,
typename std::vector<Point<dim> > &normal_vectors) const ;
- /**
- * Implementation of the
- * covariant transformation.
- */
- template <typename tensor_>
- void covariant_transformation (typename std::vector<tensor_> &dst,
- const typename std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
- /**
- * Implementation of the
- * contravariant transformation.
- */
- template <typename tensor_>
- void contravariant_transformation (typename std::vector<tensor_> &dst,
- const typename std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const;
-
/**
* Storage for internal data of
* d-linear transformation.
// cell
for (unsigned int d=0; d<dim; ++d)
{
- mapping.transform_covariant (diff_quot2, diff_quot[d],
- mapping_internal, offset);
+ mapping.transform_covariant (diff_quot2.begin(), diff_quot2.end(),
+ &diff_quot[d][offset],
+ mapping_internal);
for (unsigned int q=0; q<n_q_points; ++q)
for (unsigned int d1=0; d1<dim; ++d1)
data.shape_values(k,i) = fe_data.shape_values[k][i];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, 0);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ fe_data.shape_gradients[k].begin(),
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, offset);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ &fe_data.shape_gradients[k][offset],
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, offset);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ &fe_data.shape_gradients[k][offset],
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, 0);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ fe_data.shape_gradients[k].begin(),
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, offset);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ &fe_data.shape_gradients[k][offset],
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, offset);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ &fe_data.shape_gradients[k][offset],
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, 0);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ fe_data.shape_gradients[k].begin(),
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, offset);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ &fe_data.shape_gradients[k][offset],
+ mapping_data);
}
if (flags & update_second_derivatives)
data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
if (flags & update_gradients)
- mapping.transform_covariant(data.shape_gradients[k],
- fe_data.shape_gradients[k],
- mapping_data, offset);
+ mapping.transform_covariant(data.shape_gradients[k].begin(),
+ data.shape_gradients[k].end(),
+ &fe_data.shape_gradients[k][offset],
+ mapping_data);
}
if (flags & update_second_derivatives)
template <int dim>
void
-MappingCartesian<dim>::transform_covariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
+MappingCartesian<dim>::transform_covariant (
+ Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
- covariant_transformation(dst, src, mapping_data, src_offset);
-}
-
+ const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
-template <int dim>
-void
-MappingCartesian<dim>::transform_covariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- covariant_transformation(dst, src, mapping_data, src_offset);
+ Assert (data.update_flags & update_covariant_transformation,
+ typename FEValuesBase<dim>::ExcAccessToUninitializedField());
+
+ // simply scale by inverse Jacobian
+ // (which is diagonal here)
+ while (begin!=end)
+ {
+ for (unsigned int d=0;d<dim;++d)
+ (*begin)[d] = (*src)[d]/data.length[d];
+ begin++;
+ src++;
+ }
}
+
template <int dim>
void
-MappingCartesian<dim>::transform_contravariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
+MappingCartesian<dim>::transform_contravariant (
+ Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
- contravariant_transformation(dst, src, mapping_data, src_offset);
-}
-
+ // convert data object to internal
+ // data for this class. fails with
+ // an exception if that is not
+ // possible
+ const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
+ Assert (data.update_flags & update_contravariant_transformation,
+ typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-template <int dim>
-void
-MappingCartesian<dim>::transform_contravariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- contravariant_transformation(dst, src, mapping_data, src_offset);
+ // simply scale by Jacobian
+ // (which is diagonal here)
+ while (begin!=end)
+ {
+ for (unsigned int d=0; d<dim; ++d)
+ (*begin)[d] = (*src)[d]*data.length[d];
+ ++begin;
+ ++src;
+ }
}
-
template <int dim>
Point<dim> MappingCartesian<dim>::transform_unit_to_real_cell (
const typename Triangulation<dim>::cell_iterator cell,
}
-
-template <int dim>
-template <typename tensor_>
-void
-MappingCartesian<dim>::
-contravariant_transformation (typename std::vector<tensor_> &dst,
- const typename std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- Assert(tensor_::dimension==dim && tensor_::rank==1, ExcInvalidData());
-
- // convert data object to internal
- // data for this class. fails with
- // an exception if that is not
- // possible
- const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
-
- Assert (data.update_flags & update_contravariant_transformation,
- typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
- typename std::vector<tensor_>::const_iterator vec = src.begin() + src_offset;
- typename std::vector<tensor_>::iterator result = dst.begin();
- typename std::vector<tensor_>::const_iterator end = dst.end();
-
- // simply scale by Jacobian
- // (which is diagonal here)
- while (result!=end)
- {
- for (unsigned int d=0; d<dim; ++d)
- (*result)[d] = (*vec)[d]*data.length[d];
- ++vec;
- ++result;
- }
-}
-
-
-
-template <int dim>
-template <typename tensor_>
-void
-MappingCartesian<dim>::
-covariant_transformation (typename std::vector<tensor_> &dst,
- const typename std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- Assert(tensor_::dimension==dim && tensor_::rank==1, ExcInvalidData());
-
- // convert data object to internal
- // data for this class. fails with
- // an exception if that is not
- // possible
- const InternalData &data = dynamic_cast<const InternalData&> (mapping_data);
-
- Assert (data.update_flags & update_covariant_transformation,
- typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
- typename std::vector<tensor_>::const_iterator vec = src.begin() + src_offset;
- typename std::vector<tensor_>::iterator result = dst.begin();
- typename std::vector<tensor_>::const_iterator end = dst.end();
-
- // simply scale by inverse Jacobian
- // (which is diagonal here)
- while (result!=end)
- {
- for (unsigned int d=0;d<dim;++d)
- (*result)[d] = (*vec)[d]/data.length[d];
- vec++;
- result++;
- }
-}
-
-
-
//----------------------------------------------------------------------//
// explicit instantiations
template class MappingCartesian<deal_II_dimension>;
-
-template void MappingCartesian<deal_II_dimension>::
-contravariant_transformation<Tensor<1,deal_II_dimension> > (
- std::vector<Tensor<1,deal_II_dimension> > &dst,
- const std::vector<Tensor<1,deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;
-
-template void MappingCartesian<deal_II_dimension>::
-contravariant_transformation<Point<deal_II_dimension> > (
- std::vector<Point<deal_II_dimension> > &dst,
- const std::vector<Point<deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;
-
-template void MappingCartesian<deal_II_dimension>::
-covariant_transformation<Tensor<1,deal_II_dimension> > (
- std::vector<Tensor<1,deal_II_dimension> > &dst,
- const std::vector<Tensor<1,deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;
-
-template void MappingCartesian<deal_II_dimension>::
-covariant_transformation<Point<deal_II_dimension> > (
- std::vector<Point<deal_II_dimension> > &dst,
- const std::vector<Point<deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;
template <int dim>
void
-MappingQ<dim>::transform_covariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
+MappingQ<dim>::transform_covariant (
+ Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
- const typename MappingQ1<dim>::InternalData *q1_data_ptr =
+ const typename MappingQ1<dim>::InternalData *q1_data =
dynamic_cast<const typename MappingQ1<dim>::InternalData *> (&mapping_data);
- Assert(q1_data_ptr!=0, ExcInternalError());
- const typename MappingQ1<dim>::InternalData &q1_data=*q1_data_ptr;
+ Assert(q1_data!=0, ExcInternalError());
+
+ typename std::vector<Tensor<2,dim> >::const_iterator tensor;
- if (q1_data.is_mapping_q1_data)
- covariant_transformation(dst, src, q1_data, src_offset);
+ if (q1_data->is_mapping_q1_data)
+ tensor = q1_data->covariant.begin();
else
{
- const InternalData *data_ptr = dynamic_cast<const InternalData *> (q1_data_ptr);
- Assert(data_ptr!=0, ExcInternalError());
- const InternalData &data=*data_ptr;
+ const InternalData *data = dynamic_cast<const InternalData *> (q1_data);
+ Assert(data!=0, ExcInternalError());
- if (data.use_mapping_q1_on_current_cell)
- covariant_transformation(dst, src, data.mapping_q1_data, src_offset);
+ if (data->use_mapping_q1_on_current_cell)
+ tensor = data->mapping_q1_data.covariant.begin();
else
- covariant_transformation(dst, src, data, src_offset);
+ tensor = data->covariant.begin();
}
-}
-
-
-template <int dim>
-void
-MappingQ<dim>::transform_covariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- const typename MappingQ1<dim>::InternalData *q1_data_ptr =
- dynamic_cast<const typename MappingQ1<dim>::InternalData *> (&mapping_data);
- Assert(q1_data_ptr!=0, ExcInternalError());
- const typename MappingQ1<dim>::InternalData &q1_data=*q1_data_ptr;
-
- if (q1_data.is_mapping_q1_data)
- covariant_transformation(dst, src, q1_data, src_offset);
- else
+ while (begin!=end)
{
- const InternalData *data_ptr = dynamic_cast<const InternalData *> (q1_data_ptr);
- Assert(data_ptr!=0, ExcInternalError());
- const InternalData &data=*data_ptr;
-
- if (data.use_mapping_q1_on_current_cell)
- covariant_transformation(dst, src, data.mapping_q1_data, src_offset);
- else
- covariant_transformation(dst, src, data, src_offset);
- }
+ contract (*(begin++), *(src++), *(tensor++));
+ }
}
template <int dim>
void
-MappingQ<dim>::transform_contravariant (typename std::vector<Tensor<1,dim> > &dst,
- const typename std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
+MappingQ<dim>::transform_contravariant (
+ Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
- const typename MappingQ1<dim>::InternalData *q1_data_ptr =
+ const typename MappingQ1<dim>::InternalData *q1_data =
dynamic_cast<const typename MappingQ1<dim>::InternalData *> (&mapping_data);
- Assert(q1_data_ptr!=0, ExcInternalError());
- const typename MappingQ1<dim>::InternalData &q1_data=*q1_data_ptr;
+ Assert(q1_data!=0, ExcInternalError());
+
+ typename std::vector<Tensor<2,dim> >::const_iterator tensor;
- if (q1_data.is_mapping_q1_data)
- contravariant_transformation(dst, src, q1_data, src_offset);
+ if (q1_data->is_mapping_q1_data)
+ tensor = q1_data->contravariant.begin();
else
{
- const InternalData *data_ptr = dynamic_cast<const InternalData *> (q1_data_ptr);
- Assert(data_ptr!=0, ExcInternalError());
- const InternalData &data=*data_ptr;
+ const InternalData *data = dynamic_cast<const InternalData *> (q1_data);
+ Assert(data!=0, ExcInternalError());
- if (data.use_mapping_q1_on_current_cell)
- contravariant_transformation(dst, src, data.mapping_q1_data, src_offset);
+ if (data->use_mapping_q1_on_current_cell)
+ tensor = data->mapping_q1_data.contravariant.begin();
else
- contravariant_transformation(dst, src, data, src_offset);
+ tensor = data->contravariant.begin();
}
-}
-
-
-template <int dim>
-void
-MappingQ<dim>::transform_contravariant (typename std::vector<Point<dim> > &dst,
- const typename std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- const typename MappingQ1<dim>::InternalData *q1_data_ptr =
- dynamic_cast<const typename MappingQ1<dim>::InternalData *> (&mapping_data);
- Assert(q1_data_ptr!=0, ExcInternalError());
- const typename MappingQ1<dim>::InternalData &q1_data=*q1_data_ptr;
-
- if (q1_data.is_mapping_q1_data)
- contravariant_transformation(dst, src, q1_data, src_offset);
- else
+ while (begin!=end)
{
- const InternalData *data_ptr = dynamic_cast<const InternalData *> (q1_data_ptr);
- Assert(data_ptr!=0, ExcInternalError());
- const InternalData &data=*data_ptr;
-
- if (data.use_mapping_q1_on_current_cell)
- contravariant_transformation(dst, src, data.mapping_q1_data, src_offset);
- else
- contravariant_transformation(dst, src, data, src_offset);
- }
+ contract (*(begin++), *(tensor++), *(src++));
+ }
}
ExcDimensionMismatch(JxW_values.size(), npts));
- transform_contravariant(data.aux[0],
- data.unit_tangentials[face_no],
- data, 0);
+ transform_contravariant(data.aux[0].begin(),
+ data.aux[0].end(),
+ data.unit_tangentials[face_no].begin(),
+ data);
typename std::vector<Tensor<1,dim> >::iterator
result = boundary_forms.begin();
case 3:
{
- transform_contravariant(data.aux[1],
+ transform_contravariant(data.aux[1].begin(),
+ data.aux[1].end(),
data.unit_tangentials[
- face_no+GeometryInfo<dim>::faces_per_cell],
- data, 0);
+ face_no+GeometryInfo<dim>::faces_per_cell].begin(),
+ data);
typename std::vector<Tensor<1,dim> >::const_iterator
tang2 = data.aux[1].begin();
for (;result != end; ++result, ++tang1, ++tang2)
template <int dim>
void
-MappingQ1<dim>::transform_covariant (std::vector<Tensor<1,dim> > &dst,
- const std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
+MappingQ1<dim>::transform_covariant (
+ Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
- covariant_transformation(dst, src, mapping_data, src_offset);
-}
+ const InternalData *data_ptr = dynamic_cast<const InternalData *> (&mapping_data);
+ Assert(data_ptr!=0, ExcInternalError());
+ const InternalData &data=*data_ptr;
+ Assert (data.update_flags & update_covariant_transformation,
+ typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-template <int dim>
-void
-MappingQ1<dim>::transform_covariant (std::vector<Point<dim> > &dst,
- const std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- covariant_transformation(dst, src, mapping_data, src_offset);
-}
+//TODO: [GK] Can we do a similar assertion?
+// Assert (dst.size() == data.contravariant.size(),
+// ExcDimensionMismatch(dst.size() + src_offset, data.contravariant.size()));
-template <int dim>
-void
-MappingQ1<dim>::transform_contravariant (std::vector<Tensor<1,dim> > &dst,
- const std::vector<Tensor<1,dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- contravariant_transformation(dst, src, mapping_data, src_offset);
+ typename std::vector<Tensor<2,dim> >::const_iterator tensor = data.covariant.begin();
+
+ while (begin!=end)
+ {
+ contract (*(begin++), *(src++), *(tensor++));
+ }
}
template <int dim>
void
-MappingQ1<dim>::transform_contravariant (std::vector<Point<dim> > &dst,
- const std::vector<Point<dim> > &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
+MappingQ1<dim>::transform_contravariant (
+ Tensor<1,dim>* begin,
+ const Tensor<1,dim>* end,
+ const Tensor<1,dim>* src,
+ const typename Mapping<dim>::InternalDataBase &mapping_data) const
{
- contravariant_transformation(dst, src, mapping_data, src_offset);
-}
+ const InternalData* data_ptr = dynamic_cast<const InternalData *> (&mapping_data);
+ Assert(data_ptr!=0, ExcInternalError());
+ const InternalData &data=*data_ptr;
+ Assert (data.update_flags & update_contravariant_transformation,
+ typename FEValuesBase<dim>::ExcAccessToUninitializedField());
+ typename std::vector<Tensor<2,dim> >::const_iterator tensor = data.contravariant.begin();
+
+ while (begin!=end)
+ {
+ contract (*(begin++), *(tensor++), *(src++));
+ }
+}
template <int dim>
Point<dim> MappingQ1<dim>::transform_unit_to_real_cell (
}
}
-
-
-template <int dim>
-template <typename tensor_>
-void
-MappingQ1<dim>::contravariant_transformation (std::vector<tensor_> &dst,
- const std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- Assert(tensor_::dimension==dim && tensor_::rank==1, Mapping<dim>::ExcInvalidData());
- const InternalData* data_ptr = dynamic_cast<const InternalData *> (&mapping_data);
- Assert(data_ptr!=0, ExcInternalError());
- const InternalData &data=*data_ptr;
-
- Assert (data.update_flags & update_contravariant_transformation,
- typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
- Assert (src.size() + src_offset >= data.contravariant.size(),
- ExcDimensionMismatch(src.size(), data.contravariant.size()));
- Assert (dst.size() == data.contravariant.size(),
- ExcDimensionMismatch(dst.size(), data.contravariant.size()));
-
- typename std::vector<tensor_>::const_iterator vec = src.begin()+src_offset;
- typename std::vector<Tensor<2,dim> >::const_iterator tensor = data.contravariant.begin();
- typename std::vector<tensor_>::iterator result = dst.begin();
- typename std::vector<tensor_>::const_iterator end = dst.end();
-
- while (result!=end)
- {
- contract (*(result++), *(tensor++), *(vec++));
- }
-}
-
-
-template <int dim>
-template <typename tensor_>
-void
-MappingQ1<dim>::covariant_transformation (std::vector<tensor_> &dst,
- const std::vector<tensor_> &src,
- const typename Mapping<dim>::InternalDataBase &mapping_data,
- const unsigned int src_offset) const
-{
- Assert(tensor_::dimension==dim && tensor_::rank==1, Mapping<dim>::ExcInvalidData());
- const InternalData *data_ptr = dynamic_cast<const InternalData *> (&mapping_data);
- Assert(data_ptr!=0, ExcInternalError());
- const InternalData &data=*data_ptr;
-
- Assert (data.update_flags & update_covariant_transformation,
- typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
- Assert (src.size() + src_offset >= data.contravariant.size(),
- ExcDimensionMismatch(src.size() + src_offset, data.contravariant.size()));
- Assert (dst.size() == data.contravariant.size(),
- ExcDimensionMismatch(dst.size() + src_offset, data.contravariant.size()));
-
- typename std::vector<tensor_>::const_iterator vec = src.begin() + src_offset;
- typename std::vector<Tensor<2,dim> >::const_iterator tensor = data.covariant.begin();
- typename std::vector<tensor_>::iterator result = dst.begin();
- const typename std::vector<tensor_>::const_iterator end = dst.end();
-
- while (result!=end)
- {
- contract (*(result++), *(vec++), *(tensor++));
- }
-}
-
-
-
//----------------------------------------------------------------------//
template class MappingQ1<deal_II_dimension>;
-
-template void MappingQ1<deal_II_dimension>::
-contravariant_transformation<Tensor<1,deal_II_dimension> > (
- std::vector<Tensor<1,deal_II_dimension> > &dst,
- const std::vector<Tensor<1,deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;
-
-template void MappingQ1<deal_II_dimension>::
-contravariant_transformation<Point<deal_II_dimension> > (
- std::vector<Point<deal_II_dimension> > &dst,
- const std::vector<Point<deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;
-
-template void MappingQ1<deal_II_dimension>::
-covariant_transformation<Tensor<1,deal_II_dimension> > (
- std::vector<Tensor<1,deal_II_dimension> > &dst,
- const std::vector<Tensor<1,deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;
-
-template void MappingQ1<deal_II_dimension>::
-covariant_transformation<Point<deal_II_dimension> > (
- std::vector<Point<deal_II_dimension> > &dst,
- const std::vector<Point<deal_II_dimension> > &src,
- const Mapping<deal_II_dimension>::InternalDataBase& internal,
- const unsigned int src_offset) const;