22 #include "libmesh/equation_systems.h" 23 #include "libmesh/getpot.h" 24 #include "libmesh/libmesh_logging.h" 25 #include "libmesh/numeric_vector.h" 26 #include "libmesh/sparse_matrix.h" 27 #include "libmesh/string_to_enum.h" 33 const std::string &
name,
34 const unsigned int number)
47 LOG_SCOPE(
"assemble_claw_rhs()",
"AdvectionSystem");
84 LOG_SCOPE(
"update_Fh()",
"AdvectionSystem");
90 _Fh[i]->add(
_u(i), q);
106 <<
") approximation to the system." 116 for (
unsigned int i=0; i<2; ++i)
128 GetPot infile(parameters_filename);
129 const Real u1_in = infile(
"u1", 1.);
130 const Real u2_in = infile(
"u2", 1.);
133 std::string fe_order_str = infile(
"fe_order", std::string(
"CONSTANT"));
134 std::string fe_family_str = infile(
"fe_family", std::string(
"MONOMIAL"));
137 _fe_order = Utility::string_to_enum<Order>(fe_order_str);
138 _fe_family = Utility::string_to_enum<FEFamily>(fe_family_str);
145 libMesh::out << std::endl <<
"==== AdvectionSystem ====" << std::endl;
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
This is the EquationSystems class.
SparseMatrix< Number > & get_boundary_condition_matrix(unsigned int dim)
This class encapsulates functionality that allows us to solve conservation laws.
void vector_mult(NumericVector< T > &dest, const NumericVector< T > &arg) const
Multiplies the matrix by the NumericVector arg and stores the result in NumericVector dest...
virtual void init_data() override
Initialize the system (e.g.
NumericVector< Number > * rhs
The system matrix.
const Parallel::Communicator & comm() const
virtual void print_info() override
Print out some info about the system's configuration.
The libMesh namespace provides an interface to certain functionality in the library.
dof_id_type n_local_dofs() const
virtual void init_data() override
Initialize the system (e.g.
dof_id_type n_dofs() const
virtual void zero()=0
Set all entries to zero.
SparseMatrix< Number > & get_advection_matrix(unsigned int dim)
virtual void process_parameters_file(const std::string ¶meters_filename) override
Read in data from input file.
unsigned int _q1_var
Variable number for q1.
virtual void process_parameters_file(const std::string ¶meters_filename)
Set parameters for this system (e.g.
SparseMatrix< Number > & get_avg_matrix(unsigned int dim)
AdvectionSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
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.
Order _fe_order
Store the FE Order and family specified by the input file.
SparseMatrix< Number > & get_jump_matrix()
virtual void print_info()
Print out some info about the system's configuration.
std::string enum_to_string(const T e)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::unique_ptr< NumericVector< Number > > > _Fh
The advective flux vectors.
static std::unique_ptr< NumericVector< T > > build(const Parallel::Communicator &comm, SolverPackage solver_package=libMesh::default_solver_package(), ParallelType parallel_type=AUTOMATIC)
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
Point _u
The (assumed constant) advection velocity.
virtual void add(const numeric_index_type i, const T value)=0
Adds value to the vector entry specified by i.
virtual void assemble_claw_rhs(NumericVector< Number > &q) override
Right-hand side assembly.
A Point defines a location in LIBMESH_DIM dimensional Real space.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
void update_Fh(NumericVector< Number > &q)
Computes the vectors "uq" and "vq" where (u,v) are the (given, constant) advective velocity coefficie...
virtual ~AdvectionSystem()
Destructor.