@@ -472,6 +472,7 @@ public:
472
472
CPPUNIT_TEST ( test3DProjectVectorFEHex20 );
473
473
CPPUNIT_TEST ( test3DProjectVectorFEHex27 );
474
474
#ifdef LIBMESH_HAVE_SOLVER
475
+ CPPUNIT_TEST ( testSetSystemParameterOverEquationSystem );
475
476
CPPUNIT_TEST ( testAssemblyWithDgFemContext );
476
477
#endif
477
478
#endif // LIBMESH_DIM > 2
@@ -1289,8 +1290,9 @@ public:
1289
1290
// Create an equation systems object.
1290
1291
EquationSystems equation_systems (mesh );
1291
1292
1292
- // Set some parameters to the equation system that would cause a failed solve
1293
+ // Set some parameters to the equation system that would cause a failed test
1293
1294
equation_systems .parameters .set < unsigned int > ("linear solver maximum iterations" ) = 0 ;
1295
+ equation_systems .parameters .set < unsigned int > ("nonlinear solver absolute residual tolerance" ) = 1e10 ;
1294
1296
1295
1297
// Setup Linear Implicit system
1296
1298
LinearImplicitSystem & li_system =
@@ -1313,21 +1315,21 @@ public:
1313
1315
nli_system .get_linear_solver ()-> set_preconditioner_type (IDENTITY_PRECOND );
1314
1316
1315
1317
// Set some parameters to the system that work for the solve
1316
- li_system .parameters .set < unsigned int > ("linear solver maximum iterations" ) = 100 ;
1317
- nli_system .parameters .set < unsigned int > ("linear solver maximum iterations " ) = 100 ;
1318
+ li_system .parameters .set < unsigned int > ("linear solver maximum iterations" ) = 5 ;
1319
+ nli_system .parameters .set < unsigned int > ("nonlinear solver absolute residual tolerance " ) = 1e-10 ;
1318
1320
1319
1321
// See the solve pass, indicating system parameters are used over equation system parameters
1320
1322
equation_systems .init ();
1321
1323
li_system .solve ();
1322
1324
nli_system .solve ();
1323
1325
1324
- // We set the solution to be 1 everywhere, so the final l1 norm of the
1325
- // solution is the product of the number of variables and number of nodes.
1326
- Real ref_l1_norm = static_cast < Real > (mesh .n_nodes () * li_system .n_vars ());
1326
+ // Check that the number of iterations from the systems got obeyed
1327
+ CPPUNIT_ASSERT_EQUAL (li_system .n_linear_iterations (), 5u );
1327
1328
1328
- LIBMESH_ASSERT_FP_EQUAL (li_system .solution -> l1_norm (), ref_l1_norm , TOLERANCE * TOLERANCE );
1329
- LIBMESH_ASSERT_FP_EQUAL (nli_system .solution -> l1_norm (), ref_l1_norm , TOLERANCE * TOLERANCE );
1330
- }
1329
+ // Check that the solution for the nonlinear system is converged
1330
+ Real ref_l1_norm = static_cast < Real > (mesh .n_nodes () * li_system .n_vars ());
1331
+ LIBMESH_ASSERT_FP_EQUAL (nli_system .solution -> l1_norm (), ref_l1_norm , TOLERANCE );
1332
+ }
1331
1333
1332
1334
void testAssemblyWithDgFemContext ()
1333
1335
{
0 commit comments