20 #ifndef LIBMESH_EQUATION_SYSTEMS_H    21 #define LIBMESH_EQUATION_SYSTEMS_H    24 #include "libmesh/libmesh_common.h"    25 #include "libmesh/parameters.h"    26 #include "libmesh/system.h"    27 #include "libmesh/parallel_object.h"    31 # include "libmesh/frequency_system.h"    32 # include "libmesh/transient_system.h"    33 # include "libmesh/newmark_system.h"    34 # include "libmesh/steady_system.h"    42 #include <string_view>   106   virtual void clear ();
   111   virtual void init ();
   161   template <
typename T_sys>
   170   template <
typename T_sys>
   179   template <
typename T_sys>
   180   const T_sys & 
get_system (
const unsigned int num) 
const;
   188   template <
typename T_sys>
   216                                std::string_view 
name);
   221   template <
typename T_sys>
   228   unsigned int n_vars () 
const;
   234   std::size_t 
n_dofs () 
const;
   250   virtual void solve ();
   280                              const FEType * type=
nullptr,
   281                              const std::set<std::string> * system_names=
nullptr) 
const;
   292                               std::string_view system_name,
   293                               std::string_view variable_name = 
"all_vars") 
const;
   307                               const std::set<std::string> * system_names=
nullptr,
   308                               bool add_sides=
false) 
const;
   318   std::unique_ptr<NumericVector<Number>>
   320                                  bool add_sides=
false) 
const;
   327                                   std::vector<std::set<subdomain_id_type>> & vars_active_subdomains) 
const;
   329 #ifdef LIBMESH_ENABLE_DEPRECATED   340                      std::vector<std::string> & names) 
const;
   341 #endif // LIBMESH_ENABLE_DEPRECATED   353                                         std::vector<std::string> & names) 
const;
   377   std::vector<std::pair<unsigned int, unsigned int>>
   379                          const FEType * type=
nullptr,
   380                          const std::vector<FEType> * types=
nullptr) 
const;
   400   std::unique_ptr<NumericVector<Number>>
   420   (std::vector<Number> & soln,
   421    const std::set<std::string> * system_names = 
nullptr,
   422    const std::vector<std::string> * var_names = 
nullptr,
   423    bool vertices_only = 
false,
   424    bool add_sides = 
false) 
const;
   463   template <
typename InValType = Number>
   467              bool partition_agnostic = 
true);
   469   template <
typename InValType = Number>
   472              bool partition_agnostic = 
true);
   474   template <
typename InValType = Number>
   476              std::function<std::unique_ptr<Xdr>()> & local_io_functor,
   478              bool partition_agnostic = 
true);
   507               bool partition_agnostic = 
true) 
const;
   511               bool partition_agnostic = 
true) 
const;
   515               bool partition_agnostic = 
true) 
const;
   519               bool partition_agnostic = 
true,
   520               Xdr * 
const local_io = 
nullptr) 
const;
   529                         const Real threshold,
   530                         const bool verbose) 
const;
   536   virtual std::string 
get_info() 
const;
   547   friend std::ostream & 
