libMesh
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
AcousticsRBThetaExpansion Struct Reference

#include <assembly.h>

Inheritance diagram for AcousticsRBThetaExpansion:
[legend]

Public Member Functions

 AcousticsRBThetaExpansion ()
 Constructor.
 
virtual Number eval_A_theta (unsigned int q, const RBParameters &mu) const
 Evaluate theta_q_a at the current parameter.
 
virtual std::vector< Number > eval_A_theta (unsigned int q, const std::vector< RBParameters > &mus) const
 Evaluate theta_q_a at multiple parameters simultaneously.
 
virtual Number eval_F_theta (unsigned int q, const RBParameters &mu) const
 Evaluate theta_q_f at the current parameter.
 
virtual std::vector< Number > eval_F_theta (unsigned int q, const std::vector< RBParameters > &mus) const
 Evaluate theta_q_f at multiple parameters simultaneously.
 
virtual Number eval_output_theta (unsigned int output_index, unsigned int q_l, const RBParameters &mu) const
 Evaluate theta_q_l at the current parameter.
 
virtual std::vector< Number > eval_output_theta (unsigned int output_index, unsigned int q_l, const std::vector< RBParameters > &mus) const
 Evaluate theta_q_l at multiple parameters simultaneously.
 
unsigned int get_n_A_terms () const
 Get Q_a, the number of terms in the affine expansion for the bilinear form.
 
unsigned int get_n_F_terms () const
 Get Q_f, the number of terms in the affine expansion for the right-hand side.
 
unsigned int get_n_outputs () const
 Get n_outputs, the number output functionals.
 
unsigned int get_n_output_terms (unsigned int output_index) const
 Get the number of affine terms associated with the specified output.
 
unsigned int get_total_n_output_terms () const
 Returns the total number of affine terms associated with all outputs.
 
unsigned int output_index_1D (unsigned int n, unsigned int q_l) const
 Computes the one-dimensional index for output n, term q_l implied by a "row-major" ordering of the outputs.
 
virtual void attach_A_theta (RBTheta *theta_q_a)
 Attach a pointer to a functor object that defines one of the theta_q_a terms.
 
virtual void attach_multiple_A_theta (std::vector< std::unique_ptr< RBTheta > > &theta_q_a)
 Attach a vector of pointers to functor objects that each define one of the theta_q_a terms.
 
virtual void attach_F_theta (RBTheta *theta_q_f)
 Attach a pointer to a functor object that defines one of the theta_q_a terms.
 
virtual void attach_multiple_F_theta (std::vector< std::unique_ptr< RBTheta > > &theta_q_f)
 Attach a vector of pointers to functor objects that each define one of the theta_q_f terms.
 
virtual void attach_output_theta (std::vector< std::unique_ptr< RBTheta > > &theta_q_l)
 Attach a vector of pointers to functor objects that define one of the outputs.
 
virtual void attach_output_theta (std::vector< RBTheta * > theta_q_l)
 Attach a vector of pointers to functor objects that define one of the outputs.
 
virtual void attach_output_theta (RBTheta *theta_q_l)
 Attach a pointer to a functor object that defines one of the outputs.
 

Static Public Member Functions

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

Public Attributes

ThetaA0 theta_a_0
 
ThetaA1 theta_a_1
 
ThetaA2 theta_a_2
 
ThetaA3 theta_a_3
 
ThetaF0 theta_f_0
 
ThetaOutput0 theta_output_0
 

Protected Types

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

Protected Member Functions

void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter.
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter.
 

Static Protected Attributes

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

Private Attributes

std::vector< RBTheta * > _A_theta_vector
 Vector storing the pointers to the RBTheta functors for A.
 
std::vector< RBTheta * > _F_theta_vector
 Vector storing the RBTheta functors for the affine expansion of the rhs.
 
std::vector< std::vector< RBTheta * > > _output_theta_vector
 Vector storing the RBTheta functors for the affine expansion of the outputs.
 

Detailed Description

Definition at line 287 of file assembly.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 119 of file reference_counter.h.

Constructor & Destructor Documentation

◆ AcousticsRBThetaExpansion()

AcousticsRBThetaExpansion::AcousticsRBThetaExpansion ( )
inline

Constructor.

Definition at line 292 of file assembly.h.

