Oops, I forgot to mention that I set some charge density data to make a Gaussian shape like this:
#cylindrical coordinates rc, zc = mesh.cellCenters dv = 2.0*pi*rc*dr*dz simulation_volume = dv.sum() psi_h_list[0].setValue(sqrt(exp( -0.5* ( (rc/sigma_r)**2.0 + ((zc-nz*dz*0.5 + z0)/sigma_z)**2 ))/(sigma_z*sigma_r**2*sqrt(2.0*pi)**3) )) rho_h = rho_h + qh*psi_h_list[0]*psi_h_list[0] This all goes just before the definition of the poisson equation in my code. Thanks, -mike w. On 3/8/16 3:00 PM, Guyer, Jonathan E. Dr. (Fed) wrote: > I assume there's more to the problem than this? With rho_h = 0, isn't the > initial condition phi_h = 0 already at the final solution? > > On Mar 8, 2016, at 2:36 PM, Michael Waters <[email protected]> wrote: > >> I did some more testing, the trilinos LinearGMRESsolver works even >> better than the Pysparse LinearPCG and allows me to continue working, >> but I still don't know why the trilinos LinearPCG is failing for me in >> that one case. >> >> I am willing to debug it if the developers are interested, otherwise >> I'll go on my merry way. >> >> Thanks, >> -mike waters >> >> On 3/8/16 2:09 PM, Michael Waters wrote: >>> Hi, I am trying to solve the Poisson equation like this: >>> >>> >>> >>> from fipy.solvers.trilinos import LinearPCGSolver as mysolver >>> from fipy.solvers.trilinos.preconditioners import JacobiPreconditioner >>> as myprecon >>> >>> rho_h = CellVariable(name = 'Charge Density', mesh=mesh, value = 0.0) >>> phi_h = CellVariable(name = 'Potential', mesh=mesh, value = 0.0) >>> epsilon = CellVariable(name = 'Dielectric Permitivity', mesh=mesh, >>> value = epsilon0) >>> >>> >>> phi_h.equation = (0.0 == DiffusionTerm(coeff = epsilon) + rho_h) >>> >>> >>> phi_h_res = phi_h.equation.sweep(var = phi_h, solver = mysolver >>> (iterations = phi_solver_iterations_per_step, precon = myprecon() ) ) >>> >>> What is strange is that if I use the PySparse equivalent >>> LinearPCGSolver and JacobiPreconditioner, the problem solves normally. >>> Also, in my code I solve a similar equation using the same Trilinos >>> solvers without any problems. >>> >>> Thoughts? >>> -mike waters >> _______________________________________________ >> fipy mailing list >> [email protected] >> http://www.ctcms.nist.gov/fipy >> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] > > _______________________________________________ > fipy mailing list > [email protected] > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
