]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Take over the relevant changes from the main branch.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 19 Dec 2000 16:24:22 +0000 (16:24 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 19 Dec 2000 16:24:22 +0000 (16:24 +0000)
git-svn-id: https://svn.dealii.org/branches/Branch-3-1@3581 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/Makefile
deal.II/deal.II/include/grid/geometry_info.h
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/grid/tria.cc

index 4c6c766795fd967360096edb5274b3942f3d0705..a6d1912e9fe0f2603e291bf1f87a41498953d440 100644 (file)
@@ -76,20 +76,20 @@ endif
 
 
 lib/libbase.a: $(forward-declarations) $(o-files)
-       @echo =====base=============debug=====$(MT)== Linking library:   $@
+       @echo =====base=============debug======$(MT)== Linking library:   $@
        @ar ruv $@ $(o-files)
 
 lib/libbase.g.a: $(forward-declarations) $(go-files)
-       @echo =====base=============optimized=$(MT)== Linking library:   $@
+       @echo =====base=============optimized==$(MT)== Linking library:   $@
        @ar ruv $@ $(go-files)
 
 
 lib/libbase.so: $(forward-declarations) $(o-files)
-       @echo =====base=============optimized=$(MT)== Linking library:   $@
+       @echo =====base=============optimized==$(MT)== Linking library:   $@
        @$(CC) $(CXXFLAGS.o) -shared -o $@ $(o-files)
 
 lib/libbase.g.so: $(forward-declarations) $(go-files)
-       @echo =====base=============debug=====$(MT)== Linking library:   $@
+       @echo =====base=============debug======$(MT)== Linking library:   $@
        @$(CC) $(CXXFLAGS.g) -shared -o $@ $(go-files)
 
 
index 5e29548f95bb597a6edad9bbc123a6ece5d9b012..008ccb3e38b5895aae7a95afc577be91d766c4d9 100644 (file)
@@ -24,7 +24,7 @@
  * This class contains as static members information on vertices and
  * faces of a @p{dim}-dimensional grid cell. The interface is the same
  * for all dimensions. If a value is of no use in a low dimensional
- * cell, it is (correctly) set to zero, e.g. @p{sub_faces_per_cell} in
+ * cell, it is (correctly) set to zero, e.g. @p{subfaces_per_cell} in
  * 1d.
  *
  * This information should always replace hard-coded numbers of
index 1a9d46969b4b110820a5f20e30bb987c62cf9388..6e9f8de5ca2cf9a34b89a2b85ea4d13f39583f2c 100644 (file)
@@ -1050,8 +1050,7 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
                     n_fine_dofs   = fine_grid.n_dofs();
 
                                   // local numbers of dofs
-  const unsigned int coarse_dofs_per_cell = coarse_fe.dofs_per_cell,
-                    fine_dofs_per_cell   = fine_fe.dofs_per_cell;
+  const unsigned int fine_dofs_per_cell   = fine_fe.dofs_per_cell;
 
                                   // alias the number of dofs per
                                   // cell belonging to the
@@ -1152,7 +1151,7 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
                                       // to true if this is an
                                       // interesting dof. finally count
                                       // how many true's there
-      vector<bool>          dof_is_interesting (fine_grid.n_dofs(), false);
+      vector<bool> dof_is_interesting (fine_grid.n_dofs(), false);
       vector<unsigned int>  local_dof_indices (fine_fe.dofs_per_cell);
       
       for (DoFHandler<dim>::active_cell_iterator cell=fine_grid.begin_active();
@@ -1165,10 +1164,23 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
        };
 
       n_parameters_on_fine_grid = count (dof_is_interesting.begin(),
-                                           dof_is_interesting.end(),
-                                           true);
+                                        dof_is_interesting.end(),
+                                        true);
     };
 
+                                  // get an array in which we store
+                                  // which dof on the coarse grid is
+                                  // a parameter and which is not
+  vector<bool> coarse_dof_is_parameter (coarse_grid.n_dofs());
+  if (true)
+    {
+      vector<bool> mask (coarse_grid.get_fe().n_components(),
+                        false);
+      mask[coarse_component] = true;
+      extract_dofs (coarse_grid, mask, coarse_dof_is_parameter);
+    };
+  
+  
 
                                   // store the weights with which a dof
                                   // on the parameter grid contributes
