On Tue, 24 Jun 2008, Derek Gaston wrote:
> On Jun 24, 2008, at 1:19 PM, Roy Stogner wrote: > >> I think I noticed this problem and tried to avoid it in >> petsc_diff_solver.C; you might cut and paste some of that code into >> Ben's solver to see if using my "swap vectors, System::update" >> localization works any better. > > Ok - I've tried to implement this, but I must be off somewhere. What I've > done is add a _system refence inside of NonlinearSolver (the same way there > is one in DiffSolver) and then I'm using code like this inside of > __libmesh_petsc_snes_residual: > > PetscVector<Number> X_global(x), R(r); > PetscVector<Number>& X_local = > *dynamic_cast<PetscVector<Number>*>(sys.solution.get()); > > X_global.swap(X_local); > sys.update(); > X_global.swap(X_local); > > solver->residual (X_global, R); > > This seems to work ok in 2D... but in 3D it is generating NAN's for some > reason. Someone please point out my logic troubles... Very strange. I can't see why the dimensionality would make a difference (particularly on a conforming mesh), but I must point out that my own brief tests of PetscDiffSolver were all on 2D problems; once I found out that my NewtonSolver was performing better, I lost interest in trying to tweak SNES options for 3D. Here's what I'm trying to figure out, though: The DiffSystem::assembly() call in PetscDiffSolver uses current_local_solution to plug into the weighted residual equations, thus ensuring that DoFs which are owned by another processor have correct values. How does that work here? When you swap the solution out again, the current_local_solution doesn't come with it - you're still passing to residual() a vector that only has locally owned DoFs, right? Also: Ben, is current_local_solution a serial vector? It certainly looks that way to me, but I've always been a little confused by the solution/current_local_solution divide, so maybe I'm missing some sort of PETSc magic under the hood. --- Roy ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Libmesh-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-devel
