Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 49 of file vector_fe_ex2.C.
56 "--enable-petsc, --enable-trilinos, or --enable-eigen");
59 GetPot infile(
"vector_fe_ex2.in");
62 const unsigned int grid_size = infile(
"grid_size", 2);
65 libmesh_example_requires(3 <= LIBMESH_DIM,
"2D/3D support");
68 #ifndef LIBMESH_ENABLE_DIRICHLET
69 libmesh_example_requires(
false,
"--enable-dirichlet");
101 system.
time_solver = libmesh_make_unique<SteadySolver>(system);
104 equation_systems.init();
108 solver.
quiet = infile(
"solver_quiet",
true);
120 equation_systems.print_info();
130 std::vector<FunctionBase<Number> *> sols(1, &soln_func);
131 std::vector<FunctionBase<Gradient> *> grads(1, &soln_grad);
133 exact_sol.attach_exact_values(sols);
134 exact_sol.attach_exact_derivs(grads);
137 int extra_error_quadrature = infile(
"extra_error_quadrature", 2);
138 exact_sol.extra_quadrature_order(extra_error_quadrature);
141 exact_sol.compute_error(
"Laplace",
"u");
145 << exact_sol.l2_error(
"Laplace",
"u")
148 << exact_sol.h1_error(
"Laplace",
"u")
151 #ifdef LIBMESH_HAVE_EXODUS_API
156 #endif // #ifdef LIBMESH_HAVE_EXODUS_API
References libMesh::DiffSolver::absolute_residual_tolerance, libMesh::EquationSystems::add_system(), libMesh::ExactSolution::attach_exact_derivs(), libMesh::ExactSolution::attach_exact_values(), libMesh::MeshTools::Generation::build_cube(), libMesh::ExactSolution::compute_error(), libMesh::default_solver_package(), libMesh::ExactSolution::extra_quadrature_order(), libMesh::ExactSolution::h1_error(), libMesh::HEX8, libMesh::TriangleWrapper::init(), libMesh::EquationSystems::init(), libMesh::DiffSolver::initial_linear_tolerance, libMesh::INVALID_SOLVER_PACKAGE, libMesh::ExactSolution::l2_error(), libMesh::DiffSolver::max_linear_iterations, libMesh::DiffSolver::max_nonlinear_iterations, mesh, libMesh::out, libMesh::EquationSystems::print_info(), libMesh::MeshBase::print_info(), libMesh::DiffSolver::quiet, libMesh::DiffSolver::relative_residual_tolerance, libMesh::DiffSolver::relative_step_tolerance, libMesh::FEMSystem::solve(), libMesh::DifferentiableSystem::time_solver, libMesh::System::variable_number(), libMesh::DiffSolver::verbose, and libMesh::MeshOutput< MT >::write_equation_systems().
This class handles the computation of the L2 and/or H1 error for the Systems in the EquationSystems o...
virtual void solve() override
Invokes the solver associated with the system.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
This is a generic class that defines a solver to handle ImplicitSystem classes, including NonlinearIm...
SolverPackage default_solver_package()
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
std::unique_ptr< TimeSolver > time_solver
A pointer to the solver object we're going to use.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
Real relative_step_tolerance
bool verbose
The DiffSolver may print a lot more to libMesh::out if verbose is set to true; default is false.
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
This is the EquationSystems class.
virtual void write_equation_systems(const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr)
This method implements writing a mesh with data to a specified file where the data is taken from the ...
bool quiet
The DiffSolver should not print anything to libMesh::out unless quiet is set to false; default is tru...
Real relative_residual_tolerance
Real absolute_residual_tolerance
The DiffSolver should exit after the residual is reduced to either less than absolute_residual_tolera...
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the mesh.
unsigned int max_linear_iterations
Each linear solver step should exit after max_linear_iterations is exceeded.
unsigned short int variable_number(const std::string &var) const
unsigned int max_nonlinear_iterations
The DiffSolver should exit in failure if max_nonlinear_iterations is exceeded and continue_after_max_...
This class implements reading & writing meshes in the AVS's UCD format.
double initial_linear_tolerance
Any required linear solves will at first be done with this tolerance; the DiffSolver may tighten the ...