On Fri, 6 Feb 2009, Tim Kroeger wrote:

On Thu, 5 Feb 2009, Roy Stogner wrote:

Hmmm... we don't want to change _is_closed (requiring the user to
close() after operator= would be an API change, which I'd like to
avoid as much as possible), but it looks like we need to do
*something* within operator= itself - as is it won't be setting the
ghosted values at all.

Well, what about calling this->close() inside operator=()?

That'll work.

Nope, ex14 gives the same problem even after your close() fix.

Can you send me a minimal example for that problem? I'm not sure whether I can help you, but I could at least try.

Actually, it looks like you've already helped me: close() inside
operator= didn't do it, but I didn't realize you meant we should do a
close inside localize() as well.  I wish the PETSc docs made it more
clear that that was necessary (Scatter just doesn't set any ghost
nodes without a GhostUpdate too, huh?), but whatever fix works is fine
by me.

This particular fix worked for the problem at hand, but ex14 still
isn't working past the first solve - I suspect it may be a flaw in the
new projection case; I'll try to track it down this weekend.

To make these patches shorter, I've separated out all the new code
that either clearly works (smaller send_lists), is only for debugging
(weaker asserts) or doesn't have to be used by default (more ghosted
vector implementation code and fixes) and committed it to svn.

The remaining patch (that just switches to ghosted initialization for
formerly serial vectors) is attached.
---
Roy
Index: src/solvers/transient_system.C
===================================================================
--- src/solvers/transient_system.C      (revision 3269)
+++ src/solvers/transient_system.C      (working copy)
@@ -98,8 +98,12 @@
   Base::init_data();
 
   // Initialize the old & older solutions
-  old_local_solution->init   (this->n_dofs(), false, SERIAL);
-  older_local_solution->init (this->n_dofs(), false, SERIAL);
+  old_local_solution->init   (this->n_dofs(), this->n_local_dofs(),
+                              this->get_dof_map().get_send_list(),
+                              GHOSTED);
+  older_local_solution->init (this->n_dofs(), this->n_local_dofs(),
+                              this->get_dof_map().get_send_list(),
+                              GHOSTED);
 }
 
 
Index: src/solvers/unsteady_solver.C
===================================================================
--- src/solvers/unsteady_solver.C       (revision 3269)
+++ src/solvers/unsteady_solver.C       (working copy)
@@ -58,7 +58,9 @@
       first_solve = false;
     }
 
-  old_local_nonlinear_solution->init (_system.n_dofs(), false, SERIAL);
+  old_local_nonlinear_solution->init (_system.n_dofs(), _system.n_local_dofs(),
+                                      _system.get_dof_map().get_send_list(),
+                                      GHOSTED);
 
   _system.get_vector("_old_nonlinear_solution").localize
     (*old_local_nonlinear_solution,
Index: src/solvers/system.C
===================================================================
--- src/solvers/system.C        (revision 3269)
+++ src/solvers/system.C        (working copy)
@@ -185,7 +185,9 @@
   solution->init (this->n_dofs(), this->n_local_dofs(), false, PARALLEL);
 
   // Resize the current_local_solution for the current mesh
-  current_local_solution->init (this->n_dofs(), false, SERIAL);
+  current_local_solution->init (this->n_dofs(), this->n_local_dofs(),
+                                _dof_map->get_send_list(),
+                                GHOSTED);
 
   // from now on, no chance to add additional vectors
   _can_add_vectors = false;
@@ -211,19 +213,24 @@
         v->init (this->n_dofs(), this->n_local_dofs(), false, PARALLEL);
     }
 
+  const std::vector<unsigned int>& send_list = _dof_map->get_send_list ();
+
   // Restrict the solution on the coarsened cells
   if (_solution_projection)
     {
       this->project_vector (*solution);
       current_local_solution->clear();
-      current_local_solution->init(this->n_dofs());
-      const std::vector<unsigned int>& send_list = _dof_map->get_send_list ();
+      current_local_solution->init(this->n_dofs(),
+                                  this->n_local_dofs(), send_list, 
+                                   true, GHOSTED);
       solution->localize (*current_local_solution, send_list); 
     }
   else
     {
       current_local_solution->clear();
-      current_local_solution->init(this->n_dofs());
+      current_local_solution->init(this->n_dofs(),
+                                  this->n_local_dofs(), send_list,
+                                   false, GHOSTED);
     }
 #endif
 }
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to