@@ -1203,13 +1215,6 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
                                   // set up this mapping
   if (true)
     {
-                                      // list of local dof numbers
-                                      // belonging to the parameter
-                                      // part of the FE on the fine grid
-      vector<unsigned int> parameter_dofs;
-      for (unsigned int i=0; i<coarse_dofs_per_cell; ++i)
-       parameter_dofs.push_back(fine_fe.component_to_system_index(coarse_component,i));
-
       vector<unsigned int> local_dof_indices(fine_fe.dofs_per_cell);
       unsigned int next_free_index=0;
       for (typename DoFHandler<dim>::active_cell_iterator cell=fine_grid.begin_active();
@@ -1232,7 +1237,7 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
       Assert (next_free_index == n_parameters_on_fine_grid,
              ExcInternalError());
     };
-  
+
   
                                   // for each cell on the parameter grid:
                                   // find out which degrees of freedom on the
@@ -1250,7 +1255,6 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
                             coarse_to_fine_grid_map, parameter_dofs,
                             weight_mapping, weights);
 
-  
                                   // ok, now we have all weights for each
                                   // dof on the fine grid. if in debug
                                   // mode lets see if everything went smooth,
@@ -1305,28 +1309,40 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
                                   // possibly others)
   vector<int> representants(weights.m(), -1);
   for (unsigned int parameter_dof=0; parameter_dof<weights.m(); ++parameter_dof)
-    {
-      unsigned int column=0;
-      for (; column<weights.n(); ++column)
-       if (weights(parameter_dof,column) == 1)
-         break;
-      Assert (column < weights.n(), ExcInternalError());
-
-                                      // now we know in which column of
-                                      // weights the representant is, but
-                                      // we don't know its global index. get
-                                      // it using the inverse operation of
-                                      // the weight_mapping
-      unsigned int global_dof=0;
-      for (; global_dof<weight_mapping.size(); ++global_dof)
-       if (weight_mapping[global_dof] == static_cast<int>(column))
-         break;
-      Assert (global_dof < weight_mapping.size(), ExcInternalError());
-
-                                      // now enter the representants global
-                                      // index into our list
-      representants[parameter_dof] = global_dof;
-    };
+    if (coarse_dof_is_parameter[parameter_dof] == true)
+      {
+       unsigned int column=0;
+       for (; column<weights.n(); ++column)
+         if (weights(parameter_dof,column) == 1)
+           break;
+       Assert (column < weights.n(), ExcInternalError());
+       
+                                        // now we know in which column of
+                                        // weights the representant is, but
+                                        // we don't know its global index. get
+                                        // it using the inverse operation of
+                                        // the weight_mapping
+       unsigned int global_dof=0;
+       for (; global_dof<weight_mapping.size(); ++global_dof)
+         if (weight_mapping[global_dof] == static_cast<int>(column))
+           break;
+       Assert (global_dof < weight_mapping.size(), ExcInternalError());
+       
+                                        // now enter the representants global
+                                        // index into our list
+       representants[parameter_dof] = global_dof;
+      }
+    else
+      {
+                                        // consistency check: if this
+                                        // is no parameter dof on the
+                                        // coarse grid, then the
+                                        // respective row must be
+                                        // empty!
+       for (unsigned int col=0; col<weights.n(); ++col)
+         Assert (weights(parameter_dof,col) == 0, ExcInternalError());
+      };
+  
 
 
                                   // note for people that want to
