]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust the interfaces of all the collection classes to be similar, including the...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 21:14:28 +0000 (21:14 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 21:14:28 +0000 (21:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@12482 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_collection.h
deal.II/deal.II/include/fe/mapping_collection.h
deal.II/deal.II/include/fe/q_collection.h
deal.II/deal.II/source/fe/fe_collection.cc
deal.II/deal.II/source/fe/q_collection.cc

index 10e18bdc79cfb19b2e1c2426972e1afa01da5b44..7c9b5cffa6f5ed465b862ac5f5e89cb5273fa5f0 100644 (file)
@@ -43,6 +43,32 @@ namespace hp
   class FECollection : public Subscriptor
   {
     public:
+                                       /**
+                                        * Default constructor. Leads
+                                        * to an empty collection that
+                                        * can later be filled using
+                                        * push_back().
+                                        */
+      FECollection ();
+
+                                       /**
+                                        * Conversion constructor. This
+                                        * constructor creates a
+                                        * FECollection from a single
+                                        * finite element. More finite
+                                        * element objects can be added
+                                        * with push_back(), if
+                                        * desired, though it would
+                                        * probably be clearer to add
+                                        * all mappings the same way.
+                                        */
+      FECollection (const FiniteElement<dim> &fe);
+
+                                       /**
+                                        * Copy constructor.
+                                        */
+      FECollection (const FECollection<dim> &fe_collection);
+
                                        /**
                                         * Add a finite element. This
                                         * function generates a copy of
index 94c2198ce4198fe155447bd45980f2f01f5ef704..6b3ea115c584bd2c02d01134531719f169fa92e0 100644 (file)
@@ -54,8 +54,10 @@ namespace hp
   {
     public:
                                        /**
-                                        * Default constructor. Initialises
-                                        * this MappingCollection.
+                                        * Default constructor. Leads
+                                        * to an empty collection that
+                                        * can later be filled using
+                                        * push_back().
                                         */
       MappingCollection ();
 
index ede19a556ba10309ce2eb31409983cc8d26a6b2d..c16a7479f18b01d50ec31369d435183bd84a0da1 100644 (file)
@@ -46,21 +46,31 @@ namespace hp
   {
     public:
                                        /**
-                                        * Default constructor. Initialises
-                                        * this QCollection.
+                                        * Default constructor. Leads
+                                        * to an empty collection that
+                                        * can later be filled using
+                                        * push_back().
                                         */
       QCollection ();
 
                                        /**
                                         * Conversion constructor. This
-                                        * constructor creates a QCollection
-                                        * from a single quadrature rule. In
-                                        * the newly created QCollection, this
-                                        * quadrature is used for all active_fe
-                                        * indices.
+                                        * constructor creates a
+                                        * QCollection from a single
+                                        * quadrature rule. More
+                                        * quadrature formulas can be
+                                        * added with push_back(), if
+                                        * desired, though it would
+                                        * probably be clearer to add
+                                        * all mappings the same way.
                                         */
       QCollection (const Quadrature<dim> &quadrature);
 
+                                       /**
+                                        * Copy constructor.
+                                        */
+      QCollection (const QCollection<dim> &q_collection);
+
                                        /**
                                         * Adds a new quadrature rule
                                         * to the QCollection.  The
index 17f6dc310b64cc1aee59f343235d55a6b84f0d8a..ef885c58d3f5a23f9d823a4967ffa45a03522a32 100644 (file)
 
 namespace hp
 {
+  template <int dim>
+  FECollection<dim>::FECollection ()
+  {}
+  
+
+  
+  template <int dim>
+  FECollection<dim>::FECollection (const FiniteElement<dim> &fe)
+  {
+    push_back (fe);
+  }
+  
+
+  
+  template <int dim>
+  FECollection<dim>::
+  FECollection (const FECollection<dim> &fe_collection)
+                  :
+                  Subscriptor (),
+                                                   // copy the array
+                                                   // of shared
+                                                   // pointers. nothing
+                                                   // bad should
+                                                   // happen -- they
+                                                   // simply all point
+                                                   // to the same
+                                                   // objects, and the
+                                                   // last one to die
+                                                   // will delete the
+                                                   // mappings
+                  finite_elements (fe_collection.finite_elements)
+  {}
+
+
+
   template <int dim>
   void FECollection<dim>::push_back (const FiniteElement<dim> &new_fe)
   {
index 384fed1e12f0ba48879773c464faa01093988110..29332fbd66abd3cd4b71355530b572e25f7d2ca6 100644 (file)
@@ -39,7 +39,28 @@ namespace hp
   
 
   template <int dim>
-  inline
+  QCollection<dim>::
+  QCollection (const QCollection<dim> &q_collection)
+                  :
+                  Subscriptor (),
+                                                   // copy the array
+                                                   // of shared
+                                                   // pointers. nothing
+                                                   // bad should
+                                                   // happen -- they
+                                                   // simply all point
+                                                   // to the same
+                                                   // objects, and the
+                                                   // last one to die
+                                                   // will delete the
+                                                   // mappings
+                  quadratures (q_collection.quadratures),
+                 single_quadrature (true)
+  {}
+
+
+
+  template <int dim>
   const Quadrature<dim> &
   QCollection<dim>::operator[] (const unsigned int index) const
   {

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.