diff options
author | 2021-07-06 15:25:53 -0700 | |
---|---|---|
committer | 2021-07-06 15:25:53 -0700 | |
commit | 82eec2a5032286c617449ea45a341b72b6f8bed2 (patch) | |
tree | 0f673504e3bc7fbc89c13ca2a8b04bf097cc6041 /Source/FieldSolver | |
parent | 359e878ef50fdd61300f983cccda03805e163f67 (diff) | |
download | WarpX-82eec2a5032286c617449ea45a341b72b6f8bed2.tar.gz WarpX-82eec2a5032286c617449ea45a341b72b6f8bed2.tar.zst WarpX-82eec2a5032286c617449ea45a341b72b6f8bed2.zip |
Input parameter for AMReX MLMG verbosity (#2041)
* Added warpx_solver_verbosity input parameter
- This input paramter is for the electrostatic solver to pass into
MLMG::setVerbose(int)
- Originally this value was hardcoded to 2
* readded accidently deleted line
* Handle the default solver_verbosity value on the C++ side
* Verbosity parameter now works the same as warpx.self_fields_max_iters
- The input parameter for mlmg verbosity is now warpx.self_fields_verbosity
- It still has a default value of 2.
* fixed missing comma
* added missing parameter to function call
* Added documentation entry for warpx.self_fields_verbosity
* corrected documentation
* fixed formatting mistsake
Diffstat (limited to 'Source/FieldSolver')
-rw-r--r-- | Source/FieldSolver/ElectrostaticSolver.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/FieldSolver/ElectrostaticSolver.cpp b/Source/FieldSolver/ElectrostaticSolver.cpp index 3db4ac50e..991c1fcae 100644 --- a/Source/FieldSolver/ElectrostaticSolver.cpp +++ b/Source/FieldSolver/ElectrostaticSolver.cpp @@ -117,7 +117,7 @@ WarpX::AddSpaceChargeField (WarpXParticleContainer& pc) for (Real& beta_comp : beta) beta_comp /= PhysConst::c; // Normalize // Compute the potential phi, by solving the Poisson equation - computePhi( rho, phi, beta, pc.self_fields_required_precision, pc.self_fields_max_iters ); + computePhi( rho, phi, beta, pc.self_fields_required_precision, pc.self_fields_max_iters, pc.self_fields_verbosity ); // Compute the corresponding electric and magnetic field, from the potential phi computeE( Efield_fp, phi, beta ); @@ -168,7 +168,7 @@ WarpX::AddSpaceChargeFieldLabFrame () std::array<Real, 3> beta = {0._rt}; // Compute the potential phi, by solving the Poisson equation - computePhi( rho, phi_fp, beta, self_fields_required_precision, self_fields_max_iters ); + computePhi( rho, phi_fp, beta, self_fields_required_precision, self_fields_max_iters, self_fields_verbosity ); // Compute the corresponding electric and magnetic field, from the potential phi computeE( Efield_fp, phi_fp, beta ); @@ -189,12 +189,13 @@ WarpX::computePhi (const amrex::Vector<std::unique_ptr<amrex::MultiFab> >& rho, amrex::Vector<std::unique_ptr<amrex::MultiFab> >& phi, std::array<Real, 3> const beta, Real const required_precision, - int const max_iters) const + int const max_iters, + int const verbosity) const { #ifdef WARPX_DIM_RZ - computePhiRZ( rho, phi, beta, required_precision, max_iters ); + computePhiRZ( rho, phi, beta, required_precision, max_iters, verbosity ); #else - computePhiCartesian( rho, phi, beta, required_precision, max_iters ); + computePhiCartesian( rho, phi, beta, required_precision, max_iters, verbosity ); #endif } @@ -219,7 +220,8 @@ WarpX::computePhiRZ (const amrex::Vector<std::unique_ptr<amrex::MultiFab> >& rho amrex::Vector<std::unique_ptr<amrex::MultiFab> >& phi, std::array<Real, 3> const beta, Real const required_precision, - int const max_iters) const + int const max_iters, + int const verbosity) const { // Create a new geometry with the z coordinate scaled by gamma amrex::Real const gamma = std::sqrt(1._rt/(1. - beta[2]*beta[2])); @@ -336,7 +338,7 @@ WarpX::computePhiRZ (const amrex::Vector<std::unique_ptr<amrex::MultiFab> >& rho // Solve the Poisson equation linop.setDomainBC( lobc, hibc ); MLMG mlmg(linop); - mlmg.setVerbose(2); + mlmg.setVerbose(verbosity); mlmg.setMaxIter(max_iters); mlmg.solve( GetVecOfPtrs(phi), GetVecOfConstPtrs(rho), required_precision, 0.0); } @@ -362,7 +364,8 @@ WarpX::computePhiCartesian (const amrex::Vector<std::unique_ptr<amrex::MultiFab> amrex::Vector<std::unique_ptr<amrex::MultiFab> >& phi, std::array<Real, 3> const beta, Real const required_precision, - int const max_iters) const + int const max_iters, + int const verbosity) const { // Define the boundary conditions @@ -417,7 +420,7 @@ WarpX::computePhiCartesian (const amrex::Vector<std::unique_ptr<amrex::MultiFab> } MLMG mlmg(linop); - mlmg.setVerbose(2); + mlmg.setVerbose(verbosity); mlmg.setMaxIter(max_iters); mlmg.solve( GetVecOfPtrs(phi), GetVecOfConstPtrs(rho), required_precision, 0.0); } |