293 {
294 // set up the RBThetaExpansion object
295 attach_A_theta(&theta_a_0); // Attach the lhs theta
299
300 attach_F_theta(&theta_f_0); // Attach the rhs theta
301
303 }
virtual void attach_F_theta(RBTheta *theta_q_f)
Attach a pointer to a functor object that defines one of the theta_q_a terms.
virtual void attach_A_theta(RBTheta *theta_q_a)
Attach a pointer to a functor object that defines one of the theta_q_a terms.
virtual void attach_output_theta(std::vector< std::unique_ptr< RBTheta > > &theta_q_l)
Attach a vector of pointers to functor objects that define one of the outputs.
ThetaOutput0 theta_output_0
Definition assembly.h:311

References libMesh::RBThetaExpansion::attach_A_theta(), libMesh::RBThetaExpansion::attach_F_theta(), libMesh::RBThetaExpansion::attach_output_theta(), theta_a_0, theta_a_1, theta_a_2, theta_a_3, theta_f_0, and theta_output_0.

Member Function Documentation

◆ attach_A_theta()

void RBThetaExpansion::attach_A_theta ( RBTheta theta_q_a)
virtualinherited

Attach a pointer to a functor object that defines one of the theta_q_a terms.

Definition at line 77 of file rb_theta_expansion.C.

78{
79 libmesh_assert(theta_q_a);
80
81 _A_theta_vector.push_back(theta_q_a);
82}
std::vector< RBTheta * > _A_theta_vector
Vector storing the pointers to the RBTheta functors for A.
libmesh_assert(ctx)

References libMesh::RBThetaExpansion::_A_theta_vector, and libMesh::libmesh_assert().

Referenced by AcousticsRBThetaExpansion(), CDRBThetaExpansion::CDRBThetaExpansion(), EimTestRBThetaExpansion::EimTestRBThetaExpansion(), ElasticityThetaExpansion::ElasticityThetaExpansion(), and Ex6ThetaExpansion::Ex6ThetaExpansion().

◆ attach_F_theta()

void RBThetaExpansion::attach_F_theta ( RBTheta theta_q_f)
virtualinherited

Attach a pointer to a functor object that defines one of the theta_q_a terms.

Definition at line 93 of file rb_theta_expansion.C.

94{
95 libmesh_assert(theta_q_f);
96
97 _F_theta_vector.push_back(theta_q_f);
98}
std::vector< RBTheta * > _F_theta_vector
Vector storing the RBTheta functors for the affine expansion of the rhs.

References libMesh::RBThetaExpansion::_F_theta_vector, and libMesh::libmesh_assert().

Referenced by AcousticsRBThetaExpansion(), CDRBThetaExpansion::CDRBThetaExpansion(), ElasticityThetaExpansion::ElasticityThetaExpansion(), and Ex6ThetaExpansion::Ex6ThetaExpansion().

◆ attach_multiple_A_theta()

void RBThetaExpansion::attach_multiple_A_theta ( std::vector< std::unique_ptr< RBTheta > > &  theta_q_a)
virtualinherited

Attach a vector of pointers to functor objects that each define one of the theta_q_a terms.

Definition at line 84 of file rb_theta_expansion.C.

85{
86 for (std::size_t i=0; i<theta_q_a.size(); i++)
87 {
88 libmesh_assert(theta_q_a[i]);
89 _A_theta_vector.push_back(theta_q_a[i].get());
90 }
91}
const Elem & get(const ElemType type_in)

References libMesh::RBThetaExpansion::_A_theta_vector, and libMesh::libmesh_assert().

Referenced by main().

◆ attach_multiple_F_theta()

void RBThetaExpansion::attach_multiple_F_theta ( std::vector< std::unique_ptr< RBTheta > > &  theta_q_f)
virtualinherited

Attach a vector of pointers to functor objects that each define one of the theta_q_f terms.

Definition at line 100 of file rb_theta_expansion.C.

101{
102 for (std::size_t i=0; i<theta_q_f.size(); i++)
103 {
104 libmesh_assert(theta_q_f[i]);
105 _F_theta_vector.push_back(theta_q_f[i].get());
106 }
107}

References libMesh::RBThetaExpansion::_F_theta_vector, and libMesh::libmesh_assert().

Referenced by main().

◆ attach_output_theta() [1/3]

void RBThetaExpansion::attach_output_theta ( RBTheta theta_q_l)
virtualinherited

