]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
split template file
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Sep 2011 16:01:55 +0000 (16:01 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Sep 2011 16:01:55 +0000 (16:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@24272 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/meshworker/dof_info.templates.h
deal.II/include/deal.II/meshworker/integration_info.templates.h [new file with mode: 0644]
deal.II/source/numerics/mesh_worker_info.cc

index 35c46d80298f44f27caafe03eeaad0786e74a053..faa56529cea6ac3be81e4011e19682e7c050ad57 100644 (file)
@@ -12,7 +12,6 @@
 
 
 #include <deal.II/meshworker/dof_info.h>
-#include <deal.II/meshworker/integration_info.h>
 #include <deal.II/base/quadrature_lib.h>
 
 DEAL_II_NAMESPACE_OPEN
@@ -74,214 +73,6 @@ namespace MeshWorker
     level_cell = true;
   }
 
-//----------------------------------------------------------------------//
-
-  template<int dim, int sdim>
-  void
-  IntegrationInfo<dim,sdim>::initialize_data(
-    const std_cxx1x::shared_ptr<VectorDataBase<dim,sdim> > &data)
-  {
-    global_data = data;
-    const unsigned int nqp = fevalv[0]->n_quadrature_points;
-
-    values.resize(global_data->n_values());
-//    deallog << "values: " << values.size() << " [";
-                                    // For all selected finite
-                                    // element functions
-    for (unsigned int i=0;i<values.size();++i)
-      {
-       values[i].resize(n_components);
-//     deallog << ' ' << values[i].size() << " {";
-                                        // For all components
-       for (unsigned int j=0;j<values[i].size();++j)
-         {
-           values[i][j].resize(nqp);
-//         deallog << ' ' << values[i][j].size();
-         }
-//     deallog << " }";
-      }
-//    deallog << " ]" << std::endl;
-
-    gradients.resize(global_data->n_gradients());
-                                    // For all selected finite
-                                    // element functions
-    for (unsigned int i=0;i<gradients.size();++i)
-      {
-       gradients[i].resize(n_components);
-                                        // For all components
-       for (unsigned int j=0;j<gradients[i].size();++j)
-         {
-           gradients[i][j].resize(nqp);
-         }
-      }
-
-    hessians.resize(global_data->n_hessians());
-                                    // For all selected finite
-                                    // element functions
-    for (unsigned int i=0;i<hessians.size();++i)
-      {
-       hessians[i].resize(n_components);
-                                        // For all components
-       for (unsigned int j=0;j<hessians[i].size();++j)
-         {
-           hessians[i][j].resize(nqp);
-         }
-      }
-  }
-
-
-  template<int dim, int sdim>
-  void
-  IntegrationInfo<dim,sdim>::clear()
-  {
-    fevalv.resize(0);
-  }
-
-
-
-  template<int dim, int sdim>
-  template <typename number>
-  void
-  IntegrationInfo<dim,sdim>::fill_local_data(const DoFInfo<dim, sdim, number>& info, bool split_fevalues)
-  {
-     if (split_fevalues)
-       {
-       unsigned int comp = 0;
-                                        // Loop over all blocks
-       for (unsigned int b=0;b<info.block_info->local().size();++b)
-         {
-           const unsigned int fe_no = info.block_info->base_element(b);
-           const FEValuesBase<dim,sdim>& fe = this->fe_values(fe_no);
-           const unsigned int n_comp = fe.get_fe().n_components();
-           const unsigned int block_start = info.block_info->local().block_start(b);
-           const unsigned int block_size = info.block_info->local().block_size(b);
-
-            if(info.level_cell)
-           this->global_data->mg_fill(values, gradients, hessians, fe, info.cell->level(), info.indices,
-                                   comp, n_comp, block_start, block_size);
-            else
-           this->global_data->fill(values, gradients, hessians, fe, info.indices,
-                                   comp, n_comp, block_start, block_size);
-           comp += n_comp;
-         }
-       }
-     else
-       {
-        const FEValuesBase<dim,sdim>& fe = this->fe_values(0);
-        const unsigned int n_comp = fe.get_fe().n_components();
-         if(info.level_cell)
-        this->global_data->mg_fill(values, gradients, hessians, fe, info.cell->level(), info.indices,
-                                0, n_comp, 0, info.indices.size());
-         else
-        this->global_data->fill(values, gradients, hessians, fe, info.indices,
-                                0, n_comp, 0, info.indices.size());
-       }
-  }
-
-
-  template<int dim, int sdim>
-  std::size_t
-  IntegrationInfo<dim,sdim>::memory_consumption () const
-  {
-    std::size_t mem = sizeof(*this)
-                     + MemoryConsumption::memory_consumption(fevalv)
-                     - sizeof (fevalv);
-    for (unsigned int i=0;i<fevalv.size();++i)
-      mem += fevalv[i]->memory_consumption();
-    return mem;
-  }
-  
-//----------------------------------------------------------------------//
-
-  template<int dim, int sdim>
-  IntegrationInfoBox<dim,sdim>::IntegrationInfoBox()
-  {
-    cell_flags = update_default;
-    boundary_flags = update_default;
-    face_flags = update_default;
-    neighbor_flags = update_default;
-  }
-  
-
-  template<int dim, int sdim>
-  void
-  IntegrationInfoBox<dim,sdim>::initialize_update_flags ()
-  {
-    cell_flags |= update_JxW_values;
-    boundary_flags |= UpdateFlags(update_JxW_values | update_normal_vectors);
-    face_flags |= boundary_flags;
-    neighbor_flags |= update_default;
-
-    if (cell_selector.has_values() != 0) cell_flags |= update_values;
-    if (cell_selector.has_gradients() != 0) cell_flags |= update_gradients;
-    if (cell_selector.has_hessians() != 0) cell_flags |= update_hessians;
-
-    if (boundary_selector.has_values() != 0) boundary_flags |= update_values;
-    if (boundary_selector.has_gradients() != 0) boundary_flags |= update_gradients;
-    if (boundary_selector.has_hessians() != 0) boundary_flags |= update_hessians;
-
-    if (face_selector.has_values() != 0) face_flags |= update_values;
-    if (face_selector.has_gradients() != 0) face_flags |= update_gradients;
-    if (face_selector.has_hessians() != 0) face_flags |= update_hessians;
-
-    if (face_selector.has_values() != 0) neighbor_flags |= update_values;
-    if (face_selector.has_gradients() != 0) neighbor_flags |= update_gradients;
-    if (face_selector.has_hessians() != 0) neighbor_flags |= update_hessians;
-  }
-
-
-  template <int dim, int sdim>
-  void
-  IntegrationInfoBox<dim,sdim>::add_update_flags(
-    const UpdateFlags flags,
-    bool cell,
-    bool boundary,
-    bool face,
-    bool neighbor)
-  {
-    if (cell) cell_flags |= flags;
-    if (boundary) boundary_flags |= flags;
-    if (face) face_flags |= flags;
-    if (neighbor) neighbor_flags |= flags;
-  }
-
-  
-  template<int dim, int sdim>
-  std::size_t
-  IntegrationInfoBox<dim,sdim>::memory_consumption () const
-  {
-    std::size_t mem = sizeof(*this)
-                     + MemoryConsumption::memory_consumption(cell_quadrature)
-                     - sizeof (cell_quadrature)
-                     + MemoryConsumption::memory_consumption(boundary_quadrature)
-                     - sizeof (boundary_quadrature)
-                     + MemoryConsumption::memory_consumption(face_quadrature)
-                     - sizeof (face_quadrature)
-                     + MemoryConsumption::memory_consumption(cell_selector)
-                     -sizeof (cell_selector)
-                     + MemoryConsumption::memory_consumption(boundary_selector)
-                     -sizeof (boundary_selector)
-                     + MemoryConsumption::memory_consumption(face_selector)
-                     -sizeof (face_selector)
-                     + MemoryConsumption::memory_consumption(cell)
-                     - sizeof(cell)
-                     + MemoryConsumption::memory_consumption(boundary)
-                     - sizeof(boundary)
-                     + MemoryConsumption::memory_consumption(face)
-                     - sizeof(face)
-                     + MemoryConsumption::memory_consumption(subface)
-                     - sizeof(subface)
-                     + MemoryConsumption::memory_consumption(neighbor)
-                     - sizeof(neighbor);
-//   if (cell_data != 0)
-//     mem += MemoryConsumption::memory_consumption(*cell_data);
-//   if (boundary_data != 0)
-//     mem += MemoryConsumption::memory_consumption(*boundary_data);
-//   if (face_data != 0)
-//     mem += MemoryConsumption::memory_consumption(*face_data);
-    
-    return mem;
-  }
 }
 
 
