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);
66int 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
146 return std::exp( -100.*(std::pow(x-0.5,2.) + std::pow(y-0.5,2.)) );
This class extends ClawSystem to implement pure advection in 2D.
virtual void print_info() override
Print out some info about the system's configuration.
virtual void process_parameters_file(const std::string ¶meters_filename) override
Read in data from input file.
void solve_conservation_law()
Solve the conservation law.
void assemble_all_matrices()
Assemble the matrices we need to solve a conservation law.
This is the EquationSystems class.
void print_info(std::ostream &os=libMesh::out) const
Prints information about the equation systems, by default to libMesh::out.
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.
const T_sys & get_system(std::string_view name) const
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
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.
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
This class provides the ability to map between arbitrary, user-defined strings and several data types...
A Point defines a location in LIBMESH_DIM dimensional Real space.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, std::optional< ConstElemRange > active_local_range=std::nullopt, std::optional< std::vector< unsigned int > > variable_numbers=std::nullopt) const
Projects arbitrary functions onto the current solution.
void attach_init_function(void fptr(EquationSystems &es, const std::string &name))
Register a user function to use in initializing the system.
The libMesh namespace provides an interface to certain functionality in the library.
SolverPackage default_solver_package()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_initial_condition(EquationSystems &es, const std::string &system_name)
Number initial_condition(const Point &p, const Parameters ¶meters, const std::string &, const std::string &)