// $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, 2008 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* Constructor. @p p gives the
* degree of mapping polynomials
* on boundary cells.
- */
- MappingQ (const unsigned int p);
+ *
+ * The second argument determines
+ * whether the higher order
+ * mapping should also be used on
+ * interior cells. If its value
+ * is <code>false</code> (the
+ * default), the a lower-order
+ * mapping is used in the
+ * interior. This is sufficient
+ * for most cases where higher
+ * order mappings are only used
+ * to better approximate the
+ * boundary. In that case, cells
+ * bounded by straight lines are
+ * acceptable in the
+ * interior. However, there are
+ * cases where one would also
+ * like to use a higher order
+ * mapping in the interior. The
+ * MappingQEulerian class is one
+ * such case.
+ */
+ MappingQ (const unsigned int p,
+ const bool use_mapping_q_on_all_cells = false);
/**
* Copy constructor. Performs a
* then @p MappingQ is used on
* all cells, not only on
* boundary cells.
- *
- * The default value is false.
- *
- * This flag is kept in the
- * implementation to allow a fast
- * switch between the two cases,
- * as someone might want to do
- * some comparative tests.
*/
- static const bool use_mapping_q_on_all_cells = false;
+ const bool use_mapping_q_on_all_cells;
};
/*@}*/
#ifndef DOXYGEN
-template<> MappingQ<1>::MappingQ (const unsigned int);
+template<> MappingQ<1>::MappingQ (const unsigned int,
+ const bool);
template<> MappingQ<1>::~MappingQ ();
template<> void MappingQ<1>::compute_shapes_virtual (
const std::vector<Point<1> > &unit_points,
DEAL_II_NAMESPACE_OPEN
-template <int dim>
-const bool MappingQ<dim>::use_mapping_q_on_all_cells;
-
-
template<int dim>
MappingQ<dim>::InternalData::InternalData (const unsigned int n_shape_functions)
:
MappingQ1<dim>::InternalData(n_shape_functions),
- use_mapping_q1_on_current_cell(false),
- mapping_q1_data(1 << dim)
+ use_mapping_q1_on_current_cell(false),
+ mapping_q1_data(1 << dim)
{
this->is_mapping_q1_data=false;
}
// in 1d, it is irrelevant which polynomial degree to use, since all
// cells are scaled linearly
template<>
-MappingQ<1>::MappingQ (const unsigned int):
+MappingQ<1>::MappingQ (const unsigned int,
+ const bool use_mapping_q_on_all_cells):
degree(1),
n_inner(0),
n_outer(0),
tensor_pols(0),
n_shape_functions(2),
- renumber(0)
+ renumber(0),
+ use_mapping_q_on_all_cells (false)
{}
template<>
-MappingQ<1>::MappingQ (const MappingQ<1> &):
+MappingQ<1>::MappingQ (const MappingQ<1> &m):
MappingQ1<1> (),
degree(1),
n_inner(0),
n_outer(0),
tensor_pols(0),
n_shape_functions(2),
- renumber(0)
+ renumber(0),
+ use_mapping_q_on_all_cells (m.use_mapping_q_on_all_cells)
{}
template<int dim>
-MappingQ<dim>::MappingQ (const unsigned int p)
+MappingQ<dim>::MappingQ (const unsigned int p,
+ const bool use_mapping_q_on_all_cells)
:
degree(p),
n_inner(Utilities::fixed_power<dim>(degree-1)),
:8+12*(degree-1)+6*(degree-1)*(degree-1)),
tensor_pols(0),
n_shape_functions(Utilities::fixed_power<dim>(degree+1)),
- renumber(0)
+ renumber(0),
+ use_mapping_q_on_all_cells (use_mapping_q_on_all_cells)
{
// Construct the tensor product
// polynomials used as shape
template<int dim>
-MappingQ<dim>::MappingQ (const MappingQ<dim> &mapping):
+MappingQ<dim>::MappingQ (const MappingQ<dim> &mapping)
+ :
MappingQ1<dim>(),
- degree(mapping.degree),
- n_inner(mapping.n_inner),
- n_outer(n_outer),
- tensor_pols(0),
- n_shape_functions(mapping.n_shape_functions),
- renumber(mapping.renumber)
+ degree(mapping.degree),
+ n_inner(mapping.n_inner),
+ n_outer(n_outer),
+ tensor_pols(0),
+ n_shape_functions(mapping.n_shape_functions),
+ renumber(mapping.renumber),
+ use_mapping_q_on_all_cells (mapping.use_mapping_q_on_all_cells)
{
tensor_pols=new TensorProductPolynomials<dim> (*mapping.tensor_pols);
laplace_on_quad_vector=mapping.laplace_on_quad_vector;
<ol>
+ <li> <p>New: The MappingQ class constructor now takes a parameter that determines
+ whether a higher order mapping should also be used for interior cells. By default,
+ the higher order mapping is only used for cells on the boundary; cells in the
+ interior are bounded by straight edges described by a (bi-, tri-)linear mapping.
+ <br>
+ (WB 2008/02/05)
+ </p></li>
+
<li> <p>New: The function VectorTools::compute_no_normal_flux_constraints computes
the constraints that correspond to boundary conditions of the
form $\vec u \cdot \vec n = 0$. The use of the function is demonstrated in the