diff --git a/deal.II/include/deal.II/meshworker/integration_info.templates.h b/deal.II/include/deal.II/meshworker/integration_info.templates.h
new file mode 100644 (file)
index 0000000..61cebd8
--- /dev/null
@@ -0,0 +1,233 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//
+//    Copyright (C) 2009, 2010, 2011 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+#include <deal.II/meshworker/dof_info.h>
+#include <deal.II/meshworker/integration_info.h>
+#include <deal.II/base/quadrature_lib.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+
+namespace MeshWorker
+{
+  template<int dim, int sdim>
+  void
+  IntegrationInfo<dim,sdim>::initialize_data(
+    const std_cxx1x::shared_ptr<VectorDataBase<dim,sdim> > &data)
+  {
+    global_data = data;
+    const unsigned int nqp = fevalv[0]->n_quadrature_points;
+
+    values.resize(global_data->n_values());
+//    deallog << "values: " << values.size() << " [";
+                                    // For all selected finite
+                                    // element functions
+    for (unsigned int i=0;i<values.size();++i)
+      {
+       values[i].resize(n_components);
+//     deallog << ' ' << values[i].size() << " {";
+                                        // For all components
+       for (unsigned int j=0;j<values[i].size();++j)
+         {
+           values[i][j].resize(nqp);
+//         deallog << ' ' << values[i][j].size();
+         }
+//     deallog << " }";
+      }
+//    deallog << " ]" << std::endl;
+
+    gradients.resize(global_data->n_gradients());
+                                    // For all selected finite
+                                    // element functions
+    for (unsigned int i=0;i<gradients.size();++i)
+      {
+       gradients[i].resize(n_components);
+                                        // For all components
+       for (unsigned int j=0;j<gradients[i].size();++j)
+         {
+           gradients[i][j].resize(nqp);
+         }
+      }
+
+    hessians.resize(global_data->n_hessians());
+                                    // For all selected finite
+                                    // element functions
+    for (unsigned int i=0;i<hessians.size();++i)
+      {
+       hessians[i].resize(n_components);
+                                        // For all components
+       for (unsigned int j=0;j<hessians[i].size();++j)
+         {
+           hessians[i][j].resize(nqp);
+         }
+      }
+  }
+
+
+  template<int dim, int sdim>
+  void
+  IntegrationInfo<dim,sdim>::clear()
+  {
+    fevalv.resize(0);
+  }
+
+
+
+  template<int dim, int sdim>
+  template <typename number>
+  void
+  IntegrationInfo<dim,sdim>::fill_local_data(const DoFInfo<dim, sdim, number>& info, bool split_fevalues)
+  {
+     if (split_fevalues)
+       {
+       unsigned int comp = 0;
+                                        // Loop over all blocks
+       for (unsigned int b=0;b<info.block_info->local().size();++b)
+         {
+           const unsigned int fe_no = info.block_info->base_element(b);
+           const FEValuesBase<dim,sdim>& fe = this->fe_values(fe_no);
+           const unsigned int n_comp = fe.get_fe().n_components();
+           const unsigned int block_start = info.block_info->local().block_start(b);
+           const unsigned int block_size = info.block_info->local().block_size(b);
+
+            if(info.level_cell)
+           this->global_data->mg_fill(values, gradients, hessians, fe, info.cell->level(), info.indices,
+                                   comp, n_comp, block_start, block_size);
+            else
+           this->global_data->fill(values, gradients, hessians, fe, info.indices,
+                                   comp, n_comp, block_start, block_size);
+           comp += n_comp;
+         }
+       }
+     else
+       {
+        const FEValuesBase<dim,sdim>& fe = this->fe_values(0);
+        const unsigned int n_comp = fe.get_fe().n_components();
+         if(info.level_cell)
+        this->global_data->mg_fill(values, gradients, hessians, fe, info.cell->level(), info.indices,
+                                0, n_comp, 0, info.indices.size());
+         else
+        this->global_data->fill(values, gradients, hessians, fe, info.indices,
+                                0, n_comp, 0, info.indices.size());
+       }
+  }
+
+
+  template<int dim, int sdim>
+  std::size_t
+  IntegrationInfo<dim,sdim>::memory_consumption () const
+  {
+    std::size_t mem = sizeof(*this)
+                     + MemoryConsumption::memory_consumption(fevalv)
+                     - sizeof (fevalv);
+    for (unsigned int i=0;i<fevalv.size();++i)
+      mem += fevalv[i]->memory_consumption();
+    return mem;
+  }
+  
+//----------------------------------------------------------------------//
+
+  template<int dim, int sdim>
+  IntegrationInfoBox<dim,sdim>::IntegrationInfoBox()
+  {
+    cell_flags = update_default;
+    boundary_flags = update_default;
+    face_flags = update_default;
+    neighbor_flags = update_default;
+  }
+  
+
+  template<int dim, int sdim>
+  void
+  IntegrationInfoBox<dim,sdim>::initialize_update_flags ()
+  {
+    cell_flags |= update_JxW_values;
+    boundary_flags |= UpdateFlags(update_JxW_values | update_normal_vectors);
+    face_flags |= boundary_flags;
+    neighbor_flags |= update_default;
+
+    if (cell_selector.has_values() != 0) cell_flags |= update_values;
+    if (cell_selector.has_gradients() != 0) cell_flags |= update_gradients;
+    if (cell_selector.has_hessians() != 0) cell_flags |= update_hessians;
+
+    if (boundary_selector.has_values() != 0) boundary_flags |= update_values;
+    if (boundary_selector.has_gradients() != 0) boundary_flags |= update_gradients;
+    if (boundary_selector.has_hessians() != 0) boundary_flags |= update_hessians;
+
+    if (face_selector.has_values() != 0) face_flags |= update_values;
+    if (face_selector.has_gradients() != 0) face_flags |= update_gradients;
+    if (face_selector.has_hessians() != 0) face_flags |= update_hessians;
+
+    if (face_selector.has_values() != 0) neighbor_flags |= update_values;
+    if (face_selector.has_gradients() != 0) neighbor_flags |= update_gradients;
+    if (face_selector.has_hessians() != 0) neighbor_flags |= update_hessians;
+  }
+
+
+  template <int dim, int sdim>
+  void
+  IntegrationInfoBox<dim,sdim>::add_update_flags(
+    const UpdateFlags flags,
+    bool cell,
+    bool boundary,
+    bool face,
+    bool neighbor)
+  {
+    if (cell) cell_flags |= flags;
+    if (boundary) boundary_flags |= flags;
+    if (face) face_flags |= flags;
+    if (neighbor) neighbor_flags |= flags;
+  }
+
+  
+  template<int dim, int sdim>
+  std::size_t
+  IntegrationInfoBox<dim,sdim>::memory_consumption () const
+  {
+    std::size_t mem = sizeof(*this)
+                     + MemoryConsumption::memory_consumption(cell_quadrature)
+                     - sizeof (cell_quadrature)
+                     + MemoryConsumption::memory_consumption(boundary_quadrature)
+                     - sizeof (boundary_quadrature)
+                     + MemoryConsumption::memory_consumption(face_quadrature)
+                     - sizeof (face_quadrature)
+                     + MemoryConsumption::memory_consumption(cell_selector)
+                     -sizeof (cell_selector)
+                     + MemoryConsumption::memory_consumption(boundary_selector)
+                     -sizeof (boundary_selector)
+                     + MemoryConsumption::memory_consumption(face_selector)
+                     -sizeof (face_selector)
+                     + MemoryConsumption::memory_consumption(cell)
+                     - sizeof(cell)
+                     + MemoryConsumption::memory_consumption(boundary)
+                     - sizeof(boundary)
+                     + MemoryConsumption::memory_consumption(face)
+                     - sizeof(face)
+                     + MemoryConsumption::memory_consumption(subface)
+                     - sizeof(subface)
+                     + MemoryConsumption::memory_consumption(neighbor)
+                     - sizeof(neighbor);
+//   if (cell_data != 0)
+//     mem += MemoryConsumption::memory_consumption(*cell_data);
+//   if (boundary_data != 0)
+//     mem += MemoryConsumption::memory_consumption(*boundary_data);
+//   if (face_data != 0)
+//     mem += MemoryConsumption::memory_consumption(*face_data);
+    
+    return mem;
+  }
+}
+
+
+DEAL_II_NAMESPACE_CLOSE
+
index 462bd9875e15969279310369b947554611ad54cb..30eaf03b1259902ebe9246cf8f02f7e30fe195b4 100644 (file)
@@ -19,6 +19,7 @@
 #include <deal.II/lac/trilinos_block_vector.h>
 
 #include <deal.II/meshworker/dof_info.templates.h>
+#include <deal.II/meshworker/integration_info.templates.h>
 
 DEAL_II_NAMESPACE_OPEN
 

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.