libMesh
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
libMesh::OptimizationSystem Class Reference

This System subclass enables us to assemble an objective function, gradient, Hessian and bounds for optimization problems. More...

#include <optimization_system.h>

Inheritance diagram for libMesh::OptimizationSystem:
[legend]

Classes

class  ComputeEqualityConstraints
 Abstract base class to be used to calculate the equality constraints. More...
 
class  ComputeEqualityConstraintsJacobian
 Abstract base class to be used to calculate the Jacobian of the equality constraints. More...
 
class  ComputeGradient
 Abstract base class to be used to calculate the gradient of an objective function. More...
 
class  ComputeHessian
 Abstract base class to be used to calculate the Hessian of an objective function. More...
 
class  ComputeInequalityConstraints
 Abstract base class to be used to calculate the inequality constraints. More...
 
class  ComputeInequalityConstraintsJacobian
 Abstract base class to be used to calculate the Jacobian of the inequality constraints. More...
 
class  ComputeLowerAndUpperBounds
 Abstract base class to be used to calculate the lower and upper bounds for all dofs in the system. More...
 
class  ComputeObjective
 Abstract base class to be used to calculate the objective function for optimization. More...
 

Public Types

typedef OptimizationSystem sys_type
 The type of system. More...
 
typedef ImplicitSystem Parent
 The type of the parent. More...
 
typedef std::map< std::string, SparseMatrix< Number > * >::iterator matrices_iterator
 Matrix iterator typedefs. More...
 
typedef std::map< std::string, SparseMatrix< Number > * >::const_iterator const_matrices_iterator
 
typedef Number(* ValueFunctionPointer) (const Point &p, const Parameters &Parameters, const std::string &sys_name, const std::string &unknown_name)
 Projects arbitrary functions onto the current solution. More...
 
typedef Gradient(* GradientFunctionPointer) (const Point &p, const Parameters &parameters, const std::string &sys_name, const std::string &unknown_name)
 
typedef std::map< std::string, NumericVector< Number > * >::iterator vectors_iterator
 Vector iterator typedefs. More...
 
typedef std::map< std::string, NumericVector< Number > * >::const_iterator const_vectors_iterator
 

Public Member Functions

 OptimizationSystem (EquationSystems &es, const std::string &name, const unsigned int number)
 Constructor. More...
 
virtual ~OptimizationSystem ()
 Destructor. More...
 
sys_typesystem ()
 
virtual void clear () override
 Clear all the data structures associated with the system. More...
 
virtual void init_data () override
 Initializes new data members of the system. More...
 
virtual void reinit () override
 Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be used. More...
 
virtual void solve () override
 Solves the optimization problem. More...
 
void initialize_equality_constraints_storage (const std::vector< std::set< numeric_index_type >> &constraint_jac_sparsity)
 Initialize storage for the equality constraints, and the corresponding Jacobian. More...
 
void initialize_inequality_constraints_storage (const std::vector< std::set< numeric_index_type >> &constraint_jac_sparsity)
 Initialize storage for the inequality constraints, as per initialize_equality_constraints_storage. More...
 
virtual std::string system_type () const override
 
virtual void assemble () override
 Prepares matrix and rhs for system assembly, then calls user assembly function. More...
 
virtual void disable_cache () override
 Avoids use of any cached data that might affect any solve result. More...
 
virtual LinearSolver< Number > * get_linear_solver () const
 
virtual std::pair< unsigned int, Realget_linear_solve_parameters () const
 
virtual void release_linear_solver (LinearSolver< Number > *) const
 Releases a pointer to a linear solver acquired by this->get_linear_solver() More...
 
virtual void assembly (bool, bool, bool=false, bool=false)
 Assembles a residual in rhs and/or a jacobian in matrix, as requested. More...
 
virtual void assemble_residual_derivatives (const ParameterVector &parameters) override
 Residual parameter derivative function. More...
 
virtual std::pair< unsigned int, Realsensitivity_solve (const ParameterVector &parameters) override
 Assembles & solves the linear system(s) (dR/du)*u_p = -dR/dp, for those parameters contained within parameters. More...
 
virtual std::pair< unsigned int, Realweighted_sensitivity_solve (const ParameterVector &parameters, const ParameterVector &weights) override
 Assembles & solves the linear system(s) (dR/du)*u_w = sum(w_p*-dR/dp), for those parameters p contained within parameters weighted by the values w_p found within weights. More...
 
virtual std::pair< unsigned int, Realadjoint_solve (const QoISet &qoi_indices=QoISet()) override
 Assembles & solves the linear system (dR/du)^T*z = dq/du, for those quantities of interest q specified by qoi_indices. More...
 
virtual std::pair< unsigned int, Realweighted_sensitivity_adjoint_solve (const ParameterVector &parameters, const ParameterVector &weights, const QoISet &qoi_indices=QoISet()) override
 Assembles & solves the linear system(s) (dR/du)^T*z_w = sum(w_p*(d^2q/dudp - d^2R/dudp*z)), for those parameters p contained within parameters, weighted by the values w_p found within weights. More...
 
virtual void adjoint_qoi_parameter_sensitivity (const QoISet &qoi_indices, const ParameterVector &parameters, SensitivityData &sensitivities) override
 Solves for the derivative of each of the system's quantities of interest q in qoi[qoi_indices] with respect to each parameter in parameters, placing the result for qoi i and parameter j into sensitivities[i][j]. More...
 
virtual void forward_qoi_parameter_sensitivity (const QoISet &qoi_indices, const ParameterVector &parameters, SensitivityData &sensitivities) override
 Solves for the derivative of each of the system's quantities of interest q in qoi[qoi_indices] with respect to each parameter in parameters, placing the result for qoi i and parameter j into sensitivities[i][j]. More...
 
virtual void qoi_parameter_hessian (const QoISet &qoi_indices, const ParameterVector &parameters, SensitivityData &hessian) override
 For each of the system's quantities of interest q in qoi[qoi_indices], and for a vector of parameters p, the parameter sensitivity Hessian H_ij is defined as H_ij = (d^2 q)/(d p_i d p_j) This Hessian is the output of this method, where for each q_i, H_jk is stored in hessian.second_derivative(i,j,k). More...
 
virtual void qoi_parameter_hessian_vector_product (const QoISet &qoi_indices, const ParameterVector &parameters, const ParameterVector &vector, SensitivityData &product) override
 For each of the system's quantities of interest q in qoi[qoi_indices], and for a vector of parameters p, the parameter sensitivity Hessian H_ij is defined as H_ij = (d^2 q)/(d p_i d p_j) The Hessian-vector product, for a vector v_k in parameter space, is S_j = H_jk v_k This product is the output of this method, where for each q_i, S_j is stored in sensitivities[i][j]. More...
 
SparseMatrix< Number > & add_matrix (const std::string &mat_name)
 Adds the additional matrix mat_name to this system. More...
 
void remove_matrix (const std::string &mat_name)
 Removes the additional matrix mat_name from this system. More...
 
bool have_matrix (const std::string &mat_name) const
 
const SparseMatrix< Number > * request_matrix (const std::string &mat_name) const
 
SparseMatrix< Number > * request_matrix (const std::string &mat_name)
 
const SparseMatrix< Number > & get_matrix (const std::string &mat_name) const
 
SparseMatrix< Number > & get_matrix (const std::string &mat_name)
 
virtual unsigned int n_matrices () const override
 
virtual void assemble_qoi (const QoISet &qoi_indices=QoISet()) override
 Prepares qoi for quantity of interest assembly, then calls user qoi function. More...
 
virtual void assemble_qoi_derivative (const QoISet &qoi_indices=QoISet(), bool include_liftfunc=true, bool apply_constraints=true) override
 Prepares adjoint_rhs for quantity of interest derivative assembly, then calls user qoi derivative function. More...
 
void init ()
 Initializes degrees of freedom on the current mesh. More...
 
virtual void reinit_constraints ()
 Reinitializes the constraints for this system. More...
 
bool is_initialized ()
 
virtual void update ()
 Update the local values to reflect the solution on neighboring processors. More...
 
virtual void restrict_solve_to (const SystemSubset *subset, const SubsetSolveMode subset_solve_mode=SUBSET_ZERO)
 After calling this method, any solve will be restricted to the given subdomain. More...
 
bool is_adjoint_already_solved () const
 Accessor for the adjoint_already_solved boolean. More...
 
void set_adjoint_already_solved (bool setting)
 Setter for the adjoint_already_solved boolean. More...
 
virtual void qoi_parameter_sensitivity (const QoISet &qoi_indices, const ParameterVector &parameters, SensitivityData &sensitivities)
 Solves for the derivative of each of the system's quantities of interest q in qoi[qoi_indices] with respect to each parameter in parameters, placing the result for qoi i and parameter j into sensitivities[i][j]. More...
 
virtual bool compare (const System &other_system, const Real threshold, const bool verbose) const
 
const std::string & name () const
 
