20 #ifndef LIBMESH_EQUATION_SYSTEMS_H 21 #define LIBMESH_EQUATION_SYSTEMS_H 29 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS 112 virtual void clear ();
117 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 const std::string &
name);
221 template <
typename T_sys>
232 #ifdef LIBMESH_ENABLE_DEPRECATED 240 unsigned int n_vars ()
const;
246 std::size_t
n_dofs ()
const;
262 virtual void solve ();
292 const FEType * type=
nullptr,
293 const std::set<std::string> * system_names=
nullptr)
const;
304 const std::string & system_name,
305 const std::string & variable_name =
"all_vars")
const;
315 const std::set<std::string> * system_names=
nullptr)
const;
325 std::unique_ptr<NumericVector<Number>>
333 std::vector<std::set<subdomain_id_type>> & vars_active_subdomains)
const;
344 std::vector<std::string> & names)
const;
355 std::vector<std::string> & names)
const;
373 std::unique_ptr<NumericVector<Number>>
384 const std::set<std::string> * system_names=
nullptr)
const;
411 template <
typename InValType>
412 void read (
const std::string &
name,
415 bool partition_agnostic =
true);
420 bool partition_agnostic =
true)
421 { read<Number>(
name, mode, read_flags, partition_agnostic); }
423 template <
typename InValType>
424 void read (
const std::string &
name,
426 bool partition_agnostic =
true);
430 bool partition_agnostic =
true)
431 { read<Number>(
name, read_flags, partition_agnostic); }
461 bool partition_agnostic =
true)
const;
465 bool partition_agnostic =
true)
const;
474 const Real threshold,
475 const bool verbose)
const;
481 virtual std::string
get_info()
const;
492 friend std::ostream &
operator << (std::ostream & os,
596 template <
typename InValType>
599 const unsigned int read_flags,
600 bool partition_agnostic =
true);
639 return cast_int<unsigned int>(
_systems.size());
645 template <
typename T_sys>
649 T_sys * ptr =
nullptr;
653 const unsigned int sys_num = this->
n_systems();
654 ptr =
new T_sys(*
this,
name, sys_num);
669 ptr = &(this->get_system<T_sys>(
name));
689 template <
typename T_sys>
693 libmesh_assert_less (num, this->
n_systems());
699 for (; pos !=
end; ++pos)
700 if (pos->second->number() == num)
705 libmesh_error_msg(
"ERROR: no system number " << num <<
" found!");
708 return *cast_ptr<T_sys *>(pos->second);
714 template <
typename T_sys>
718 libmesh_assert_less (num, this->
n_systems());
723 for (; pos !=
end; ++pos)
724 if (pos->second->number() == num)
729 libmesh_error_msg(
"ERROR: no system number " << num <<
" found!");
732 return *cast_ptr<T_sys *>(pos->second);
740 template <
typename T_sys>
748 libmesh_error_msg(
"ERROR: no system named \"" <<
name <<
"\" found!");
751 return *cast_ptr<T_sys *>(pos->second);
759 template <
typename T_sys>
767 libmesh_error_msg(
"ERROR: no system named " <<
name <<
" found!");
770 return *cast_ptr<T_sys *>(pos->second);
782 return this->get_system<System>(
name);
790 return this->get_system<System>(
name);
798 return this->get_system<System>(num);
806 return this->get_system<System>(num);
813 #endif // LIBMESH_EQUATION_SYSTEMS_H EquationSystems(MeshBase &mesh)
std::string name(const ElemQuality q)
Manages the family, order, etc. parameters for a given FE.
Manages multiples systems of equations.
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
unsigned int n_systems() const
bool _enable_default_ghosting
Specifies parameters for parameter sensitivity calculations.
std::unique_ptr< NumericVector< Number > > build_parallel_elemental_solution_vector(std::vector< std::string > &names) const
std::size_t n_dofs() const
Used to specify quantities of interest in a simulation.
const T_sys & get_system(const std::string &name) const
virtual ~EquationSystems()
void print_info(std::ostream &os=libMesh::out) const
void disable_refine_in_reinit()
std::unique_ptr< NumericVector< Number > > build_parallel_solution_vector(const std::set< std::string > *system_names=nullptr) const
virtual void enable_default_ghosting(bool enable)
virtual void adjoint_solve(const QoISet &qoi_indices=QoISet())
void read(const std::string &name, const XdrMODE, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
friend std::ostream & operator<<(std::ostream &os, const EquationSystems &es)
virtual std::string get_info() const
void get_vars_active_subdomains(const std::vector< std::string > &names, std::vector< std::set< subdomain_id_type >> &vars_active_subdomains) const
virtual void sensitivity_solve(const ParameterVector ¶meters)
std::map< std::string, System * >::const_iterator const_system_iterator
void read(const std::string &name, const XdrMODE mode, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
void write(const std::string &name, const XdrMODE, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
virtual void reinit_systems()
void enable_refine_in_reinit()
std::map< std::string, System * >::iterator system_iterator
Manages consistently variables, degrees of freedom, and coefficient vectors.
void delete_system(const std::string &name)
bool refine_in_reinit_flag()
virtual System & add_system(const std::string &system_type, const std::string &name)
An object whose state is distributed along a set of processors.
void read(const std::string &name, const unsigned int read_flags=(READ_HEADER|READ_DATA), bool partition_agnostic=true)
void get_solution(std::vector< Number > &soln, std::vector< std::string > &names) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void build_solution_vector(std::vector< Number > &soln, const std::string &system_name, const std::string &variable_name="all_vars") const
void _remove_default_ghosting(unsigned int sys_num)
const MeshBase & get_mesh() const
std::size_t n_active_dofs() const
bool has_system(const std::string &name) const
virtual bool compare(const EquationSystems &other_es, const Real threshold, const bool verbose) const
void _read_impl(const std::string &name, const XdrMODE, const unsigned int read_flags, bool partition_agnostic=true)
OStreamProxy out(std::cout)
void build_discontinuous_solution_vector(std::vector< Number > &soln, const std::set< std::string > *system_names=nullptr) const
void _add_system_to_nodes_and_elems()
void build_elemental_solution_vector(std::vector< Number > &soln, std::vector< std::string > &names) const
std::map< std::string, System * > _systems