diff --git a/fem/tmop_tools.cpp b/fem/tmop_tools.cpp index b43f2dc888d..d5eb372a101 100644 --- a/fem/tmop_tools.cpp +++ b/fem/tmop_tools.cpp @@ -437,7 +437,7 @@ real_t TMOPNewtonSolver::ComputeScalingFactor(const Vector &x, // Check for convergence if (init_fit_max_err < surf_fit_max_err_limit) { - if (print_options.iterations) + if (print_options.iterations || print_options.warnings) { mfem::out << "TMOPNewtonSolver converged " "based on the surface fitting error.\n"; diff --git a/linalg/solvers.cpp b/linalg/solvers.cpp index 00f5a2be603..39d4913fd6c 100644 --- a/linalg/solvers.cpp +++ b/linalg/solvers.cpp @@ -1919,7 +1919,8 @@ void NewtonSolver::Mult(const Vector &b, Vector &x) const print_options.first_and_last) { mfem::out << "Newton: Number of iterations: " << final_iter << '\n' - << " ||r|| = " << final_norm << '\n'; + << " ||r|| = " << final_norm + << ", ||r||/||r_0|| = " << final_norm/norm0 << '\n'; } if (!converged && (print_options.summary || print_options.warnings)) { @@ -2141,7 +2142,8 @@ void LBFGSSolver::Mult(const Vector &b, Vector &x) const print_options.first_and_last) { mfem::out << "LBFGS: Number of iterations: " << final_iter << '\n' - << " ||r|| = " << final_norm << '\n'; + << " ||r|| = " << final_norm + << ", ||r||/||r_0|| = " << final_norm/norm0 << '\n'; } if (print_options.summary || (!converged && print_options.warnings)) { diff --git a/miniapps/meshing/mesh-optimizer.cpp b/miniapps/meshing/mesh-optimizer.cpp index 7cbfce43b60..082d4d0ab51 100644 --- a/miniapps/meshing/mesh-optimizer.cpp +++ b/miniapps/meshing/mesh-optimizer.cpp @@ -51,14 +51,13 @@ // Adapted discrete size NC mesh; // mesh-optimizer -m amr-quad-q2.mesh -o 2 -rs 2 -mid 94 -tid 5 -ni 50 -qo 4 -nor // Adapted discrete size 3D with PA: -// mesh-optimizer -m cube.mesh -o 2 -rs 2 -mid 321 -tid 5 -ls 3 -nor -pa +// mesh-optimizer -m cube.mesh -o 2 -rs 2 -mid 321 -tid 5 -ls 3 -nor -pa -rtol 1e-8 // Adapted discrete size 3D with PA on device (requires CUDA): // * mesh-optimizer -m cube.mesh -o 3 -rs 3 -mid 321 -tid 5 -ls 3 -nor -lc 0.1 -pa -d cuda // Adapted discrete size; explicit combo of metrics; mixed tri/quad mesh: // mesh-optimizer -m ../../data/square-mixed.mesh -o 2 -rs 2 -mid 2 -tid 5 -ni 200 -bnd -qo 6 -cmb 2 -nor // Adapted discrete size+aspect_ratio: // mesh-optimizer -m square01.mesh -o 2 -rs 2 -mid 7 -tid 6 -ni 100 -// mesh-optimizer -m square01.mesh -o 2 -rs 2 -mid 7 -tid 6 -ni 100 -qo 6 -ex -st 1 -nor // Adapted discrete size+orientation: // mesh-optimizer -m square01.mesh -o 2 -rs 2 -mid 36 -tid 8 -qo 4 -fd -nor // Adapted discrete aspect ratio (3D): @@ -67,7 +66,7 @@ // Adaptive limiting: // mesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 50 -qo 5 -nor -vl 1 -alc 0.5 // Adaptive limiting through the L-BFGS solver: -// mesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 400 -qo 5 -nor -vl 1 -alc 0.5 -st 1 +// mesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 400 -qo 5 -nor -vl 1 -alc 0.5 -st 1 -rtol 1e-8 // Adaptive limiting through FD (requires GSLIB): // * mesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 50 -qo 5 -nor -vl 1 -alc 0.5 -fd -ae 1 // @@ -1109,8 +1108,8 @@ int main(int argc, char *argv[]) } // Level of output. IterativeSolver::PrintLevel newton_print; - if (verbosity_level > 0) - { newton_print.Errors().Warnings().Iterations(); } + if (verbosity_level > 0) { newton_print.Errors().Warnings().Iterations(); } + else { newton_print.Errors().Warnings(); } solver.SetPrintLevel(newton_print); // hr-adaptivity solver. // If hr-adaptivity is disabled, r-adaptivity is done once using the diff --git a/miniapps/meshing/pmesh-fitting.cpp b/miniapps/meshing/pmesh-fitting.cpp index 5263fe3f917..a9dacf64c88 100644 --- a/miniapps/meshing/pmesh-fitting.cpp +++ b/miniapps/meshing/pmesh-fitting.cpp @@ -37,11 +37,11 @@ // mpirun -np 4 pmesh-fitting -o 3 -mid 58 -tid 1 -vl 1 -sfc 5e4 -rtol 1e-5 // mpirun -np 4 pmesh-fitting -m square01-tri.mesh -o 3 -rs 0 -mid 58 -tid 1 -vl 1 -sfc 1e4 -rtol 1e-5 // Surface fitting with weight adaptation and termination based on fitting error: -// mpirun -np 4 pmesh-fitting -o 2 -mid 2 -tid 1 -vl 2 -sfc 10 -rtol 1e-20 -sfa 10.0 -sft 1e-5 -no-resid +// mpirun -np 4 pmesh-fitting -o 2 -mid 2 -tid 1 -vl 2 -sfc 10 -rtol 1e-20 -sfa 10.0 -sft 1e-5 -no-resid -ni 40 // Surface fitting with weight adaptation, limit on max weight, and convergence based on residual. // * mpirun -np 4 pmesh-fitting -m ../../data/inline-tri.mesh -o 2 -mid 2 -tid 4 -vl 2 -sfc 10 -rtol 1e-10 -sfa 10.0 -sft 1e-5 -bgamriter 3 -sbgmesh -ae 1 -marking -slstype 3 -resid -sfcmax 10000 -mod-bndr-attr // Surface fitting to Fischer-Tropsch reactor like domain (requires GSLIB): -// * mpirun -np 6 pmesh-fitting -m ../../data/inline-tri.mesh -o 2 -rs 4 -mid 2 -tid 1 -vl 2 -sfc 100 -rtol 1e-12 -li 20 -ae 1 -bnd -sbgmesh -slstype 2 -smtype 0 -sfa 10.0 -sft 1e-4 -no-resid -bgamriter 5 -dist -mod-bndr-attr +// * mpirun -np 6 pmesh-fitting -m ../../data/inline-tri.mesh -o 2 -rs 4 -mid 2 -tid 1 -vl 2 -sfc 100 -rtol 1e-12 -li 20 -ae 1 -bnd -sbgmesh -slstype 2 -smtype 0 -sfa 10.0 -sft 1e-4 -no-resid -bgamriter 5 -dist -mod-bndr-attr -ni 50 #include "mesh-fitting.hpp" @@ -809,7 +809,7 @@ int main (int argc, char *argv[]) solver.SetRelTol(solver_rtol); solver.SetAbsTol(0.0); solver.SetMinimumDeterminantThreshold(0.001*min_detJ); - solver.SetPrintLevel(verbosity_level >= 1 ? 1 : -1); + solver.SetPrintLevel(verbosity_level >= 1 ? 1 : 0); solver.SetOperator(a); Vector b(0); solver.Mult(b, x.GetTrueVector()); diff --git a/miniapps/meshing/pmesh-optimizer.cpp b/miniapps/meshing/pmesh-optimizer.cpp index 1341bf08ca9..bada631754b 100644 --- a/miniapps/meshing/pmesh-optimizer.cpp +++ b/miniapps/meshing/pmesh-optimizer.cpp @@ -51,14 +51,13 @@ // Adapted discrete size NC mesh; // mpirun -np 4 pmesh-optimizer -m amr-quad-q2.mesh -o 2 -rs 2 -mid 94 -tid 5 -ni 50 -qo 4 -nor // Adapted discrete size 3D with PA: -// mpirun -np 4 pmesh-optimizer -m cube.mesh -o 2 -rs 2 -mid 321 -tid 5 -ls 3 -nor -pa +// mpirun -np 4 pmesh-optimizer -m cube.mesh -o 2 -rs 2 -mid 321 -tid 5 -ls 3 -nor -pa -rtol 1e-8 // Adapted discrete size 3D with PA on device (requires CUDA): // * mpirun -n 4 pmesh-optimizer -m cube.mesh -o 3 -rs 3 -mid 321 -tid 5 -ls 3 -nor -lc 0.1 -pa -d cuda // Adapted discrete size; explicit combo of metrics; mixed tri/quad mesh: // mpirun -np 4 pmesh-optimizer -m ../../data/square-mixed.mesh -o 2 -rs 2 -mid 2 -tid 5 -ni 200 -bnd -qo 6 -cmb 2 -nor // Adapted discrete size+aspect_ratio: // mpirun -np 4 pmesh-optimizer -m square01.mesh -o 2 -rs 2 -mid 7 -tid 6 -ni 100 -// mpirun -np 4 pmesh-optimizer -m square01.mesh -o 2 -rs 2 -mid 7 -tid 6 -ni 100 -qo 6 -ex -st 1 -nor // Adapted discrete size+orientation: // mpirun -np 4 pmesh-optimizer -m square01.mesh -o 2 -rs 2 -mid 36 -tid 8 -qo 4 -fd -nor // Adapted discrete aspect ratio (3D): @@ -67,7 +66,7 @@ // Adaptive limiting: // mpirun -np 4 pmesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 50 -qo 5 -nor -vl 1 -alc 0.5 // Adaptive limiting through the L-BFGS solver: -// mpirun -np 4 pmesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 400 -qo 5 -nor -vl 1 -alc 0.5 -st 1 +// mpirun -np 4 pmesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 400 -qo 5 -nor -vl 1 -alc 0.5 -st 1 -rtol 1e-8 // Adaptive limiting through FD (requires GSLIB): // * mpirun -np 4 pmesh-optimizer -m stretched2D.mesh -o 2 -mid 2 -tid 1 -ni 50 -qo 5 -nor -vl 1 -alc 0.5 -fd -ae 1 // @@ -1154,8 +1153,8 @@ int main (int argc, char *argv[]) } // Level of output. IterativeSolver::PrintLevel newton_print; - if (verbosity_level > 0) - { newton_print.Errors().Warnings().Iterations(); } + if (verbosity_level > 0) { newton_print.Errors().Warnings().Iterations(); } + else { newton_print.Errors().Warnings(); } solver.SetPrintLevel(newton_print); // hr-adaptivity solver. // If hr-adaptivity is disabled, r-adaptivity is done once using the