]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
TensorProductPolynomials keep their own copy of Polynomials.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 7 Mar 2001 10:46:23 +0000 (10:46 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 7 Mar 2001 10:46:23 +0000 (10:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@4138 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_dgq.h
deal.II/deal.II/include/fe/fe_q.h
deal.II/deal.II/include/fe/mapping_q.h
deal.II/deal.II/source/fe/fe_dgq.cc
deal.II/deal.II/source/fe/fe_q.cc
deal.II/deal.II/source/fe/mapping_q.cc

index 2f4f473f129885f14640cfc79119e43d4222a7cc..ff2e01d6fa9e56adb16c88a318d254ef70571de9 100644 (file)
@@ -188,14 +188,8 @@ class FE_DGQ : public FiniteElement<dim>
     const unsigned int degree;
 
                                     /**
-                                     * Vector of one-dimensional
-                                     * polynomials used.
-                                     */
-    std::vector<Polynomial<double> > polynomials;
-
-                                    /**
-                                     * Implementation of the tensor
-                                     * product of polynomials.
+                                     * Pointer to the tensor
+                                     * product polynomials.
                                      */
     TensorProductPolynomials<dim>* poly;
 
index 1d65c0b48697b8f961691ad7b3ce7fa620cac5b5..4314c96e47d060e9cef3597a04e83c48fb35914e 100644 (file)
@@ -263,16 +263,10 @@ class FE_Q : public FiniteElement<dim>
                                      * shape function numbering on first face.
                                      */
     std::vector<unsigned int> face_renumber;
-    
-                                    /**
-                                     * Vector of one-dimensional
-                                     * polynomials used.
-                                     */
-    std::vector<LagrangeEquidistant> polynomials;
 
                                     /**
-                                     * Implementation of the tensor
-                                     * product of polynomials.
+                                     * Pointer to the tensor
+                                     * product polynomials.
                                      */
     TensorProductPolynomials<dim>* poly;
 
index 2874fae674a5bb9b0c6a92a3f5f0b9fa98473009..fd0f76c5b1f9f6c8656b1c4007fe21e49a258335 100644 (file)
@@ -426,15 +426,6 @@ class MappingQ : public MappingQ1<dim>
                                      */
     const unsigned int n_outer;
     
-    
-                                    /**
-                                     * Vector of one-dimensional
-                                     * polynomials used as shape
-                                     * functions for the Qp mapping
-                                     * of cell at the boundary.
-                                     */
-    std::vector<LagrangeEquidistant> polynomials;
-
                                     /**
                                      * Pointer to the
                                      * @p{dim}-dimensional tensor
index 2250f1a0590e9461ed40d351f431c1f38991f242..9e9c75693b495d62c9f09e00527cde528f8357d8 100644 (file)
@@ -52,31 +52,25 @@ FE_DGQ<dim>::InternalData::~InternalData ()
 
 
 template <int dim>
-FE_DGQ<dim>::FE_DGQ (unsigned int degree)
-               :
+FE_DGQ<dim>::FE_DGQ (unsigned int degree):
                FiniteElement<dim> (FiniteElementData<dim>(get_dpo_vector(degree),1), dummy),
                                      degree(degree),
-                                     polynomials(degree+1),
                                      poly(0)
 {
-  std::vector<SmartPointer<Polynomial<double> > > v(degree+1);
   if (degree==0)
     {
-      std::vector<double> coeff(1);
-      coeff[0] = 1.;
-      polynomials[0] = Polynomial<double> (coeff);
-      v[0] = &(polynomials[0]);
-    } else {
+      std::vector<Polynomial<double> > v(
+       1, Polynomial<double> (std::vector<double> (1,1.)));
+      poly = new TensorProductPolynomials<dim> (v);
+    }
+  else
+    {
+      std::vector<LagrangeEquidistant> v;
       for (unsigned int i=0;i<=degree;++i)
-       {
-         LagrangeEquidistant p(degree, i);
-         polynomials[i] = p;
-         v[i] = &(polynomials[i]);
-       }
+       v.push_back(LagrangeEquidistant(degree,i));
+      poly = new TensorProductPolynomials<dim> (v);
     }
   
-  poly = new TensorProductPolynomials<dim> (v);
-
   Assert (degree <= 10, ExcNotImplemented());
   
   std::vector<unsigned int> right;
index 7b7fffb3fddd9766240aeead24a2fac0a48d32d4..a1f585675a542e899b46eb196fa3a4666df41bda 100644 (file)
@@ -47,15 +47,11 @@ FE_Q<dim>::FE_Q (unsigned int degree)
                degree(degree),
                renumber(dofs_per_cell, 0),
                face_renumber(dofs_per_face, 0),
-               polynomials(degree+1),
                poly(0)
 {
-  std::vector<SmartPointer<Polynomial<double> > > v(degree+1);
+  std::vector<LagrangeEquidistant> v;
   for (unsigned int i=0;i<=degree;++i)
-    {
-      polynomials[i] = LagrangeEquidistant(degree,i);
-      v[i] = &(polynomials[i]);
-    };
+    v.push_back(LagrangeEquidistant(degree,i));
   
   poly = new TensorProductPolynomials<dim> (v);
   build_renumbering (*this, degree, renumber);
index 1ce783904371c6bebe6268b86b4b5b13231dc26d..04b73b163f6b038bd7233c3b123b53173c3ce742 100644 (file)
@@ -45,7 +45,6 @@ MappingQ<1>::MappingQ (unsigned int):
                degree(1),
                n_inner(0),
                n_outer(0),
-               polynomials(0),
                tensor_pols(0),
                n_shape_functions(2),
                renumber(0),
@@ -80,7 +79,6 @@ MappingQ<dim>::MappingQ (unsigned int p):
                n_inner(power(degree-1, dim)),
                n_outer((dim==2) ? 4+4*(degree-1)
                        :8+12*(degree-1)+6*(degree-1)*(degree-1)),
-               polynomials(p+1),
                tensor_pols(0),
                n_shape_functions(0),
                renumber(0),
@@ -91,14 +89,11 @@ MappingQ<dim>::MappingQ (unsigned int p):
                                   // polynomials used as shape
                                   // functions for the Qp mapping of
                                   // cells at the boundary.
-  std::vector<SmartPointer<Polynomial<double> > > pol_pointers(p+1);
-  for (unsigned int i=0; i<=p; ++i)
-    {
-      LagrangeEquidistant lagrange_pol(p, i);
-      polynomials[i] = lagrange_pol;
-      pol_pointers[i] = &(polynomials[i]);
-    }
-  tensor_pols = new TensorProductPolynomials<dim> (pol_pointers);
+  std::vector<LagrangeEquidistant> v;
+  for (unsigned int i=0;i<=degree;++i)
+    v.push_back(LagrangeEquidistant(degree,i));
+
+  tensor_pols = new TensorProductPolynomials<dim> (v);
   n_shape_functions=tensor_pols->n_tensor_product_polynomials();
   Assert(n_inner+n_outer==n_shape_functions, ExcInternalError());
   

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.