// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
//TODO: Offset in transform functions should be replaced by initializing VectorSlice correctly
+ /**
+ * The transformation type used
+ * for the Mapping::transform() functions.
+ *
+ * Special finite elements may
+ * need special Mapping from the
+ * reference cell to the actual
+ * mesh cell. In order to be most
+ * flexible, this enum provides
+ * an extensible interface for
+ * arbitrary
+ * transformations. Nevertheless,
+ * these must be implemented in
+ * the transform() functions of
+ * inheriting classes in order to
+ * work.
+ */
+enum MappingType
+{
+/// Covariant mapping
+ mapping_covariant = 0x0001,
+/// Contravariant mapping
+ mapping_contravariant = 0x0002,
+/// The Piola transform usually used for Hdiv elements
+ mapping_piola = 0x0003,
+/// The mapping used for Raviart-Thomas elements
+ mapping_raviart_thomas = mapping_piola,
+/// The mapping used for BDM elements
+ mapping_bdm = mapping_piola
+};
+
/**
* Abstract base class for mapping classes.
bool first_cell;
};
+ /**
+ * Transform a field of
+ * vectors accorsing to
+ * the selected MappingType.
+ */
+ virtual
+ void
+ transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ VectorSlice<std::vector<Tensor<1,spacedim> > > output,
+ const InternalDataBase &internal,
+ const MappingType type) const = 0;
+
+
+ /**
+ * Transform a field of
+ * rank two tensors accorsing to
+ * the selected MappingType.
+ */
+ virtual
+ void
+ transform (const VectorSlice<const std::vector<Tensor<2,dim> > > input,
+ VectorSlice<std::vector<Tensor<2,spacedim> > > output,
+ const InternalDataBase &internal,
+ const MappingType type) const = 0;
+
/**
* Transform a field of covariant
* vectors. The covariant
const unsigned int offset,
VectorSlice<std::vector<Tensor<2,spacedim> > > output,
const InternalDataBase &internal) const = 0;
+
+//TODO: The argument list here seems wrong
/**
* Transform a field of
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
std::vector<Point<dim> > &normal_vectors,
std::vector<double> &cell_JxW_values) const ;
+ virtual void
+ transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ VectorSlice<std::vector<Tensor<1,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType type) const;
+
+ virtual void
+ transform (const VectorSlice<const std::vector<Tensor<2,dim> > > input,
+ VectorSlice<std::vector<Tensor<2,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType type) const;
+
virtual void
transform_covariant (const VectorSlice<const std::vector<Tensor<1,spacedim> > > input,
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Point<spacedim> &p) const;
+ virtual void
+ transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ VectorSlice<std::vector<Tensor<1,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType type) const;
+
+ virtual void
+ transform (const VectorSlice<const std::vector<Tensor<2,dim> > > input,
+ VectorSlice<std::vector<Tensor<2,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType type) const;
+
/**
* Implementation of the
* interface in Mapping.
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
const Point<spacedim> &p) const;
+ virtual void
+ transform (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ VectorSlice<std::vector<Tensor<1,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType type) const;
+
+ virtual void
+ transform (const VectorSlice<const std::vector<Tensor<2,dim> > > input,
+ VectorSlice<std::vector<Tensor<2,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType type) const;
+
virtual void
transform_covariant (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
const unsigned int offset,
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#endif
+template<int dim, int spacedim>
+void
+MappingCartesian<dim,spacedim>::transform (
+ const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ VectorSlice<std::vector<Tensor<1,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType mapping_type) const
+{
+ switch (mapping_type)
+ {
+ case mapping_covariant:
+ transform_covariant(input, 0, output, internal);
+ return;
+// case mapping_contravariant:
+// transform_contravariant(input, 0, output, internal);
+// return;
+ default:
+ Assert(false, ExcNotImplemented());
+ }
+}
+
+template<int dim, int spacedim>
+void
+MappingCartesian<dim,spacedim>::transform (
+ const VectorSlice<const std::vector<Tensor<2,dim> > > input,
+ VectorSlice<std::vector<Tensor<2,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType mapping_type) const
+{
+ switch (mapping_type)
+ {
+ case mapping_covariant:
+ transform_covariant(input, 0, output, internal);
+ return;
+// case mapping_contravariant:
+// transform_contravariant(input, 0, output, internal);
+// return;
+ default:
+ Assert(false, ExcNotImplemented());
+ }
+}
+
+
+
template<int dim, int spacedim>
void
MappingCartesian<dim, spacedim>::transform_covariant (
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
}
+template<int dim, int spacedim>
+void
+MappingQ<dim,spacedim>::transform (
+ const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ VectorSlice<std::vector<Tensor<1,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType mapping_type) const
+{
+ switch (mapping_type)
+ {
+ case mapping_covariant:
+ transform_covariant(input, 0, output, internal);
+ return;
+// case mapping_contravariant:
+// transform_contravariant(input, 0, output, internal);
+// return;
+ default:
+ Assert(false, ExcNotImplemented());
+ }
+}
+
+
+template<int dim, int spacedim>
+void
+MappingQ<dim,spacedim>::transform (
+ const VectorSlice<const std::vector<Tensor<2,dim> > > input,
+ VectorSlice<std::vector<Tensor<2,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType mapping_type) const
+{
+ switch (mapping_type)
+ {
+ case mapping_covariant:
+ transform_covariant(input, 0, output, internal);
+ return;
+// case mapping_contravariant:
+// transform_contravariant(input, 0, output, internal);
+// return;
+ default:
+ Assert(false, ExcNotImplemented());
+ }
+}
+
+
template<int dim, int spacedim>
void
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#endif
+template<int dim, int spacedim>
+void
+MappingQ1<dim,spacedim>::transform (
+ const VectorSlice<const std::vector<Tensor<1,dim> > > input,
+ VectorSlice<std::vector<Tensor<1,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType mapping_type) const
+{
+ switch (mapping_type)
+ {
+ case mapping_covariant:
+ transform_covariant(input, 0, output, internal);
+ return;
+// case mapping_contravariant:
+// transform_contravariant(input, 0, output, internal);
+// return;
+ default:
+ Assert(false, ExcNotImplemented());
+ }
+}
+
+template<int dim, int spacedim>
+void
+MappingQ1<dim,spacedim>::transform (
+ const VectorSlice<const std::vector<Tensor<2,dim> > > input,
+ VectorSlice<std::vector<Tensor<2,spacedim> > > output,
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal,
+ const MappingType mapping_type) const
+{
+ switch (mapping_type)
+ {
+ case mapping_covariant:
+ transform_covariant(input, 0, output, internal);
+ return;
+// case mapping_contravariant:
+// transform_contravariant(input, 0, output, internal);
+// return;
+ default:
+ Assert(false, ExcNotImplemented());
+ }
+}
+
+
template<int dim, int spacedim>
void
MappingQ1<dim,spacedim>::transform_covariant (