// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* the real cell.
*/
update_hessians = 0x0004,
- //! Outter normal vector, not normalized
+ //! Outer normal vector, not normalized
/**
* Vector product of tangential
* vectors, yielding a normal
* reference to realcell.
*/
update_JxW_values = 0x0020,
- //! Normal vectors to the faces
+ //! Normal vectors
+ /**
+ * Compute the normal vectors,
+ * either for a face or for a
+ * cell of codimension
+ * one. Setting this flag for
+ * any other object will raise
+ * an error.
+ */
+ update_normal_vectors = 0x0040,
/**
- * Compute the unit outer
- * normal vector on the face of
- * a cell.
+ * @deprecated Use #update_normal_vectors
*/
- update_face_normal_vectors = 0x0040,
- //! Normal vectors to the cells
+ update_face_normal_vectors = update_normal_vectors,
/**
- * Compute the unit outer
- * normal vector on the cell
- * itself. Only possible if
- * dim=spacedim-1
+ * @deprecated Use #update_normal_vectors
*/
- update_cell_normal_vectors = 0x20000,
+ update_cell_normal_vectors = update_normal_vectors,
//! Volume element
/**
* Compute the Jacobian of the
* derivatives.
*/
update_second_derivatives = update_hessians,
- //! Normal vectors
- /**
- * @deprecated Update normal
- * vectors. Use
- * update_face_normal_vectors
- */
- update_normal_vectors = update_face_normal_vectors,
//! Values needed for Piola transform
/**
* Combination of the flags
*/
std::vector<Point<spacedim> > normal_vectors;
- /**
- * List of outward vectors normal to the cell
- * surface (line) at the quadrature points
- * for the codimension 1 case,
- * when spacedim=3 (=2).
- */
- std::vector<Point<spacedim> > cell_normal_vectors;
-
/**
* List of boundary forms at the
* quadrature points. This field is filled
*/
const typename Triangulation<dim,spacedim>::cell_iterator get_cell () const;
- /**
- * Returns the vectors normal to
- * the cell in each of the
- * quadrature points.
+ /**
+ * For a face, return the outward
+ * normal vector to the cell at
+ * the <tt>i</tt>th quadrature
+ * point.
+ *
+ * For a cell of codimension one,
+ * return the normal vector, as
+ * it is specified by the
+ * numbering of the vertices.
+ *
+ * The length of the vector
+ * is normalized to one.
*/
+ const Point<spacedim> & normal_vector (const unsigned int i) const;
- const std::vector<Point<spacedim> > & get_cell_normal_vectors () const;
+ /**
+ * Return the normal vectors at
+ * the quadrature points. For a
+ * face, these are the outward
+ * normal vectors to the
+ * cell. For a cell of
+ * codimension one, the
+ * orientation is given by the
+ * numbering of vertices.
+ */
+ const std::vector<Point<spacedim> > & get_normal_vectors () const;
/**
+ * @deprecated Use
+ * normal_vector() instead.
+ *
* Return the outward normal vector to
* the cell at the <tt>i</tt>th quadrature
* point. The length of the vector
*/
const Point<spacedim> & cell_normal_vector (const unsigned int i) const;
+ /**
+ * @deprecated Use
+ * get_normal_vectors() instead.
+ *
+ * Returns the vectors normal to
+ * the cell in each of the
+ * quadrature points.
+ */
+ const std::vector<Point<spacedim> > & get_cell_normal_vectors () const;
+
/**
* Return the relation of the current
* cell to the previous cell. This
* when evaluating something on the surface of a cell. All the data
* that is available in the interior of cells is also available here.
*
- * On surfaces of mesh cells, normal vectors and boundary forms are
+ * On surfaces of mesh cells, boundary forms are
* additional values that can be computed. This class provides the
* interface to access those. Implementations are in derived classes
* FEFaceValues and FESubfaceValues.
const FiniteElement<dim,spacedim> &fe,
const Quadrature<dim-1>& quadrature);
- /**
- * Return the outward normal vector to
- * the cell at the <tt>i</tt>th quadrature
- * point. The length of the vector
- * is normalized to one.
- */
- const Point<dim> & normal_vector (const unsigned int i) const;
-
/**
* Boundary form of the
* transformation of the cell at
*/
const Tensor<1,spacedim> & boundary_form (const unsigned int i) const;
- /**
- * Return the list of outward normal
- * vectors to the cell at the
- * quadrature points.
- */
- const std::vector<Point<dim> > & get_normal_vectors () const;
-
/**
* Return the list of outward
* normal vectors times the
template <int dim, int spacedim>
inline
const Point<spacedim> &
-FEValuesBase<dim,spacedim>::cell_normal_vector (const unsigned int i) const
+FEValuesBase<dim,spacedim>::normal_vector (const unsigned int i) const
{
typedef FEValuesBase<dim,spacedim> FVB;
- Assert (i<this->cell_normal_vectors.size(),
- ExcIndexRange(i, 0, this->cell_normal_vectors.size()));
- Assert (this->update_flags & update_cell_normal_vectors,
+ Assert (this->update_flags & update_normal_vectors,
typename FVB::ExcAccessToUninitializedField());
+ Assert (i<this->normal_vectors.size(),
+ ExcIndexRange(i, 0, this->normal_vectors.size()));
+
+ return this->normal_vectors[i];
+}
- return this->cell_normal_vectors[i];
+
+
+template <int dim, int spacedim>
+inline
+const Point<spacedim> &
+FEValuesBase<dim,spacedim>::cell_normal_vector (const unsigned int i) const
+{
+ return this->normal_vector(i);
}
/*------------------------ Inline functions: FEFaceValuesBase --------------------*/
-template <int dim, int spacedim>
-inline
-const Point<dim> &
-FEFaceValuesBase<dim,spacedim>::normal_vector (const unsigned int i) const
-{
- typedef FEValuesBase<dim,spacedim> FVB;
- Assert (i<this->normal_vectors.size(),
- ExcIndexRange(i, 0, this->normal_vectors.size()));
- Assert (this->update_flags & update_normal_vectors,
- typename FVB::ExcAccessToUninitializedField());
-
- return this->normal_vectors[i];
-}
-
-
template <int dim, int spacedim>
inline
unsigned int
if (flags & update_normal_vectors)
this->normal_vectors.resize(n_quadrature_points);
-
- if (flags & update_cell_normal_vectors)
- this->cell_normal_vectors.resize(n_quadrature_points);
}
template <int dim, int spacedim>
const std::vector<Point<spacedim> > &
-FEValuesBase<dim,spacedim>::get_cell_normal_vectors () const
+FEValuesBase<dim,spacedim>::get_normal_vectors () const
{
typedef FEValuesBase<dim,spacedim> FEVB;
- Assert (this->update_flags & update_cell_normal_vectors,
+ Assert (this->update_flags & update_normal_vectors,
typename FEVB::ExcAccessToUninitializedField());
- return this->cell_normal_vectors;
+ return this->normal_vectors;
+}
+
+
+
+template <int dim, int spacedim>
+const std::vector<Point<spacedim> > &
+FEValuesBase<dim,spacedim>::get_cell_normal_vectors () const
+{
+ return this->get_normal_vectors ();
}
void
FEValues<dim,spacedim>::initialize (const UpdateFlags update_flags)
{
- // you can't compute normal vectors
- // on cells, only on faces
- typedef FEValuesBase<dim,spacedim> FEVB;
- Assert ((update_flags & update_normal_vectors) == false,
- typename FEVB::ExcInvalidUpdateFlag());
-
// You can compute normal vectors
// to the cells only in the
// codimension one case.
- if(dim == spacedim)
- Assert ( (update_flags & update_cell_normal_vectors) == false,
- typename FEVB::ExcInvalidUpdateFlag());
-
-
+ typedef FEValuesBase<dim,spacedim> FEVB;
+ if (dim != spacedim-1)
+ Assert ((update_flags & update_normal_vectors) == false,
+ typename FEVB::ExcInvalidUpdateFlag());
+
const UpdateFlags flags = this->compute_update_flags (update_flags);
// then get objects into which the
this->jacobians,
this->jacobian_grads,
this->inverse_jacobians,
- this->cell_normal_vectors,
+ this->normal_vectors,
this->cell_similarity);
this->get_fe().fill_fe_values(this->get_mapping(),
-template <int dim, int spacedim>
-const std::vector<Point<dim> > &
-FEFaceValuesBase<dim,spacedim>::get_normal_vectors () const
-{
- typedef FEValuesBase<dim,spacedim> FEVB;
- Assert (this->update_flags & update_normal_vectors,
- typename FEVB::ExcAccessToUninitializedField());
- return this->normal_vectors;
-}
-
-
-
template <int dim, int spacedim>
const std::vector<Tensor<1,spacedim> > &
FEFaceValuesBase<dim,spacedim>::get_boundary_forms () const
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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<Tensor<2,spacedim> > &jacobians,
std::vector<Tensor<3,spacedim> > &jacobian_grads,
std::vector<Tensor<2,spacedim> > &inverse_jacobians,
- std::vector<Point<spacedim> > &cell_normal_vectors,
+ std::vector<Point<spacedim> > &normal_vectors,
CellSimilarity::Similarity &cell_similarity) const
{
// convert data object to internal
MappingQ1<dim,spacedim>::fill_fe_values(cell, q, *p_data,
quadrature_points, JxW_values,
jacobians, jacobian_grads, inverse_jacobians,
- cell_normal_vectors, cell_similarity);
+ normal_vectors, cell_similarity);
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
if (in & (update_covariant_transformation
| update_contravariant_transformation
| update_JxW_values
- | update_cell_normal_vectors
| update_boundary_forms
| update_normal_vectors
| update_jacobians
| update_covariant_transformation
| update_contravariant_transformation
| update_JxW_values
- | update_cell_normal_vectors
| update_boundary_forms
| update_normal_vectors
| update_volume_elements
if (out & (update_covariant_transformation
| update_JxW_values
- | update_cell_normal_vectors
| update_jacobians
| update_jacobian_grads
| update_boundary_forms
if (out & update_contravariant_transformation)
out |= update_JxW_values;
- if (out & update_cell_normal_vectors)
- out |= update_JxW_values | update_cell_normal_vectors;
+ if (out & update_normal_vectors)
+ out |= update_JxW_values;
}
std::vector<Tensor<2,spacedim> > &jacobians,
std::vector<Tensor<3,spacedim> > &jacobian_grads,
std::vector<Tensor<2,spacedim> > &inverse_jacobians,
- std::vector<Point<spacedim> > &cell_normal_vectors,
+ std::vector<Point<spacedim> > &normal_vectors,
CellSimilarity::Similarity &cell_similarity) const
{
// ensure that the following cast is really correct:
// columns of the Jacobian and
// store the cell normal vectors in
// the case <2,3>
- if (update_flags & (update_cell_normal_vectors
+ if (update_flags & (update_normal_vectors
| update_JxW_values))
{
Assert (JxW_values.size() == n_q_points,
ExcDimensionMismatch(JxW_values.size(), n_q_points));
- Assert( !(update_flags & update_cell_normal_vectors ) ||
- (cell_normal_vectors.size() == n_q_points),
- ExcDimensionMismatch(cell_normal_vectors.size(), n_q_points));
+ Assert( !(update_flags & update_normal_vectors ) ||
+ (normal_vectors.size() == n_q_points),
+ ExcDimensionMismatch(normal_vectors.size(), n_q_points));
if (cell_similarity != CellSimilarity::translation)
for (unsigned int point=0; point<n_q_points; ++point)
data.contravariant[point]=transpose(data.contravariant[point]);
JxW_values[point]
= data.contravariant[point][0].norm()*weights[point];
- if(update_flags & update_cell_normal_vectors)
+ if(update_flags & update_normal_vectors)
{
- cell_normal_vectors[point][0]=-data.contravariant[point][0][1]
+ normal_vectors[point][0]=-data.contravariant[point][0][1]
/data.contravariant[point][0].norm();
- cell_normal_vectors[point][1]=data.contravariant[point][0][0]
+ normal_vectors[point][1]=data.contravariant[point][0][0]
/data.contravariant[point][0].norm();
}
}
//is stored in the 3d
//subtensor of the contravariant tensor
data.contravariant[point][2]/=data.contravariant[point][2].norm();
- if(update_flags & update_cell_normal_vectors)
- cell_normal_vectors[point]=data.contravariant[point][2];
+ if(update_flags & update_normal_vectors)
+ normal_vectors[point]=data.contravariant[point][2];
}
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 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<Tensor<2,spacedim> > &jacobians,
std::vector<Tensor<3,spacedim> > &jacobian_grads,
std::vector<Tensor<2,spacedim> > &inverse_jacobians,
- std::vector<Point<spacedim> > &cell_normal_vectors,
+ std::vector<Point<spacedim> > &normal_vectors,
CellSimilarity::Similarity &cell_similarity) const
{
// disable any previously detected
MappingQ1<dim,spacedim>::fill_fe_values (cell, q, mapping_data,
quadrature_points, JxW_values, jacobians,
jacobian_grads, inverse_jacobians,
- cell_normal_vectors, cell_similarity);
+ normal_vectors, cell_similarity);
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 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<Tensor<2,spacedim> > &jacobians,
std::vector<Tensor<3,spacedim> > &jacobian_grads,
std::vector<Tensor<2,spacedim> > &inverse_jacobians,
- std::vector<Point<spacedim> > &cell_normal_vectors,
+ std::vector<Point<spacedim> > &normal_vectors,
CellSimilarity::Similarity &cell_similarity) const
{
// disable any previously detected
MappingQ<dim,spacedim>::fill_fe_values (cell, q, mapping_data,
quadrature_points, JxW_values, jacobians,
jacobian_grads, inverse_jacobians,
- cell_normal_vectors, cell_similarity);
+ normal_vectors, cell_similarity);
}