]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make the flag that determines whether to use higher order mappings also on internal...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Feb 2008 20:43:14 +0000 (20:43 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 5 Feb 2008 20:43:14 +0000 (20:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@15711 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/mapping_q.h
deal.II/deal.II/source/fe/mapping_q.cc
deal.II/doc/news/changes.h

index 021e94ccca40f36370fd9a7975f35728cff95dad..bbe8299fde07c46d57f6a35c4388f9039a2e8055 100644 (file)
@@ -2,7 +2,7 @@
 //    $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
@@ -45,8 +45,30 @@ class MappingQ : public MappingQ1<dim>
                                      * 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
@@ -512,16 +534,8 @@ class MappingQ : public MappingQ1<dim>
                                      * 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;
 };
 
 /*@}*/
@@ -530,7 +544,8 @@ class MappingQ : public MappingQ1<dim>
 
 #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,
index 1c5a3f210d1f5ce3fe82312726b1adf1fdd5daba..0a9b3778419850b7471662b8045c3cda9a713eb2 100644 (file)
 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;
 }
@@ -65,25 +61,28 @@ MappingQ<dim>::InternalData::memory_consumption () const
 // 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)
 {}
 
 
@@ -96,7 +95,8 @@ MappingQ<1>::~MappingQ ()
 
 
 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)),
@@ -104,7 +104,8 @@ MappingQ<dim>::MappingQ (const unsigned int p)
                        :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
@@ -150,14 +151,16 @@ MappingQ<dim>::MappingQ (const unsigned int p)
 
 
 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;
index fdf6ac255c60ed45f52636d038b8a85f63392265..0fb045ad8d31f14cbc7010d75a11c425423c31f0 100644 (file)
@@ -233,6 +233,14 @@ constraints individually.
 
 <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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.