void project_solution (FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
 Projects arbitrary functions onto the current solution. More...
 
void project_solution (FEMFunctionBase< Number > *f, FEMFunctionBase< Gradient > *g=nullptr) const
 Projects arbitrary functions onto the current solution. More...
 
void project_solution (ValueFunctionPointer fptr, GradientFunctionPointer gptr, const Parameters &parameters) const
 
void project_vector (NumericVector< Number > &new_vector, FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, int is_adjoint=-1) const
 Projects arbitrary functions onto a vector of degree of freedom values for the current system. More...
 
void project_vector (NumericVector< Number > &new_vector, FEMFunctionBase< Number > *f, FEMFunctionBase< Gradient > *g=nullptr, int is_adjoint=-1) const
 Projects arbitrary functions onto a vector of degree of freedom values for the current system. More...
 
void project_vector (ValueFunctionPointer fptr, GradientFunctionPointer gptr, const Parameters &parameters, NumericVector< Number > &new_vector, int is_adjoint=-1) const
 Projects arbitrary functions onto a vector of degree of freedom values for the current system. More...
 
void boundary_project_solution (const std::set< boundary_id_type > &b, const std::vector< unsigned int > &variables, FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr)
 Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system. More...
 
void boundary_project_solution (const std::set< boundary_id_type > &b, const std::vector< unsigned int > &variables, ValueFunctionPointer fptr, GradientFunctionPointer gptr, const Parameters &parameters)
 Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system. More...
 
void boundary_project_vector (const std::set< boundary_id_type > &b, const std::vector< unsigned int > &variables, NumericVector< Number > &new_vector, FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, int is_adjoint=-1) const
 Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system. More...
 
void boundary_project_vector (const std::set< boundary_id_type > &b, const std::vector< unsigned int > &variables, ValueFunctionPointer fptr, GradientFunctionPointer gptr, const Parameters &parameters, NumericVector< Number > &new_vector, int is_adjoint=-1) const
 Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system. More...
 
unsigned int number () const
 
void update_global_solution (std::vector< Number > &global_soln) const
 Fill the input vector global_soln so that it contains the global solution on all processors. More...
 
void update_global_solution (std::vector< Number > &global_soln, const processor_id_type dest_proc) const
 Fill the input vector global_soln so that it contains the global solution on processor dest_proc. More...
 
const MeshBaseget_mesh () const
 
MeshBaseget_mesh ()
 
const DofMapget_dof_map () const
 
DofMapget_dof_map ()
 
const EquationSystemsget_equation_systems () const
 
EquationSystemsget_equation_systems ()
 
bool active () const
 
void activate ()
 Activates the system. More...
 
void deactivate ()
 Deactivates the system. More...
 
void set_basic_system_only ()
 Sets the system to be "basic only": i.e. More...
 
vectors_iterator vectors_begin ()
 Beginning of vectors container. More...
 
const_vectors_iterator vectors_begin () const
 Beginning of vectors container. More...
 
vectors_iterator vectors_end ()
 End of vectors container. More...
 
const_vectors_iterator vectors_end () const
 End of vectors container. More...
 
NumericVector< Number > & add_vector (const std::string &vec_name, const bool projections=true, const ParallelType type=PARALLEL)
 Adds the additional vector vec_name to this system. More...
 
void remove_vector (const std::string &vec_name)
 Removes the additional vector vec_name from this system. More...
 
bool & project_solution_on_reinit (void)
 Tells the System whether or not to project the solution vector onto new grids when the system is reinitialized. More...
 
bool have_vector (const std::string &vec_name) const
 
const NumericVector< Number > * request_vector (const std::string &vec_name) const
 
NumericVector< Number > * request_vector (const std::string &vec_name)
 
const NumericVector< Number > * request_vector (const unsigned int vec_num) const
 
NumericVector< Number > * request_vector (const unsigned int vec_num)
 
const NumericVector< Number > & get_vector (const std::string &vec_name) const
 
NumericVector< Number > & get_vector (const std::string &vec_name)
 
const NumericVector< Number > & get_vector (const unsigned int vec_num) const
 
NumericVector< Number > & get_vector (const unsigned int vec_num)
 
const std::string & vector_name (const unsigned int vec_num) const
 
const std::string & vector_name (const NumericVector< Number > &vec_reference) const
 
void set_vector_as_adjoint (const std::string &vec_name, int qoi_num)
 Allows one to set the QoI index controlling whether the vector identified by vec_name represents a solution from the adjoint (qoi_num >= 0) or primal (qoi_num == -1) space. More...
 
int vector_is_adjoint (const std::string &vec_name) const
 
void set_vector_preservation (const std::string &vec_name, bool preserve)
 Allows one to set the boolean controlling whether the vector identified by vec_name should be "preserved": projected to new meshes, saved, etc. More...
 
bool vector_preservation (const std::string &vec_name) const
 
NumericVector< Number > & add_adjoint_solution (unsigned int i=0)
 
NumericVector< Number > & get_adjoint_solution (unsigned int i=0)
 
const NumericVector< Number > & get_adjoint_solution (unsigned int i=0) const
 
NumericVector< Number > & add_sensitivity_solution (unsigned int i=0)
 
NumericVector< Number > & get_sensitivity_solution (unsigned int i=0)
 
const NumericVector< Number > & get_sensitivity_solution (unsigned int i=0) const
 
NumericVector< Number > & add_weighted_sensitivity_adjoint_solution (unsigned int i=0)
 
NumericVector< Number > & get_weighted_sensitivity_adjoint_solution (unsigned int i=0)
 
const NumericVector< Number > & get_weighted_sensitivity_adjoint_solution (unsigned int i=0) const
 
NumericVector< Number > & add_weighted_sensitivity_solution ()
 
NumericVector< Number > & get_weighted_sensitivity_solution ()
 
const NumericVector< Number > & get_weighted_sensitivity_solution () const
 
NumericVector< Number > & add_adjoint_rhs (unsigned int i=0)
 
NumericVector< Number > & get_adjoint_rhs (unsigned int i=0)
 
const NumericVector< Number > & get_adjoint_rhs (unsigned int i=0) const
 
NumericVector< Number > & add_sensitivity_rhs (unsigned int i=0)
 
NumericVector< Number > & get_sensitivity_rhs (unsigned int i=0)
 
const NumericVector< Number > & get_sensitivity_rhs (unsigned int i=0) const
 
unsigned int n_vectors () const
 
unsigned int n_vars () const
 
unsigned int n_variable_groups () const
 
unsigned int n_components () const
 
dof_id_type n_dofs () const
 
dof_id_type n_active_dofs () const
 
dof_id_type n_constrained_dofs () const
 
dof_id_type n_local_constrained_dofs () const
 
dof_id_type n_local_dofs () const
 
unsigned int add_variable (const std::string &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. More...
 
unsigned int add_variable (const std::string &var, const Order order=FIRST, const FEFamily=LAGRANGE, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
 Adds the variable var to the list of variables for this system. More...
 
unsigned int add_variables (const std::vector< std::string > &vars, 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. More...
 
unsigned int add_variables (const std::vector< std::string > &vars, const Order order=FIRST, const FEFamily=LAGRANGE, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
 Adds the variable var to the list of variables for this system. More...
 
const Variablevariable (unsigned int var) const
 Return a constant reference to Variable var. More...
 
const VariableGroupvariable_group (unsigned int vg) const
 Return a constant reference to VariableGroup vg. More...
 
bool has_variable (const std::string &var) const
 
const std::string & variable_name (const unsigned int i) const
 
unsigned short int variable_number (const std::string &var) const
 
void get_all_variable_numbers (std::vector< unsigned int > &all_variable_numbers) const
 Fills all_variable_numbers with all the variable numbers for the variables that have been added to this system. More...
 
unsigned int variable_scalar_number (const std::string &var, unsigned int component) const
 
unsigned int variable_scalar_number (unsigned int var_num, unsigned int component) const
 
const FETypevariable_type (const unsigned int i) const
 
const FETypevariable_type (const std::string &var) const
 
bool identify_variable_groups () const
 
void identify_variable_groups (const bool)
 Toggle automatic VariableGroup identification. More...
 
Real calculate_norm (const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type, std::set< unsigned int > *skip_dimensions=nullptr) const
 
Real calculate_norm (const NumericVector< Number > &v, const SystemNorm &norm, std::set< unsigned int > *skip_dimensions=nullptr) const
 
void read_header (Xdr &io, const std::string &version, const bool read_header=true, const bool read_additional_data=true, const bool read_legacy_format=false)
 Reads the basic data header for this System. More...
 
void read_legacy_data (Xdr &io, const bool read_additional_data=true)
 Reads additional data, namely vectors, for this System. More...
 
template<typename ValType >
void read_serialized_data (Xdr &io, const bool read_additional_data=true)
 Reads additional data, namely vectors, for this System. More...
 
void read_serialized_data (Xdr &io, const bool read_additional_data=true)
 Non-templated version for backward compatibility. More...
 
template<typename InValType >
std::size_t read_serialized_vectors (Xdr &io, const std::vector< NumericVector< Number > *> &vectors) const
 Read a number of identically distributed vectors. More...
 
std::size_t read_serialized_vectors (Xdr &io, const std::vector< NumericVector< Number > *> &vectors) const
 Non-templated version for backward compatibility. More...
 
template<typename InValType >
void read_parallel_data (Xdr &io, const bool read_additional_data)
 Reads additional data, namely vectors, for this System. More...
 
void read_parallel_data (Xdr &io, const bool read_additional_data)
 Non-templated version for backward compatibility. More...
 
void write_header (Xdr &io, const std::string &version, const bool write_additional_data) const
 Writes the basic data header for this System. More...
 
void write_serialized_data (Xdr &io, const bool write_additional_data=true) const
 Writes additional data, namely vectors, for this System. More...
 
std::size_t write_serialized_vectors (Xdr &io, const std::vector< const NumericVector< Number > *> &vectors) const
 Serialize & write a number of identically distributed vectors. More...
 
void write_parallel_data (Xdr &io, const bool write_additional_data) const
 Writes additional data, namely vectors, for this System. More...
 
std::string get_info () const
 
void attach_init_function (void fptr(EquationSystems &es, const std::string &name))
 Register a user function to use in initializing the system. More...
 
void attach_init_object (Initialization &init)
 Register a user class to use to initialize the system. More...
 
void attach_assemble_function (void fptr(EquationSystems &es, const std::string &name))
 Register a user function to use in assembling the system matrix and RHS. More...
 
void attach_assemble_object (Assembly &assemble)
 Register a user object to use in assembling the system matrix and RHS. More...
 
void attach_constraint_function (void fptr(EquationSystems &es, const std::string &name))
 Register a user function for imposing constraints. More...
 
void attach_constraint_object (Constraint &constrain)
 Register a user object for imposing constraints. More...
 
void attach_QOI_function (void fptr(EquationSystems &es, const std::string &name, const QoISet &qoi_indices))
 Register a user function for evaluating the quantities of interest, whose values should be placed in System::qoi. More...
 
void attach_QOI_object (QOI &qoi)
 Register a user object for evaluating the quantities of interest, whose values should be placed in System::qoi. More...
 
void attach_QOI_derivative (void fptr(EquationSystems &es, const std::string &name, const QoISet &qoi_indices, bool include_liftfunc, bool apply_constraints))
 Register a user function for evaluating derivatives of a quantity of interest with respect to test functions, whose values should be placed in System::rhs. More...
 
void attach_QOI_derivative_object (QOIDerivative &qoi_derivative)
 Register a user object for evaluating derivatives of a quantity of interest with respect to test functions, whose values should be placed in System::rhs. More...
 
virtual void user_initialization ()
 Calls user's attached initialization function, or is overridden by the user in derived classes. More...
 
virtual void user_assembly ()
 Calls user's attached assembly function, or is overridden by the user in derived classes. More...
 
virtual void user_constrain ()
 Calls user's attached constraint function, or is overridden by the user in derived classes. More...
 
virtual void user_QOI (const QoISet &qoi_indices)
 Calls user's attached quantity of interest function, or is overridden by the user in derived classes. More...
 
virtual void user_QOI_derivative (const QoISet &qoi_indices=QoISet(), bool include_liftfunc=true, bool apply_constraints=true)
 Calls user's attached quantity of interest derivative function, or is overridden by the user in derived classes. More...
 
virtual void re_update ()
 Re-update the local values when the mesh has changed. More...
 
virtual void restrict_vectors ()
 Restrict vectors after the mesh has coarsened. More...
 
virtual void prolong_vectors ()
 Prolong vectors after the mesh has refined. More...
 
Number current_solution (const dof_id_type global_dof_number) const
 
unsigned int n_qois () const
 Number of currently active quantities of interest. More...
 
Number point_value (unsigned int var, const Point &p, const bool insist_on_success=true) const
 
Number point_value (unsigned int var, const Point &p, const Elem &e) const
 
Number point_value (unsigned int var, const Point &p, const Elem *e) const
 Calls the version of point_value() which takes a reference. More...
 
Gradient point_gradient (unsigned int var, const Point &p, const bool insist_on_success=true) const
 
Gradient point_gradient (unsigned int var, const Point &p, const Elem &e) const
 
Gradient point_gradient (unsigned int var, const Point &p, const Elem *e) const
 Calls the version of point_gradient() which takes a reference. More...
 
Tensor point_hessian (unsigned int var, const Point &p, const bool insist_on_success=true) const
 
Tensor point_hessian (unsigned int var, const Point &p, const Elem &e) const
 
Tensor point_hessian (unsigned int var, const Point &p, const Elem *e) const
 Calls the version of point_hessian() which takes a reference. More...
 
void local_dof_indices (const unsigned int var, std::set< dof_id_type > &var_indices) const
 Fills the std::set with the degrees of freedom on the local processor corresponding the the variable number passed in. More...
 
void zero_variable (NumericVector< Number > &v, unsigned int var_num) const
 Zeroes all dofs in v that correspond to variable number var_num. More...
 
bool & hide_output ()
 
void projection_matrix (SparseMatrix< Number > &proj_mat) const
 This method creates a projection matrix which corresponds to the operation of project_vector between old and new solution spaces. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Public Attributes

std::unique_ptr< OptimizationSolver< Number > > optimization_solver
 The OptimizationSolver that is used for performing the optimization. More...
 
std::unique_ptr< NumericVector< Number > > C_eq
 The vector that stores equality constraints. More...
 
std::unique_ptr< SparseMatrix< Number > > C_eq_jac
 The sparse matrix that stores the Jacobian of C_eq. More...
 
std::unique_ptr< NumericVector< Number > > C_ineq
 The vector that stores inequality constraints. More...
 
std::unique_ptr< SparseMatrix< Number > > C_ineq_jac
 The sparse matrix that stores the Jacobian of C_ineq. More...
 
std::unique_ptr< NumericVector< Number > > lambda_eq
 Vectors to store the dual variables associated with equality and inequality constraints. More...
 
std::unique_ptr< NumericVector< Number > > lambda_ineq
 
std::vector< std::set< numeric_index_type > > eq_constraint_jac_sparsity
 A copy of the equality and inequality constraint Jacobian sparsity patterns. More...
 
std::vector< std::set< numeric_index_type > > ineq_constraint_jac_sparsity
 
SparseMatrix< Number > * matrix
 The system matrix. More...
 
bool zero_out_matrix_and_rhs
 By default, the system will zero out the matrix and the right hand side. More...
 
NumericVector< Number > * rhs
 The system matrix. More...
 
bool assemble_before_solve
 Flag which tells the system to whether or not to call the user assembly function during each call to solve(). More...
 
bool use_fixed_solution
 A boolean to be set to true by systems using elem_fixed_solution, for optional use by e.g. More...
 
int extra_quadrature_order
 A member int that can be employed to indicate increased or reduced quadrature order. More...
 
std::unique_ptr< NumericVector< Number > > solution
 Data structure to hold solution values. More...
 
std::unique_ptr< NumericVector< Number > > current_local_solution
 All the values I need to compute my contribution to the simulation at hand. More...
 
Real time
 For time-dependent problems, this is the time t at the beginning of the current timestep. More...
 
std::vector< Numberqoi
 Values of the quantities of interest. More...
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 

Protected Member Functions

virtual void init_matrices ()
 Initializes the matrices associated with this system. More...
 
void project_vector (NumericVector< Number > &, int is_adjoint=-1) const
 Projects the vector defined on the old mesh onto the new mesh. More...
 
void project_vector (const NumericVector< Number > &, NumericVector< Number > &, int is_adjoint=-1) const
 Projects the vector defined on the old mesh onto the new mesh. More...
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Protected Attributes

const Parallel::Communicator_communicator
 

Static Protected Attributes

static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int > _n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter
 Flag to control whether reference count information is printed when print_info is called. More...
 

Detailed Description

This System subclass enables us to assemble an objective function, gradient, Hessian and bounds for optimization problems.

Author
David Knezevic
Date
2015

Definition at line 43 of file optimization_system.h.

Member Typedef Documentation

◆ const_matrices_iterator

typedef std::map<std::string, SparseMatrix<Number> *>::const_iterator libMesh::ImplicitSystem::const_matrices_iterator
inherited

Definition at line 290 of file implicit_system.h.

◆ const_vectors_iterator

typedef std::map<std::string, NumericVector<Number> *>::const_iterator libMesh::System::const_vectors_iterator
inherited

Definition at line 742 of file system.h.

◆ Counts

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

Definition at line 117 of file reference_counter.h.

◆ GradientFunctionPointer

typedef Gradient(* libMesh::System::GradientFunctionPointer) (const Point &p, const Parameters &parameters, const std::string &sys_name, const std::string &unknown_name)
inherited

Definition at line 517 of file system.h.

◆ matrices_iterator

typedef std::map<std::string, SparseMatrix<Number> *>::iterator libMesh::ImplicitSystem::matrices_iterator
inherited

Matrix iterator typedefs.

Definition at line 289 of file implicit_system.h.

◆ Parent

The type of the parent.

Definition at line 68 of file optimization_system.h.

◆ sys_type

The type of system.

Definition at line 63 of file optimization_system.h.

◆ ValueFunctionPointer

typedef Number(* libMesh::System::ValueFunctionPointer) (const Point &p, const Parameters &Parameters, const std::string &sys_name, const std::string &unknown_name)
inherited

Projects arbitrary functions onto the current solution.

The function value fptr and its gradient gptr are represented by function pointers. A gradient gptr is only required/used for projecting onto finite element spaces with continuous derivatives.

Definition at line 513 of file system.h.

◆ vectors_iterator

typedef std::map<std::string, NumericVector<Number> *>::iterator libMesh::System::vectors_iterator
inherited

Vector iterator typedefs.

Definition at line 741 of file system.h.

Constructor & Destructor Documentation

◆ OptimizationSystem()

libMesh::OptimizationSystem::OptimizationSystem ( EquationSystems es,
const std::string &  name,
const unsigned int  number 
)

Constructor.

Optionally initializes required data structures.

◆ ~OptimizationSystem()

virtual libMesh::OptimizationSystem::~OptimizationSystem ( )
virtual

Destructor.

Member Function Documentation

◆ activate()

void libMesh::System::activate ( )
inherited

Activates the system.

Only active systems are solved.

Definition at line 2066 of file system.h.

References libMesh::System::_active.

2067 {
2068  _active = true;
2069 }
bool _active
Flag stating if the system is active or not.
Definition: system.h:1920

◆ active()

bool libMesh::System::active ( ) const
inherited
Returns
true if the system is active, false otherwise. An active system will be solved.

Definition at line 2058 of file system.h.

References libMesh::System::_active.

2059 {
2060  return _active;
2061 }
bool _active
Flag stating if the system is active or not.
Definition: system.h:1920

◆ add_adjoint_rhs()

NumericVector<Number>& libMesh::System::add_adjoint_rhs ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's adjoint rhs vectors, by default the one corresponding to the first qoi. Creates the vector if it doesn't already exist.

◆ add_adjoint_solution()

NumericVector<Number>& libMesh::System::add_adjoint_solution ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's adjoint solution vectors, by default the one corresponding to the first qoi. Creates the vector if it doesn't already exist.

◆ add_matrix()

SparseMatrix<Number>& libMesh::ImplicitSystem::add_matrix ( const std::string &  mat_name)
inherited

Adds the additional matrix mat_name to this system.

Only allowed prior to assemble(). All additional matrices have the same sparsity pattern as the matrix used during solution. When not System but the user wants to initialize the mayor matrix, then all the additional matrices, if existent, have to be initialized by the user, too.

◆ add_sensitivity_rhs()

NumericVector<Number>& libMesh::System::add_sensitivity_rhs ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's sensitivity rhs vectors, by default the one corresponding to the first parameter. Creates the vector if it doesn't already exist.

◆ add_sensitivity_solution()

NumericVector<Number>& libMesh::System::add_sensitivity_solution ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's solution sensitivity vectors, by default the one corresponding to the first parameter. Creates the vector if it doesn't already exist.

◆ add_variable() [1/2]

unsigned int libMesh::System::add_variable ( const std::string &  var,
const FEType type,
const std::set< subdomain_id_type > *const  active_subdomains = nullptr 
)
inherited

Adds the variable var to the list of variables for this system.

Returns
The index number for the new variable.

Referenced by SimpleRBConstruction::init_data(), and FETest< order, family, elem_type >::setUp().

◆ add_variable() [2/2]

unsigned int libMesh::System::add_variable ( const std::string &  var,
const Order  order = FIRST,
const FEFamily  = LAGRANGE,
const std::set< subdomain_id_type > *const  active_subdomains = nullptr 
)
inherited

Adds the variable var to the list of variables for this system.

Same as before, but assumes LAGRANGE as default value for FEType.family.

◆ add_variables() [1/2]

unsigned int libMesh::System::add_variables ( const std::vector< std::string > &  vars,
const FEType type,
const std::set< subdomain_id_type > *const  active_subdomains = nullptr 
)
inherited

Adds the variable var to the list of variables for this system.

Returns
The index number for the new variable.

◆ add_variables() [2/2]

unsigned int libMesh::System::add_variables ( const std::vector< std::string > &  vars,
const Order  order = FIRST,
const FEFamily  = LAGRANGE,
const std::set< subdomain_id_type > *const  active_subdomains = nullptr 
)
inherited

Adds the variable var to the list of variables for this system.

Same as before, but assumes LAGRANGE as default value for FEType.family.

◆ add_vector()

NumericVector<Number>& libMesh::System::add_vector ( const std::string &  vec_name,
const bool  projections = true,
const ParallelType  type = PARALLEL 
)
inherited

Adds the additional vector vec_name to this system.

All the additional vectors are similarly distributed, like the solution, and initialized to zero.

By default vectors added by add_vector are projected to changed grids by reinit(). To zero them instead (more efficient), pass "false" as the second argument

◆ add_weighted_sensitivity_adjoint_solution()

NumericVector<Number>& libMesh::System::add_weighted_sensitivity_adjoint_solution ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's weighted sensitivity adjoint solution vectors, by default the one corresponding to the first qoi. Creates the vector if it doesn't already exist.

◆ add_weighted_sensitivity_solution()

NumericVector<Number>& libMesh::System::add_weighted_sensitivity_solution ( )
inherited
Returns
A reference to the solution of the last weighted sensitivity solve Creates the vector if it doesn't already exist.

◆ adjoint_qoi_parameter_sensitivity()

virtual void libMesh::ImplicitSystem::adjoint_qoi_parameter_sensitivity ( const QoISet qoi_indices,
const ParameterVector parameters,
SensitivityData sensitivities 
)
overridevirtualinherited

Solves for the derivative of each of the system's quantities of interest q in qoi[qoi_indices] with respect to each parameter in parameters, placing the result for qoi i and parameter j into sensitivities[i][j].

Uses adjoint_solve() and the adjoint sensitivity method.

Currently uses finite differenced derivatives (partial q / partial p) and (partial R / partial p).

Reimplemented from libMesh::System.

◆ adjoint_solve()

virtual std::pair<unsigned int, Real> libMesh::ImplicitSystem::adjoint_solve ( const QoISet qoi_indices = QoISet())
overridevirtualinherited

Assembles & solves the linear system (dR/du)^T*z = dq/du, for those quantities of interest q specified by qoi_indices.

Leave qoi_indices empty to solve all adjoint problems.

Returns
A pair with the total number of linear iterations performed and the (sum of the) final residual norms

Reimplemented from libMesh::System.

Reimplemented in libMesh::DifferentiableSystem.

◆ assemble()

virtual void libMesh::ImplicitSystem::assemble ( )
overridevirtualinherited

Prepares matrix and rhs for system assembly, then calls user assembly function.

Can be overridden in derived classes.

Reimplemented from libMesh::System.

Reimplemented in libMesh::DifferentiableSystem, libMesh::LinearImplicitSystem, libMesh::FrequencySystem, and libMesh::NewmarkSystem.

Referenced by libMesh::LinearImplicitSystem::assemble().

◆ assemble_qoi()

virtual void libMesh::ExplicitSystem::assemble_qoi ( const QoISet qoi_indices = QoISet())
overridevirtualinherited

Prepares qoi for quantity of interest assembly, then calls user qoi function.

Can be overridden in derived classes.

Reimplemented from libMesh::System.

Reimplemented in libMesh::FEMSystem.

◆ assemble_qoi_derivative()

virtual void libMesh::ExplicitSystem::assemble_qoi_derivative ( const QoISet qoi_indices = QoISet(),
bool  include_liftfunc = true,
bool  apply_constraints = true 
)
overridevirtualinherited

Prepares adjoint_rhs for quantity of interest derivative assembly, then calls user qoi derivative function.

Can be overridden in derived classes.

Reimplemented from libMesh::System.

Reimplemented in libMesh::FEMSystem.

◆ assemble_residual_derivatives()

virtual void libMesh::ImplicitSystem::assemble_residual_derivatives ( const ParameterVector parameters)
overridevirtualinherited

Residual parameter derivative function.

Uses finite differences by default.

This will assemble the sensitivity rhs vectors to hold -(partial R / partial p_i), making them ready to solve the forward sensitivity equation.

Can be overridden in derived classes.

Reimplemented from libMesh::System.

◆ assembly()

virtual void libMesh::ImplicitSystem::assembly ( bool  ,
bool  ,
bool  = false,
bool  = false 
)
virtualinherited

Assembles a residual in rhs and/or a jacobian in matrix, as requested.

This is undefined in ImplicitSystem; subclasses each have their own way of handling assembly.

Reimplemented in libMesh::NonlinearImplicitSystem, libMesh::DifferentiableSystem, libMesh::LinearImplicitSystem, and libMesh::FEMSystem.

Definition at line 152 of file implicit_system.h.

156  { libmesh_not_implemented(); }

◆ attach_assemble_function()

void libMesh::System::attach_assemble_function ( void   fptrEquationSystems &es, const std::string &name)
inherited

Register a user function to use in assembling the system matrix and RHS.

◆ attach_assemble_object()

void libMesh::System::attach_assemble_object ( Assembly assemble)
inherited

Register a user object to use in assembling the system matrix and RHS.

◆ attach_constraint_function()

void libMesh::System::attach_constraint_function ( void   fptrEquationSystems &es, const std::string &name)
inherited

Register a user function for imposing constraints.

◆ attach_constraint_object()

void libMesh::System::attach_constraint_object ( Constraint constrain)
inherited

Register a user object for imposing constraints.

◆ attach_init_function()

void libMesh::System::attach_init_function ( void   fptrEquationSystems &es, const std::string &name)
inherited

Register a user function to use in initializing the system.

◆ attach_init_object()

void libMesh::System::attach_init_object ( Initialization init)
inherited

Register a user class to use to initialize the system.

Note
This is exclusive with the attach_init_function.

◆ attach_QOI_derivative()

void libMesh::System::attach_QOI_derivative ( void   fptrEquationSystems &es, const std::string &name, const QoISet &qoi_indices, bool include_liftfunc, bool apply_constraints)
inherited

Register a user function for evaluating derivatives of a quantity of interest with respect to test functions, whose values should be placed in System::rhs.

◆ attach_QOI_derivative_object()

void libMesh::System::attach_QOI_derivative_object ( QOIDerivative qoi_derivative)
inherited

Register a user object for evaluating derivatives of a quantity of interest with respect to test functions, whose values should be placed in System::rhs.

◆ attach_QOI_function()

void libMesh::System::attach_QOI_function ( void   fptrEquationSystems &es, const std::string &name, const QoISet &qoi_indices)
inherited

Register a user function for evaluating the quantities of interest, whose values should be placed in System::qoi.

◆ attach_QOI_object()

void libMesh::System::attach_QOI_object ( QOI qoi)
inherited

Register a user object for evaluating the quantities of interest, whose values should be placed in System::qoi.

◆ boundary_project_solution() [1/2]

void libMesh::System::boundary_project_solution ( const std::set< boundary_id_type > &  b,
const std::vector< unsigned int > &  variables,
FunctionBase< Number > *  f,
FunctionBase< Gradient > *  g = nullptr 
)
inherited

Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system.

Only degrees of freedom which affect the function's trace on a boundary in the set b are affected. Only degrees of freedom associated with the variables listed in the vector variables are projected. The function value f and its gradient g are user-provided cloneable functors. A gradient g is only required/used for projecting onto finite element spaces with continuous derivatives. If non-default Parameters are to be used, they can be provided in the parameters argument.

◆ boundary_project_solution() [2/2]

void libMesh::System::boundary_project_solution ( const std::set< boundary_id_type > &  b,
const std::vector< unsigned int > &  variables,
ValueFunctionPointer  fptr,
GradientFunctionPointer  gptr,
const Parameters parameters 
)
inherited

Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system.

Only degrees of freedom which affect the function's trace on a boundary in the set b are affected. Only degrees of freedom associated with the variables listed in the vector variables are projected. The function value fptr and its gradient gptr are represented by function pointers. A gradient gptr is only required/used for projecting onto finite element spaces with continuous derivatives.

◆ boundary_project_vector() [1/2]

void libMesh::System::boundary_project_vector ( const std::set< boundary_id_type > &  b,
const std::vector< unsigned int > &  variables,
NumericVector< Number > &  new_vector,
FunctionBase< Number > *  f,
FunctionBase< Gradient > *  g = nullptr,
int  is_adjoint = -1 
) const
inherited

Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system.

Only degrees of freedom which affect the function's trace on a boundary in the set b are affected. Only degrees of freedom associated with the variables listed in the vector variables are projected. The function value f and its gradient g are user-provided cloneable functors. A gradient g is only required/used for projecting onto finite element spaces with continuous derivatives. If non-default Parameters are to be used, they can be provided in the parameters argument.

Constrain the new vector using the requested adjoint rather than primal constraints if is_adjoint is non-negative.

◆ boundary_project_vector() [2/2]

void libMesh::System::boundary_project_vector ( const std::set< boundary_id_type > &  b,
const std::vector< unsigned int > &  variables,
ValueFunctionPointer  fptr,
GradientFunctionPointer  gptr,
const Parameters parameters,
NumericVector< Number > &  new_vector,
int  is_adjoint = -1 
) const
inherited

Projects arbitrary boundary functions onto a vector of degree of freedom values for the current system.

Only degrees of freedom which affect the function's trace on a boundary in the set b are affected. Only degrees of freedom associated with the variables listed in the vector variables are projected. The function value fptr and its gradient gptr are represented by function pointers. A gradient gptr is only required/used for projecting onto finite element spaces with continuous derivatives.

Constrain the new vector using the requested adjoint rather than primal constraints if is_adjoint is non-negative.

◆ calculate_norm() [1/2]

Real libMesh::System::calculate_norm ( const NumericVector< Number > &  v,
unsigned int  var,
FEMNormType  norm_type,
std::set< unsigned int > *  skip_dimensions = nullptr 
) const
inherited
Returns
A norm of variable var in the vector v, in the specified norm (e.g. L2, L_INF, H1)

◆ calculate_norm() [2/2]

Real libMesh::System::calculate_norm ( const NumericVector< Number > &  v,
const SystemNorm norm,
std::set< unsigned int > *  skip_dimensions = nullptr 
) const
inherited
Returns
A norm of the vector v, using component_norm and component_scale to choose and weight the norms of each variable.

◆ clear()

virtual void libMesh::OptimizationSystem::clear ( )
overridevirtual

Clear all the data structures associated with the system.

Reimplemented from libMesh::ImplicitSystem.

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited

◆ compare()

virtual bool libMesh::System::compare ( const System other_system,
const Real  threshold,
const bool  verbose 
) const
virtualinherited
Returns
true when the other system contains identical data, up to the given threshold. Outputs some diagnostic info when verbose is set.

◆ current_solution()

Number libMesh::System::current_solution ( const dof_id_type  global_dof_number) const
inherited
Returns
The current solution for the specified global DOF.

◆ deactivate()

void libMesh::System::deactivate ( )
inherited

Deactivates the system.

Only active systems are solved.

Definition at line 2074 of file system.h.

References libMesh::System::_active.

2075 {
2076  _active = false;
2077 }
bool _active
Flag stating if the system is active or not.
Definition: system.h:1920

◆ disable_cache()

virtual void libMesh::ImplicitSystem::disable_cache ( )
overridevirtualinherited

Avoids use of any cached data that might affect any solve result.

Should be overridden in derived systems.

Reimplemented from libMesh::System.

◆ disable_print_counter_info()

static void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

◆ enable_print_counter_info()

static void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

◆ forward_qoi_parameter_sensitivity()

virtual void libMesh::ImplicitSystem::forward_qoi_parameter_sensitivity ( const QoISet qoi_indices,
const ParameterVector parameters,
SensitivityData sensitivities 
)
overridevirtualinherited

Solves for the derivative of each of the system's quantities of interest q in qoi[qoi_indices] with respect to each parameter in parameters, placing the result for qoi i and parameter j into sensitivities[i][j].

Uses the forward sensitivity method.

Currently uses finite differenced derivatives (partial q / partial p) and (partial R / partial p).

Reimplemented from libMesh::System.

◆ get_adjoint_rhs() [1/2]

NumericVector<Number>& libMesh::System::get_adjoint_rhs ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's adjoint rhs vectors, by default the one corresponding to the first qoi. This what the user's QoI derivative code should assemble when setting up an adjoint problem

◆ get_adjoint_rhs() [2/2]

const NumericVector<Number>& libMesh::System::get_adjoint_rhs ( unsigned int  i = 0) const
inherited
Returns
A reference to one of the system's adjoint rhs vectors, by default the one corresponding to the first qoi.

◆ get_adjoint_solution() [1/2]

NumericVector<Number>& libMesh::System::get_adjoint_solution ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's adjoint solution vectors, by default the one corresponding to the first qoi.

◆ get_adjoint_solution() [2/2]

const NumericVector<Number>& libMesh::System::get_adjoint_solution ( unsigned int  i = 0) const
inherited
Returns
A reference to one of the system's adjoint solution vectors, by default the one corresponding to the first qoi.

◆ get_all_variable_numbers()

void libMesh::System::get_all_variable_numbers ( std::vector< unsigned int > &  all_variable_numbers) const
inherited

Fills all_variable_numbers with all the variable numbers for the variables that have been added to this system.

◆ get_dof_map() [1/2]

const DofMap & libMesh::System::get_dof_map ( ) const
inherited
Returns
A constant reference to this system's _dof_map.

Definition at line 2042 of file system.h.

References libMesh::System::_dof_map.

Referenced by SimpleRBConstruction::init_data(), and FETest< order, family, elem_type >::setUp().

2043 {
2044  return *_dof_map;
2045 }
std::unique_ptr< DofMap > _dof_map
Data structure describing the relationship between nodes, variables, etc...
Definition: system.h:1877

◆ get_dof_map() [2/2]

DofMap & libMesh::System::get_dof_map ( )
inherited
Returns
A writable reference to this system's _dof_map.

Definition at line 2050 of file system.h.

References libMesh::System::_dof_map.

2051 {
2052  return *_dof_map;
2053 }
std::unique_ptr< DofMap > _dof_map
Data structure describing the relationship between nodes, variables, etc...
Definition: system.h:1877

◆ get_equation_systems() [1/2]

const EquationSystems& libMesh::System::get_equation_systems ( ) const
inherited
Returns
A constant reference to this system's parent EquationSystems object.

Definition at line 705 of file system.h.

References libMesh::System::_equation_systems.

Referenced by libMesh::WrappedFunction< Output >::WrappedFunction().

705 { return _equation_systems; }
EquationSystems & _equation_systems
Constant reference to the EquationSystems object used for the simulation.
Definition: system.h:1883

◆ get_equation_systems() [2/2]

EquationSystems& libMesh::System::get_equation_systems ( )
inherited
Returns
A reference to this system's parent EquationSystems object.

Definition at line 710 of file system.h.

References libMesh::System::_equation_systems.

710 { return _equation_systems; }
EquationSystems & _equation_systems
Constant reference to the EquationSystems object used for the simulation.
Definition: system.h:1883

◆ get_info() [1/2]

static std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

◆ get_info() [2/2]

std::string libMesh::System::get_info ( ) const
inherited
Returns
A string containing information about the system.

◆ get_linear_solve_parameters()

virtual std::pair<unsigned int, Real> libMesh::ImplicitSystem::get_linear_solve_parameters ( ) const
virtualinherited
Returns
An integer corresponding to the upper iteration count limit and a Real corresponding to the convergence tolerance to be used in linear adjoint and/or sensitivity solves

Reimplemented in libMesh::NonlinearImplicitSystem, and libMesh::DifferentiableSystem.

◆ get_linear_solver()

virtual LinearSolver<Number>* libMesh::ImplicitSystem::get_linear_solver ( ) const
virtualinherited
Returns
A pointer to a linear solver appropriate for use in adjoint and/or sensitivity solves

This function must be overridden in derived classes, since this base class does not have a valid LinearSolver to hand back a pointer to.

Deprecated:
This function's current behavior, i.e. allocating a LinearSolver and handing it back to the user, makes it very easy to leak memory, and probably won't have the intended effect, i.e. of setting some parameters on a LinearSolver that the System would later use internally.

Reimplemented in libMesh::LinearImplicitSystem, and libMesh::DifferentiableSystem.

◆ get_matrix() [1/2]

const SparseMatrix<Number>& libMesh::ImplicitSystem::get_matrix ( const std::string &  mat_name) const
inherited
Returns
A const reference to this system's additional matrix named mat_name.

None of these matrices is involved in the solution process. Access is only granted when the matrix is already properly initialized.

◆ get_matrix() [2/2]

SparseMatrix<Number>& libMesh::ImplicitSystem::get_matrix ( const std::string &  mat_name)
inherited
Returns
A writable reference to this system's additional matrix named mat_name.

None of these matrices is involved in the solution process. Access is only granted when the matrix is already properly initialized.

◆ get_mesh() [1/2]

const MeshBase & libMesh::System::get_mesh ( ) const
inherited
Returns
A constant reference to this systems's _mesh.

Definition at line 2026 of file system.h.

References libMesh::System::_mesh.

Referenced by AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), and AssemblyA2::boundary_assembly().

2027 {
2028  return _mesh;
2029 }
MeshBase & _mesh
Constant reference to the mesh data structure used for the simulation.
Definition: system.h:1889

◆ get_mesh() [2/2]

MeshBase & libMesh::System::get_mesh ( )
inherited
Returns
A reference to this systems's _mesh.

Definition at line 2034 of file system.h.

References libMesh::System::_mesh.

2035 {
2036  return _mesh;
2037 }
MeshBase & _mesh
Constant reference to the mesh data structure used for the simulation.
Definition: system.h:1889

◆ get_sensitivity_rhs() [1/2]

NumericVector<Number>& libMesh::System::get_sensitivity_rhs ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's sensitivity rhs vectors, by default the one corresponding to the first parameter. By default these vectors are built by the library, using finite differences, when assemble_residual_derivatives() is called.

When assembled, this vector should hold -(partial R / partial p_i)

◆ get_sensitivity_rhs() [2/2]

const NumericVector<Number>& libMesh::System::get_sensitivity_rhs ( unsigned int  i = 0) const
inherited
Returns
A reference to one of the system's sensitivity rhs vectors, by default the one corresponding to the first parameter.

◆ get_sensitivity_solution() [1/2]

NumericVector<Number>& libMesh::System::get_sensitivity_solution ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's solution sensitivity vectors, by default the one corresponding to the first parameter.

◆ get_sensitivity_solution() [2/2]

const NumericVector<Number>& libMesh::System::get_sensitivity_solution ( unsigned int  i = 0) const
inherited
Returns
A reference to one of the system's solution sensitivity vectors, by default the one corresponding to the first parameter.

◆ get_vector() [1/4]

const NumericVector<Number>& libMesh::System::get_vector ( const std::string &  vec_name) const
inherited
Returns
A const reference to this system's additional vector named vec_name. Access is only granted when the vector is already properly initialized.

◆ get_vector() [2/4]

NumericVector<Number>& libMesh::System::get_vector ( const std::string &  vec_name)
inherited
Returns
A writable reference to this system's additional vector named vec_name. Access is only granted when the vector is already properly initialized.

◆ get_vector() [3/4]

const NumericVector<Number>& libMesh::System::get_vector ( const unsigned int  vec_num) const
inherited
Returns
A const reference to this system's additional vector number vec_num (where the vectors are counted starting with 0).

◆ get_vector() [4/4]

NumericVector<Number>& libMesh::System::get_vector ( const unsigned int  vec_num)
inherited
Returns
A writable reference to this system's additional vector number vec_num (where the vectors are counted starting with 0).

◆ get_weighted_sensitivity_adjoint_solution() [1/2]

NumericVector<Number>& libMesh::System::get_weighted_sensitivity_adjoint_solution ( unsigned int  i = 0)
inherited
Returns
A reference to one of the system's weighted sensitivity adjoint solution vectors, by default the one corresponding to the first qoi.

◆ get_weighted_sensitivity_adjoint_solution() [2/2]

const NumericVector<Number>& libMesh::System::get_weighted_sensitivity_adjoint_solution ( unsigned int  i = 0) const
inherited
Returns
A reference to one of the system's weighted sensitivity adjoint solution vectors, by default the one corresponding to the first qoi.

◆ get_weighted_sensitivity_solution() [1/2]

NumericVector<Number>& libMesh::System::get_weighted_sensitivity_solution ( )
inherited
Returns
A reference to the solution of the last weighted sensitivity solve

◆ get_weighted_sensitivity_solution() [2/2]

const NumericVector<Number>& libMesh::System::get_weighted_sensitivity_solution ( ) const
inherited
Returns
A reference to the solution of the last weighted sensitivity solve

◆ has_variable()

bool libMesh::System::has_variable ( const std::string &  var) const
inherited
Returns
true if a variable named var exists in this System

◆ have_matrix()

bool libMesh::ImplicitSystem::have_matrix ( const std::string &  mat_name) const
inherited
Returns
true if this System has a matrix associated with the given name, false otherwise.

Definition at line 403 of file implicit_system.h.

References libMesh::ImplicitSystem::_matrices.

404 {
405  return (_matrices.count(mat_name));
406 }
std::map< std::string, SparseMatrix< Number > * > _matrices
Some systems need an arbitrary number of matrices.

◆ have_vector()

bool libMesh::System::have_vector ( const std::string &  vec_name) const
inherited
Returns
true if this System has a vector associated with the given name, false otherwise.

Definition at line 2218 of file system.h.

References libMesh::System::_vectors.

2219 {
2220  return (_vectors.count(vec_name));
2221 }
std::map< std::string, NumericVector< Number > *> _vectors
Some systems need an arbitrary number of vectors.
Definition: system.h:1928

◆ hide_output()

bool& libMesh::System::hide_output ( )
inherited
Returns
A writable reference to a boolean that determines if this system can be written to file or not. If set to true, then EquationSystems::write will ignore this system.

Definition at line 1655 of file system.h.

References libMesh::System::_hide_output.

1655 { return _hide_output; }
bool _hide_output
Are we allowed to write this system to file? If _hide_output is true, then EquationSystems::write wil...
Definition: system.h:2002

◆ identify_variable_groups() [1/2]

bool libMesh::System::identify_variable_groups ( ) const
inherited
Returns
true when VariableGroup structures should be automatically identified, false otherwise.

Definition at line 2194 of file system.h.

References libMesh::System::_identify_variable_groups.

2195 {
2197 }
bool _identify_variable_groups
true when VariableGroup structures should be automatically identified, false otherwise.
Definition: system.h:1970

◆ identify_variable_groups() [2/2]

void libMesh::System::identify_variable_groups ( const bool  ivg)
inherited

Toggle automatic VariableGroup identification.

Definition at line 2202 of file system.h.

References libMesh::System::_identify_variable_groups.

2203 {
2205 }
bool _identify_variable_groups
true when VariableGroup structures should be automatically identified, false otherwise.
Definition: system.h:1970

◆ increment_constructor_count()

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

Definition at line 181 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }
std::string name(const ElemQuality q)
static Counts _counts
Actually holds the data.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.

◆ increment_destructor_count()

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

Definition at line 194 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }
std::string name(const ElemQuality q)
static Counts _counts
Actually holds the data.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.

◆ init()

void libMesh::System::init ( )
inherited

Initializes degrees of freedom on the current mesh.

Sets the

◆ init_data()

virtual void libMesh::OptimizationSystem::init_data ( )
overridevirtual

Initializes new data members of the system.

Reimplemented from libMesh::ImplicitSystem.

◆ init_matrices()

virtual void libMesh::ImplicitSystem::init_matrices ( )
protectedvirtualinherited

Initializes the matrices associated with this system.

◆ initialize_equality_constraints_storage()

void libMesh::OptimizationSystem::initialize_equality_constraints_storage ( const std::vector< std::set< numeric_index_type >> &  constraint_jac_sparsity)

Initialize storage for the equality constraints, and the corresponding Jacobian.

The length of constraint_jac_sparsity indicates the number of constraints that will be imposed, and n_dofs_per_constraint[i] gives the indices that are non-zero in row i of the Jacobian.

◆ initialize_inequality_constraints_storage()

void libMesh::OptimizationSystem::initialize_inequality_constraints_storage ( const std::vector< std::set< numeric_index_type >> &  constraint_jac_sparsity)

Initialize storage for the inequality constraints, as per initialize_equality_constraints_storage.

◆ is_adjoint_already_solved()

bool libMesh::System::is_adjoint_already_solved ( ) const
inherited

Accessor for the adjoint_already_solved boolean.

Definition at line 381 of file system.h.

References libMesh::System::adjoint_already_solved.

382  { return adjoint_already_solved;}
bool adjoint_already_solved
Has the adjoint problem already been solved? If the user sets adjoint_already_solved to true...
Definition: system.h:1996

◆ is_initialized()

bool libMesh::System::is_initialized ( )
inherited
Returns
true iff this system has been initialized.

Definition at line 2082 of file system.h.

References libMesh::System::_is_initialized.

2083 {
2084  return _is_initialized;
2085 }
bool _is_initialized
true when additional vectors and variables do not require immediate initialization, false otherwise.
Definition: system.h:1964

◆ local_dof_indices()

void libMesh::System::local_dof_indices ( const unsigned int  var,
std::set< dof_id_type > &  var_indices 
) const
inherited

Fills the std::set with the degrees of freedom on the local processor corresponding the the variable number passed in.

◆ n_active_dofs()

dof_id_type libMesh::System::n_active_dofs ( ) const
inherited
Returns
The number of active degrees of freedom for this System.

Definition at line 2210 of file system.h.

References libMesh::System::n_constrained_dofs(), and libMesh::System::n_dofs().

2211 {
2212  return this->n_dofs() - this->n_constrained_dofs();
2213 }
dof_id_type n_dofs() const
dof_id_type n_constrained_dofs() const

◆ n_components()

unsigned int libMesh::System::n_components ( ) const
inherited
Returns
The total number of scalar components in the system's variables. This will equal n_vars() in the case of all scalar-valued variables.

Definition at line 2114 of file system.h.

References libMesh::System::_variables, libMesh::Variable::first_scalar_number(), and libMesh::Variable::n_components().

2115 {
2116  if (_variables.empty())
2117  return 0;
2118 
2119  const Variable & last = _variables.back();
2120  return last.first_scalar_number() + last.n_components();
2121 }
std::vector< Variable > _variables
The Variable in this System.
Definition: system.h:1904

◆ n_constrained_dofs()

dof_id_type libMesh::System::n_constrained_dofs ( ) const
inherited
Returns
The total number of constrained degrees of freedom in the system.

Referenced by libMesh::System::n_active_dofs().

◆ n_dofs()

dof_id_type libMesh::System::n_dofs ( ) const
inherited
Returns
The number of degrees of freedom in the system

Referenced by libMesh::System::n_active_dofs().

◆ n_local_constrained_dofs()

dof_id_type libMesh::System::n_local_constrained_dofs ( ) const
inherited
Returns
The number of constrained degrees of freedom on this processor.

◆ n_local_dofs()

dof_id_type libMesh::System::n_local_dofs ( ) const
inherited
Returns
The number of degrees of freedom local to this processor

◆ n_matrices()

unsigned int libMesh::ImplicitSystem::n_matrices ( ) const
overridevirtualinherited
Returns
The number of matrices handled by this system

Reimplemented from libMesh::System.

Definition at line 410 of file implicit_system.h.

References libMesh::ImplicitSystem::_matrices.

411 {
412  return cast_int<unsigned int>(_matrices.size());
413 }
std::map< std::string, SparseMatrix< Number > * > _matrices
Some systems need an arbitrary number of matrices.

◆ n_objects()

static unsigned int libMesh::ReferenceCounter::n_objects ( )
staticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 83 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

84  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::MeshBase::partition().

94  { return cast_int<processor_id_type>(_communicator.size()); }
processor_id_type size() const
Definition: communicator.h:175
const Parallel::Communicator & _communicator

◆ n_qois()

unsigned int libMesh::System::n_qois ( ) const
inherited

Number of currently active quantities of interest.

Definition at line 2271 of file system.h.

References libMesh::System::qoi.

Referenced by libMesh::SensitivityData::allocate_data(), and libMesh::SensitivityData::allocate_hessian_data().

2272 {
2273  return cast_int<unsigned int>(this->qoi.size());
2274 }
std::vector< Number > qoi
Values of the quantities of interest.
Definition: system.h:1551

◆ n_variable_groups()

unsigned int libMesh::System::n_variable_groups ( ) const
inherited
Returns
The number of VariableGroup variable groups in the system

Definition at line 2106 of file system.h.

References libMesh::System::_variable_groups.

2107 {
2108  return cast_int<unsigned int>(_variable_groups.size());
2109 }
std::vector< VariableGroup > _variable_groups
The VariableGroup in this System.
Definition: system.h:1909

◆ n_vars()

unsigned int libMesh::System::n_vars ( ) const
inherited
Returns
The number of variables in the system

Definition at line 2098 of file system.h.

References libMesh::System::_variables.

2099 {
2100  return cast_int<unsigned int>(_variables.size());
2101 }
std::vector< Variable > _variables
The Variable in this System.
Definition: system.h:1904

◆ n_vectors()

unsigned int libMesh::System::n_vectors ( ) const
inherited
Returns
The number of vectors (in addition to the solution) handled by this system This is the size of the _vectors map

Definition at line 2226 of file system.h.

References libMesh::System::_vectors.

2227 {
2228  return cast_int<unsigned int>(_vectors.size());
2229 }
std::map< std::string, NumericVector< Number > *> _vectors
Some systems need an arbitrary number of vectors.
Definition: system.h:1928

◆ name()

const std::string & libMesh::System::name ( ) const
inherited
Returns
The system name.

Definition at line 2010 of file system.h.

References libMesh::System::_sys_name.

2011 {
2012  return _sys_name;
2013 }
const std::string _sys_name
A name associated with this system.
Definition: system.h:1894

◆ number()

unsigned int libMesh::System::number ( ) const
inherited
Returns
The system number.

Definition at line 2018 of file system.h.

References libMesh::System::_sys_number.

2019 {
2020  return _sys_number;
2021 }
const unsigned int _sys_number
The number associated with this system.
Definition: system.h:1899

◆ point_gradient() [1/3]

Gradient libMesh::System::point_gradient ( unsigned int  var,
const Point p,
const bool  insist_on_success = true 
) const
inherited
Returns
The gradient of the solution variable var at the physical point p in the mesh, similarly to point_value.

◆ point_gradient() [2/3]

Gradient libMesh::System::point_gradient ( unsigned int  var,
const Point p,
const Elem e 
) const
inherited
Returns
The gradient of the solution variable var at the physical point p in local Elem e in the mesh, similarly to point_value.

◆ point_gradient() [3/3]

Gradient libMesh::System::point_gradient ( unsigned int  var,
const Point p,
const Elem e 
) const
inherited

Calls the version of point_gradient() which takes a reference.

This function exists only to prevent people from calling the version of point_gradient() that has a boolean third argument, which would result in unnecessary PointLocator calls.

◆ point_hessian() [1/3]

Tensor libMesh::System::point_hessian ( unsigned int  var,
const Point p,
const bool  insist_on_success = true 
) const
inherited
Returns
The second derivative tensor of the solution variable var at the physical point p in the mesh, similarly to point_value.

◆ point_hessian() [2/3]

Tensor libMesh::System::point_hessian ( unsigned int  var,
const Point p,
const Elem e 
) const
inherited
Returns
The second derivative tensor of the solution variable var at the physical point p in local Elem e in the mesh, similarly to point_value.

◆ point_hessian() [3/3]

Tensor libMesh::System::point_hessian ( unsigned int  var,
const Point p,
const Elem e 
) const
inherited

Calls the version of point_hessian() which takes a reference.

This function exists only to prevent people from calling the version of point_hessian() that has a boolean third argument, which would result in unnecessary PointLocator calls.

◆ point_value() [1/3]

Number libMesh::System::point_value ( unsigned int  var,
const Point p,
const bool  insist_on_success = true 
) const
inherited
Returns
The value of the solution variable var at the physical point p in the mesh, without knowing a priori which element contains p.
Note
This function uses MeshBase::sub_point_locator(); users may or may not want to call MeshBase::clear_point_locator() afterward. Also, point_locator() is expensive (N log N for initial construction, log N for evaluations). Avoid using this function in any context where you are already looping over elements.

Because the element containing p may lie on any processor, this function is parallel-only.

By default this method expects the point to reside inside the domain and will abort if no element can be found which contains p. The optional parameter insist_on_success can be set to false to allow the method to return 0 when the point is not located.

◆ point_value() [2/3]

Number libMesh::System::point_value ( unsigned int  var,
const Point p,
const Elem e 
) const
inherited
Returns
The value of the solution variable var at the physical point p contained in local Elem e

This version of point_value can be run in serial, but assumes e is in the local mesh partition or is algebraically ghosted.

◆ point_value() [3/3]

Number libMesh::System::point_value ( unsigned int  var,
const Point p,
const Elem e 
) const
inherited

Calls the version of point_value() which takes a reference.

This function exists only to prevent people from calling the version of point_value() that has a boolean third argument, which would result in unnecessary PointLocator calls.

◆ print_info()

static void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited

◆ project_solution() [1/3]

void libMesh::System::project_solution ( FunctionBase< Number > *  f,
FunctionBase< Gradient > *  g = nullptr 
) const
inherited

Projects arbitrary functions onto the current solution.

The function value f and its gradient g are user-provided cloneable functors. A gradient g is only required/used for projecting onto finite element spaces with continuous derivatives. If non-default Parameters are to be used, they can be provided in the parameters argument.

Referenced by FETest< order, family, elem_type >::setUp().

◆ project_solution() [2/3]

void libMesh::System::project_solution ( FEMFunctionBase< Number > *  f,
FEMFunctionBase< Gradient > *  g = nullptr 
) const
inherited

Projects arbitrary functions onto the current solution.

The function value f and its gradient g are user-provided cloneable functors. A gradient g is only required/used for projecting onto finite element spaces with continuous derivatives. If non-default Parameters are to be used, they can be provided in the parameters argument.

◆ project_solution() [3/3]

void libMesh::System::project_solution ( ValueFunctionPointer  fptr,
GradientFunctionPointer  gptr,
const Parameters parameters 
) const
inherited

◆ project_solution_on_reinit()

bool& libMesh::System::project_solution_on_reinit ( void  )
inherited

Tells the System whether or not to project the solution vector onto new grids when the system is reinitialized.

The solution will be projected unless project_solution_on_reinit() = false is called.

Definition at line 787 of file system.h.

References libMesh::System::_solution_projection.

788  { return _solution_projection; }
bool _solution_projection
Holds true if the solution vector should be projected onto a changed grid, false if it should be zero...
Definition: system.h:1952

◆ project_vector() [1/5]

void libMesh::System::project_vector ( NumericVector< Number > &  new_vector,
FunctionBase< Number > *  f,
FunctionBase< Gradient > *  g = nullptr,
int  is_adjoint = -1 
) const
inherited

Projects arbitrary functions onto a vector of degree of freedom values for the current system.

The function value f and its gradient g are user-provided cloneable functors. A gradient g is only required/used for projecting onto finite element spaces with continuous derivatives. If non-default Parameters are to be used, they can be provided in the parameters argument.

Constrain the new vector using the requested adjoint rather than primal constraints if is_adjoint is non-negative.

◆ project_vector() [2/5]

void libMesh::System::project_vector ( NumericVector< Number > &  new_vector,
FEMFunctionBase< Number > *  f,
FEMFunctionBase< Gradient > *  g = nullptr,
int  is_adjoint = -1 
) const
inherited

Projects arbitrary functions onto a vector of degree of freedom values for the current system.

The function value f and its gradient g are user-provided cloneable functors. A gradient g is only required/used for projecting onto finite element spaces with continuous derivatives. If non-default Parameters are to be used, they can be provided in the parameters argument.

Constrain the new vector using the requested adjoint rather than primal constraints if is_adjoint is non-negative.

◆ project_vector() [3/5]

void libMesh::System::project_vector ( ValueFunctionPointer  fptr,
GradientFunctionPointer  gptr,
const Parameters parameters,
NumericVector< Number > &  new_vector,
int  is_adjoint = -1 
) const
inherited

Projects arbitrary functions onto a vector of degree of freedom values for the current system.

The function value fptr and its gradient gptr are represented by function pointers. A gradient gptr is only required/used for projecting onto finite element spaces with continuous derivatives.

Constrain the new vector using the requested adjoint rather than primal constraints if is_adjoint is non-negative.

◆ project_vector() [4/5]

void libMesh::System::project_vector ( NumericVector< Number > &  ,
int  is_adjoint = -1 
) const
protectedinherited

Projects the vector defined on the old mesh onto the new mesh.

Constrain the new vector using the requested adjoint rather than primal constraints if is_adjoint is non-negative.

◆ project_vector() [5/5]

void libMesh::System::project_vector ( const NumericVector< Number > &  ,
NumericVector< Number > &  ,
int  is_adjoint = -1 
) const
protectedinherited

Projects the vector defined on the old mesh onto the new mesh.

The original vector is unchanged and the new vector is passed through the second argument.

Constrain the new vector using the requested adjoint rather than primal constraints if is_adjoint is non-negative.

◆ projection_matrix()

void libMesh::System::projection_matrix ( SparseMatrix< Number > &  proj_mat) const
inherited

This method creates a projection matrix which corresponds to the operation of project_vector between old and new solution spaces.

Heterogeneous Dirichlet boundary conditions are not taken into account here; if this matrix is used for prolongation (mesh refinement) on a side with a heterogeneous BC, the newly created degrees of freedom on that side will still match the coarse grid approximation of the BC, not the fine grid approximation.

◆ prolong_vectors()

virtual void libMesh::System::prolong_vectors ( )
virtualinherited

Prolong vectors after the mesh has refined.

◆ qoi_parameter_hessian()

virtual void libMesh::ImplicitSystem::qoi_parameter_hessian ( const QoISet qoi_indices,
const ParameterVector parameters,
SensitivityData hessian 
)
overridevirtualinherited

For each of the system's quantities of interest q in qoi[qoi_indices], and for a vector of parameters p, the parameter sensitivity Hessian H_ij is defined as H_ij = (d^2 q)/(d p_i d p_j) This Hessian is the output of this method, where for each q_i, H_jk is stored in hessian.second_derivative(i,j,k).

Note that in some cases only current_local_solution is used during assembly, and, therefore, if solution has been altered without update() being called, then the user must call update() before calling this function.

Reimplemented from libMesh::System.

◆ qoi_parameter_hessian_vector_product()

virtual void libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product ( const QoISet qoi_indices,
const ParameterVector parameters,
const ParameterVector vector,
SensitivityData product 
)
overridevirtualinherited

For each of the system's quantities of interest q in qoi[qoi_indices], and for a vector of parameters p, the parameter sensitivity Hessian H_ij is defined as H_ij = (d^2 q)/(d p_i d p_j) The Hessian-vector product, for a vector v_k in parameter space, is S_j = H_jk v_k This product is the output of this method, where for each q_i, S_j is stored in sensitivities[i][j].

Reimplemented from libMesh::System.

◆ qoi_parameter_sensitivity()

virtual void libMesh::System::qoi_parameter_sensitivity ( const QoISet qoi_indices,
const ParameterVector parameters,
SensitivityData sensitivities 
)
virtualinherited

Solves for the derivative of each of the system's quantities of interest q in qoi[qoi_indices] with respect to each parameter in parameters, placing the result for qoi i and parameter j into sensitivities[i][j].

Note
parameters is a const vector, not a vector-of-const; parameter values in this vector need to be mutable for finite differencing to work.

Automatically chooses the forward method for problems with more quantities of interest than parameters, or the adjoint method otherwise.

This method is only usable in derived classes which override an implementation.

◆ re_update()

virtual void libMesh::System::re_update ( )
virtualinherited

Re-update the local values when the mesh has changed.

This method takes the data updated by update() and makes it up-to-date on the current mesh.

Reimplemented in libMesh::TransientSystem< RBConstruction >.

◆ read_header()

void libMesh::System::read_header ( Xdr io,
const std::string &  version,
const bool  read_header = true,
const bool  read_additional_data = true,
const bool  read_legacy_format = false 
)
inherited

Reads the basic data header for this System.

◆ read_legacy_data()

void libMesh::System::read_legacy_data ( Xdr io,
const bool  read_additional_data = true 
)
inherited

Reads additional data, namely vectors, for this System.

Deprecated:
The ability to read XDR data files in the old (aka "legacy") XDR format has been deprecated for many years, this capability may soon disappear altogether.

◆ read_parallel_data() [1/2]

template<typename InValType >
void libMesh::System::read_parallel_data ( Xdr io,
const bool  read_additional_data 
)
inherited

Reads additional data, namely vectors, for this System.

This method may safely be called on a distributed-memory mesh. This method will read an individual file for each processor in the simulation where the local solution components for that processor are stored.

◆ read_parallel_data() [2/2]

void libMesh::System::read_parallel_data ( Xdr io,
const bool  read_additional_data 
)
inherited

Non-templated version for backward compatibility.

Reads additional data, namely vectors, for this System. This method may safely be called on a distributed-memory mesh. This method will read an individual file for each processor in the simulation where the local solution components for that processor are stored.

Definition at line 1292 of file system.h.

1294  { read_parallel_data<Number>(io, read_additional_data); }

◆ read_serialized_data() [1/2]

template<typename ValType >
void libMesh::System::read_serialized_data ( Xdr io,
const bool  read_additional_data = true 
)
inherited

Reads additional data, namely vectors, for this System.

This method may safely be called on a distributed-memory mesh.

◆ read_serialized_data() [2/2]

void libMesh::System::read_serialized_data ( Xdr io,
const bool  read_additional_data = true 
)
inherited

Non-templated version for backward compatibility.

Reads additional data, namely vectors, for this System. This method may safely be called on a distributed-memory mesh.

Definition at line 1250 of file system.h.

1252  { read_serialized_data<Number>(io, read_additional_data); }

◆ read_serialized_vectors() [1/2]

template<typename InValType >
std::size_t libMesh::System::read_serialized_vectors ( Xdr io,
const std::vector< NumericVector< Number > *> &  vectors 
) const
inherited

Read a number of identically distributed vectors.

This method allows for optimization for the multiple vector case by only communicating the metadata once.

◆ read_serialized_vectors() [2/2]

std::size_t libMesh::System::read_serialized_vectors ( Xdr io,
const std::vector< NumericVector< Number > *> &  vectors 
) const
inherited

Non-templated version for backward compatibility.

Read a number of identically distributed vectors. This method allows for optimization for the multiple vector case by only communicating the metadata once.

Definition at line 1270 of file system.h.

1272  { return read_serialized_vectors<Number>(io, vectors); }

◆ reinit()

virtual void libMesh::OptimizationSystem::reinit ( )
overridevirtual

Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be used.

Reimplemented from libMesh::ImplicitSystem.

◆ reinit_constraints()

virtual void libMesh::System::reinit_constraints ( )
virtualinherited

Reinitializes the constraints for this system.

◆ release_linear_solver()

virtual void libMesh::ImplicitSystem::release_linear_solver ( LinearSolver< Number > *  ) const
virtualinherited

Releases a pointer to a linear solver acquired by this->get_linear_solver()

Deprecated:
This function is designed to work with the deprecated get_linear_solver() function, so its use is now deprecated as well.

Reimplemented in libMesh::LinearImplicitSystem, and libMesh::DifferentiableSystem.

◆ remove_matrix()

void libMesh::ImplicitSystem::remove_matrix ( const std::string &  mat_name)
inherited

Removes the additional matrix mat_name from this system.

◆ remove_vector()

void libMesh::System::remove_vector ( const std::string &  vec_name)
inherited

Removes the additional vector vec_name from this system.

◆ request_matrix() [1/2]

const SparseMatrix<Number>* libMesh::ImplicitSystem::request_matrix ( const std::string &  mat_name) const
inherited
Returns
A const pointer to this system's additional matrix named mat_name, or nullptr if no matrix by that name exists.

◆ request_matrix() [2/2]

SparseMatrix<Number>* libMesh::ImplicitSystem::request_matrix ( const std::string &  mat_name)
inherited
Returns
A writable pointer to this system's additional matrix named mat_name, or nullptr if no matrix by that name exists.

◆ request_vector() [1/4]

const NumericVector<Number>* libMesh::System::request_vector ( const std::string &  vec_name) const
inherited
Returns
A const pointer to the vector if this System has a vector associated with the given name, nullptr otherwise.

◆ request_vector() [2/4]

NumericVector<Number>* libMesh::System::request_vector ( const std::string &  vec_name)
inherited
Returns
A pointer to the vector if this System has a vector associated with the given name, nullptr otherwise.

◆ request_vector() [3/4]

const NumericVector<Number>* libMesh::System::request_vector ( const unsigned int  vec_num) const
inherited
Returns
A const pointer to this system's additional vector number vec_num (where the vectors are counted starting with 0), or nullptr if the system has no such vector.

◆ request_vector() [4/4]

NumericVector<Number>* libMesh::System::request_vector ( const unsigned int  vec_num)
inherited
Returns
A writable pointer to this system's additional vector number vec_num (where the vectors are counted starting with 0), or nullptr if the system has no such vector.

◆ restrict_solve_to()

virtual void libMesh::System::restrict_solve_to ( const SystemSubset subset,
const SubsetSolveMode  subset_solve_mode = SUBSET_ZERO 
)
virtualinherited

After calling this method, any solve will be restricted to the given subdomain.

To disable this mode, call this method with subset being a nullptr.

Reimplemented in libMesh::LinearImplicitSystem.

◆ restrict_vectors()

virtual void libMesh::System::restrict_vectors ( )
virtualinherited

Restrict vectors after the mesh has coarsened.

◆ sensitivity_solve()

virtual std::pair<unsigned int, Real> libMesh::ImplicitSystem::sensitivity_solve ( const ParameterVector parameters)
overridevirtualinherited

Assembles & solves the linear system(s) (dR/du)*u_p = -dR/dp, for those parameters contained within parameters.

Returns
A pair with the total number of linear iterations performed and the (sum of the) final residual norms

Reimplemented from libMesh::System.

◆ set_adjoint_already_solved()

void libMesh::System::set_adjoint_already_solved ( bool  setting)
inherited

Setter for the adjoint_already_solved boolean.

Definition at line 387 of file system.h.

References libMesh::System::adjoint_already_solved.

388  { adjoint_already_solved = setting;}
bool adjoint_already_solved
Has the adjoint problem already been solved? If the user sets adjoint_already_solved to true...
Definition: system.h:1996

◆ set_basic_system_only()

void libMesh::System::set_basic_system_only ( )
inherited

Sets the system to be "basic only": i.e.

advanced system components such as ImplicitSystem matrices may not be initialized. This is useful for efficiency in certain utility programs that never use System::solve(). This method must be called after the System or derived class is created but before it is initialized; e.g. from within EquationSystems::read()

Definition at line 2090 of file system.h.

References libMesh::System::_basic_system_only.

2091 {
2092  _basic_system_only = true;
2093 }
bool _basic_system_only
Holds true if the components of more advanced system types (e.g.
Definition: system.h:1958

◆ set_vector_as_adjoint()

void libMesh::System::set_vector_as_adjoint ( const std::string &  vec_name,
int  qoi_num 
)
inherited

Allows one to set the QoI index controlling whether the vector identified by vec_name represents a solution from the adjoint (qoi_num >= 0) or primal (qoi_num == -1) space.

This becomes significant if those spaces have differing heterogeneous Dirichlet constraints.

qoi_num == -2 can be used to indicate a vector which should not be affected by constraints during projection operations.

◆ set_vector_preservation()

void libMesh::System::set_vector_preservation ( const std::string &  vec_name,
bool  preserve 
)
inherited

Allows one to set the boolean controlling whether the vector identified by vec_name should be "preserved": projected to new meshes, saved, etc.

◆ solve()

virtual void libMesh::OptimizationSystem::solve ( )
overridevirtual

Solves the optimization problem.

Reimplemented from libMesh::ExplicitSystem.

◆ system()

sys_type& libMesh::OptimizationSystem::system ( )
Returns
A reference to *this.

Definition at line 220 of file optimization_system.h.

220 { return *this; }

◆ system_type()

virtual std::string libMesh::OptimizationSystem::system_type ( ) const
overridevirtual
Returns
"Optimization". Helps in identifying the system type in an equation system file.

Reimplemented from libMesh::ImplicitSystem.

Definition at line 263 of file optimization_system.h.

263 { return "Optimization"; }

◆ update()

virtual void libMesh::System::update ( )
virtualinherited

Update the local values to reflect the solution on neighboring processors.

Reimplemented in SolidSystem.

◆ update_global_solution() [1/2]

void libMesh::System::update_global_solution ( std::vector< Number > &  global_soln) const
inherited

Fill the input vector global_soln so that it contains the global solution on all processors.

Requires communication with all other processors.

◆ update_global_solution() [2/2]

void libMesh::System::update_global_solution ( std::vector< Number > &  global_soln,
const processor_id_type  dest_proc 
) const
inherited

Fill the input vector global_soln so that it contains the global solution on processor dest_proc.

Requires communication with all other processors.

◆ user_assembly()

virtual void libMesh::System::user_assembly ( )
virtualinherited

Calls user's attached assembly function, or is overridden by the user in derived classes.

◆ user_constrain()

virtual void libMesh::System::user_constrain ( )
virtualinherited

Calls user's attached constraint function, or is overridden by the user in derived classes.

◆ user_initialization()

virtual void libMesh::System::user_initialization ( )
virtualinherited

Calls user's attached initialization function, or is overridden by the user in derived classes.

◆ user_QOI()

virtual void libMesh::System::user_QOI ( const QoISet qoi_indices)
virtualinherited

Calls user's attached quantity of interest function, or is overridden by the user in derived classes.

◆ user_QOI_derivative()

virtual void libMesh::System::user_QOI_derivative ( const QoISet qoi_indices = QoISet(),
bool  include_liftfunc = true,
bool  apply_constraints = true 
)
virtualinherited

Calls user's attached quantity of interest derivative function, or is overridden by the user in derived classes.

◆ variable()

const Variable & libMesh::System::variable ( unsigned int  var) const
inherited

Return a constant reference to Variable var.

Definition at line 2126 of file system.h.

References libMesh::System::_variables.

2127 {
2128  libmesh_assert_less (i, _variables.size());
2129 
2130  return _variables[i];
2131 }
std::vector< Variable > _variables
The Variable in this System.
Definition: system.h:1904

◆ variable_group()

const VariableGroup & libMesh::System::variable_group ( unsigned int  vg) const
inherited

Return a constant reference to VariableGroup vg.

Definition at line 2136 of file system.h.

References libMesh::System::_variable_groups.

2137 {
2138  libmesh_assert_less (vg, _variable_groups.size());
2139 
2140  return _variable_groups[vg];
2141 }
std::vector< VariableGroup > _variable_groups
The VariableGroup in this System.
Definition: system.h:1909

◆ variable_name()

const std::string & libMesh::System::variable_name ( const unsigned int  i) const
inherited
Returns
The name of variable i.

Definition at line 2146 of file system.h.

References libMesh::System::_variables.

2147 {
2148  libmesh_assert_less (i, _variables.size());
2149 
2150  return _variables[i].name();
2151 }
std::vector< Variable > _variables
The Variable in this System.
Definition: system.h:1904

◆ variable_number()

unsigned short int libMesh::System::variable_number ( const std::string &  var) const
inherited
Returns
The variable number associated with the user-specified variable named var.

Referenced by libMesh::System::variable_scalar_number(), and libMesh::System::variable_type().

◆ variable_scalar_number() [1/2]

unsigned int libMesh::System::variable_scalar_number ( const std::string &  var,
unsigned int  component 
) const
inherited
Returns
An index, starting from 0 for the first component of the first variable, and incrementing for each component of each (potentially vector-valued) variable in the system in order. For systems with only scalar-valued variables, this will be the same as variable_number(var)

Irony: currently our only non-scalar-valued variable type is SCALAR.

Definition at line 2157 of file system.h.

References libMesh::System::variable_number().

2159 {
2160  return variable_scalar_number(this->variable_number(var), component);
2161 }
unsigned int variable_scalar_number(const std::string &var, unsigned int component) const
Definition: system.h:2157
unsigned short int variable_number(const std::string &var) const

◆ variable_scalar_number() [2/2]

unsigned int libMesh::System::variable_scalar_number ( unsigned int  var_num,
unsigned int  component 
) const
inherited
Returns
An index, starting from 0 for the first component of the first variable, and incrementing for each component of each (potentially vector-valued) variable in the system in order. For systems with only scalar-valued variables, this will be the same as var_num

Irony: currently our only non-scalar-valued variable type is SCALAR.

Definition at line 2167 of file system.h.

References libMesh::System::_variables.

2169 {
2170  return _variables[var_num].first_scalar_number() + component;
2171 }
std::vector< Variable > _variables
The Variable in this System.
Definition: system.h:1904

◆ variable_type() [1/2]

const FEType & libMesh::System::variable_type ( const unsigned int  i) const
inherited
Returns
The finite element type variable number i.

Definition at line 2176 of file system.h.

References libMesh::System::_variables.

Referenced by FETest< order, family, elem_type >::setUp().

2177 {
2178  libmesh_assert_less (i, _variables.size());
2179 
2180  return _variables[i].type();
2181 }
std::vector< Variable > _variables
The Variable in this System.
Definition: system.h:1904

◆ variable_type() [2/2]

const FEType & libMesh::System::variable_type ( const std::string &  var) const
inherited
Returns
The finite element type for variable var.

Definition at line 2186 of file system.h.

References libMesh::System::_variables, and libMesh::System::variable_number().

2187 {
2188  return _variables[this->variable_number(var)].type();
2189 }
std::vector< Variable > _variables
The Variable in this System.
Definition: system.h:1904
unsigned short int variable_number(const std::string &var) const

◆ vector_is_adjoint()

int libMesh::System::vector_is_adjoint ( const std::string &  vec_name) const
inherited
Returns
The integer describing whether the vector identified by vec_name represents a solution from an adjoint (non-negative) or the primal (-1) space.

◆ vector_name() [1/2]

const std::string& libMesh::System::vector_name ( const unsigned int  vec_num) const
inherited
Returns
The name of this system's additional vector number vec_num (where the vectors are counted starting with 0).

◆ vector_name() [2/2]

const std::string& libMesh::System::vector_name ( const NumericVector< Number > &  vec_reference) const
inherited
Returns
The name of a system vector, given a reference to that vector

◆ vector_preservation()

bool libMesh::System::vector_preservation ( const std::string &  vec_name) const
inherited
Returns
The boolean describing whether the vector identified by vec_name should be "preserved": projected to new meshes, saved, etc.

◆ vectors_begin() [1/2]

System::vectors_iterator libMesh::System::vectors_begin ( )
inherited

Beginning of vectors container.

Definition at line 2238 of file system.h.

References libMesh::System::_vectors.

2239 {
2240  return _vectors.begin();
2241 }
std::map< std::string, NumericVector< Number > *> _vectors
Some systems need an arbitrary number of vectors.
Definition: system.h:1928

◆ vectors_begin() [2/2]

System::const_vectors_iterator libMesh::System::vectors_begin ( ) const
inherited

Beginning of vectors container.

Definition at line 2244 of file system.h.

References libMesh::System::_vectors.

2245 {
2246  return _vectors.begin();
2247 }
std::map< std::string, NumericVector< Number > *> _vectors
Some systems need an arbitrary number of vectors.
Definition: system.h:1928

◆ vectors_end() [1/2]

System::vectors_iterator libMesh::System::vectors_end ( )
inherited

End of vectors container.

Definition at line 2250 of file system.h.

References libMesh::System::_vectors.

2251 {
2252  return _vectors.end();
2253 }
std::map< std::string, NumericVector< Number > *> _vectors
Some systems need an arbitrary number of vectors.
Definition: system.h:1928

◆ vectors_end() [2/2]

System::const_vectors_iterator libMesh::System::vectors_end ( ) const
inherited

End of vectors container.

Definition at line 2256 of file system.h.

References libMesh::System::_vectors.

2257 {
2258  return _vectors.end();
2259 }
std::map< std::string, NumericVector< Number > *> _vectors
Some systems need an arbitrary number of vectors.
Definition: system.h:1928

◆ weighted_sensitivity_adjoint_solve()

virtual std::pair<unsigned int, Real> libMesh::ImplicitSystem::weighted_sensitivity_adjoint_solve ( const ParameterVector parameters,
const ParameterVector weights,
const QoISet qoi_indices = QoISet() 
)
overridevirtualinherited

Assembles & solves the linear system(s) (dR/du)^T*z_w = sum(w_p*(d^2q/dudp - d^2R/dudp*z)), for those parameters p contained within parameters, weighted by the values w_p found within weights.

Assumes that adjoint_solve has already calculated z for each qoi in qoi_indices.

Returns
A pair with the total number of linear iterations performed and the (sum of the) final residual norms

Reimplemented from libMesh::System.

◆ weighted_sensitivity_solve()

virtual std::pair<unsigned int, Real> libMesh::ImplicitSystem::weighted_sensitivity_solve ( const ParameterVector parameters,
const ParameterVector weights 
)
overridevirtualinherited

Assembles & solves the linear system(s) (dR/du)*u_w = sum(w_p*-dR/dp), for those parameters p contained within parameters weighted by the values w_p found within weights.

Returns
A pair with the total number of linear iterations performed and the (sum of the) final residual norms

Reimplemented from libMesh::System.

◆ write_header()

void libMesh::System::write_header ( Xdr io,
const std::string &  version,
const bool  write_additional_data 
) const
inherited

Writes the basic data header for this System.

◆ write_parallel_data()

void libMesh::System::write_parallel_data ( Xdr io,
const bool  write_additional_data 
) const
inherited

Writes additional data, namely vectors, for this System.

This method may safely be called on a distributed-memory mesh. This method will create an individual file for each processor in the simulation where the local solution components for that processor will be stored.

◆ write_serialized_data()

void libMesh::System::write_serialized_data ( Xdr io,
const bool  write_additional_data = true 
) const
inherited

Writes additional data, namely vectors, for this System.

This method may safely be called on a distributed-memory mesh.

◆ write_serialized_vectors()

std::size_t libMesh::System::write_serialized_vectors ( Xdr io,
const std::vector< const NumericVector< Number > *> &  vectors 
) const
inherited

Serialize & write a number of identically distributed vectors.

This method allows for optimization for the multiple vector case by only communicating the metadata once.

◆ zero_variable()

void libMesh::System::zero_variable ( NumericVector< Number > &  v,
unsigned int  var_num 
) const
inherited

Zeroes all dofs in v that correspond to variable number var_num.

Member Data Documentation

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ _counts

Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _enable_print_counter

bool libMesh::ReferenceCounter::_enable_print_counter
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 141 of file reference_counter.h.

◆ _mutex

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _n_objects

Threads::atomic<unsigned int> libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ assemble_before_solve

bool libMesh::System::assemble_before_solve
inherited

Flag which tells the system to whether or not to call the user assembly function during each call to solve().

By default, every call to solve() begins with a call to the user assemble, so this flag is true. (For explicit systems, "solving" the system occurs during the assembly step, so this flag is always true for explicit systems.)

You will only want to set this to false if you need direct control over when the system is assembled, and are willing to track the state of its assembly yourself. An example of such a case is an implicit system with multiple right hand sides. In this instance, a single assembly would likely be followed with multiple calls to solve.

The frequency system and Newmark system have their own versions of this flag, called _finished_assemble, which might be able to be replaced with this more general concept.

Definition at line 1470 of file system.h.

Referenced by libMesh::System::disable_cache().

◆ C_eq

std::unique_ptr<NumericVector<Number> > libMesh::OptimizationSystem::C_eq

The vector that stores equality constraints.

Definition at line 273 of file optimization_system.h.

◆ C_eq_jac

std::unique_ptr<SparseMatrix<Number> > libMesh::OptimizationSystem::C_eq_jac

The sparse matrix that stores the Jacobian of C_eq.

Definition at line 278 of file optimization_system.h.

◆ C_ineq

std::unique_ptr<NumericVector<Number> > libMesh::OptimizationSystem::C_ineq

The vector that stores inequality constraints.

Definition at line 283 of file optimization_system.h.

◆ C_ineq_jac

std::unique_ptr<SparseMatrix<Number> > libMesh::OptimizationSystem::C_ineq_jac

The sparse matrix that stores the Jacobian of C_ineq.

Definition at line 288 of file optimization_system.h.

◆ current_local_solution

std::unique_ptr<NumericVector<Number> > libMesh::System::current_local_solution
inherited

All the values I need to compute my contribution to the simulation at hand.

Think of this as the current solution with any ghost values needed from other processors. This vector is necessarily larger than the solution vector in the case of a parallel simulation. The update() member is used to synchronize the contents of the solution and current_local_solution vectors.

Definition at line 1528 of file system.h.

Referenced by FETest< order, family, elem_type >::testGradU(), FETest< order, family, elem_type >::testGradUComp(), and FETest< order, family, elem_type >::testU().

◆ eq_constraint_jac_sparsity

std::vector<std::set<numeric_index_type> > libMesh::OptimizationSystem::eq_constraint_jac_sparsity

A copy of the equality and inequality constraint Jacobian sparsity patterns.

Definition at line 301 of file optimization_system.h.

◆ extra_quadrature_order

int libMesh::System::extra_quadrature_order
inherited

A member int that can be employed to indicate increased or reduced quadrature order.

Note
For FEMSystem users, by default, when calling the user-defined residual functions, the FEMSystem will first set up an appropriate FEType::default_quadrature_rule() object for performing the integration. This rule will integrate elements of order up to 2*p+1 exactly (where p is the sum of the base FEType and local p refinement levels), but if additional (or reduced) quadrature accuracy is desired then this extra_quadrature_order (default 0) will be added.

Definition at line 1501 of file system.h.

◆ ineq_constraint_jac_sparsity

std::vector<std::set<numeric_index_type> > libMesh::OptimizationSystem::ineq_constraint_jac_sparsity

Definition at line 302 of file optimization_system.h.

◆ lambda_eq

std::unique_ptr<NumericVector<Number> > libMesh::OptimizationSystem::lambda_eq

Vectors to store the dual variables associated with equality and inequality constraints.

Definition at line 294 of file optimization_system.h.

◆ lambda_ineq

std::unique_ptr<NumericVector<Number> > libMesh::OptimizationSystem::lambda_ineq

Definition at line 295 of file optimization_system.h.

◆ matrix

SparseMatrix<Number>* libMesh::ImplicitSystem::matrix
inherited

The system matrix.

Implicit systems are characterized by the need to solve the linear system Ax=b. This is the system matrix A.

Definition at line 357 of file implicit_system.h.

◆ optimization_solver

std::unique_ptr<OptimizationSolver<Number> > libMesh::OptimizationSystem::optimization_solver

The OptimizationSolver that is used for performing the optimization.

Definition at line 268 of file optimization_system.h.

◆ qoi

std::vector<Number> libMesh::System::qoi
inherited

Values of the quantities of interest.

This vector needs to be both resized and filled by the user before any quantity of interest assembly is done and before any sensitivities are calculated.

Definition at line 1551 of file system.h.

Referenced by libMesh::DifferentiableSystem::attach_qoi(), and libMesh::System::n_qois().

◆ rhs

NumericVector<Number>* libMesh::ExplicitSystem::rhs
inherited

The system matrix.

Implicit systems are characterized by the need to solve the linear system Ax=b. This is the right-hand-side vector b.

Definition at line 105 of file explicit_system.h.

◆ solution

std::unique_ptr<NumericVector<Number> > libMesh::System::solution
inherited

Data structure to hold solution values.

Definition at line 1516 of file system.h.

◆ time

Real libMesh::System::time
inherited

For time-dependent problems, this is the time t at the beginning of the current timestep.

Note
For DifferentiableSystem users: do not access this time during an assembly! Use the DiffContext::time value instead to get correct results.

Definition at line 1538 of file system.h.

◆ use_fixed_solution

bool libMesh::System::use_fixed_solution
inherited

A boolean to be set to true by systems using elem_fixed_solution, for optional use by e.g.

stabilized methods. False by default.

Note
For FEMSystem users, if this variable is set to true, it must be before init_data() is called.

Definition at line 1486 of file system.h.

◆ zero_out_matrix_and_rhs

bool libMesh::ImplicitSystem::zero_out_matrix_and_rhs
inherited

By default, the system will zero out the matrix and the right hand side.

If this flag is false, it is the responsibility of the client code to take care of setting these to zero before assembly begins

Definition at line 364 of file implicit_system.h.


The documentation for this class was generated from the following file: