]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fixed: Vectors could not be given as input and output vectors to the
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Oct 2002 19:31:09 +0000 (19:31 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Oct 2002 19:31:09 +0000 (19:31 +0000)
       <code class="class">SolutionTransfer</code> class at the same time, but
       this was not checked. An assertion has now been added to ensure this
       requirement.

git-svn-id: https://svn.dealii.org/trunk@6732 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/solution_transfer.cc
deal.II/doc/news/2002/c-3-4.html

index 0b819826b8a367e8574fb534126c3893bf118b6d..3e254149a218031cd02ee6178a548aeb6ae08c08 100644 (file)
@@ -108,6 +108,9 @@ SolutionTransfer<dim, number>::refine_interpolate(const Vector<number> &in,
   Assert(in.size()==n_dofs_old, ExcWrongVectorSize(in.size(),n_dofs_old));
   Assert(out.size()==dof_handler->n_dofs(),
         ExcWrongVectorSize(out.size(),dof_handler->n_dofs()));
+  Assert(&in != &out,
+         ExcMessage ("Vectors cannot be used as input and output"
+                     " at the same time!"));
 
   unsigned int dofs_per_cell=dof_handler->get_fe().dofs_per_cell;  
   Vector<number> local_values(dofs_per_cell);
@@ -284,7 +287,8 @@ interpolate (const std::vector<Vector<number> > &all_in,
   for (unsigned int i=0; i<all_in.size(); ++i)
     Assert (all_in[i].size() == n_dofs_old,
            ExcWrongVectorSize(all_in[i].size(), n_dofs_old));
-                             
+
+  
   unsigned int out_size=all_out.size();
 
                                   // resize the output vector
@@ -298,6 +302,11 @@ interpolate (const std::vector<Vector<number> > &all_in,
          all_out[i].reinit (dof_handler->n_dofs());
     };
 
+  for (unsigned int i=0; i<all_in.size(); ++i)
+    for (unsigned int j=0; j<all_in.size(); ++j)
+      Assert(&all_in[i] != &all_out[j],
+             ExcMessage ("Vectors cannot be used as input and output"
+                         " at the same time!"));
 
   const unsigned int dofs_per_cell=dof_handler->get_fe().dofs_per_cell;  
   Vector<number> local_values(dofs_per_cell);
index e57bbb5ce686b3bbebf0a99cdd8747af61a493ef..4911bbe460525d63a5d28fda5fce1ad1eb2a9f4d 100644 (file)
@@ -154,10 +154,10 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        </p>
 
   <li> <p> 
-       Improved: make knows a target <tt>veryclean</tt>
-       now. <tt>clean</tt> leaves the libraries now, removing
+       New: The top-level makefile now how a target <tt>distclean</tt>.
+       <tt>clean</tt> leaves the libraries now, removing
        everything that is not needed to use
-       <acronym>deal.II</acronym>. <tt>veryclean</tt> removes even the
+       <acronym>deal.II</acronym>. <tt>distclean</tt> removes even the
        libraries, leaving the directory more or less in the state like
        after <tt>configure</tt>.
        <br>
@@ -402,6 +402,15 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p> 
+       Fixed: Vectors could not be given as input and output vectors to the
+       <code class="class">SolutionTransfer</code> class at the same time, but
+       this was not checked. An assertion has now been added to ensure this
+       requirement. 
+       <br>
+       (WB 2002/10/28)
+       </p>
+
   <li> <p> 
        Fixed: The <code
        class="member">DoFRenumbering::component_wise</code> function accepts a

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.