libMesh
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Attributes | List of all members
ElasticityThetaExpansion Struct Reference

#include <assembly.h>

Inheritance diagram for ElasticityThetaExpansion:
[legend]

Public Member Functions

 ElasticityThetaExpansion ()
 Constructor. More...
 
virtual Number eval_A_theta (unsigned int q, const RBParameters &mu) const
 Evaluate theta_q_a at the current parameter. More...
 
virtual std::vector< Number > eval_A_theta (unsigned int q, const std::vector< RBParameters > &mus) const
 Evaluate theta_q_a at multiple parameters simultaneously. More...
 
virtual Number eval_F_theta (unsigned int q, const RBParameters &mu) const
 Evaluate theta_q_f at the current parameter. More...
 
virtual std::vector< Number > eval_F_theta (unsigned int q, const std::vector< RBParameters > &mus) const
 Evaluate theta_q_f at multiple parameters simultaneously. More...
 
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. More...
 
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. More...
 
unsigned int get_n_A_terms () const
 Get Q_a, the number of terms in the affine expansion for the bilinear form. More...
 
unsigned int get_n_F_terms () const
 Get Q_f, the number of terms in the affine expansion for the right-hand side. More...
 
unsigned int get_n_outputs () const
 Get n_outputs, the number output functionals. More...
 
unsigned int get_n_output_terms (unsigned int output_index) const
 Get the number of affine terms associated with the specified output. More...
 
unsigned int get_total_n_output_terms () const
 Returns the total number of affine terms associated with all outputs. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void attach_output_theta (RBTheta *theta_q_l)
 Attach a pointer to a functor object that defines one of the outputs. More...
 

Static Public Member Functions

static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out_stream=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

ThetaA0 theta_a_0
 
ThetaA1 theta_a_1
 
ThetaA2 theta_a_2
 
ThetaF0 theta_f_0
 
ThetaF1 theta_f_1
 
ThetaF2 theta_f_2
 
ThetaPointLoadX theta_point_load_x
 
ThetaPointLoadY theta_point_load_y
 
ThetaPointLoadZ theta_point_load_z
 

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) noexcept
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter. More...
 

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

Detailed Description

Definition at line 246 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

◆ ElasticityThetaExpansion()

ElasticityThetaExpansion::ElasticityThetaExpansion ( )
inline

Constructor.

Definition at line 252 of file assembly.h.

References libMesh::RBThetaExpansion::attach_A_theta(), libMesh::RBThetaExpansion::attach_F_theta(), theta_a_0, theta_a_1, theta_a_2, theta_f_0, theta_f_1, theta_f_2, theta_point_load_x, theta_point_load_y, and theta_point_load_z.

253  {
254  // set up the RBThetaExpansion object
264  }
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.
ThetaPointLoadY theta_point_load_y
Definition: assembly.h:274
ThetaPointLoadZ theta_point_load_z
Definition: assembly.h:275
ThetaPointLoadX theta_point_load_x
Definition: assembly.h:273
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.

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.

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

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

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)

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

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

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

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.
libmesh_assert(ctx)

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

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

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 }
std::vector< RBTheta * > _A_theta_vector
Vector storing the pointers to the RBTheta functors for A.
libmesh_assert(ctx)

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

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

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 }
std::vector< RBTheta * > _F_theta_vector
Vector storing the RBTheta functors for the affine expansion of the rhs.
libmesh_assert(ctx)

◆ attach_output_theta() [1/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.

References libMesh::RBThetaExpansion::_output_theta_vector.

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

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 }
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.

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

References libMesh::RBThetaExpansion::_output_theta_vector.

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.

◆ attach_output_theta() [3/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.

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

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 }
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.
libmesh_assert(ctx)

◆ disable_print_counter_info()

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ 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 94 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