@@ -1363,7 +1379,12 @@ DoFTools::compute_intergrid_constraints (const DoFHandler<dim>              &coa
 
        if ((weights(first_used_row,weight_mapping[global_dof]) == 1) &&
            (representants[first_used_row] == static_cast<int>(global_dof)))
-                                          // dof unconstrained
+                                          // dof unconstrained or
+                                          // constrained to itself
+                                          // (in case this cell is
+                                          // mapped to itself, rather
+                                          // than to children of
+                                          // itself)
          continue;
 
                                         // otherwise enter all constraints
@@ -1397,7 +1418,7 @@ DoFTools::compute_intergrid_weights (const DoFHandler<dim>              &coarse_
     cell_intervals = Threads::split_range<active_cell_iterator> (coarse_grid.begin_active(),
                                                                 coarse_grid.end(),
                                                                 multithread_info.n_default_threads);
-  
+
   Threads::ThreadManager thread_manager;
   for (unsigned int i=0; i<multithread_info.n_default_threads; ++i)
     Threads::spawn (thread_manager,
@@ -1428,7 +1449,7 @@ DoFTools::compute_intergrid_weights_1 (const DoFHandler<dim>              &coars
                                   // aliases to the finite elements
                                   // used by the dof handlers:
   const FiniteElement<dim> &coarse_fe = coarse_grid.get_fe();    
-  
+
                                   // for each cell on the parameter grid:
                                   // find out which degrees of freedom on the
                                   // fine grid correspond in which way to
@@ -1514,13 +1535,19 @@ DoFTools::compute_intergrid_weights_1 (const DoFHandler<dim>              &coars
                                       // loop over all dofs on this
                                       // cell and check whether they
                                       // are interesting for us
-      for (unsigned int local_parameter_dof=0;
-          local_parameter_dof<coarse_fe.dofs_per_cell;
-          ++local_parameter_dof)
-       if (coarse_fe.system_to_component_index(local_parameter_dof).first
+      for (unsigned int local_dof=0;
+          local_dof<coarse_fe.dofs_per_cell;
+          ++local_dof)
+       if (coarse_fe.system_to_component_index(local_dof).first
            ==
            coarse_component)
          {
+                                            // the how-many-th
+                                            // parameter is this on
+                                            // this cell?
+           const unsigned int local_parameter_dof
+             = coarse_fe.system_to_component_index(local_dof).second;
+           
            global_parameter_representation.clear ();
            
                                             // distribute the representation of
@@ -1566,7 +1593,7 @@ DoFTools::compute_intergrid_weights_1 (const DoFHandler<dim>              &coars
                                                   // zero
                  if (global_parameter_representation(i) != 0)
                    {
-                     const unsigned int wi = parameter_dof_indices[local_parameter_dof],
+                     const unsigned int wi = parameter_dof_indices[local_dof],
                                         wj = weight_mapping[i];
                      weights(wi,wj) = global_parameter_representation(i);
                    };
index fc21e14a58eb69d4fe5f58cccc05e858424ff269..5ad1391713780dbff2c06183642ff335020a84c0 100644 (file)
@@ -3476,72 +3476,55 @@ unsigned int Triangulation<dim>::n_active_quads (const unsigned int level) const
 
 #if deal_II_dimension < 3
 
-template <>
-unsigned int Triangulation<1>::n_hexs () const {
+template <int dim>
+unsigned int Triangulation<dim>::n_hexs () const
+{
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
 
 
-template <>
-unsigned int Triangulation<1>::n_hexs (const unsigned int) const {
-  Assert (false, ExcFunctionNotUseful());
-  return 0;
-};
-
 
-template <>
-unsigned int Triangulation<1>::n_active_hexs () const {
+template <int dim>
+unsigned int Triangulation<dim>::n_hexs (const unsigned int) const
+{
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
 
 
-template <>
-unsigned int Triangulation<1>::n_active_hexs (const unsigned int) const {
-  Assert (false, ExcFunctionNotUseful());
-  return 0;
-};
-
 
-template <>
-unsigned int Triangulation<2>::n_hexs () const {
+template <int dim>
+unsigned int Triangulation<dim>::n_active_hexs () const
+{
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
 
 
-template <>
-unsigned int Triangulation<2>::n_hexs (const unsigned int) const {
-  Assert (false, ExcFunctionNotUseful());
-  return 0;
-};
-
 
-template <>
-unsigned int Triangulation<2>::n_active_hexs () const {
+template <int dim>
+unsigned int Triangulation<dim>::n_active_hexs (const unsigned int) const
+{
   Assert (false, ExcFunctionNotUseful());
   return 0;
 };
 
 
-template <>
-unsigned int Triangulation<2>::n_active_hexs (const unsigned int) const {
-  Assert (false, ExcFunctionNotUseful());
-  return 0;
-};
-
-#endif
+#else
 
 
 template <int dim>
-unsigned int Triangulation<dim>::n_hexs () const {
+unsigned int Triangulation<dim>::n_hexs () const
+{
   return number_cache.n_hexes;
 };
 
 
+
 template <int dim>
-unsigned int Triangulation<dim>::n_hexs (const unsigned int level) const {
+unsigned int Triangulation<dim>::n_hexs (const unsigned int level) const
+{
   Assert (level < number_cache.n_hexes_level.size(),
          ExcIndexRange (level, 0, number_cache.n_hexes_level.size()));
   
@@ -3549,14 +3532,18 @@ unsigned int Triangulation<dim>::n_hexs (const unsigned int level) const {
 };
 
 
+
 template <int dim>
-unsigned int Triangulation<dim>::n_active_hexs () const {
+unsigned int Triangulation<dim>::n_active_hexs () const
+{
   return number_cache.n_active_hexes;
 };
 
 
+
 template <int dim>
-unsigned int Triangulation<dim>::n_active_hexs (const unsigned int level) const {
+unsigned int Triangulation<dim>::n_active_hexs (const unsigned int level) const
+{
   Assert (level < number_cache.n_hexes_level.size(),
          ExcIndexRange (level, 0, number_cache.n_hexes_level.size()));
   
@@ -3564,8 +3551,12 @@ unsigned int Triangulation<dim>::n_active_hexs (const unsigned int level) const
 };
 
 
+#endif
+
+
 template <int dim>
-unsigned int Triangulation<dim>::n_levels () const {
+unsigned int Triangulation<dim>::n_levels () const
+{
   if (levels.size() == 0)
     return 0;
                                   // check whether there are

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.