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

This class is part of the rbOOmit framework. More...

#include <rb_scm_evaluation.h>

Inheritance diagram for libMesh::RBSCMEvaluation:
[legend]

Public Member Functions

 RBSCMEvaluation (const Parallel::Communicator &comm)
 Constructor. More...
 
virtual ~RBSCMEvaluation ()
 Destructor. More...
 
void set_rb_theta_expansion (RBThetaExpansion &rb_theta_expansion_in)
 Set the RBThetaExpansion object. More...
 
RBThetaExpansionget_rb_theta_expansion ()
 Get a reference to the rb_theta_expansion. More...
 
virtual Real get_SCM_LB ()
 Evaluate single SCM lower bound. More...
 
virtual Real get_SCM_UB ()
 Evaluate single SCM upper bound. More...
 
Real get_C_J_stability_constraint (unsigned int j) const
 Get stability constraints (i.e. More...
 
void set_C_J_stability_constraint (unsigned int j, Real stability_constraint_in)
 Set stability constraints (i.e. More...
 
Real get_SCM_UB_vector (unsigned int j, unsigned int q)
 Get entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J. More...
 
void set_SCM_UB_vector (unsigned int j, unsigned int q, Real y_q)
 Set entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J. More...
 
unsigned int get_C_J_size ()
 Get size of the set C_J. More...
 
const RBParametersget_C_J_entry (unsigned int j)
 Get entry of C_J. More...
 
Real get_C_J_stability_value (unsigned int j)
 Get entry of C_J_stability_vector. More...
 
Real get_B_min (unsigned int i) const
 Get B_min and B_max. More...
 
Real get_B_max (unsigned int i) const
 
void set_B_min (unsigned int i, Real B_min_val)
 Set B_min and B_max. More...
 
void set_B_max (unsigned int i, Real B_max_val)
 
virtual void save_current_parameters ()
 Helper function to save current_parameters in saved_parameters. More...
 
virtual void reload_current_parameters ()
 Helper function to (re)load current_parameters from saved_parameters. More...
 
virtual void set_current_parameters_from_C_J (unsigned int C_J_index)
 Set parameters based on values saved in "C_J". More...
 
virtual void legacy_write_offline_data_to_files (const std::string &directory_name="offline_data", const bool write_binary_data=true)
 Write out all the data to text files in order to segregate the Offline stage from the Online stage. More...
 
virtual void legacy_read_offline_data_from_files (const std::string &directory_name="offline_data", const bool read_binary_data=true)
 Read in the saved Offline reduced basis data to initialize the system for Online solves. More...
 
virtual void clear ()
 Clear all the data structures associated with the system. More...
 
void initialize_parameters (const RBParameters &mu_min_in, const RBParameters &mu_max_in, const std::map< std::string, std::vector< Real >> &discrete_parameter_values)
 Initialize the parameter ranges and set current_parameters. More...
 
void initialize_parameters (const RBParametrized &rb_parametrized)
 Initialize the parameter ranges and set current_parameters. More...
 
unsigned int get_n_params () const
 Get the number of parameters. More...
 
unsigned int get_n_continuous_params () const
 Get the number of continuous parameters. More...
 
unsigned int get_n_discrete_params () const
 Get the number of discrete parameters. More...
 
std::set< std::string > get_parameter_names () const
 Get a set that stores the parameter names. More...
 
const RBParametersget_parameters () const
 Get the current parameters. More...
 
void set_parameters (const RBParameters &params)
 Set the current parameters to params. More...
 
const RBParametersget_parameters_min () const
 Get an RBParameters object that specifies the minimum allowable value for each parameter. More...
 
const RBParametersget_parameters_max () const
 Get an RBParameters object that specifies the maximum allowable value for each parameter. More...
 
Real get_parameter_min (const std::string &param_name) const
 Get minimum allowable value of parameter param_name. More...
 
Real get_parameter_max (const std::string &param_name) const
 Get maximum allowable value of parameter param_name. More...
 
void print_parameters () const
 Print the current parameters. More...
 
void write_parameter_data_to_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool write_binary_data)
 Write out the parameter ranges to files. More...
 
void read_parameter_data_from_files (const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool read_binary_data)
 Read in the parameter ranges from files. More...
 
bool is_discrete_parameter (const std::string &mu_name) const
 Is parameter mu_name discrete? More...
 
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values () const
 Get a const reference to the discrete parameter values. More...
 
void print_discrete_parameter_values () const
 Print out all the discrete parameter values. More...
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static Real get_closest_value (Real value, const std::vector< Real > &list_of_values)
 
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::vector< RealB_min
 B_min, B_max define the bounding box. More...
 
std::vector< RealB_max
 
std::vector< RBParametersC_J
 Vector storing the greedily selected parameters during SCM training. More...
 
std::vector< RealC_J_stability_vector
 Vector storing the (truth) stability values at the parameters in C_J. More...
 
std::vector< std::vector< Real > > SCM_UB_vectors
 This matrix stores the infimizing vectors y_1( \( \mu \)),...,y_Q_a( \( \mu \)), for each \( \mu \) in C_J, which are used in computing the SCM upper bounds. More...
 
bool verbose_mode
 Public boolean to toggle verbose mode. 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 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 = true
 Flag to control whether reference count information is printed when print_info is called. More...
 

Private Member Functions

void write_parameter_ranges_to_file (const std::string &file_name, const bool write_binary)
 Write out the parameter ranges to file. More...
 
void write_discrete_parameter_values_to_file (const std::string &file_name, const bool write_binary_data)
 Write out the discrete parameter values to file. More...
 
void read_parameter_ranges_from_file (const std::string &file_name, const bool read_binary, RBParameters &param_min, RBParameters &param_max)
 Read in the parameter ranges from file. More...
 
void read_discrete_parameter_values_from_file (const std::string &file_name, const bool read_binary_data, std::map< std::string, std::vector< Real >> &discrete_parameter_values_in)
 Read in the discrete parameter values from file, if we have any. More...
 
bool valid_params (const RBParameters &params)
 Helper function to check that params is valid. More...
 

Static Private Member Functions

static bool is_value_in_list (Real value, const std::vector< Real > &list_of_values, Real tol)
 Helper function to check if the specified value is in the list of values (within a tolerance given by tol). More...
 

Private Attributes

RBParameters saved_parameters
 Vector in which to save a parameter set. More...
 
RBThetaExpansionrb_theta_expansion
 A pointer to to the object that stores the theta expansion. More...
 
bool parameters_initialized
 Flag indicating whether the parameters have been initialized. More...
 
RBParameters parameters
 Vector storing the current parameters. More...
 
RBParameters parameters_min
 Vectors that define the ranges (min and max) for the parameters. More...
 
RBParameters parameters_max
 
std::map< std::string, std::vector< Real > > _discrete_parameter_values
 Map that defines the allowable values of any discrete parameters. More...
 

Detailed Description

This class is part of the rbOOmit framework.

RBSCMEvaluation encapsulates the functionality required to evaluate the Successive Constraint Method for associated with a reduced basis model.

Author
David J. Knezevic
Date
2011

Definition at line 52 of file rb_scm_evaluation.h.

Member Typedef Documentation

◆ 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.

Constructor & Destructor Documentation

◆ RBSCMEvaluation()

libMesh::RBSCMEvaluation::RBSCMEvaluation ( const Parallel::Communicator &  comm)

Constructor.

Definition at line 52 of file rb_scm_evaluation.C.

52  :
53  ParallelObject(comm_in)
54 {
55  // Clear SCM data vectors
56  B_min.clear();
57  B_max.clear();
58  C_J.clear();
59  C_J_stability_vector.clear();
60  SCM_UB_vectors.clear();
61 }

References B_max, B_min, C_J, C_J_stability_vector, and SCM_UB_vectors.

◆ ~RBSCMEvaluation()

libMesh::RBSCMEvaluation::~RBSCMEvaluation ( )
virtual

Destructor.

Definition at line 63 of file rb_scm_evaluation.C.

64 {
65 }

Member Function Documentation

◆ clear()

void libMesh::RBParametrized::clear ( )
virtualinherited

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inlineinherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 94 of file parallel_object.h.

95  { return _communicator; }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_jacobian(), libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), libMesh::DofMap::add_constraints_to_send_list(), add_cube_convex_hull_to_mesh(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::ImplicitSystem::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::DynaIO::add_spline_constraints(), libMesh::System::add_vector(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::DofMap::attach_matrix(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::PetscDMWrapper::build_section(), libMesh::PetscDMWrapper::build_sf(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBConstruction::compute_residual_dual_norm_slow(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::EigenSystem::init_matrices(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_rb_construction(), integrate_function(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::libmesh_petsc_preconditioner_apply(), libMesh::libmesh_petsc_snes_fd_residual(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_mffd_residual(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::libmesh_petsc_snes_residual(), libMesh::libmesh_petsc_snes_residual_helper(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::DofMap::n_constrained_dofs(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::split_mesh(), libMesh::BoundaryInfo::sync(), libMesh::MeshRefinement::test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), libMesh::MeshRefinement::test_unflagged(), SystemsTest::testBlockRestrictedVarNDofs(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), SystemsTest::testProjectCubeWithMeshFunction(), CheckpointIOTest::testSplitter(), libMesh::MeshTools::total_weight(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::VTKIO::write_nodal_data(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().

◆ disable_print_counter_info()

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

107 {
108  _enable_print_counter = false;
109  return;
110 }

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit().

◆ enable_print_counter_info()

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 100 of file reference_counter.C.

101 {
102  _enable_print_counter = true;
103  return;
104 }

References libMesh::ReferenceCounter::_enable_print_counter.

◆ get_B_max()

Real libMesh::RBSCMEvaluation::get_B_max ( unsigned int  i) const

Definition at line 142 of file rb_scm_evaluation.C.

143 {
144  if (q >= B_max.size())
145  libmesh_error_msg("Error: q is too large in get_B_max.");
146 
147  return B_max[q];
148 }

References B_max.

Referenced by libMesh::RBDataSerialization::add_rb_scm_evaluation_data_to_builder(), libMesh::RBSCMConstruction::compute_SCM_bounding_box(), and legacy_write_offline_data_to_files().

◆ get_B_min()

Real libMesh::RBSCMEvaluation::get_B_min ( unsigned int  i) const

Get B_min and B_max.

Definition at line 133 of file rb_scm_evaluation.C.

134 {
135  if (q >= B_min.size())
136  libmesh_error_msg("Error: q is too large in get_B_min.");
137 
138  return B_min[q];
139 }

References B_min.

Referenced by libMesh::RBDataSerialization::add_rb_scm_evaluation_data_to_builder(), libMesh::RBSCMConstruction::compute_SCM_bounding_box(), and legacy_write_offline_data_to_files().

◆ get_C_J_entry()

const RBParameters & libMesh::RBSCMEvaluation::get_C_J_entry ( unsigned int  j)

Get entry of C_J.

Definition at line 125 of file rb_scm_evaluation.C.

126 {
127  if (j >= C_J.size())
128  libmesh_error_msg("Error: Input parameter j is too large in get_C_J.");
129 
130  return C_J[j];
131 }

References C_J.

◆ get_C_J_size()

unsigned int libMesh::RBSCMEvaluation::get_C_J_size ( )
inline

Get size of the set C_J.

Definition at line 120 of file rb_scm_evaluation.h.

121  { return cast_int<unsigned int>(C_J.size()); }

References C_J.

◆ get_C_J_stability_constraint()

Real libMesh::RBSCMEvaluation::get_C_J_stability_constraint ( unsigned int  j) const

Get stability constraints (i.e.

the values of coercivity/ inf-sup/stability constants at the parameter values chosen during the greedy); we store one constraint for each element of C_J.

Definition at line 92 of file rb_scm_evaluation.C.

93 {
94  if (j >= C_J_stability_vector.size())
95  libmesh_error_msg("Error: Input parameter j is too large in get_C_J_stability_constraint.");
96 
97  return C_J_stability_vector[j];
98 }

References C_J_stability_vector.

Referenced by libMesh::RBDataSerialization::add_rb_scm_evaluation_data_to_builder(), libMesh::RBSCMConstruction::evaluate_stability_constant(), and legacy_write_offline_data_to_files().

◆ get_C_J_stability_value()

Real libMesh::RBSCMEvaluation::get_C_J_stability_value ( unsigned int  j)
inline

Get entry of C_J_stability_vector.

Definition at line 131 of file rb_scm_evaluation.h.

131 { return C_J_stability_vector[j]; }

References C_J_stability_vector.

◆ get_closest_value()

Real libMesh::RBParametrized::get_closest_value ( Real  value,
const std::vector< Real > &  list_of_values 
)
staticinherited
Returns
The closest entry to value from list_of_values.

Definition at line 433 of file rb_parametrized.C.

434 {
435  if (list_of_values.empty())
436  libmesh_error_msg("Error: list_of_values is empty.");
437 
438  Real min_distance = std::numeric_limits<Real>::max();
439  Real closest_val = 0.;
440  for (const auto & current_value : list_of_values)
441  {
442  Real distance = std::abs(value - current_value);
443  if (distance < min_distance)
444  {
445  min_distance = distance;
446  closest_val = current_value;
447  }
448  }
449 
450  return closest_val;
451 }

References std::abs(), distance(), libMesh::Real, and value.

Referenced by libMesh::RBParametrized::is_value_in_list().

◆ get_discrete_parameter_values()

const std::map< std::string, std::vector< Real > > & libMesh::RBParametrized::get_discrete_parameter_values ( ) const
inherited

◆ get_info()

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

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }

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

Referenced by libMesh::ReferenceCounter::print_info().

◆ get_n_continuous_params()

unsigned int libMesh::RBParametrized::get_n_continuous_params ( ) const
inherited

Get the number of continuous parameters.

Definition at line 125 of file rb_parametrized.C.

126 {
128  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_n_continuous_params");
129 
131 
132  return static_cast<unsigned int>(get_n_params() - get_n_discrete_params());
133 }

References libMesh::RBParametrized::get_n_discrete_params(), libMesh::RBParametrized::get_n_params(), libMesh::libmesh_assert(), and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ get_n_discrete_params()

unsigned int libMesh::RBParametrized::get_n_discrete_params ( ) const
inherited

Get the number of discrete parameters.

Definition at line 135 of file rb_parametrized.C.

136 {
138  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_n_discrete_params");
139 
140  return cast_int<unsigned int>
142 }

References libMesh::RBParametrized::get_discrete_parameter_values(), and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBParametrized::get_n_continuous_params(), and libMesh::RBParametrized::write_discrete_parameter_values_to_file().

◆ get_n_params()

unsigned int libMesh::RBParametrized::get_n_params ( ) const
inherited

◆ get_parameter_max()

Real libMesh::RBParametrized::get_parameter_max ( const std::string &  param_name) const
inherited

Get maximum allowable value of parameter param_name.

Definition at line 198 of file rb_parametrized.C.

199 {
201  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_max");
202 
203  return parameters_max.get_value(param_name);
204 }

References libMesh::RBParameters::get_value(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_max.

Referenced by libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), and libMesh::RBParametrized::valid_params().

◆ get_parameter_min()

Real libMesh::RBParametrized::get_parameter_min ( const std::string &  param_name) const
inherited

Get minimum allowable value of parameter param_name.

Definition at line 190 of file rb_parametrized.C.

191 {
193  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_min");
194 
195  return parameters_min.get_value(param_name);
196 }

References libMesh::RBParameters::get_value(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_min.

Referenced by libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), and libMesh::RBParametrized::valid_params().

◆ get_parameter_names()

std::set< std::string > libMesh::RBParametrized::get_parameter_names ( ) const
inherited

Get a set that stores the parameter names.

Definition at line 144 of file rb_parametrized.C.

145 {
147  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_names");
148 
149  std::set<std::string> parameter_names;
150  parameters_min.get_parameter_names(parameter_names);
151 
152  return parameter_names;
153 }

References libMesh::RBParameters::get_parameter_names(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_min.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder().

◆ get_parameters()

const RBParameters & libMesh::RBParametrized::get_parameters ( ) const
inherited

Get the current parameters.

Definition at line 166 of file rb_parametrized.C.

167 {
169  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_current_parameters");
170 
171  return parameters;
172 }

References libMesh::RBParametrized::parameters, and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::TransientRBConstruction::add_scaled_mass_matrix(), libMesh::TransientRBEvaluation::cache_online_residual_terms(), libMesh::RBEIMConstruction::compute_best_fit_error(), libMesh::RBEvaluation::compute_residual_dual_norm(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::RBSCMConstruction::enrich_C_J(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::RBEIMTheta::evaluate(), libMesh::RBEIMEvaluation::evaluate_parametrized_function(), libMesh::RBSCMConstruction::evaluate_stability_constant(), libMesh::RBConstruction::get_RB_error_bound(), get_SCM_LB(), get_SCM_UB(), SimpleRBEvaluation::get_stability_lower_bound(), libMesh::RBConstruction::greedy_termination_test(), legacy_read_offline_data_from_files(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), libMesh::RBParametrized::print_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBEIMEvaluation::rb_solve(), save_current_parameters(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_solve(), libMesh::RBEIMConstruction::truth_solve(), libMesh::RBConstruction::truth_solve(), libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm(), and libMesh::RBConstruction::update_greedy_param_list().

◆ get_parameters_max()

const RBParameters & libMesh::RBParametrized::get_parameters_max ( ) const
inherited

Get an RBParameters object that specifies the maximum allowable value for each parameter.

Definition at line 182 of file rb_parametrized.C.

183 {
185  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameters_max");
186 
187  return parameters_max;
188 }

References libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_max.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::RBConstruction::set_rb_construction_parameters(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ get_parameters_min()

const RBParameters & libMesh::RBParametrized::get_parameters_min ( ) const
inherited

Get an RBParameters object that specifies the minimum allowable value for each parameter.

Definition at line 174 of file rb_parametrized.C.

175 {
177  libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameters_min");
178 
179  return parameters_min;
180 }

References libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::parameters_min.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::RBConstruction::set_rb_construction_parameters(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ get_rb_theta_expansion()

RBThetaExpansion & libMesh::RBSCMEvaluation::get_rb_theta_expansion ( )

Get a reference to the rb_theta_expansion.

Definition at line 72 of file rb_scm_evaluation.C.

73 {
74  if (!rb_theta_expansion)
75  libmesh_error_msg("Error: rb_theta_expansion hasn't been initialized yet");
76 
77  return *rb_theta_expansion;
78 }

References rb_theta_expansion.

Referenced by libMesh::RBDataSerialization::add_rb_scm_evaluation_data_to_builder(), libMesh::RBSCMConstruction::get_rb_theta_expansion(), and libMesh::RBDataDeserialization::load_rb_scm_evaluation_data().

◆ get_SCM_LB()

Real libMesh::RBSCMEvaluation::get_SCM_LB ( )
virtual

Evaluate single SCM lower bound.

Definition at line 166 of file rb_scm_evaluation.C.

167 {
168  LOG_SCOPE("get_SCM_LB()", "RBSCMEvaluation");
169 
170  // Initialize the LP
171  glp_prob * lp;
172  lp = glp_create_prob();
173  glp_set_obj_dir(lp,GLP_MIN);
174 
175  // Add columns to the LP: corresponds to
176  // the variables y_1,...y_Q_a.
177  // These are the same for each \mu in the SCM
178  // training set, hence can do this up front.
179  glp_add_cols(lp,rb_theta_expansion->get_n_A_terms());
180 
181  for (unsigned int q=0; q<rb_theta_expansion->get_n_A_terms(); q++)
182  {
183  if (B_max[q] < B_min[q]) // Invalid bound, set as free variable
184  {
185  // GLPK indexing is not zero based!
186  glp_set_col_bnds(lp, q+1, GLP_FR, 0., 0.);
187  }
188  else
189  {
190  // GLPK indexing is not zero based!
191  glp_set_col_bnds(lp, q+1, GLP_DB, B_min[q], B_max[q]);
192  }
193 
194  // If B_max is not defined, just set lower bounds...
195  // glp_set_col_bnds(lp, q+1, GLP_LO, B_min[q], 0.);
196  }
197 
198 
199  // Add rows to the LP: corresponds to the auxiliary
200  // variables that define the constraints at each
201  // mu \in C_J_M
202  unsigned int n_rows = cast_int<unsigned int>(C_J.size());
203  glp_add_rows(lp, n_rows);
204 
205  // Now put current_parameters in saved_parameters
207 
208  unsigned int matrix_size = n_rows*rb_theta_expansion->get_n_A_terms();
209  std::vector<int> ia(matrix_size+1);
210  std::vector<int> ja(matrix_size+1);
211  std::vector<double> ar(matrix_size+1);
212  unsigned int count=0;
213  for (unsigned int m=0; m<n_rows; m++)
214  {
216 
217  // Set the lower bound on the auxiliary variable
218  // due to the stability constant at mu_index
219  glp_set_row_bnds(lp, m+1, GLP_LO, C_J_stability_vector[m], 0.);
220 
221  // Now define the matrix that relates the y's
222  // to the auxiliary variables at the current
223  // value of mu.
224  for (unsigned int q=0; q<rb_theta_expansion->get_n_A_terms(); q++)
225  {
226  count++;
227 
228  ia[count] = m+1;
229  ja[count] = q+1;
230 
231  // This can only handle Reals right now
233  }
234  }
235 
236  // Now load the original parameters back into current_parameters
237  // in order to set the coefficients of the objective function
239 
240  glp_load_matrix(lp, matrix_size, ia.data(), ja.data(), ar.data());
241 
242  for (unsigned int q=0; q<rb_theta_expansion->get_n_A_terms(); q++)
243  {
244  glp_set_obj_coef(lp,q+1, libmesh_real( rb_theta_expansion->eval_A_theta(q,get_parameters()) ) );
245  }
246 
247  // Use this command to initialize the basis for the LP
248  // since default behavior is to use the basis from
249  // the previous solve, but that might become singular
250  // if we switch the order of constraints (as can
251  // happen when we generate a new C_J_M)
252  //lpx_cpx_basis(lp); //glp_cpx_basis(lp);
253 
254  glp_smcp parm;
255  glp_init_smcp(&parm);
256  parm.msg_lev = GLP_MSG_ERR;
257  parm.meth = GLP_DUAL;
258 
259 
260  // use the simplex method and solve the LP
261  glp_simplex(lp, &parm);
262 
263  Real min_J_obj = glp_get_obj_val(lp);
264 
265  // int simplex_status = glp_get_status(lp);
266  // if (simplex_status == GLP_UNBND)
267  // {
268  // libMesh::out << "Simplex method gave unbounded solution." << std::endl;
269  // min_J_obj = std::numeric_limits<Real>::quiet_NaN();
270  // }
271  // else
272  // {
273  // min_J_obj = glp_get_obj_val(lp);
274  // }
275 
276  // Destroy the LP
277  glp_delete_prob(lp);
278 
279  return min_J_obj;
280 }

References B_max, B_min, C_J, C_J_stability_vector, libMesh::RBThetaExpansion::eval_A_theta(), libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBParametrized::get_parameters(), libMesh::libmesh_real(), rb_theta_expansion, libMesh::Real, reload_current_parameters(), save_current_parameters(), and set_current_parameters_from_C_J().

Referenced by libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), and SimpleRBEvaluation::get_stability_lower_bound().

◆ get_SCM_UB()

Real libMesh::RBSCMEvaluation::get_SCM_UB ( )
virtual

Evaluate single SCM upper bound.

Definition at line 282 of file rb_scm_evaluation.C.

283 {
284  LOG_SCOPE("get_SCM_UB()", "RBSCMEvaluation");
285 
286  // Add rows to the LP: corresponds to the auxiliary
287  // variables that define the constraints at each
288  // mu \in C_J
289  unsigned int n_rows = cast_int<unsigned int>(C_J.size());
290 
291  // For each mu, we just find the minimum of J_obj over
292  // the subset of vectors in SCM_UB_vectors corresponding
293  // to C_J_M (SCM_UB_vectors contains vectors for all of
294  // C_J).
295  Real min_J_obj = 0.;
296  for (unsigned int m=0; m<n_rows; m++)
297  {
298  const std::vector<Real> UB_vector = SCM_UB_vectors[m];
299 
300  Real J_obj = 0.;
301  for (unsigned int q=0; q<rb_theta_expansion->get_n_A_terms(); q++)
302  {
303  J_obj += libmesh_real( rb_theta_expansion->eval_A_theta(q,get_parameters()) )*UB_vector[q];
304  }
305 
306  if ((m==0) || (J_obj < min_J_obj))
307  {
308  min_J_obj = J_obj;
309  }
310  }
311 
312  return min_J_obj;
313 }

References C_J, libMesh::RBThetaExpansion::eval_A_theta(), libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBParametrized::get_parameters(), libMesh::libmesh_real(), rb_theta_expansion, libMesh::Real, and SCM_UB_vectors.

Referenced by libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set().

◆ get_SCM_UB_vector()

Real libMesh::RBSCMEvaluation::get_SCM_UB_vector ( unsigned int  j,
unsigned int  q 
)

Get entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J.

Definition at line 113 of file rb_scm_evaluation.C.

114 {
115  // First make sure that j <= J
116  if (j >= SCM_UB_vectors.size())
117  libmesh_error_msg("Error: We must have j < J in get_SCM_UB_vector.");
118 
119  if (q >= SCM_UB_vectors[0].size())
120  libmesh_error_msg("Error: q is too large in get_SCM_UB_vector.");
121 
122  return SCM_UB_vectors[j][q];
123 }

References SCM_UB_vectors.

Referenced by libMesh::RBDataSerialization::add_rb_scm_evaluation_data_to_builder(), and legacy_write_offline_data_to_files().

◆ increment_constructor_count()

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

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.

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 }

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

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

◆ increment_destructor_count()

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

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.

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 }

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

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

◆ initialize_parameters() [1/2]

void libMesh::RBParametrized::initialize_parameters ( const RBParameters mu_min_in,
const RBParameters mu_max_in,
const std::map< std::string, std::vector< Real >> &  discrete_parameter_values 
)
inherited

Initialize the parameter ranges and set current_parameters.

Definition at line 60 of file rb_parametrized.C.

63 {
64  // Check that the min/max vectors are valid
65  {
66  const std::string err_string = "Error: Invalid mu_min/mu_max in RBParameters constructor.";
67  bool valid_min_max = (mu_min_in.n_parameters() == mu_max_in.n_parameters());
68  if (!valid_min_max)
69  libmesh_error_msg(err_string);
70 
71  else
72  {
73  for (const auto & pr : mu_min_in)
74  {
75  const std::string & param_name = pr.first;
76  if (mu_min_in.get_value(param_name) > mu_max_in.get_value(param_name))
77  libmesh_error_msg(err_string);
78  }
79  }
80  }
81 
82  parameters_min = mu_min_in;
83  parameters_max = mu_max_in;
84 
85  // Add in min/max values due to the discrete parameters
86  for (const auto & pr : discrete_parameter_values)
87  {
88  if (pr.second.empty())
89  libmesh_error_msg("Error: List of discrete parameters for " << pr.first << " is empty.");
90 
91  Real min_val = *std::min_element(pr.second.begin(), pr.second.end());
92  Real max_val = *std::max_element(pr.second.begin(), pr.second.end());
93 
94  libmesh_assert_less_equal(min_val,max_val);
95 
96  parameters_min.set_value(pr.first, min_val);
97  parameters_max.set_value(pr.first, max_val);
98  }
99 
100  _discrete_parameter_values = discrete_parameter_values;
101 
102  parameters_initialized = true;
103 
104  // Initialize the current parameters to parameters_min
106 }

References libMesh::RBParametrized::_discrete_parameter_values, libMesh::RBParameters::get_value(), libMesh::RBParameters::n_parameters(), libMesh::RBParametrized::parameters_initialized, libMesh::RBParametrized::parameters_max, libMesh::RBParametrized::parameters_min, libMesh::Real, libMesh::RBParametrized::set_parameters(), and libMesh::RBParameters::set_value().

Referenced by libMesh::RBConstruction::enrich_basis_from_rhs_terms(), libMesh::RBParametrized::initialize_parameters(), libMesh::RBEIMConstruction::initialize_parametrized_functions_in_training_set(), libMesh::RBDataDeserialization::load_parameter_ranges(), libMesh::RBSCMConstruction::perform_SCM_greedy(), libMesh::RBSCMConstruction::process_parameters_file(), libMesh::RBParametrized::read_parameter_data_from_files(), libMesh::RBConstruction::set_rb_construction_parameters(), and libMesh::RBConstruction::train_reduced_basis().

◆ initialize_parameters() [2/2]

void libMesh::RBParametrized::initialize_parameters ( const RBParametrized rb_parametrized)
inherited

Initialize the parameter ranges and set current_parameters.

Definition at line 108 of file rb_parametrized.C.

109 {
110  initialize_parameters(rb_parametrized.get_parameters_min(),
111  rb_parametrized.get_parameters_max(),
112  rb_parametrized.get_discrete_parameter_values());
113 }

References libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::get_parameters_max(), libMesh::RBParametrized::get_parameters_min(), and libMesh::RBParametrized::initialize_parameters().

◆ is_discrete_parameter()

bool libMesh::RBParametrized::is_discrete_parameter ( const std::string &  mu_name) const
inherited

Is parameter mu_name discrete?

Definition at line 373 of file rb_parametrized.C.

374 {
376  libmesh_error_msg("Error: parameters not initialized in RBParametrized::is_discrete_parameter");
377 
378  return (_discrete_parameter_values.find(mu_name) != _discrete_parameter_values.end());
379 }

References libMesh::RBParametrized::_discrete_parameter_values, and libMesh::RBParametrized::parameters_initialized.

Referenced by libMesh::RBDataSerialization::add_parameter_ranges_to_builder(), libMesh::RBConstruction::print_info(), libMesh::RBParametrized::valid_params(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

◆ is_value_in_list()

bool libMesh::RBParametrized::is_value_in_list ( Real  value,
const std::vector< Real > &  list_of_values,
Real  tol 
)
staticprivateinherited

Helper function to check if the specified value is in the list of values (within a tolerance given by tol).

Definition at line 453 of file rb_parametrized.C.

454 {
455  Real closest_value = get_closest_value(value, list_of_values);
456 
457  // Check if relative tolerance is satisfied
458  Real rel_error = std::abs(value - closest_value) / std::abs(value);
459  if (rel_error <= tol)
460  {
461  return true;
462  }
463 
464  // If relative tolerance isn't satisfied, we should still check an absolute
465  // error, since relative tolerance can be misleading if value is close to zero
466  Real abs_error = std::abs(value - closest_value);
467  return (abs_error <= tol);
468 }

References std::abs(), libMesh::RBParametrized::get_closest_value(), libMesh::Real, and value.

Referenced by libMesh::RBParametrized::valid_params().

◆ legacy_read_offline_data_from_files()

void libMesh::RBSCMEvaluation::legacy_read_offline_data_from_files ( const std::string &  directory_name = "offline_data",
const bool  read_binary_data = true 
)
virtual

Read in the saved Offline reduced basis data to initialize the system for Online solves.

Note
This is a legacy method, use RBDataSerialization instead.

Definition at line 444 of file rb_scm_evaluation.C.

446 {
447  LOG_SCOPE("legacy_read_offline_data_from_files()", "RBSCMEvaluation");
448 
449  // The reading mode: DECODE for binary, READ for ASCII
450  XdrMODE mode = read_binary_data ? DECODE : READ;
451 
452  // The suffix to use for all the files that are written out
453  const std::string suffix = read_binary_data ? ".xdr" : ".dat";
454 
455  // The string stream we'll use to make the file names
456  std::ostringstream file_name;
457 
458  // Read in the parameter ranges
459  file_name.str("");
460  file_name << directory_name << "/parameter_ranges" << suffix;
461  std::string continuous_param_file_name = file_name.str();
462 
463  // Read in the discrete parameter values
464  file_name.str("");
465  file_name << directory_name << "/discrete_parameter_values" << suffix;
466  std::string discrete_param_file_name = file_name.str();
467  read_parameter_data_from_files(continuous_param_file_name,
468  discrete_param_file_name,
469  read_binary_data);
470 
471  // Read in the bounding box min values
472  // Note that there are Q_a values
473  file_name.str("");
474  file_name << directory_name << "/B_min" << suffix;
475  Xdr B_min_in(file_name.str(), mode);
476 
477  B_min.clear();
478  for (unsigned int i=0; i<rb_theta_expansion->get_n_A_terms(); i++)
479  {
480  Real B_min_val;
481  B_min_in >> B_min_val;
482  B_min.push_back(B_min_val);
483  }
484  B_min_in.close();
485 
486 
487  // Read in the bounding box max values
488  // Note that there are Q_a values
489  file_name.str("");
490  file_name << directory_name << "/B_max" << suffix;
491  Xdr B_max_in(file_name.str(), mode);
492 
493  B_max.clear();
494  for (unsigned int i=0; i<rb_theta_expansion->get_n_A_terms(); i++)
495  {
496  Real B_max_val;
497  B_max_in >> B_max_val;
498  B_max.push_back(B_max_val);
499  }
500 
501  // Read in the length of the C_J data
502  file_name.str("");
503  file_name << directory_name << "/C_J_length" << suffix;
504  Xdr C_J_length_in(file_name.str(), mode);
505 
506  unsigned int C_J_length;
507  C_J_length_in >> C_J_length;
508  C_J_length_in.close();
509 
510  // Read in C_J_stability_vector
511  file_name.str("");
512  file_name << directory_name << "/C_J_stability_vector" << suffix;
513  Xdr C_J_stability_vector_in(file_name.str(), mode);
514 
515  C_J_stability_vector.clear();
516  for (unsigned int i=0; i<C_J_length; i++)
517  {
518  Real C_J_stability_val;
519  C_J_stability_vector_in >> C_J_stability_val;
520  C_J_stability_vector.push_back(C_J_stability_val);
521  }
522  C_J_stability_vector_in.close();
523 
524  // Read in C_J
525  file_name.str("");
526  file_name << directory_name << "/C_J" << suffix;
527  Xdr C_J_in(file_name.str(), mode);
528 
529  // Resize C_J based on C_J_stability_vector and Q_a
530  C_J.resize( C_J_length );
531  for (auto & params : C_J)
532  for (const auto & pr : get_parameters())
533  {
534  const std::string & param_name = pr.first;
535  Real param_value;
536  C_J_in >> param_value;
537  params.set_value(param_name, param_value);
538  }
539  C_J_in.close();
540 
541 
542  // Read in SCM_UB_vectors get_SCM_UB_vector
543  file_name.str("");
544  file_name << directory_name << "/SCM_UB_vectors" << suffix;
545  Xdr SCM_UB_vectors_in(file_name.str(), mode);
546 
547  // Resize SCM_UB_vectors based on C_J_stability_vector and Q_a
548  SCM_UB_vectors.resize( C_J_stability_vector.size() );
549  for (auto i : index_range(SCM_UB_vectors))
550  {
552  for (unsigned int j=0; j<rb_theta_expansion->get_n_A_terms(); j++)
553  {
554  SCM_UB_vectors_in >> SCM_UB_vectors[i][j];
555  }
556  }
557  SCM_UB_vectors_in.close();
558 }

References B_max, B_min, C_J, C_J_stability_vector, libMesh::Xdr::close(), libMesh::DECODE, libMesh::RBThetaExpansion::get_n_A_terms(), libMesh::RBParametrized::get_parameters(), libMesh::index_range(), rb_theta_expansion, libMesh::READ, libMesh::RBParametrized::read_parameter_data_from_files(), libMesh::Real, and SCM_UB_vectors.

◆ legacy_write_offline_data_to_files()

void libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files ( const std::string &  directory_name = "offline_data",
const bool  write_binary_data = true 
)
virtual

Write out all the data to text files in order to segregate the Offline stage from the Online stage.

Note
This is a legacy method, use RBDataSerialization instead.

Definition at line 330 of file rb_scm_evaluation.C.

332 {
333  LOG_SCOPE("legacy_write_offline_data_to_files()", "RBSCMEvaluation");
334 
335  if (this->processor_id() == 0)
336  {
337  // Make a directory to store all the data files
338  if (mkdir(directory_name.c_str(), 0777) == -1)
339  {
340  libMesh::out << "In RBSCMEvaluation::write_offline_data_to_files, directory "
341  << directory_name << " already exists, overwriting contents." << std::endl;
342  }
343 
344  // The writing mode: ENCODE for binary, WRITE for ASCII
345  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
346 
347  // The suffix to use for all the files that are written out
348  const std::string suffix = write_binary_data ? ".xdr" : ".dat";
349 
350  // Stream for building the file names
351  std::ostringstream file_name;
352 
353  // Write out the parameter ranges
354  file_name.str("");
355  file_name << directory_name << "/parameter_ranges" << suffix;
356  std::string continuous_param_file_name = file_name.str();
357 
358  // Write out the discrete parameter values
359  file_name.str("");
360  file_name << directory_name << "/discrete_parameter_values" << suffix;
361  std::string discrete_param_file_name = file_name.str();
362 
363  write_parameter_data_to_files(continuous_param_file_name,
364  discrete_param_file_name,
365  write_binary_data);
366 
367  // Write out the bounding box min values
368  file_name.str("");
369  file_name << directory_name << "/B_min" << suffix;
370  Xdr B_min_out(file_name.str(), mode);
371 
372  for (auto i : IntRange<unsigned int>(0, B_min.size()))
373  {
374  Real B_min_i = get_B_min(i);
375  B_min_out << B_min_i;
376  }
377  B_min_out.close();
378 
379 
380  // Write out the bounding box max values
381  file_name.str("");
382  file_name << directory_name << "/B_max" << suffix;
383  Xdr B_max_out(file_name.str(), mode);
384 
385  for (auto i : IntRange<unsigned int>(0, B_max.size()))
386  {
387  Real B_max_i = get_B_max(i);
388  B_max_out << B_max_i;
389  }
390  B_max_out.close();
391 
392  // Write out the length of the C_J data
393  file_name.str("");
394  file_name << directory_name << "/C_J_length" << suffix;
395  Xdr C_J_length_out(file_name.str(), mode);
396 
397  unsigned int C_J_length = cast_int<unsigned int>(C_J.size());
398  C_J_length_out << C_J_length;
399  C_J_length_out.close();
400 
401  // Write out C_J_stability_vector
402  file_name.str("");
403  file_name << directory_name << "/C_J_stability_vector" << suffix;
404  Xdr C_J_stability_vector_out(file_name.str(), mode);
405 
406  for (auto i : IntRange<unsigned int>(0, C_J_stability_vector.size()))
407  {
408  Real C_J_stability_constraint_i = get_C_J_stability_constraint(i);
409  C_J_stability_vector_out << C_J_stability_constraint_i;
410  }
411  C_J_stability_vector_out.close();
412 
413  // Write out C_J
414  file_name.str("");
415  file_name << directory_name << "/C_J" << suffix;
416  Xdr C_J_out(file_name.str(), mode);
417 
418  for (auto & param : C_J)
419  for (const auto & item : param)
420  {
421  // Need to make a copy of the value so that it's not const
422  // Xdr is not templated on const's
423  Real param_value = item.second;
424  C_J_out << param_value;
425  }
426  C_J_out.close();
427 
428  // Write out SCM_UB_vectors get_SCM_UB_vector
429  file_name.str("");
430  file_name << directory_name << "/SCM_UB_vectors" << suffix;
431  Xdr SCM_UB_vectors_out(file_name.str(), mode);
432 
433  for (auto i : IntRange<unsigned int>(0, SCM_UB_vectors.size()))
434  for (auto j : IntRange<unsigned int>(0, rb_theta_expansion->get_n_A_terms()))
435  {
436  Real SCM_UB_vector_ij = get_SCM_UB_vector(i,j);
437  SCM_UB_vectors_out << SCM_UB_vector_ij;
438  }
439  SCM_UB_vectors_out.close();
440  }
441 }

References B_max, B_min, C_J, C_J_stability_vector, libMesh::Xdr::close(), libMesh::ENCODE, get_B_max(), get_B_min(), get_C_J_stability_constraint(), libMesh::RBThetaExpansion::get_n_A_terms(), get_SCM_UB_vector(), libMesh::Utility::mkdir(), libMesh::out, libMesh::ParallelObject::processor_id(), rb_theta_expansion, libMesh::Real, SCM_UB_vectors, libMesh::WRITE, and libMesh::RBParametrized::write_parameter_data_to_files().

◆ n_objects()

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

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

Definition at line 83 of file reference_counter.h.

84  { return _n_objects; }

References libMesh::ReferenceCounter::_n_objects.

◆ n_processors()

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

Definition at line 100 of file parallel_object.h.

101  { return cast_int<processor_id_type>(_communicator.size()); }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DofMap::add_constraints_to_send_list(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::EnsightIO::EnsightIO(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::partition(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::prepare_send_list(), libMesh::DofMap::print_dof_constraints(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::DistributedMesh::renumber_dof_objects(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::VTKIO::write_nodal_data(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

◆ print_discrete_parameter_values()

void libMesh::RBParametrized::print_discrete_parameter_values ( ) const
inherited

Print out all the discrete parameter values.

Definition at line 389 of file rb_parametrized.C.

390 {
391  for (const auto & pr : get_discrete_parameter_values())
392  {
393  libMesh::out << "Discrete parameter " << pr.first << ", values: ";
394 
395  const std::vector<Real> & values = pr.second;
396  for (const auto & value : values)
397  libMesh::out << value << " ";
398  libMesh::out << std::endl;
399  }
400 }

References libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::out, and value.

Referenced by libMesh::RBSCMConstruction::print_info(), and libMesh::RBConstruction::print_info().

◆ print_info()

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

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

Definition at line 87 of file reference_counter.C.

88 {
90  out_stream << ReferenceCounter::get_info();
91 }

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

◆ print_parameters()

void libMesh::RBParametrized::print_parameters ( ) const
inherited

Print the current parameters.

Definition at line 206 of file rb_parametrized.C.

207 {
209  libmesh_error_msg("Error: parameters not initialized in RBParametrized::print_current_parameters");
210 
211  get_parameters().print();
212 }

References libMesh::RBParametrized::get_parameters(), libMesh::RBParametrized::parameters_initialized, and libMesh::RBParameters::print().

Referenced by libMesh::RBConstruction::train_reduced_basis().

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inlineinherited
Returns
The rank of this processor in the group.

Definition at line 106 of file parallel_object.h.

107  { return cast_int<processor_id_type>(_communicator.rank()); }

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::DofMap::get_local_constraints(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), HeatSystem::init_data(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::DofMap::last_dof(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::DofMap::n_local_dofs(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::SparsityPattern::Build::operator()(), libMesh::DistributedMesh::own_node(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_data(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::LaplaceMeshSmoother::smooth(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusCopyElementSolution(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), CheckpointIOTest::testSplitter(), WriteVecAndScalar::testWrite(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_element_values_element_major(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::System::write_header(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::VTKIO::write_nodal_data(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEvaluation::write_out_vectors(), write_output_solvedata(), libMesh::System::write_parallel_data(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_data(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::System::write_serialized_vector(), libMesh::System::write_serialized_vectors(), libMesh::ExodusII_IO_Helper::write_sideset_data(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), libMesh::ExodusII_IO_Helper::write_timestep(), and libMesh::ExodusII_IO::write_timestep_discontinuous().

◆ read_discrete_parameter_values_from_file()

void libMesh::RBParametrized::read_discrete_parameter_values_from_file ( const std::string &  file_name,
const bool  read_binary_data,
std::map< std::string, std::vector< Real >> &  discrete_parameter_values_in 
)
privateinherited

Read in the discrete parameter values from file, if we have any.

Definition at line 340 of file rb_parametrized.C.

343 {
344  // read in the discrete parameters, if we have any
345  std::ifstream check_if_file_exists(file_name.c_str());
346  if (check_if_file_exists.good())
347  {
348  // The reading mode: DECODE for binary, READ for ASCII
349  XdrMODE mode = read_binary_data ? DECODE : READ;
350 
351  // Read in the parameter ranges
352  Xdr discrete_parameter_values_in(file_name, mode);
353  unsigned int n_discrete_params;
354  discrete_parameter_values_in >> n_discrete_params;
355 
356  for (unsigned int i=0; i<n_discrete_params; i++)
357  {
358  std::string param_name;
359  discrete_parameter_values_in >> param_name;
360 
361  unsigned int n_discrete_values;
362  discrete_parameter_values_in >> n_discrete_values;
363 
364  std::vector<Real> discrete_values(n_discrete_values);
365  for (auto & val : discrete_values)
366  discrete_parameter_values_in >> val;
367 
368  discrete_parameter_values[param_name] = discrete_values;
369  }
370  }
371 }

References libMesh::DECODE, and libMesh::READ.

Referenced by libMesh::RBParametrized::read_parameter_data_from_files().

◆ read_parameter_data_from_files()

void libMesh::RBParametrized::read_parameter_data_from_files ( const std::string &  continuous_param_file_name,
const std::string &  discrete_param_file_name,
const bool  read_binary_data 
)
inherited

Read in the parameter ranges from files.

Definition at line 284 of file rb_parametrized.C.

287 {
288  RBParameters param_min;
289  RBParameters param_max;
290  read_parameter_ranges_from_file(continuous_param_file_name,
291  read_binary_data,
292  param_min,
293  param_max);
294 
295  std::map<std::string, std::vector<Real>> discrete_parameter_values_in;
296  read_discrete_parameter_values_from_file(discrete_param_file_name,
297  read_binary_data,
298  discrete_parameter_values_in);
299 
300  initialize_parameters(param_min, param_max, discrete_parameter_values_in);
301 }

References libMesh::RBParametrized::initialize_parameters(), libMesh::RBParametrized::read_discrete_parameter_values_from_file(), and libMesh::RBParametrized::read_parameter_ranges_from_file().

Referenced by libMesh::RBEvaluation::legacy_read_offline_data_from_files(), and legacy_read_offline_data_from_files().

◆ read_parameter_ranges_from_file()

void libMesh::RBParametrized::read_parameter_ranges_from_file ( const std::string &  file_name,
const bool  read_binary,
RBParameters param_min,
RBParameters param_max 
)
privateinherited

Read in the parameter ranges from file.

Initialize parameters to the "minimum" parameter values.

Definition at line 303 of file rb_parametrized.C.

307 {
308  // The reading mode: DECODE for binary, READ for ASCII
309  XdrMODE mode = read_binary_data ? DECODE : READ;
310 
311  // Read in the parameter ranges
312  Xdr parameter_ranges_in(file_name, mode);
313  unsigned int n_continuous_params;
314  parameter_ranges_in >> n_continuous_params;
315 
316  for (unsigned int i=0; i<n_continuous_params; i++)
317  {
318  std::string param_name;
319  Real param_value;
320 
321  parameter_ranges_in >> param_name;
322  parameter_ranges_in >> param_value;
323 
324  param_min.set_value(param_name, param_value);
325  }
326  for (unsigned int i=0; i<n_continuous_params; i++)
327  {
328  std::string param_name;
329  Real param_value;
330 
331  parameter_ranges_in >> param_name;
332  parameter_ranges_in >> param_value;
333 
334  param_max.set_value(param_name, param_value);
335  }
336 
337  parameter_ranges_in.close();
338 }

References libMesh::Xdr::close(), libMesh::DECODE, libMesh::READ, libMesh::Real, and libMesh::RBParameters::set_value().

Referenced by libMesh::RBParametrized::read_parameter_data_from_files().

◆ reload_current_parameters()

void libMesh::RBSCMEvaluation::reload_current_parameters ( )
virtual

Helper function to (re)load current_parameters from saved_parameters.

Definition at line 325 of file rb_scm_evaluation.C.

326 {
328 }

References saved_parameters, and libMesh::RBParametrized::set_parameters().

Referenced by get_SCM_LB().

◆ save_current_parameters()

void libMesh::RBSCMEvaluation::save_current_parameters ( )
virtual

Helper function to save current_parameters in saved_parameters.

Definition at line 320 of file rb_scm_evaluation.C.

321 {
323 }

References libMesh::RBParametrized::get_parameters(), and saved_parameters.

Referenced by get_SCM_LB().

◆ set_B_max()

void libMesh::RBSCMEvaluation::set_B_max ( unsigned int  i,
Real  B_max_val 
)

Definition at line 158 of file rb_scm_evaluation.C.

159 {
160  if (q >= B_max.size())
161  libmesh_error_msg("Error: q is too large in set_B_max.");
162 
163  B_max[q] = B_max_val;
164 }

References B_max.

Referenced by libMesh::RBSCMConstruction::compute_SCM_bounding_box().

◆ set_B_min()

void libMesh::RBSCMEvaluation::set_B_min ( unsigned int  i,
Real  B_min_val 
)

Set B_min and B_max.

Definition at line 150 of file rb_scm_evaluation.C.

151 {
152  if (q >= B_min.size())
153  libmesh_error_msg("Error: q is too large in set_B_min.");
154 
155  B_min[q] = B_min_val;
156 }

References B_min.

Referenced by libMesh::RBSCMConstruction::compute_SCM_bounding_box().

◆ set_C_J_stability_constraint()

void libMesh::RBSCMEvaluation::set_C_J_stability_constraint ( unsigned int  j,
Real  stability_constraint_in 
)

Set stability constraints (i.e.

the values of coercivity/ inf-sup/stability constants at the parameter values chosen during the greedy); we store one constraint for each element of C_J.

Definition at line 80 of file rb_scm_evaluation.C.

81 {
82  if (j >= C_J_stability_vector.size())
83  libmesh_error_msg("Error: Input parameter j is too large in set_C_J_stability_constraint.");
84 
85  // we assume that C_J_stability_vector is resized elsewhere
86  // to be the same size as C_J.
87  libmesh_assert_equal_to (C_J_stability_vector.size(), C_J.size());
88 
89  C_J_stability_vector[j] = stability_const_in;
90 }

References C_J, and C_J_stability_vector.

Referenced by libMesh::RBSCMConstruction::evaluate_stability_constant().

◆ set_current_parameters_from_C_J()

void libMesh::RBSCMEvaluation::set_current_parameters_from_C_J ( unsigned int  C_J_index)
virtual

Set parameters based on values saved in "C_J".

Definition at line 315 of file rb_scm_evaluation.C.

316 {
317  set_parameters(C_J[C_J_index]);
318 }

References C_J, and libMesh::RBParametrized::set_parameters().

Referenced by get_SCM_LB().

◆ set_parameters()

void libMesh::RBParametrized::set_parameters ( const RBParameters params)
inherited

Set the current parameters to params.

Definition at line 155 of file rb_parametrized.C.

156 {
158  libmesh_error_msg("Error: parameters not initialized in RBParametrized::set_current_parameters");
159 
160  valid_params(params); // Terminates if params has the wrong number of parameters
161 
162  // Make a copy of params (default assignment operator just does memberwise copy, which is sufficient here)
163  this->parameters = params;
164 }

References libMesh::RBParametrized::parameters, libMesh::RBParametrized::parameters_initialized, and libMesh::RBParametrized::valid_params().

Referenced by libMesh::RBEIMConstruction::compute_best_fit_error(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::RBEIMTheta::evaluate(), libMesh::RBConstruction::get_RB_error_bound(), SimpleRBEvaluation::get_stability_lower_bound(), libMesh::RBParametrized::initialize_parameters(), reload_current_parameters(), set_current_parameters_from_C_J(), and libMesh::RBEIMConstruction::truth_solve().

◆ set_rb_theta_expansion()

void libMesh::RBSCMEvaluation::set_rb_theta_expansion ( RBThetaExpansion rb_theta_expansion_in)

Set the RBThetaExpansion object.

Definition at line 67 of file rb_scm_evaluation.C.

68 {
69  rb_theta_expansion = &rb_theta_expansion_in;
70 }

References rb_theta_expansion.

Referenced by main().

◆ set_SCM_UB_vector()

void libMesh::RBSCMEvaluation::set_SCM_UB_vector ( unsigned int  j,
unsigned int  q,
Real  y_q 
)

Set entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors for the elements of C_J.

Definition at line 100 of file rb_scm_evaluation.C.

101 {
102  // First make sure that j <= J
103  if (j >= SCM_UB_vectors.size())
104  libmesh_error_msg("Error: We must have j < J in set_SCM_UB_vector.");
105 
106  // Next make sure that q <= Q_a or Q_a_hat
107  if (q >= SCM_UB_vectors[0].size())
108  libmesh_error_msg("Error: q is too large in set_SCM_UB_vector.");
109 
110  SCM_UB_vectors[j][q] = y_q;
111 }

References SCM_UB_vectors.

Referenced by libMesh::RBSCMConstruction::evaluate_stability_constant().

◆ valid_params()

bool libMesh::RBParametrized::valid_params ( const RBParameters params)
privateinherited

Helper function to check that params is valid.

Definition at line 402 of file rb_parametrized.C.

403 {
404  if (params.n_parameters() != get_n_params())
405  libmesh_error_msg("Error: Number of parameters don't match");
406 
407  else
408  {
409  bool valid = true;
410  for (const auto & pr : params)
411  {
412  const std::string & param_name = pr.first;
413  valid = valid && ( (get_parameter_min(param_name) <= params.get_value(param_name)) &&
414  (params.get_value(param_name) <= get_parameter_max(param_name)) );
415 
416  if (is_discrete_parameter(param_name))
417  {
418  // make sure params.get_value(param_name) is sufficiently close
419  // to one of the discrete parameter values
420  valid = valid && is_value_in_list(params.get_value(param_name),
421  get_discrete_parameter_values().find(param_name)->second,
422  TOLERANCE);
423  }
424  }
425 
426  if (!valid && verbose_mode)
427  libMesh::out << "Warning: parameter is outside parameter range" << std::endl;
428 
429  return valid;
430  }
431 }

References libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::get_n_params(), libMesh::RBParametrized::get_parameter_max(), libMesh::RBParametrized::get_parameter_min(), libMesh::RBParametrized::is_discrete_parameter(), libMesh::RBParametrized::is_value_in_list(), libMesh::RBParameters::n_parameters(), libMesh::out, libMesh::TOLERANCE, libMesh::Quality::valid(), and libMesh::RBParametrized::verbose_mode.

Referenced by libMesh::RBParametrized::set_parameters().

◆ write_discrete_parameter_values_to_file()

void libMesh::RBParametrized::write_discrete_parameter_values_to_file ( const std::string &  file_name,
const bool  write_binary_data 
)
privateinherited

Write out the discrete parameter values to file.

Definition at line 255 of file rb_parametrized.C.

257 {
258  // write out the discrete parameters, if we have any
259  if (get_n_discrete_params() > 0)
260  {
261  // The writing mode: ENCODE for binary, WRITE for ASCII
262  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
263 
264  Xdr discrete_parameters_out(file_name, mode);
265  unsigned int n_discrete_params = get_n_discrete_params();
266  discrete_parameters_out << n_discrete_params;
267 
268  for (const auto & pr : get_discrete_parameter_values())
269  {
270  std::string param_name = pr.first;
271  unsigned int n_discrete_values = cast_int<unsigned int>
272  (pr.second.size());
273  discrete_parameters_out << param_name << n_discrete_values;
274 
275  for (unsigned int i=0; i<n_discrete_values; i++)
276  {
277  Real discrete_value = pr.second[i];
278  discrete_parameters_out << discrete_value;
279  }
280  }
281  }
282 }

References libMesh::ENCODE, libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::get_n_discrete_params(), libMesh::Real, and libMesh::WRITE.

Referenced by libMesh::RBParametrized::write_parameter_data_to_files().

◆ write_parameter_data_to_files()

void libMesh::RBParametrized::write_parameter_data_to_files ( const std::string &  continuous_param_file_name,
const std::string &  discrete_param_file_name,
const bool  write_binary_data 
)
inherited

Write out the parameter ranges to files.

Definition at line 214 of file rb_parametrized.C.

217 {
218  write_parameter_ranges_to_file(continuous_param_file_name, write_binary_data);
219  write_discrete_parameter_values_to_file(discrete_param_file_name, write_binary_data);
220 }

References libMesh::RBParametrized::write_discrete_parameter_values_to_file(), and libMesh::RBParametrized::write_parameter_ranges_to_file().

Referenced by libMesh::RBEvaluation::legacy_write_offline_data_to_files(), and legacy_write_offline_data_to_files().

◆ write_parameter_ranges_to_file()

void libMesh::RBParametrized::write_parameter_ranges_to_file ( const std::string &  file_name,
const bool  write_binary 
)
privateinherited

Write out the parameter ranges to file.

Definition at line 222 of file rb_parametrized.C.

224 {
225  // The writing mode: ENCODE for binary, WRITE for ASCII
226  XdrMODE mode = write_binary_data ? ENCODE : WRITE;
227 
228  // Write out the parameter ranges
229  Xdr parameter_ranges_out(file_name, mode);
230  unsigned int n_continuous_params = get_n_continuous_params();
231  parameter_ranges_out << n_continuous_params;
232 
233  for (const auto & pr : get_parameters_min())
234  {
235  std::string param_name = pr.first;
236  if (!is_discrete_parameter(param_name))
237  {
238  Real param_value = pr.second;
239  parameter_ranges_out << param_name << param_value;
240  }
241  }
242 
243  for (const auto & pr : get_parameters_max())
244  {
245  std::string param_name = pr.first;
246  if (!is_discrete_parameter(param_name))
247  {
248  Real param_value = pr.second;
249  parameter_ranges_out << param_name << param_value;
250  }
251  }
252  parameter_ranges_out.close();
253 }

References libMesh::Xdr::close(), libMesh::ENCODE, libMesh::RBParametrized::get_n_continuous_params(), libMesh::RBParametrized::get_parameters_max(), libMesh::RBParametrized::get_parameters_min(), libMesh::RBParametrized::is_discrete_parameter(), libMesh::Real, and libMesh::WRITE.

Referenced by libMesh::RBParametrized::write_parameter_data_to_files().

Member Data Documentation

◆ _communicator

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

◆ _counts

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _discrete_parameter_values

std::map<std::string, std::vector<Real> > libMesh::RBParametrized::_discrete_parameter_values
privateinherited

Map that defines the allowable values of any discrete parameters.

Definition at line 235 of file rb_parametrized.h.

Referenced by libMesh::RBParametrized::get_discrete_parameter_values(), libMesh::RBParametrized::initialize_parameters(), and libMesh::RBParametrized::is_discrete_parameter().

◆ _enable_print_counter

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

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

Definition at line 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _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().

◆ B_max

std::vector<Real> libMesh::RBSCMEvaluation::B_max

◆ B_min

std::vector<Real> libMesh::RBSCMEvaluation::B_min

◆ C_J

std::vector<RBParameters > libMesh::RBSCMEvaluation::C_J

◆ C_J_stability_vector

std::vector<Real> libMesh::RBSCMEvaluation::C_J_stability_vector

◆ parameters

RBParameters libMesh::RBParametrized::parameters
privateinherited

◆ parameters_initialized

bool libMesh::RBParametrized::parameters_initialized
privateinherited

◆ parameters_max

RBParameters libMesh::RBParametrized::parameters_max
privateinherited

◆ parameters_min

RBParameters libMesh::RBParametrized::parameters_min
privateinherited

◆ rb_theta_expansion

RBThetaExpansion* libMesh::RBSCMEvaluation::rb_theta_expansion
private

A pointer to to the object that stores the theta expansion.

This is not a std::unique_ptr since we may want to share it.

Note
A shared_ptr would be a good option here.

Definition at line 222 of file rb_scm_evaluation.h.

Referenced by get_rb_theta_expansion(), get_SCM_LB(), get_SCM_UB(), legacy_read_offline_data_from_files(), legacy_write_offline_data_to_files(), and set_rb_theta_expansion().

◆ saved_parameters

RBParameters libMesh::RBSCMEvaluation::saved_parameters
private

Vector in which to save a parameter set.

Useful in get_SCM_LB, for example.

Definition at line 214 of file rb_scm_evaluation.h.

Referenced by reload_current_parameters(), and save_current_parameters().

◆ SCM_UB_vectors

std::vector<std::vector<Real> > libMesh::RBSCMEvaluation::SCM_UB_vectors

This matrix stores the infimizing vectors y_1( \( \mu \)),...,y_Q_a( \( \mu \)), for each \( \mu \) in C_J, which are used in computing the SCM upper bounds.

Definition at line 206 of file rb_scm_evaluation.h.

Referenced by libMesh::RBSCMConstruction::enrich_C_J(), get_SCM_UB(), get_SCM_UB_vector(), legacy_read_offline_data_from_files(), legacy_write_offline_data_to_files(), libMesh::RBDataDeserialization::load_rb_scm_evaluation_data(), RBSCMEvaluation(), libMesh::RBSCMConstruction::resize_SCM_vectors(), and set_SCM_UB_vector().

◆ verbose_mode

bool libMesh::RBParametrized::verbose_mode
inherited

Public boolean to toggle verbose mode.

Definition at line 170 of file rb_parametrized.h.

Referenced by libMesh::RBParametrized::valid_params().


The documentation for this class was generated from the following files:
libMesh::RBParametrized::get_parameters_min
const RBParameters & get_parameters_min() const
Get an RBParameters object that specifies the minimum allowable value for each parameter.
Definition: rb_parametrized.C:174
libMesh::RBParametrized::_discrete_parameter_values
std::map< std::string, std::vector< Real > > _discrete_parameter_values
Map that defines the allowable values of any discrete parameters.
Definition: rb_parametrized.h:235
libMesh::RBParameters::print
void print() const
Print the parameters.
Definition: rb_parameters.C:134
libMesh::RBSCMEvaluation::C_J
std::vector< RBParameters > C_J
Vector storing the greedily selected parameters during SCM training.
Definition: rb_scm_evaluation.h:192
libMesh::RBSCMEvaluation::B_max
std::vector< Real > B_max
Definition: rb_scm_evaluation.h:186
libMesh::RBParametrized::write_parameter_data_to_files
void write_parameter_data_to_files(const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool write_binary_data)
Write out the parameter ranges to files.
Definition: rb_parametrized.C:214
libMesh::RBSCMEvaluation::set_current_parameters_from_C_J
virtual void set_current_parameters_from_C_J(unsigned int C_J_index)
Set parameters based on values saved in "C_J".
Definition: rb_scm_evaluation.C:315
libMesh::RBParametrized::get_closest_value
static Real get_closest_value(Real value, const std::vector< Real > &list_of_values)
Definition: rb_parametrized.C:433
libMesh::RBParametrized::read_discrete_parameter_values_from_file
void read_discrete_parameter_values_from_file(const std::string &file_name, const bool read_binary_data, std::map< std::string, std::vector< Real >> &discrete_parameter_values_in)
Read in the discrete parameter values from file, if we have any.
Definition: rb_parametrized.C:340
libMesh::libmesh_real
T libmesh_real(T a)
Definition: libmesh_common.h:166
libMesh::index_range
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:106
libMesh::RBParametrized::get_n_params
unsigned int get_n_params() const
Get the number of parameters.
Definition: rb_parametrized.C:115
libMesh::RBParametrized::verbose_mode
bool verbose_mode
Public boolean to toggle verbose mode.
Definition: rb_parametrized.h:170
libMesh::RBSCMEvaluation::reload_current_parameters
virtual void reload_current_parameters()
Helper function to (re)load current_parameters from saved_parameters.
Definition: rb_scm_evaluation.C:325
libMesh::ReferenceCounter::_counts
static Counts _counts
Actually holds the data.
Definition: reference_counter.h:122
libMesh::TOLERANCE
static const Real TOLERANCE
Definition: libmesh_common.h:128
libMesh::RBSCMEvaluation::get_SCM_UB_vector
Real get_SCM_UB_vector(unsigned int j, unsigned int q)
Get entries of SCM_UB_vector, which stores the vector y, corresponding to the minimizing eigenvectors...
Definition: rb_scm_evaluation.C:113
libMesh::RBSCMEvaluation::SCM_UB_vectors
std::vector< std::vector< Real > > SCM_UB_vectors
This matrix stores the infimizing vectors y_1( ),...,y_Q_a( ), for each in C_J, which are used in co...
Definition: rb_scm_evaluation.h:206
libMesh::ReferenceCounter::_n_objects
static Threads::atomic< unsigned int > _n_objects
The number of objects.
Definition: reference_counter.h:130
libMesh::WRITE
Definition: enum_xdr_mode.h:40
libMesh::RBParametrized::set_parameters
void set_parameters(const RBParameters &params)
Set the current parameters to params.
Definition: rb_parametrized.C:155
libMesh::RBParametrized::get_n_discrete_params
unsigned int get_n_discrete_params() const
Get the number of discrete parameters.
Definition: rb_parametrized.C:135
libMesh::ReferenceCounter::get_info
static std::string get_info()
Gets a string containing the reference information.
Definition: reference_counter.C:47
libMesh::RBParametrized::parameters_max
RBParameters parameters_max
Definition: rb_parametrized.h:230
libMesh::RBParameters::n_parameters
unsigned int n_parameters() const
Get the number of parameters that have been added.
Definition: rb_parameters.C:63
libMesh::RBParametrized::get_n_continuous_params
unsigned int get_n_continuous_params() const
Get the number of continuous parameters.
Definition: rb_parametrized.C:125
libMesh::RBParametrized::get_parameters_max
const RBParameters & get_parameters_max() const
Get an RBParameters object that specifies the maximum allowable value for each parameter.
Definition: rb_parametrized.C:182
libMesh::RBParametrized::get_parameters
const RBParameters & get_parameters() const
Get the current parameters.
Definition: rb_parametrized.C:166
libMesh::RBSCMEvaluation::C_J_stability_vector
std::vector< Real > C_J_stability_vector
Vector storing the (truth) stability values at the parameters in C_J.
Definition: rb_scm_evaluation.h:198
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::RBParametrized::get_parameter_max
Real get_parameter_max(const std::string &param_name) const
Get maximum allowable value of parameter param_name.
Definition: rb_parametrized.C:198
libMesh::ParallelObject::ParallelObject
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
Definition: parallel_object.h:63
std::abs
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::XdrMODE
XdrMODE
Defines an enum for read/write mode in Xdr format.
Definition: enum_xdr_mode.h:35
libMesh::DECODE
Definition: enum_xdr_mode.h:39
libMesh::Threads::spin_mtx
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
libMesh::ParallelObject::processor_id
processor_id_type processor_id() const
Definition: parallel_object.h:106
libMesh::ParallelObject::_communicator
const Parallel::Communicator & _communicator
Definition: parallel_object.h:112
libMesh::RBSCMEvaluation::saved_parameters
RBParameters saved_parameters
Vector in which to save a parameter set.
Definition: rb_scm_evaluation.h:214
libMesh::RBSCMEvaluation::B_min
std::vector< Real > B_min
B_min, B_max define the bounding box.
Definition: rb_scm_evaluation.h:185
libMesh::RBParameters::set_value
void set_value(const std::string &param_name, Real value)
Set the value of the specified parameter.
Definition: rb_parameters.C:47
libMesh::RBThetaExpansion::eval_A_theta
virtual Number eval_A_theta(unsigned int q, const RBParameters &mu)
Evaluate theta_q_a at the current parameter.
Definition: rb_theta_expansion.C:119
libMesh::RBParametrized::parameters_min
RBParameters parameters_min
Vectors that define the ranges (min and max) for the parameters.
Definition: rb_parametrized.h:229
libMesh::RBSCMEvaluation::get_B_max
Real get_B_max(unsigned int i) const
Definition: rb_scm_evaluation.C:142
libMesh::READ
Definition: enum_xdr_mode.h:41
libMesh::RBParametrized::write_discrete_parameter_values_to_file
void write_discrete_parameter_values_to_file(const std::string &file_name, const bool write_binary_data)
Write out the discrete parameter values to file.
Definition: rb_parametrized.C:255
libMesh::Utility::mkdir
int mkdir(const char *pathname)
Create a directory.
Definition: utility.C:140
libMesh::RBSCMEvaluation::rb_theta_expansion
RBThetaExpansion * rb_theta_expansion
A pointer to to the object that stores the theta expansion.
Definition: rb_scm_evaluation.h:222
libMesh::RBParameters::get_parameter_names
void get_parameter_names(std::set< std::string > &param_names) const
Fill param_names with the names of the parameters.
Definition: rb_parameters.C:69
libMesh::Quality::valid
std::vector< ElemQuality > valid(const ElemType t)
Returns all valid quality metrics for element type t.
Definition: elem_quality.C:324
libMesh::ENCODE
Definition: enum_xdr_mode.h:38
distance
Real distance(const Point &p)
Definition: subdomains_ex3.C:50
libMesh::RBParametrized::initialize_parameters
void initialize_parameters(const RBParameters &mu_min_in, const RBParameters &mu_max_in, const std::map< std::string, std::vector< Real >> &discrete_parameter_values)
Initialize the parameter ranges and set current_parameters.
Definition: rb_parametrized.C:60
libMesh::RBParametrized::read_parameter_ranges_from_file
void read_parameter_ranges_from_file(const std::string &file_name, const bool read_binary, RBParameters &param_min, RBParameters &param_max)
Read in the parameter ranges from file.
Definition: rb_parametrized.C:303
libMesh::RBParametrized::parameters
RBParameters parameters
Vector storing the current parameters.
Definition: rb_parametrized.h:224
libMesh::RBParametrized::read_parameter_data_from_files
void read_parameter_data_from_files(const std::string &continuous_param_file_name, const std::string &discrete_param_file_name, const bool read_binary_data)
Read in the parameter ranges from files.
Definition: rb_parametrized.C:284
libMesh::RBParametrized::valid_params
bool valid_params(const RBParameters &params)
Helper function to check that params is valid.
Definition: rb_parametrized.C:402
value
static const bool value
Definition: xdr_io.C:56
libMesh::RBParametrized::get_discrete_parameter_values
const std::map< std::string, std::vector< Real > > & get_discrete_parameter_values() const
Get a const reference to the discrete parameter values.
Definition: rb_parametrized.C:381
libMesh::RBThetaExpansion::get_n_A_terms
unsigned int get_n_A_terms() const
Get Q_a, the number of terms in the affine expansion for the bilinear form.
Definition: rb_theta_expansion.C:35
libMesh::RBSCMEvaluation::get_B_min
Real get_B_min(unsigned int i) const
Get B_min and B_max.
Definition: rb_scm_evaluation.C:133
libMesh::RBParametrized::parameters_initialized
bool parameters_initialized
Flag indicating whether the parameters have been initialized.
Definition: rb_parametrized.h:219
libMesh::RBParameters::clear
void clear()
Clear this object.
Definition: rb_parameters.C:35
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::RBParametrized::is_value_in_list
static bool is_value_in_list(Real value, const std::vector< Real > &list_of_values, Real tol)
Helper function to check if the specified value is in the list of values (within a tolerance given by...
Definition: rb_parametrized.C:453
libMesh::ReferenceCounter::_enable_print_counter
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.
Definition: reference_counter.h:141
libMesh::out
OStreamProxy out
libMesh::RBParametrized::write_parameter_ranges_to_file
void write_parameter_ranges_to_file(const std::string &file_name, const bool write_binary)
Write out the parameter ranges to file.
Definition: rb_parametrized.C:222
libMesh::RBSCMEvaluation::save_current_parameters
virtual void save_current_parameters()
Helper function to save current_parameters in saved_parameters.
Definition: rb_scm_evaluation.C:320
libMesh::RBParametrized::is_discrete_parameter
bool is_discrete_parameter(const std::string &mu_name) const
Is parameter mu_name discrete?
Definition: rb_parametrized.C:373
libMesh::Quality::name
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
libMesh::RBSCMEvaluation::get_C_J_stability_constraint
Real get_C_J_stability_constraint(unsigned int j) const
Get stability constraints (i.e.
Definition: rb_scm_evaluation.C:92
libMesh::RBParameters::get_value
Real get_value(const std::string &param_name) const
Get the value of the specific parameter.
Definition: rb_parameters.C:41
libMesh::RBParametrized::get_parameter_min
Real get_parameter_min(const std::string &param_name) const
Get minimum allowable value of parameter param_name.
Definition: rb_parametrized.C:190