532 libmesh_example_requires(LIBMESH_DIM > 2,
"--disable-1D-only --disable-2D-only");
535 #ifndef LIBMESH_ENABLE_DIRICHLET
536 libmesh_example_requires(
false,
"--enable-dirichlet");
539 GetPot infile(
"systems_of_equations_ex7.in");
540 const Real x_length = infile(
"x_length", 0.);
541 const Real y_length = infile(
"y_length", 0.);
542 const Real z_length = infile(
"z_length", 0.);
543 const int n_elem_x = infile(
"n_elem_x", 0);
544 const int n_elem_y = infile(
"n_elem_y", 0);
545 const int n_elem_z = infile(
"n_elem_z", 0);
546 const std::string approx_order = infile(
"approx_order",
"FIRST");
547 const std::string fe_family = infile(
"fe_family",
"LAGRANGE");
549 const Real young_modulus = infile(
"Young_modulus", 1.0);
550 const Real poisson_ratio = infile(
"poisson_ratio", 0.3);
551 const Real forcing_magnitude = infile(
"forcing_magnitude", 0.001);
553 const Real nonlinear_abs_tol = infile(
"nonlinear_abs_tol", 1.e-8);
554 const Real nonlinear_rel_tol = infile(
"nonlinear_rel_tol", 1.e-8);
555 const unsigned int nonlinear_max_its = infile(
"nonlinear_max_its", 50);
557 const unsigned int n_solves = infile(
"n_solves", 10);
558 const Real force_scaling = infile(
"force_scaling", 5.0);
581 Utility::string_to_enum<Order> (approx_order),
582 Utility::string_to_enum<FEFamily>(fe_family));
586 Utility::string_to_enum<Order> (approx_order),
587 Utility::string_to_enum<FEFamily>(fe_family));
591 Utility::string_to_enum<Order> (approx_order),
592 Utility::string_to_enum<FEFamily>(fe_family));
604 equation_systems.parameters.set<
Real> (
"nonlinear solver absolute residual tolerance") = nonlinear_abs_tol;
605 equation_systems.parameters.set<
Real> (
"nonlinear solver relative residual tolerance") = nonlinear_rel_tol;
606 equation_systems.parameters.set<
unsigned int> (
"nonlinear solver maximum iterations") = nonlinear_max_its;
611 equation_systems.parameters.set<
Real>(
"young_modulus") = young_modulus;
612 equation_systems.parameters.set<
Real>(
"poisson_ratio") = poisson_ratio;
613 equation_systems.parameters.set<
Real>(
"forcing_magnitude") = forcing_magnitude;
615 #ifdef LIBMESH_ENABLE_DIRICHLET
617 std::set<boundary_id_type> clamped_boundaries;
618 clamped_boundaries.insert(BOUNDARY_ID_MIN_X);
620 std::vector<unsigned int> uvw;
621 uvw.push_back(u_var);
622 uvw.push_back(v_var);
623 uvw.push_back(w_var);
634 #endif // LIBMESH_ENABLE_DIRICHLET
636 equation_systems.init();
637 equation_systems.print_info();
644 for (
unsigned int count=0; count<n_solves; count++)
646 Real previous_forcing_magnitude = equation_systems.parameters.get<
Real>(
"forcing_magnitude");
647 equation_systems.parameters.set<
Real>(
"forcing_magnitude") = previous_forcing_magnitude*force_scaling;
651 <<
", forcing_magnitude: "
652 << equation_systems.parameters.
get<
Real>(
"forcing_magnitude")
659 <<
" , final nonlinear residual norm: "
666 lde.compute_stresses();
668 #ifdef LIBMESH_HAVE_EXODUS_API
669 std::stringstream filename;
670 filename <<
"solution_" << count <<
".exo";