40 #include "libmesh/libmesh.h" 41 #include "libmesh/mesh.h" 42 #include "libmesh/mesh_generation.h" 43 #include "libmesh/exodusII_io.h" 44 #include "libmesh/equation_systems.h" 45 #include "libmesh/getpot.h" 46 #include "libmesh/enum_solver_package.h" 59 const std::string& system_name);
66 int main (
int argc,
char** argv)
73 "--enable-petsc, --enable-trilinos, or --enable-eigen");
76 GetPot command_line (argc, argv);
81 std::string parameters_filename =
"advection_2D.in";
82 if ( command_line.search(2,
"-i",
"--input_file") )
83 parameters_filename = command_line.next(parameters_filename);
86 GetPot infile(parameters_filename);
87 unsigned int n_elem = infile(
"n_elem", 1);
110 equation_systems.
init ();
120 #ifdef LIBMESH_HAVE_EXODUS_API This is the EquationSystems class.
This class provides the ability to map between arbitrary, user-defined strings and several data types...
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 ...
void print_info(std::ostream &os=libMesh::out) const
Prints information about the equation systems, by default to libMesh::out.
virtual void print_info() override
Print out some info about the system's configuration.
void assemble_all_matrices()
Assemble the matrices we need to solve a conservation law.
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
The libMesh namespace provides an interface to certain functionality in the library.
const T_sys & get_system(std::string_view name) const
SolverPackage default_solver_package()
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
Projects arbitrary functions onto the current solution.
virtual void process_parameters_file(const std::string ¶meters_filename) override
Read in data from input file.
virtual void write_equation_systems(const std::string &fname, const EquationSystems &es, const std::set< std::string > *system_names=nullptr) override
Writes out the solution for no specific time or timestep.
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
Number initial_condition(const Point &p, const Parameters ¶meters, const std::string &, const std::string &)
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
void set_initial_condition(EquationSystems &es, const std::string &system_name)
void solve_conservation_law()
Solve the conservation law.
This class extends ClawSystem to implement pure advection in 2D.
int main(int argc, char **argv)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Parameters parameters
Data structure holding arbitrary parameters.
virtual void init()
Initialize all the systems.
virtual System & add_system(std::string_view system_type, std::string_view name)
Add the system of type system_type named name to the systems array.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
A Point defines a location in LIBMESH_DIM dimensional Real space.
void attach_init_function(void fptr(EquationSystems &es, const std::string &name))
Register a user function to use in initializing the system.