Go to the documentation of this file.
28 #include "libmesh/libmesh.h"
29 #include "libmesh/mesh.h"
30 #include "libmesh/equation_systems.h"
31 #include "libmesh/nonlinear_implicit_system.h"
32 #include "libmesh/nonlinear_solver.h"
33 #include "libmesh/parameters.h"
34 #include "libmesh/getpot.h"
35 #include "libmesh/enum_solver_package.h"
36 #include "libmesh/exodusII_io.h"
37 #include "libmesh/mesh_generation.h"
38 #include "libmesh/enum_elem_type.h"
62 main(
int argc,
char ** argv)
70 "--enable-petsc or --enable-trilinos");
73 GetPot input_file(
"vector_fe_ex5.in");
76 const Real epsilon = input_file(
"epsilon", -1);
77 const Real sigma = input_file(
"sigma", 6);
80 const std::size_t nx = input_file(
"nx", 15);
81 const std::size_t ny = input_file(
"ny", 15);
87 for (
int i = 1; i < argc; i++)
93 libmesh_example_requires(2 <= LIBMESH_DIM,
"2D support");
123 auto & nl_solver = *nl_system.nonlinear_solver;
128 equation_systems.
init();
135 #ifdef LIBMESH_HAVE_EXODUS_API
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
virtual System & add_system(const std::string &system_type, const std::string &name)
Add the system of type system_type named name to the systems array.
void compute_jacobian(const NumericVector< Number > &X, SparseMatrix< Number > &J, NonlinearImplicitSystem &S)
The libMesh namespace provides an interface to certain functionality in the library.
SolverPackage default_solver_package()
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 non-linear solv...
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
void compute_residual(const NumericVector< Number > &X, NumericVector< Number > &R, NonlinearImplicitSystem &S)
unsigned int add_variable(const std::string &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.
virtual void init()
Initialize all the systems.
int main(int argc, char **argv)
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
void print_info(std::ostream &os=libMesh::out) const
Prints information about the equation systems, by default to libMesh::out.
This is the EquationSystems class.
T & set(const std::string &)
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 ...
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Parameters parameters
Data structure holding arbitrary parameters.