Attach a pointer to a functor object that defines one of the outputs.

Definition at line 124 of file rb_theta_expansion.C.

125{
126 libmesh_assert(theta_q_l);
127
128 std::vector<RBTheta *> theta_l_vector(1);
129 theta_l_vector[0] = theta_q_l;
130
131 attach_output_theta(theta_l_vector);
132}

References libMesh::RBThetaExpansion::attach_output_theta(), and libMesh::libmesh_assert().

◆ attach_output_theta() [2/3]

void RBThetaExpansion::attach_output_theta ( std::vector< RBTheta * >  theta_q_l)
virtualinherited

Attach a vector of pointers to functor objects that define one of the outputs.

Definition at line 119 of file rb_theta_expansion.C.

120{
121 _output_theta_vector.push_back(std::move(theta_q_l));
122}
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.

References libMesh::RBThetaExpansion::_output_theta_vector.

◆ attach_output_theta() [3/3]

void RBThetaExpansion::attach_output_theta ( std::vector< std::unique_ptr< RBTheta > > &  theta_q_l)
virtualinherited

Attach a vector of pointers to functor objects that define one of the outputs.

Definition at line 109 of file rb_theta_expansion.C.

110{
111 std::vector<RBTheta *> theta_q_l_ptr;
112 for(std::size_t i=0; i<theta_q_l.size(); i++)
113 {
114 theta_q_l_ptr.push_back( theta_q_l[i].get() );
115 }
116 _output_theta_vector.push_back(theta_q_l_ptr);
117}

References libMesh::RBThetaExpansion::_output_theta_vector.

Referenced by AcousticsRBThetaExpansion(), libMesh::RBThetaExpansion::attach_output_theta(), CDRBThetaExpansion::CDRBThetaExpansion(), and EimTestRBThetaExpansion::EimTestRBThetaExpansion().

◆ disable_print_counter_info()

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

101{
102 _enable_print_counter = false;
103 return;
104}
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.

References libMesh::ReferenceCounter::_enable_print_counter.

◆ enable_print_counter_info()

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Enabled by default.

Definition at line 94 of file reference_counter.C.

95{
97 return;
98}

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ eval_A_theta() [1/2]

Number RBThetaExpansion::eval_A_theta ( unsigned int  q,
const RBParameters mu 
) const
virtualinherited

Evaluate theta_q_a at the current parameter.

Override if the theta functions need to be treated differently in subclasses.

Definition at line 134 of file rb_theta_expansion.C.

136{
137 libmesh_error_msg_if(q >= get_n_A_terms(), "Error: We must have q < get_n_A_terms in eval_A_theta.");
139
140 return _A_theta_vector[q]->evaluate( mu );
141}
unsigned int get_n_A_terms() const
Get Q_a, the number of terms in the affine expansion for the bilinear form.

References libMesh::RBThetaExpansion::_A_theta_vector, libMesh::RBThetaExpansion::get_n_A_terms(), and libMesh::libmesh_assert().