95 {
96  _enable_print_counter = true;
97  return;
98 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

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

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::TransientRBConstruction::truth_assembly(), and libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm().

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 }
std::vector< RBTheta * > _A_theta_vector
Vector storing the pointers to the RBTheta functors for A.
unsigned int get_n_A_terms() const
Get Q_a, the number of terms in the affine expansion for the bilinear form.
libmesh_assert(ctx)

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

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

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 }
std::vector< RBTheta * > _A_theta_vector
Vector storing the pointers to the RBTheta functors for A.
unsigned int get_n_A_terms() const
Get Q_a, the number of terms in the affine expansion for the bilinear form.
libmesh_assert(ctx)

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

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

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.
std::vector< RBTheta * > _F_theta_vector
Vector storing the RBTheta functors for the affine expansion of the rhs.
libmesh_assert(ctx)

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

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

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 }
unsigned int get_n_F_terms() const
Get Q_f, the number of terms in the affine expansion for the right-hand side.
std::vector< RBTheta * > _F_theta_vector
Vector storing the RBTheta functors for the affine expansion of the rhs.
libmesh_assert(ctx)

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

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::TransientRBConstruction::truth_solve(), and libMesh::RBConstruction::truth_solve().

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_outputs() const
Get n_outputs, the number output functionals.
libmesh_assert(ctx)
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.
unsigned int get_n_output_terms(unsigned int output_index) const
Get the number of affine terms associated with the specified output.

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

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

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 }
unsigned int get_n_outputs() const
Get n_outputs, the number output functionals.
libmesh_assert(ctx)
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.
unsigned int get_n_output_terms(unsigned int output_index) const
Get the number of affine terms associated with the specified output.

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

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

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

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 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
static Counts _counts
Actually holds the data.

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

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::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::TransientRBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBSCMEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::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::RBEvaluation::resize_data_structures(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm(), libMesh::RBConstruction::update_RB_system_matrices(), and libMesh::RBConstruction::update_residual_terms().

32 {
33  return cast_int<unsigned int>
34  (_A_theta_vector.size());
35 }
std::vector< RBTheta * > _A_theta_vector
Vector storing the pointers to the RBTheta functors for A.

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

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::RBEvaluation::eval_output_dual_norm(), libMesh::RBConstruction::get_all_vectors(), libMesh::TransientRBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::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::RBEvaluation::resize_data_structures(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBEvaluation::uncached_compute_residual_dual_norm(), libMesh::RBConstruction::update_RB_system_matrices(), and libMesh::RBConstruction::update_residual_terms().

38 {
39  return cast_int<unsigned int>
40  (_F_theta_vector.size());
41 }
std::vector< RBTheta * > _F_theta_vector
Vector storing the RBTheta functors for the affine expansion of the rhs.

◆ get_n_output_terms()

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

Get the number of affine terms associated with the specified output.

Definition at line 49 of file rb_theta_expansion.C.

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

Referenced by libMesh::RBDataSerialization::add_rb_evaluation_data_to_builder(), libMesh::RBConstruction::allocate_data_structures(), libMesh::RBConstruction::assemble_all_output_vectors(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBEvaluation::eval_output_dual_norm(), libMesh::RBThetaExpansion::eval_output_theta(), libMesh::RBConstruction::get_output_vectors(), libMesh::RBEvaluation::legacy_read_offline_data_from_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBDataDeserialization::load_rb_evaluation_data(), main(), libMesh::RBConstruction::print_info(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::RBEvaluation::resize_data_structures(), libMesh::TransientRBConstruction::truth_solve(), libMesh::RBConstruction::truth_solve(), and libMesh::RBConstruction::update_RB_system_matrices().

50 {
51  libmesh_error_msg_if(index >= get_n_outputs(), "Error: We must have index < n_outputs in get_Q_l.");
52 
53  return cast_int<unsigned int>
54  (_output_theta_vector[index].size());
55 }
unsigned int get_n_outputs() const
Get n_outputs, the number output functionals.
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.

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

References libMesh::RBThetaExpansion::_output_theta_vector.

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

58 {
59  unsigned int sum = 0;
60  for (const auto & vec : _output_theta_vector)
61  sum += vec.size();
62  return sum;
63 }
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.

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

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

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

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 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;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

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

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

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

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 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
OStreamProxy err
static Counts _counts
Actually holds the data.
streamT * get()
Rather than implement every ostream/ios/ios_base function, we&#39;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

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

References libMesh::ReferenceCounter::_n_objects.

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

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

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

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

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

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 }
std::vector< std::vector< RBTheta * > > _output_theta_vector
Vector storing the RBTheta functors for the affine expansion of the outputs.
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:134

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

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

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

82 {
84  out_stream << ReferenceCounter::get_info();
85 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...

Member Data Documentation

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

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

The number of objects.

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

Definition at line 132 of file reference_counter.h.

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

◆ theta_a_0

ThetaA0 ElasticityThetaExpansion::theta_a_0

Definition at line 267 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_a_1

ThetaA1 ElasticityThetaExpansion::theta_a_1

Definition at line 268 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_a_2

ThetaA2 ElasticityThetaExpansion::theta_a_2

Definition at line 269 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_f_0

ThetaF0 ElasticityThetaExpansion::theta_f_0

Definition at line 270 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_f_1

ThetaF1 ElasticityThetaExpansion::theta_f_1

Definition at line 271 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_f_2

ThetaF2 ElasticityThetaExpansion::theta_f_2

Definition at line 272 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_point_load_x

ThetaPointLoadX ElasticityThetaExpansion::theta_point_load_x

Definition at line 273 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_point_load_y

ThetaPointLoadY ElasticityThetaExpansion::theta_point_load_y

Definition at line 274 of file assembly.h.

Referenced by ElasticityThetaExpansion().

◆ theta_point_load_z

ThetaPointLoadZ ElasticityThetaExpansion::theta_point_load_z

Definition at line 275 of file assembly.h.

Referenced by ElasticityThetaExpansion().


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