Skip to content

Commit ebc3b60

Browse files
committed
Options for constrain_in_solver debugging
1 parent b018623 commit ebc3b60

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

examples/fem_system/fem_system_ex1/fem_system_ex1.C

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ int main (int argc, char ** argv)
104104
const unsigned int dim = infile("dimension", 2);
105105
const std::string slvr_type = infile("solver_type", "newton");
106106
const std::string mesh_type = infile("mesh_type" , "replicated");
107+
const bool constrain_in_solver = infile("constrain_in_solver", true);
108+
109+
// More desperate debugging options
110+
const bool print_solutions = infile("print_solutions", false);
111+
const bool print_residuals = infile("print_residuals", false);
112+
const bool print_jacobians = infile("print_jacobians", false);
107113

108114
#ifdef LIBMESH_HAVE_EXODUS_API
109115
const unsigned int write_interval = infile("write_interval", 5);
@@ -176,6 +182,14 @@ int main (int argc, char ** argv)
176182
NavierSystem & system =
177183
equation_systems.add_system<NavierSystem> ("Navier-Stokes");
178184

185+
// Debug it if requested
186+
system.print_solutions = print_solutions;
187+
system.print_solution_norms = print_solutions;
188+
system.print_residuals = print_residuals;
189+
system.print_residual_norms = print_residuals;
190+
system.print_jacobians = print_jacobians;
191+
system.print_jacobian_norms = print_jacobians;
192+
179193
// Solve this as a time-dependent or steady system
180194
if (transient)
181195
system.time_solver = std::make_unique<EulerSolver>(system);
@@ -217,6 +231,8 @@ int main (int argc, char ** argv)
217231
solver.absolute_residual_tolerance =
218232
infile("absolute_residual_tolerance", 0.0);
219233

234+
system.set_constrain_in_solver(constrain_in_solver);
235+
220236
// And the linear solver options
221237
solver.max_linear_iterations =
222238
infile("max_linear_iterations", 50000);

0 commit comments

Comments
 (0)