417 "--enable-petsc, --enable-trilinos, or --enable-eigen");
420 const unsigned int dim = 3;
423 libmesh_example_requires(
dim == LIBMESH_DIM,
"3D support");
426 #ifndef LIBMESH_ENABLE_DIRICHLET 427 libmesh_example_requires(
false,
"--enable-dirichlet");
452 for (
const auto & elem :
mesh.element_ptr_range())
455 side_max_x = 0, side_min_y = 0,
456 side_max_y = 0, side_max_z = 0;
459 found_side_max_x =
false, found_side_max_y =
false,
460 found_side_min_y =
false, found_side_max_z =
false;
462 for (
auto side : elem->side_index_range())
467 found_side_max_x =
true;
473 found_side_min_y =
true;
479 found_side_max_y =
true;
485 found_side_max_z =
true;
492 if (found_side_max_x && found_side_max_y && found_side_max_z)
493 for (
auto n : elem->node_index_range())
494 if (elem->is_node_on_side(n, side_max_x) &&
495 elem->is_node_on_side(n, side_max_y) &&
496 elem->is_node_on_side(n, side_max_z))
503 if (found_side_max_x && found_side_min_y)
504 for (
auto e : elem->edge_index_range())
505 if (elem->is_edge_on_side(e, side_max_x) &&
506 elem->is_edge_on_side(e, side_min_y))
518 #ifdef LIBMESH_HAVE_PETSC 524 petsc_linear_solver->set_solver_configuration(petsc_solver_config);
530 #ifdef LIBMESH_ENABLE_DIRICHLET 543 {u_var, v_var, w_var}, zf,
549 #endif // LIBMESH_ENABLE_DIRICHLET 564 equation_systems.init();
567 equation_systems.print_info();
573 le.compute_stresses();
576 #ifdef LIBMESH_HAVE_EXODUS_API 580 exo_io.write_discontinuous_exodusII(
"displacement_and_stress.exo", equation_systems);
582 #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...