operator << (std::ostream & os,
   611   std::map<std::string, std::unique_ptr<System>, std::less<>> 
_systems;
   663   return cast_int<unsigned int>(
_systems.size());
   669 template <
typename T_sys>
   675       const unsigned int sys_num = this->
n_systems();
   678         (
name, std::make_unique<T_sys>(*
this, std::string(
name),
   688       auto it = result.first;
   689       auto & sys_ptr = it->second;
   690       return cast_ref<T_sys &>(*sys_ptr);
   697       return this->get_system<T_sys>(
name);
   714 template <
typename T_sys>
   718   libmesh_assert_less (num, this->
n_systems());
   722       const auto & sys_ptr = pr.second;
   723       if (sys_ptr->number() == num)
   724         return cast_ref<const T_sys &>(*sys_ptr);
   727   libmesh_error_msg(
"ERROR: no system number " << num << 
" found!");
   733 template <
typename T_sys>
   737   libmesh_assert_less (num, this->
n_systems());
   741       auto & sys_ptr = pr.second;
   742       if (sys_ptr->number() == num)
   743         return cast_ref<T_sys &>(*sys_ptr);
   747   libmesh_error_msg(
"ERROR: no system number " << num << 
" found!");
   755 template <
typename T_sys>
   762   libmesh_error_msg_if(pos == 
_systems.end(), 
"ERROR: no system named \"" << 
name << 
"\" found!");
   765   const auto & sys_ptr = pos->second;
   766   return cast_ref<const T_sys &>(*sys_ptr);
   774 template <
typename T_sys>
   781   libmesh_error_msg_if(pos == 
_systems.end(), 
"ERROR: no system named " << 
name << 
" found!");
   784   auto & sys_ptr = pos->second;
   785   return cast_ref<T_sys &>(*sys_ptr);
   797   return this->get_system<System>(
name);
   805   return this->get_system<System>(
name);
   813   return this->get_system<System>(num);
   821   return this->get_system<System>(num);
   828 #endif // LIBMESH_EQUATION_SYSTEMS_H EquationSystems(MeshBase &mesh)
Constructor. 
std::string name(const ElemQuality q)
This function returns a string containing some name for q. 
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
WriteFlags
Define enumeration to set properties in EquationSystems::write() 
This is the EquationSystems class. 
unsigned int n_vars() const
void build_variable_names(std::vector< std::string > &var_names, const FEType *type=nullptr, const std::set< std::string > *system_names=nullptr) const
Fill the input vector var_names with the names of the variables for each system. 
void write(std::string_view name, const XdrMODE, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
Write the systems to disk using the XDR data format. 
unsigned int n_systems() const
bool _enable_default_ghosting
Flag for whether to enable default ghosting on newly added Systems. 
This class provides the ability to map between arbitrary, user-defined strings and several data types...
Data structure for specifying which Parameters should be independent variables in a parameter sensiti...
bool has_system(std::string_view name) const
std::unique_ptr< NumericVector< Number > > build_parallel_elemental_solution_vector(std::vector< std::string > &names) const
Builds a parallel vector of CONSTANT MONOMIAL and/or components of CONSTANT MONOMIAL_VEC solution val...
std::size_t n_dofs() const
Data structure for specifying which Quantities of Interest should be calculated in an adjoint or a pa...
void build_discontinuous_solution_vector(std::vector< Number > &soln, const std::set< std::string > *system_names=nullptr, const std::vector< std::string > *var_names=nullptr, bool vertices_only=false, bool add_sides=false) const
Fill the input vector soln with solution values. 
bool reinit_solutions()
Handle any mesh changes and project any solutions onto the updated mesh. 
virtual void clear()
Restores the data structure to a pristine state. 
virtual ~EquationSystems()
Destructor. 
This is the base class from which all geometric element types are derived. 
void print_info(std::ostream &os=libMesh::out) const
Prints information about the equation systems, by default to libMesh::out. 
void disable_refine_in_reinit()
Calls to reinit() will not try to coarsen or refine the mesh. 
virtual void enable_default_ghosting(bool enable)
Enable or disable default ghosting functors on the Mesh and on all Systems. 
virtual void adjoint_solve(const QoISet &qoi_indices=QoISet())
Call adjoint_solve on all the individual equation systems. 
friend std::ostream & operator<<(std::ostream &os, const EquationSystems &es)
Same as above, but allows you to also use stream syntax. 
The libMesh namespace provides an interface to certain functionality in the library. 
const T_sys & get_system(std::string_view name) const
This is the MeshBase class. 
virtual std::string get_info() const
MeshBase & _mesh
The mesh data structure. 
XdrMODE
Defines an enum for read/write mode in Xdr format. 
void allgather()
Serializes a distributed mesh and its associated degree of freedom numbering for all systems...
void get_vars_active_subdomains(const std::vector< std::string > &names, std::vector< std::set< subdomain_id_type >> &vars_active_subdomains) const
Retrieve vars_active_subdomains, which indicates the active subdomains for each variable in names...
virtual void sensitivity_solve(const ParameterVector ¶meters)
Call sensitivity_solve on all the individual equation systems. 
virtual void reinit_systems()
Reinitialize all systems on the current mesh. 
void enable_refine_in_reinit()
Calls to reinit() will also do two-step coarsen-then-refine. 
Manages consistently variables, degrees of freedom, and coefficient vectors. 
virtual void reinit()
Handle any mesh changes and reinitialize all the systems on the updated mesh. 
ReadFlags
Define enumeration to set properties in EquationSystems::read() 
bool refine_in_reinit_flag()
void read(std::string_view name, const XdrMODE, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
Read & initialize the systems from disk using the XDR data format. 
void build_solution_vector(std::vector< Number > &soln, std::string_view system_name, std::string_view variable_name="all_vars") const
Fill the input vector soln with the solution values for the system named name. 
bool _refine_in_reinit
Flag for whether to call coarsen/refine in reinit(). 
virtual void reinit_mesh()
Handle the association of a completely new mesh with the EquationSystem and all the Systems assigned ...
This class implements reference counting. 
An object whose state is distributed along a set of processors. 
This class implements a C++ interface to the XDR (eXternal Data Representation) format. 
virtual void solve()
Call solve on all the individual equation systems. 
void get_solution(std::vector< Number > &soln, std::vector< std::string > &names) const
Retrieve the solution data for CONSTANT MONOMIALs and/or components of CONSTANT MONOMIAL_VECs. 
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::unique_ptr< NumericVector< Number > > build_parallel_solution_vector(const std::set< std::string > *system_names=nullptr, bool add_sides=false) const
A version of build_solution_vector which is appropriate for "parallel" output formats like Nemesis...
void _remove_default_ghosting(unsigned int sys_num)
This just calls DofMap::remove_default_ghosting() but using a shim lets us forward-declare DofMap...
const MeshBase & get_mesh() const
std::size_t n_active_dofs() const
std::vector< std::pair< unsigned int, unsigned int > > find_variable_numbers(std::vector< std::string > &names, const FEType *type=nullptr, const std::vector< FEType > *types=nullptr) const
Finds system and variable numbers for any variables of 'type' or of 'types' corresponding to the entr...
Parameters parameters
Data structure holding arbitrary parameters. 
virtual void init()
Initialize all the systems. 
virtual bool compare(const EquationSystems &other_es, const Real threshold, const bool verbose) const
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. 
void _add_system_to_nodes_and_elems()
This function is used in the implementation of add_system, it loops over the nodes and elements of th...
void ErrorVector unsigned int
void update()
Updates local values for all the systems. 
void build_elemental_solution_vector(std::vector< Number > &soln, std::vector< std::string > &names) const
Retrieve the solution data for CONSTANT MONOMIALs and/or components of CONSTANT MONOMIAL_VECs. 
std::map< std::string, std::unique_ptr< System >, std::less<> > _systems
Data structure holding the systems. 
static bool redundant_added_side(const Elem &elem, unsigned int side)