]> https://gitweb.dealii.org/ - dealii.git/commitdiff
use the MGConstrainedDoFs object in the transfer
authorBaerbel Jannsen <baerbel.janssen@gmail.com>
Thu, 26 Aug 2010 15:52:46 +0000 (15:52 +0000)
committerBaerbel Jannsen <baerbel.janssen@gmail.com>
Thu, 26 Aug 2010 15:52:46 +0000 (15:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@21732 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/multigrid/mg_transfer_prebuilt.cc
deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc

index b170691295e6e81eeb1d672d125b1ef36052a068..6a02a3d6db4b8cf9080901de8d1aa69c489962ca 100644 (file)
@@ -155,8 +155,7 @@ MGTransferPrebuilt<VECTOR>::copy_to_mg (
 template <typename VECTOR>
 template <int dim, int spacedim>
 void MGTransferPrebuilt<VECTOR>::build_matrices (
-  const MGDoFHandler<dim,spacedim>  &mg_dof,
-  const MGConstraints               &mg_constraints)
+  const MGDoFHandler<dim,spacedim>  &mg_dof)
 {
   const unsigned int n_levels      = mg_dof.get_tria().n_levels();
   const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
@@ -286,12 +285,13 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
                                // impose boundary conditions
                                // but only in the column of
                                // the prolongation matrix
-  if (mg_constraints.get_boundary_indices().size() != 0)
+  if(mg_constrained_dofs != 0)
+  if (mg_constrained_dofs->get_boundary_indices().size() != 0)
     {
       std::vector<unsigned int> constrain_indices;
       for (int level=n_levels-2; level>=0; --level)
        {
-         if (mg_constraints.get_boundary_indices()[level].size() == 0)
+         if (mg_constrained_dofs->get_boundary_indices()[level].size() == 0)
            continue;
 
                                // need to delete all the columns in the
@@ -302,8 +302,8 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
          constrain_indices.resize (0);
          constrain_indices.resize (prolongation_matrices[level]->n(), 0);
          std::set<unsigned int>::const_iterator dof 
-            = mg_constraints.get_boundary_indices()[level].begin(),
-           endd = mg_constraints.get_boundary_indices()[level].end();
+            = mg_constrained_dofs->get_boundary_indices()[level].begin(),
+           endd = mg_constrained_dofs->get_boundary_indices()[level].end();
          for (; dof != endd; ++dof)
            constrain_indices[*dof] = 1;
 
@@ -362,7 +362,12 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
 
          for (unsigned int i=0; i<dofs_per_cell; ++i)
           {
-           if(!mg_constraints.at_refinement_edge(level,level_dof_indices[i]))
+            if(mg_constrained_dofs != 0)
+            {
+             if(!mg_constrained_dofs->at_refinement_edge(level,level_dof_indices[i]))
+               temp_copy_indices[level_dof_indices[i]] = global_dof_indices[i];
+            }
+            else
              temp_copy_indices[level_dof_indices[i]] = global_dof_indices[i];
           }
        }
@@ -392,23 +397,19 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
 
 template
 void MGTransferPrebuilt<Vector<float> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof,
- const MGConstraints& mg_constraints);
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
 
 template
 void MGTransferPrebuilt<Vector<double> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof,
- const MGConstraints& mg_constraints);
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
 
 template
 void MGTransferPrebuilt<BlockVector<float> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof,
- const MGConstraints& mg_constraints);
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
 
 template
 void MGTransferPrebuilt<BlockVector<double> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof,
- const MGConstraints& mg_constraints);
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
 
 template void
 MGTransferPrebuilt<Vector<float> >::copy_to_mg (
index 134df115ab98463ec1724b70a25acf160ff602eb..73c90dba11bf15973a04e2e7aa98e2a4555a807e 100644 (file)
@@ -107,12 +107,12 @@ MGTransferPrebuilt<VECTOR>::MGTransferPrebuilt ()
 
 
 template<class VECTOR>
-MGTransferPrebuilt<VECTOR>::MGTransferPrebuilt (const ConstraintMatrix &c)
+MGTransferPrebuilt<VECTOR>::MGTransferPrebuilt (const ConstraintMatrix &c, const MGConstrainedDoFs& mg_c)
  :
-   constraints(&c)
+   constraints(&c),
+   mg_constrained_dofs(&mg_c)
 {} 
 
-
 template <class VECTOR>
 MGTransferPrebuilt<VECTOR>::~MGTransferPrebuilt () 
 {}

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.