libMesh
|
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solvers for implicit systems. More...
#include <nonlinear_implicit_system.h>
Classes | |
class | ComputeBounds |
Abstract base class to be used to calculate the bounds on the degrees of freedom of a nonlinear system. More... | |
class | ComputeJacobian |
Abstract base class to be used to calculate the Jacobian of a nonlinear system. More... | |
class | ComputePostCheck |
Abstract base class to be used for applying user modifications to the solution vector and/or Newton update step after each nonlinear step. More... | |
class | ComputeResidual |
Abstract base class to be used to calculate the residual of a nonlinear system. More... | |
class | ComputeResidualandJacobian |
Abstract base class to be used to calculate the residual and Jacobian simultaneously of a nonlinear system. More... | |
class | ComputeVectorSubspace |
Callable abstract base class to be used as a callback to provide the solver with a basis for the system's Jacobian's nullspace (the kernel or the "zero energy modes") or near-nullspace (the "low energy modes"). More... | |
Public Types | |
typedef NonlinearImplicitSystem | 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 ¶meters, 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 | |
NonlinearImplicitSystem (EquationSystems &es, const std::string &name, const unsigned int number) | |
Constructor. More... | |
virtual | ~NonlinearImplicitSystem () |
Destructor. More... | |
sys_type & | system () |
virtual void | clear () override |
Clear all the data structures associated with 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 |
Assembles & solves the nonlinear system R(x) = 0. More... | |
virtual std::pair< unsigned int, Real > | get_linear_solve_parameters () const override |
virtual void | assembly (bool get_residual, bool get_jacobian, bool apply_heterogeneous_constraints=false, bool apply_no_constraints=false) override |
Assembles a residual in rhs and/or a jacobian in matrix , as requested. More... | |
virtual std::string | system_type () const override |
unsigned int | n_nonlinear_iterations () const |
Real | final_nonlinear_residual () const |
unsigned | get_current_nonlinear_iteration_number () const |
If called during the solve(), for example by the user-specified residual or Jacobian function, return the current nonlinear iteration number. More... | |
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 void | release_linear_solver (LinearSolver< Number > *) const |
Releases a pointer to a linear solver acquired by this->get_linear_solver() More... | |
virtual void | assemble_residual_derivatives (const ParameterVector ¶meters) override |
Residual parameter derivative function. More... | |
virtual std::pair< unsigned int, Real > | sensitivity_solve (const ParameterVector ¶meters) 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, Real > | weighted_sensitivity_solve (const ParameterVector ¶meters, 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, Real > | adjoint_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, Real > | weighted_sensitivity_adjoint_solve (const ParameterVector ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters) 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 ¶meters, 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 ¶meters) |
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 ¶meters, 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 MeshBase & | get_mesh () const |
MeshBase & | get_mesh () |
const DofMap & | get_dof_map () const |
DofMap & | get_dof_map () |
const EquationSystems & | get_equation_systems () const |
EquationSystems & | get_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 Variable & | variable (unsigned int var) const |
Return a constant reference to Variable var . More... | |
const VariableGroup & | variable_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 FEType & | variable_type (const unsigned int i) const |
const FEType & | variable_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::Communicator & | comm () 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< NonlinearSolver< Number > > | nonlinear_solver |
The NonlinearSolver defines the default interface used to solve the nonlinear_implicit system. More... | |
std::unique_ptr< DiffSolver > | diff_solver |
The DiffSolver defines an optional interface used to solve the nonlinear_implicit system. More... | |
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< Number > | qoi |
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 | |
void | set_solver_parameters () |
Copies system parameters into nonlinear solver parameters. More... | |
virtual void | init_data () override |
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used. More... | |
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 | |
unsigned int | _n_nonlinear_iterations |
The number of nonlinear iterations required to solve the nonlinear system R(x)=0. More... | |
Real | _final_nonlinear_residual |
The final residual for the nonlinear system R(x) More... | |
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... | |
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solvers for implicit systems.
An implicit system is a system that requires the solution of a system of equations. This class has the ability to create and use a non-linear solver to solve the system of equations.
The matrix NonlinearImplicitSystem::matrix and the vector NonlinearImplicitSystem::rhs should be filled during assembly.
Definition at line 54 of file nonlinear_implicit_system.h.
|
inherited |
Definition at line 306 of file implicit_system.h.
|
inherited |
|
protectedinherited |
Data structure to log the information.
The log is identified by the class name.
Definition at line 117 of file reference_counter.h.
|
inherited |
|
inherited |
Matrix iterator typedefs.
Definition at line 305 of file implicit_system.h.
The type of the parent.
Definition at line 79 of file nonlinear_implicit_system.h.
The type of system.
Definition at line 74 of file nonlinear_implicit_system.h.
|
inherited |
|
inherited |
libMesh::NonlinearImplicitSystem::NonlinearImplicitSystem | ( | EquationSystems & | es, |
const std::string & | name, | ||
const unsigned int | number | ||
) |
Constructor.
Optionally initializes required data structures.
|
virtual |
Destructor.
|
inherited |
Activates the system.
Only active systems are solved.
Definition at line 2073 of file system.h.
References libMesh::System::_active.
|
inherited |
true
if the system is active, false
otherwise. An active system will be solved. Definition at line 2065 of file system.h.
References libMesh::System::_active.
|
inherited |
|
inherited |
|
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.
|
inherited |
|
inherited |
|
inherited |
Adds the variable var
to the list of variables for this system.
Referenced by SimpleRBConstruction::init_data(), and FETest< order, family, elem_type >::setUp().
|
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
.
|
inherited |
Adds the variable var
to the list of variables for this system.
|
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
.
|
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
|
inherited |
|
inherited |
|
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.
|
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.
Reimplemented from libMesh::System.
Reimplemented in libMesh::DifferentiableSystem.
|
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::LinearImplicitSystem, libMesh::DifferentiableSystem, libMesh::FrequencySystem, and libMesh::NewmarkSystem.
Referenced by libMesh::LinearImplicitSystem::assemble().
|
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.
|
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.
|
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.
|
overridevirtual |
Assembles a residual in rhs
and/or a jacobian in matrix
, as requested.
Reimplemented from libMesh::ImplicitSystem.
|
inherited |
Register a user function to use in assembling the system matrix and RHS.
|
inherited |
Register a user object to use in assembling the system matrix and RHS.
|
inherited |
Register a user function for imposing constraints.
|
inherited |
Register a user object for imposing constraints.
|
inherited |
Register a user function to use in initializing the system.
|
inherited |
Register a user class to use to initialize the system.
attach_init_function
.
|
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
.
|
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
.
|
inherited |
Register a user function for evaluating the quantities of interest, whose values should be placed in System::qoi
.
|
inherited |
Register a user object for evaluating the quantities of interest, whose values should be placed in System::qoi
.
|
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.
|
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.
|
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.
|
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.
|
inherited |
var
in the vector v
, in the specified norm (e.g. L2, L_INF, H1)
|
inherited |
v
, using component_norm
and component_scale
to choose and weight the norms of each variable.
|
overridevirtual |
Clear all the data structures associated with the system.
Reimplemented from libMesh::ImplicitSystem.
|
inherited |
Parallel::Communicator
object used by this mesh. Definition at line 89 of file parallel_object.h.
References libMesh::ParallelObject::_communicator.
Referenced by libMesh::EpetraVector< T >::EpetraVector(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), and libMesh::Parallel::sync_node_data_by_element_id_once().
|
virtualinherited |
true
when the other system contains identical data, up to the given threshold. Outputs some diagnostic info when verbose
is set.
|
inherited |
|
inherited |
Deactivates the system.
Only active systems are solved.
Definition at line 2081 of file system.h.
References libMesh::System::_active.
|
overridevirtualinherited |
Avoids use of any cached data that might affect any solve result.
Should be overridden in derived systems.
Reimplemented from libMesh::System.
|
staticinherited |
|
staticinherited |
Methods to enable/disable the reference counter output from print_info()
Real libMesh::NonlinearImplicitSystem::final_nonlinear_residual | ( | ) | const |
Definition at line 278 of file nonlinear_implicit_system.h.
References _final_nonlinear_residual.
|
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.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Fills all_variable_numbers
with all the variable numbers for the variables that have been added to this system.
unsigned libMesh::NonlinearImplicitSystem::get_current_nonlinear_iteration_number | ( | ) | const |
If called during the solve(), for example by the user-specified residual or Jacobian function, return the current nonlinear iteration number.
|
inherited |
_dof_map
. Definition at line 2049 of file system.h.
References libMesh::System::_dof_map.
Referenced by SimpleRBConstruction::init_data(), and FETest< order, family, elem_type >::setUp().
|
inherited |
_dof_map
. Definition at line 2057 of file system.h.
References libMesh::System::_dof_map.
|
inherited |
Definition at line 712 of file system.h.
References libMesh::System::_equation_systems.
Referenced by libMesh::WrappedFunction< Output >::WrappedFunction().
|
inherited |
Definition at line 717 of file system.h.
References libMesh::System::_equation_systems.
|
staticinherited |
Gets a string containing the reference information.
|
inherited |
|
overridevirtual |
Reimplemented from libMesh::ImplicitSystem.
|
virtualinherited |
This function must be overridden in derived classes, since this base class does not have a valid LinearSolver to hand back a pointer to.
Reimplemented in libMesh::LinearImplicitSystem, and libMesh::DifferentiableSystem.
|
inherited |
mat_name
.None of these matrices is involved in the solution process. Access is only granted when the matrix is already properly initialized.
|
inherited |
mat_name
.None of these matrices is involved in the solution process. Access is only granted when the matrix is already properly initialized.
|
inherited |
_mesh
. Definition at line 2033 of file system.h.
References libMesh::System::_mesh.
Referenced by AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), and AssemblyA2::boundary_assembly().
|
inherited |
_mesh
. Definition at line 2041 of file system.h.
References libMesh::System::_mesh.
|
inherited |
assemble_residual_derivatives()
is called.When assembled, this vector should hold -(partial R / partial p_i)
|
inherited |
|
inherited |
|
inherited |
|
inherited |
vec_name
. Access is only granted when the vector is already properly initialized.
|
inherited |
vec_name
. Access is only granted when the vector is already properly initialized.
|
inherited |
vec_num
(where the vectors are counted starting with 0).
|
inherited |
vec_num
(where the vectors are counted starting with 0).
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
true
if a variable named var
exists in this System
|
inherited |
true
if this System
has a matrix associated with the given name, false
otherwise. Definition at line 419 of file implicit_system.h.
References libMesh::ImplicitSystem::_matrices.
|
inherited |
true
if this System
has a vector associated with the given name, false
otherwise. Definition at line 2225 of file system.h.
References libMesh::System::_vectors.
|
inherited |
true
, then EquationSystems::write
will ignore this system. Definition at line 1662 of file system.h.
References libMesh::System::_hide_output.
|
inherited |
true
when VariableGroup
structures should be automatically identified, false
otherwise. Definition at line 2201 of file system.h.
References libMesh::System::_identify_variable_groups.
|
inherited |
Toggle automatic VariableGroup
identification.
Definition at line 2209 of file system.h.
References libMesh::System::_identify_variable_groups.
|
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().
|
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().
|
inherited |
Initializes degrees of freedom on the current mesh.
Sets the
|
overrideprotectedvirtualinherited |
Initializes the member data fields associated with the system, so that, e.g., assemble()
may be used.
Reimplemented from libMesh::System.
Reimplemented in libMesh::DifferentiableSystem, libMesh::ContinuationSystem, libMesh::RBEIMConstruction, libMesh::FEMSystem, libMesh::OptimizationSystem, libMesh::FrequencySystem, libMesh::RBConstructionBase< LinearImplicitSystem >, SecondOrderScalarSystemSecondOrderTimeSolverBase, SimpleRBConstruction, SimpleRBConstruction, SimpleRBConstruction, SimpleRBConstruction, SimpleRBConstruction, FirstOrderScalarSystemBase, libMesh::LinearImplicitSystem, HeatSystem, SimpleRBConstruction, ElasticityRBConstruction, CoupledSystem, L2System, ElasticitySystem, LaplaceSystem, CurlCurlSystem, LaplaceSystem, PoissonSystem, LaplaceSystem, LaplaceSystem, CurlCurlSystem, SolidSystem, NavierSystem, and HeatSystem.
|
protectedvirtualinherited |
Initializes the matrices associated with this system.
|
inherited |
Accessor for the adjoint_already_solved boolean.
Definition at line 388 of file system.h.
References libMesh::System::adjoint_already_solved.
|
inherited |
true
iff this system has been initialized. Definition at line 2089 of file system.h.
References libMesh::System::_is_initialized.
|
inherited |
Fills the std::set with the degrees of freedom on the local processor corresponding the the variable number passed in.
|
inherited |
Definition at line 2217 of file system.h.
References libMesh::System::n_constrained_dofs(), and libMesh::System::n_dofs().
|
inherited |
n_vars()
in the case of all scalar-valued variables. Definition at line 2121 of file system.h.
References libMesh::System::_variables, libMesh::Variable::first_scalar_number(), and libMesh::Variable::n_components().
|
inherited |
Referenced by libMesh::System::n_active_dofs().
|
inherited |
Referenced by libMesh::System::n_active_dofs().
|
inherited |
|
inherited |
|
overridevirtualinherited |
Reimplemented from libMesh::System.
Definition at line 426 of file implicit_system.h.
References libMesh::ImplicitSystem::_matrices.
unsigned int libMesh::NonlinearImplicitSystem::n_nonlinear_iterations | ( | ) | const |
Definition at line 273 of file nonlinear_implicit_system.h.
References _n_nonlinear_iterations.
|
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.
|
inherited |
Definition at line 95 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().
Referenced by libMesh::MeshBase::partition().
|
inherited |
Number of currently active quantities of interest.
Definition at line 2278 of file system.h.
References libMesh::System::qoi.
Referenced by libMesh::SensitivityData::allocate_data(), and libMesh::SensitivityData::allocate_hessian_data().
|
inherited |
VariableGroup
variable groups in the system Definition at line 2113 of file system.h.
References libMesh::System::_variable_groups.
|
inherited |
Definition at line 2105 of file system.h.
References libMesh::System::_variables.
|
inherited |
_vectors
map Definition at line 2233 of file system.h.
References libMesh::System::_vectors.
|
inherited |
Definition at line 2017 of file system.h.
References libMesh::System::_sys_name.
|
inherited |
Definition at line 2025 of file system.h.
References libMesh::System::_sys_number.
|
inherited |
var
at the physical point p
in the mesh, similarly to point_value.
|
inherited |
var
at the physical point p
in local Elem e
in the mesh, similarly to point_value.
|
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.
|
inherited |
var
at the physical point p
in the mesh, similarly to point_value.
|
inherited |
var
at the physical point p
in local Elem e
in the mesh, similarly to point_value.
|
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.
|
inherited |
var
at the physical point p
in the mesh, without knowing a priori which element contains p
.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.
|
inherited |
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.
|
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.
|
staticinherited |
Prints the reference information, by default to libMesh::out
.
|
inherited |
Definition at line 101 of file parallel_object.h.
References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().
Referenced by libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), libMesh::DofMap::last_dof(), libMesh::MeshBase::n_active_local_elem(), libMesh::DofMap::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), and libMesh::MeshTools::weight().
|
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().
|
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.
|
inherited |
|
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 794 of file system.h.
References libMesh::System::_solution_projection.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
virtualinherited |
Prolong vectors after the mesh has refined.
|
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.
|
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.
|
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].
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.
|
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 >.
|
inherited |
Reads the basic data header for this System.
|
inherited |
Reads additional data, namely vectors, for this System.
|
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.
|
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.
|
inherited |
Reads additional data, namely vectors, for this System.
This method may safely be called on a distributed-memory mesh.
|
inherited |
|
inherited |
Read a number of identically distributed vectors.
This method allows for optimization for the multiple vector case by only communicating the metadata once.
|
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.
|
overridevirtual |
Reinitializes the member data fields associated with the system, so that, e.g., assemble()
may be used.
Reimplemented from libMesh::ImplicitSystem.
|
virtualinherited |
Reinitializes the constraints for this system.
|
virtualinherited |
Releases a pointer to a linear solver acquired by this->get_linear_solver()
Reimplemented in libMesh::LinearImplicitSystem, and libMesh::DifferentiableSystem.
|
inherited |
Removes the additional matrix mat_name
from this system.
|
inherited |
Removes the additional vector vec_name
from this system.
|
inherited |
mat_name
, or nullptr
if no matrix by that name exists.
|
inherited |
mat_name
, or nullptr
if no matrix by that name exists.
|
inherited |
System
has a vector associated with the given name, nullptr
otherwise.
|
inherited |
System
has a vector associated with the given name, nullptr
otherwise.
|
inherited |
vec_num
(where the vectors are counted starting with 0), or nullptr
if the system has no such vector.
|
inherited |
vec_num
(where the vectors are counted starting with 0), or nullptr
if the system has no such vector.
|
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.
|
virtualinherited |
Restrict vectors after the mesh has coarsened.
|
overridevirtualinherited |
Assembles & solves the linear system(s) (dR/du)*u_p = -dR/dp, for those parameters contained within parameters
.
Reimplemented from libMesh::System.
|
inherited |
Setter for the adjoint_already_solved boolean.
Definition at line 394 of file system.h.
References libMesh::System::adjoint_already_solved.
|
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 2097 of file system.h.
References libMesh::System::_basic_system_only.
|
protected |
Copies system parameters into nonlinear solver parameters.
|
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.
|
inherited |
Allows one to set the boolean controlling whether the vector identified by vec_name should be "preserved": projected to new meshes, saved, etc.
|
overridevirtual |
Assembles & solves the nonlinear system R(x) = 0.
Reimplemented from libMesh::ImplicitSystem.
sys_type& libMesh::NonlinearImplicitSystem::system | ( | ) |
Definition at line 213 of file nonlinear_implicit_system.h.
|
overridevirtual |
"NonlinearImplicit"
. Helps in identifying the system type in an equation system file. Reimplemented from libMesh::ImplicitSystem.
Definition at line 253 of file nonlinear_implicit_system.h.
|
virtualinherited |
Update the local values to reflect the solution on neighboring processors.
Reimplemented in SolidSystem.
|
inherited |
Fill the input vector global_soln
so that it contains the global solution on all processors.
Requires communication with all other processors.
|
inherited |
Fill the input vector global_soln
so that it contains the global solution on processor dest_proc
.
Requires communication with all other processors.
|
virtualinherited |
Calls user's attached assembly function, or is overridden by the user in derived classes.
|
virtualinherited |
Calls user's attached constraint function, or is overridden by the user in derived classes.
|
virtualinherited |
Calls user's attached initialization function, or is overridden by the user in derived classes.
|
virtualinherited |
Calls user's attached quantity of interest function, or is overridden by the user in derived classes.
|
virtualinherited |
Calls user's attached quantity of interest derivative function, or is overridden by the user in derived classes.
|
inherited |
Return a constant reference to Variable
var
.
Definition at line 2133 of file system.h.
References libMesh::System::_variables.
|
inherited |
Return a constant reference to VariableGroup
vg
.
Definition at line 2143 of file system.h.
References libMesh::System::_variable_groups.
|
inherited |
i
. Definition at line 2153 of file system.h.
References libMesh::System::_variables.
|
inherited |
var
. Referenced by libMesh::System::variable_scalar_number(), and libMesh::System::variable_type().
|
inherited |
variable_number(var)
Irony: currently our only non-scalar-valued variable type is SCALAR.
Definition at line 2164 of file system.h.
References libMesh::System::variable_number().
|
inherited |
var_num
Irony: currently our only non-scalar-valued variable type is SCALAR.
Definition at line 2174 of file system.h.
References libMesh::System::_variables.
|
inherited |
i
. Definition at line 2183 of file system.h.
References libMesh::System::_variables.
Referenced by FETest< order, family, elem_type >::setUp().
|
inherited |
var
. Definition at line 2193 of file system.h.
References libMesh::System::_variables, and libMesh::System::variable_number().
|
inherited |
|
inherited |
vec_num
(where the vectors are counted starting with 0).
|
inherited |
|
inherited |
|
inherited |
Beginning of vectors container.
Definition at line 2245 of file system.h.
References libMesh::System::_vectors.
|
inherited |
Beginning of vectors container.
Definition at line 2251 of file system.h.
References libMesh::System::_vectors.
|
inherited |
End of vectors container.
Definition at line 2257 of file system.h.
References libMesh::System::_vectors.
|
inherited |
End of vectors container.
Definition at line 2263 of file system.h.
References libMesh::System::_vectors.
|
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
.
Reimplemented from libMesh::System.
|
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
.
Reimplemented from libMesh::System.
|
inherited |
Writes the basic data header for this System.
|
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.
|
inherited |
Writes additional data, namely vectors, for this System.
This method may safely be called on a distributed-memory mesh.
|
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.
|
inherited |
Zeroes all dofs in v
that correspond to variable number var_num
.
|
protectedinherited |
Definition at line 107 of file parallel_object.h.
Referenced by libMesh::ParallelObject::comm(), libMesh::ParallelObject::n_processors(), libMesh::ParallelObject::operator=(), and libMesh::ParallelObject::processor_id().
|
staticprotectedinherited |
Actually holds the data.
Definition at line 122 of file reference_counter.h.
Referenced by libMesh::ReferenceCounter::increment_constructor_count(), and libMesh::ReferenceCounter::increment_destructor_count().
|
staticprotectedinherited |
Flag to control whether reference count information is printed when print_info is called.
Definition at line 141 of file reference_counter.h.
|
protected |
The final residual for the nonlinear system R(x)
Definition at line 304 of file nonlinear_implicit_system.h.
Referenced by final_nonlinear_residual().
|
staticprotectedinherited |
Mutual exclusion object to enable thread-safe reference counting.
Definition at line 135 of file reference_counter.h.
|
protected |
The number of nonlinear iterations required to solve the nonlinear system R(x)=0.
Definition at line 299 of file nonlinear_implicit_system.h.
Referenced by n_nonlinear_iterations().
|
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().
|
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 1477 of file system.h.
Referenced by libMesh::System::disable_cache().
|
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 1535 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().
std::unique_ptr<DiffSolver> libMesh::NonlinearImplicitSystem::diff_solver |
The DiffSolver
defines an optional interface used to solve the nonlinear_implicit system.
Definition at line 267 of file nonlinear_implicit_system.h.
|
inherited |
A member int that can be employed to indicate increased or reduced quadrature order.
|
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 373 of file implicit_system.h.
std::unique_ptr<NonlinearSolver<Number> > libMesh::NonlinearImplicitSystem::nonlinear_solver |
The NonlinearSolver
defines the default interface used to solve the nonlinear_implicit system.
This class handles all the details of interfacing with various nonlinear algebra packages like PETSc or LASPACK.
Definition at line 261 of file nonlinear_implicit_system.h.
|
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 1558 of file system.h.
Referenced by libMesh::DifferentiableSystem::attach_qoi(), and libMesh::System::n_qois().
|
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 114 of file explicit_system.h.
|
inherited |
|
inherited |
For time-dependent problems, this is the time t at the beginning of the current timestep.
|
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.
|
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 380 of file implicit_system.h.