421 "--enable-petsc, --enable-trilinos, or --enable-eigen");
424 const unsigned int dim = 3;
427 libmesh_example_requires(
dim == LIBMESH_DIM,
"3D support");
430 #ifndef LIBMESH_ENABLE_DIRICHLET 431 libmesh_example_requires(
false,
"--enable-dirichlet");
456 for (
const auto & elem :
mesh.element_ptr_range())
459 side_max_x = 0, side_min_y = 0,
460 side_max_y = 0, side_max_z = 0;
463 found_side_max_x =
false, found_side_max_y =
false,
464 found_side_min_y =
false, found_side_max_z =
false;
466 for (
auto side : elem->side_index_range())
471 found_side_max_x =
true;
477 found_side_min_y =
true;
483 found_side_max_y =
true;
489 found_side_max_z =
true;
496 if (found_side_max_x && found_side_max_y && found_side_max_z)
497 for (
auto n : elem->node_index_range())
498 if (elem->is_node_on_side(n, side_max_x) &&
499 elem->is_node_on_side(n, side_max_y) &&
500 elem->is_node_on_side(n, side_max_z))
507 if (found_side_max_x && found_side_min_y)
508 for (
auto e : elem->edge_index_range())
509 if (elem->is_edge_on_side(e, side_max_x) &&
510 elem->is_edge_on_side(e, side_min_y))
522 #ifdef LIBMESH_HAVE_PETSC 528 petsc_linear_solver->set_solver_configuration(petsc_solver_config);
534 #ifdef LIBMESH_ENABLE_DIRICHLET 547 {u_var, v_var, w_var}, zf,
553 #endif // LIBMESH_ENABLE_DIRICHLET 568 equation_systems.init();
571 equation_systems.print_info();
577 le.compute_stresses();
580 #ifdef LIBMESH_HAVE_EXODUS_API 584 exo_io.write_discontinuous_exodusII(
"displacement_and_stress.exo", equation_systems);
586 #endif // #ifdef LIBMESH_HAVE_EXODUS_API
T command_line_next(std::string name, T default_value)
Use GetPot's search()/next() functions to get following arguments from the command line...
This is the EquationSystems class.
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
ConstFunction that simply returns 0.
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids an...
virtual LinearSolver< Number > * get_linear_solver() const override
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
virtual void solve() override
Assembles & solves the linear system A*x=b.
SolverPackage default_solver_package()
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
void attach_assemble_object(Assembly &assemble)
Register a user object to use in assembling the system matrix and RHS.
void add_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
Adds a copy of the specified Dirichlet boundary to the system.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
const DofMap & get_dof_map() const
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems...
void add_edge(const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
Add edge edge of element number elem with boundary id id to the boundary information data structure...