Referenced by libMesh::TransientRBEvaluation::cache_online_residual_terms(), libMesh::RBEvaluation::compute_residual_dual_norm(), libMesh::RBSCMEvaluation::get_SCM_LB(), libMesh::RBSCMEvaluation::get_SCM_UB(), main(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_assembly(), and libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm().

◆ eval_A_theta() [2/2]

std::vector< Number > RBThetaExpansion::eval_A_theta ( unsigned int  q,
const std::vector< RBParameters > &  mus 
) const
virtualinherited

Evaluate theta_q_a at multiple parameters simultaneously.

Definition at line 143 of file rb_theta_expansion.C.

145{
146 libmesh_error_msg_if(q >= get_n_A_terms(), "Error: We must have q < get_n_A_terms in eval_A_theta.");
148
149 return _A_theta_vector[q]->evaluate_vec(mus);
150}

References libMesh::RBThetaExpansion::_A_theta_vector, libMesh::RBThetaExpansion::get_n_A_terms(), and libMesh::libmesh_assert().

◆ eval_F_theta() [1/2]

Number RBThetaExpansion::eval_F_theta ( unsigned int  q,
const RBParameters mu 
) const
virtualinherited

Evaluate theta_q_f at the current parameter.

Definition at line 152 of file rb_theta_expansion.C.

154{
155 libmesh_error_msg_if(q >= get_n_F_terms(), "Error: We must have q < get_n_F_terms in eval_F_theta.");
157
158 return _F_theta_vector[q]->evaluate( mu );
159}
unsigned int get_n_F_terms() const
Get Q_f, the number of terms in the affine expansion for the right-hand side.

References libMesh::RBThetaExpansion::_F_theta_vector, libMesh::RBThetaExpansion::get_n_F_terms(), and libMesh::libmesh_assert().

Referenced by libMesh::TransientRBEvaluation::cache_online_residual_terms(), libMesh::RBEvaluation::compute_residual_dual_norm(), main(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::TransientRBConstruction::truth_assembly(), and libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm().

◆ eval_F_theta() [2/2]

std::vector< Number > RBThetaExpansion::eval_F_theta ( unsigned int  q,
const std::vector< RBParameters > &  mus 
) const
virtualinherited

Evaluate theta_q_f at multiple parameters simultaneously.

Definition at line 161 of file rb_theta_expansion.C.

163{
164 libmesh_error_msg_if(q >= get_n_F_terms(), "Error: We must have q < get_n_F_terms in eval_F_theta.");
166
167 return _F_theta_vector[q]->evaluate_vec(mus);
168}

References libMesh::RBThetaExpansion::_F_theta_vector, libMesh::RBThetaExpansion::get_n_F_terms(), and libMesh::libmesh_assert().

◆ eval_output_theta() [1/2]

Number RBThetaExpansion::eval_output_theta ( unsigned int  output_index,
unsigned int  q_l,
const RBParameters mu 
) const
virtualinherited

Evaluate theta_q_l at the current parameter.

Definition at line 170 of file rb_theta_expansion.C.

173{
174 libmesh_error_msg_if((output_index >= get_n_outputs()) || (q_l >= get_n_output_terms(output_index)),
175 "Error: We must have output_index < n_outputs and "
176 "q_l < get_n_output_terms(output_index) in eval_output_theta.");
177
178 libmesh_assert(_output_theta_vector[output_index][q_l]);
179
180 return _output_theta_vector[output_index][q_l]->evaluate( mu );
181}
unsigned int get_n_output_terms(unsigned int output_index) const
Get the number of affine terms associated with the specified output.
unsigned int get_n_outputs() const
Get n_outputs, the number output functionals.

References libMesh::RBThetaExpansion::_output_theta_vector, libMesh::RBThetaExpansion::get_n_output_terms(), libMesh::RBThetaExpansion::get_n_outputs(), and libMesh::libmesh_assert().

Referenced by libMesh::RBEvaluation::eval_output_dual_norm(), main(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBConstruction::truth_solve(), and libMesh::TransientRBConstruction::truth_solve().

◆ eval_output_theta() [2/2]

std::vector< Number > RBThetaExpansion::eval_output_theta ( unsigned int  output_index,
unsigned int  q_l,
const std::vector< RBParameters > &  mus 
) const
virtualinherited

Evaluate theta_q_l at multiple parameters simultaneously.

Definition at line 184 of file rb_theta_expansion.C.

187{
188 libmesh_error_msg_if((output_index >= get_n_outputs()) || (q_l >= get_n_output_terms(output_index)),
189 "Error: We must have output_index < n_outputs and "
190 "q_l < get_n_output_terms(output_index) in eval_output_theta.");
191
192 libmesh_assert(_output_theta_vector[output_index][q_l]);
193
194 return _output_theta_vector[output_index][q_l]->evaluate_vec(mus);
195}

References libMesh::RBThetaExpansion::_output_theta_vector, libMesh::RBThetaExpansion::get_n_output_terms(), libMesh::RBThetaExpansion::get_n_outputs(), and libMesh::libmesh_assert().

◆ 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 & [name, cd] : _counts)
59 oss << "| " << name << " reference count information:\n"
60 << "| Creations: " << cd.first << '\n'
61 << "| Destructions: " << cd.second << '\n';
62
63 oss << " ---------------------------------------------------------------------------- \n";
64
65 return oss.str();
66
67#else
68
69 return "";
70
71#endif
72}
static Counts _counts
Actually holds the data.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.

References libMesh::ReferenceCounter::_counts.

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

◆ get_n_A_terms()

unsigned int RBThetaExpansion::get_n_A_terms ( ) const
inherited

Get Q_a, the number of terms in the affine expansion for the bilinear form.

Definition at line 31 of file rb_theta_expansion.C.

32{
33 return cast_int<unsigned int>
34 (_A_theta_vector.size());
35}

References libMesh::RBThetaExpansion::_A_theta_vector.

Referenced by libMesh::RBDataSerialization::add_rb_evaluation_data_to_builder(), libMesh::RBDataSerialization::add_rb_scm_evaluation_data_to_builder(), libMesh::RBDataSerialization::add_transient_rb_evaluation_data_to_builder(), libMesh::RBConstruction::allocate_data_structures(), libMesh::RBConstruction::assemble_all_affine_operators(), libMesh::RBConstruction::assemble_inner_product_matrix(), libMesh::TransientRBEvaluation::cache_online_residual_terms(), libMesh::RBEvaluation::check_evaluated_thetas_size(), libMesh::RBEvaluation::compute_residual_dual_norm(), libMesh::RBSCMConstruction::compute_SCM_bounding_box(), libMesh::RBThetaExpansion::eval_A_theta(), libMesh::RBThetaExpansion::eval_A_theta(), libMesh::RBEvaluation::eval_output_dual_norm(), libMesh::RBSCMConstruction::evaluate_stability_constant(), libMesh::RBConstruction::get_all_matrices(), libMesh::RBSCMEvaluation::get_SCM_LB(), libMesh::RBSCMEvaluation::get_SCM_UB(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), libMesh::TransientRBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBSCMEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBDataDeserialization::load_rb_evaluation_data(), libMesh::RBDataDeserialization::load_rb_scm_evaluation_data(), libMesh::RBDataDeserialization::load_transient_rb_evaluation_data(), main(), libMesh::RBConstruction::preevaluate_thetas(), libMesh::RBSCMConstruction::print_info(), libMesh::RBConstruction::print_info(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::TransientRBEvaluation::resize_data_structures(), libMesh::RBSCMConstruction::resize_SCM_vectors(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), and libMesh::RBConstruction::update_residual_terms().

◆ get_n_F_terms()

unsigned int RBThetaExpansion::get_n_F_terms ( ) const
inherited

Get Q_f, the number of terms in the affine expansion for the right-hand side.

Definition at line 37 of file rb_theta_expansion.C.

38{
39 return cast_int<unsigned int>
40 (_F_theta_vector.size());
41}

References libMesh::RBThetaExpansion::_F_theta_vector.

Referenced by libMesh::RBDataSerialization::add_rb_evaluation_data_to_builder(), libMesh::RBDataSerialization::add_transient_rb_evaluation_data_to_builder(), libMesh::RBConstruction::allocate_data_structures(), libMesh::RBConstruction::assemble_all_affine_vectors(), libMesh::TransientRBEvaluation::cache_online_residual_terms(), libMesh::RBEvaluation::check_evaluated_thetas_size(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBEvaluation::compute_residual_dual_norm(), libMesh::RBConstruction::enrich_basis_from_rhs_terms(), libMesh::RBThetaExpansion::eval_F_theta(), libMesh::RBThetaExpansion::eval_F_theta(), libMesh::RBEvaluation::eval_output_dual_norm(), libMesh::RBConstruction::get_all_vectors(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), libMesh::TransientRBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBDataDeserialization::load_rb_evaluation_data(), libMesh::RBDataDeserialization::load_transient_rb_evaluation_data(), main(), libMesh::RBConstruction::print_info(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::TransientRBEvaluation::resize_data_structures(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), and libMesh::RBConstruction::update_residual_terms().

◆ get_n_output_terms()

unsigned int RBThetaExpansion::get_n_output_terms ( unsigned int  output_index) const
inherited

◆ get_n_outputs()

unsigned int RBThetaExpansion::get_n_outputs ( ) const
inherited

◆ get_total_n_output_terms()

unsigned int RBThetaExpansion::get_total_n_output_terms ( ) const
inherited

Returns the total number of affine terms associated with all outputs.

Definition at line 57 of file rb_theta_expansion.C.

58{
59 unsigned int sum = 0;
60 for (const auto & vec : _output_theta_vector)
61 sum += vec.size();
62 return sum;
63}

References libMesh::RBThetaExpansion::_output_theta_vector.

Referenced by libMesh::RBEvaluation::check_evaluated_thetas_size(), and main().

◆ increment_constructor_count()

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

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

184{
185 libmesh_try
186 {
187 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188 std::pair<unsigned int, unsigned int> & p = _counts[name];
189 p.first++;
190 }
191 libmesh_catch (...)
192 {
193 auto stream = libMesh::err.get();
194 stream->exceptions(stream->goodbit); // stream must not throw
195 libMesh::err << "Encountered unrecoverable error while calling "
196 << "ReferenceCounter::increment_constructor_count() "
197 << "for a(n) " << name << " object." << std::endl;
198 std::terminate();
199 }
200}
streamT * get()
Rather than implement every ostream/ios/ios_base function, we'll be lazy and make esoteric uses go th...
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition threads.C:30
OStreamProxy err

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), and libMesh::ReferenceCountedObject< T >::ReferenceCountedObject().

◆ increment_destructor_count()

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

208{
209 libmesh_try
210 {
211 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212 std::pair<unsigned int, unsigned int> & p = _counts[name];
213 p.second++;
214 }
215 libmesh_catch (...)
216 {
217 auto stream = libMesh::err.get();
218 stream->exceptions(stream->goodbit); // stream must not throw
219 libMesh::err << "Encountered unrecoverable error while calling "
220 << "ReferenceCounter::increment_destructor_count() "
221 << "for a(n) " << name << " object." << std::endl;
222 std::terminate();
223 }
224}

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

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

◆ n_objects()

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

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

Definition at line 85 of file reference_counter.h.

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

References libMesh::ReferenceCounter::_n_objects.

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

◆ output_index_1D()

unsigned int RBThetaExpansion::output_index_1D ( unsigned int  n,
unsigned int  q_l 
) const
inherited

Computes the one-dimensional index for output n, term q_l implied by a "row-major" ordering of the outputs.

This is useful for indexing into pre-evaluated theta arrays, which store the pre-evaluated output theta values in this order following the "A" and "F" theta values.

Definition at line 65 of file rb_theta_expansion.C.

66{
67 // Start with index of the current term
68 unsigned int index = q_l;
69
70 // Add to it the number of terms for all outputs prior to n
71 for (auto i : make_range(n))
72 index += _output_theta_vector[i].size();
73
74 return index;
75}
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition int_range.h:176

References libMesh::RBThetaExpansion::_output_theta_vector, and libMesh::make_range().

Referenced by libMesh::RBEvaluation::eval_output_dual_norm().

◆ print_info()

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

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

Definition at line 81 of file reference_counter.C.

82{
84 out_stream << ReferenceCounter::get_info();
85}
static std::string get_info()
Gets a string containing the reference information.

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

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

Member Data Documentation

◆ _A_theta_vector

std::vector<RBTheta *> libMesh::RBThetaExpansion::_A_theta_vector
privateinherited

◆ _counts

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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _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 143 of file reference_counter.h.

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

◆ _F_theta_vector

std::vector<RBTheta *> libMesh::RBThetaExpansion::_F_theta_vector
privateinherited

◆ _mutex

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

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

◆ _n_objects

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

◆ _output_theta_vector

std::vector<std::vector<RBTheta *> > libMesh::RBThetaExpansion::_output_theta_vector
privateinherited

◆ theta_a_0

ThetaA0 AcousticsRBThetaExpansion::theta_a_0

Definition at line 306 of file assembly.h.

Referenced by AcousticsRBThetaExpansion().

◆ theta_a_1

ThetaA1 AcousticsRBThetaExpansion::theta_a_1

Definition at line 307 of file assembly.h.

Referenced by AcousticsRBThetaExpansion().

◆ theta_a_2

ThetaA2 AcousticsRBThetaExpansion::theta_a_2

Definition at line 308 of file assembly.h.

Referenced by AcousticsRBThetaExpansion().

◆ theta_a_3

ThetaA3 AcousticsRBThetaExpansion::theta_a_3

Definition at line 309 of file assembly.h.

Referenced by AcousticsRBThetaExpansion().

◆ theta_f_0

ThetaF0 AcousticsRBThetaExpansion::theta_f_0

Definition at line 310 of file assembly.h.

Referenced by AcousticsRBThetaExpansion().

◆ theta_output_0

ThetaOutput0 AcousticsRBThetaExpansion::theta_output_0

Definition at line 311 of file assembly.h.

Referenced by AcousticsRBThetaExpansion().


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