GRINS-0.8.0
List of all members | Public Member Functions | Protected Attributes
GRINS::CachedValues Class Reference

#include <cached_values.h>

Public Member Functions

 CachedValues ()
 
 ~CachedValues ()
 
void add_quantity (unsigned int quantity)
 
void add_quantities (const std::set< unsigned int > &cache_list)
 
void clear ()
 
bool is_active (unsigned int quantity)
 
void set_values (unsigned int quantity, std::vector< libMesh::Number > &values)
 
void set_gradient_values (unsigned int quantity, std::vector< libMesh::Gradient > &values)
 
void set_vector_values (unsigned int quantity, std::vector< std::vector< libMesh::Number > > &values)
 
void set_vector_gradient_values (unsigned int quantity, std::vector< std::vector< libMesh::Gradient > > &values)
 
const std::vector< libMesh::Number > & get_cached_values (unsigned int quantity) const
 
const std::vector< libMesh::Gradient > & get_cached_gradient_values (unsigned int quantity) const
 
const std::vector< std::vector< libMesh::Number > > & get_cached_vector_values (unsigned int quantity) const
 
const std::vector< std::vector< libMesh::Gradient > > & get_cached_vector_gradient_values (unsigned int quantity) const
 
unsigned int size () const
 

Protected Attributes

std::set< unsigned int > _cache_list
 
std::map< unsigned int, std::vector< libMesh::Number > > _cached_values
 
std::map< unsigned int, std::vector< libMesh::Gradient > > _cached_gradient_values
 
std::map< unsigned int, std::vector< std::vector< libMesh::Number > > > _cached_vector_values
 
std::map< unsigned int, std::vector< std::vector< libMesh::Gradient > > > _cached_vector_gradient_values
 

Detailed Description

Definition at line 43 of file cached_values.h.

Constructor & Destructor Documentation

GRINS::CachedValues::CachedValues ( )

Definition at line 30 of file cached_values.C.

31  {
32  return;
33  }
GRINS::CachedValues::~CachedValues ( )

Definition at line 35 of file cached_values.C.

36  {
37  return;
38  }

Member Function Documentation

void GRINS::CachedValues::add_quantities ( const std::set< unsigned int > &  cache_list)

Definition at line 46 of file cached_values.C.

References _cache_list.

47  {
48  _cache_list.insert(cache_list.begin(), cache_list.end());
49  return;
50  }
std::set< unsigned int > _cache_list
Definition: cached_values.h:81
void GRINS::CachedValues::add_quantity ( unsigned int  quantity)

Definition at line 40 of file cached_values.C.

References _cache_list.

Referenced by main().

41  {
42  _cache_list.insert(quantity);
43  return;
44  }
std::set< unsigned int > _cache_list
Definition: cached_values.h:81
void GRINS::CachedValues::clear ( )

Definition at line 52 of file cached_values.C.

References _cached_gradient_values, _cached_values, _cached_vector_gradient_values, and _cached_vector_values.

Referenced by GRINS::MultiphysicsSystem::_general_residual().

53  {
54  _cached_values.clear();
56  _cached_vector_values.clear();
58 
59  return;
60  }
std::map< unsigned int, std::vector< std::vector< libMesh::Number > > > _cached_vector_values
Definition: cached_values.h:85
std::map< unsigned int, std::vector< std::vector< libMesh::Gradient > > > _cached_vector_gradient_values
Definition: cached_values.h:86
std::map< unsigned int, std::vector< libMesh::Number > > _cached_values
Definition: cached_values.h:83
std::map< unsigned int, std::vector< libMesh::Gradient > > _cached_gradient_values
Definition: cached_values.h:84
const std::vector< libMesh::Gradient > & GRINS::CachedValues::get_cached_gradient_values ( unsigned int  quantity) const
const std::vector< libMesh::Number > & GRINS::CachedValues::get_cached_values ( unsigned int  quantity) const
const std::vector< std::vector< libMesh::Gradient > > & GRINS::CachedValues::get_cached_vector_gradient_values ( unsigned int  quantity) const

Definition at line 117 of file cached_values.C.

References _cached_vector_gradient_values.

Referenced by GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >::element_time_derivative().

118  {
119  libmesh_assert( _cached_vector_gradient_values.find(quantity) != _cached_vector_gradient_values.end() );
120  return _cached_vector_gradient_values.find(quantity)->second;
121  }
std::map< unsigned int, std::vector< std::vector< libMesh::Gradient > > > _cached_vector_gradient_values
Definition: cached_values.h:86
const std::vector< std::vector< libMesh::Number > > & GRINS::CachedValues::get_cached_vector_values ( unsigned int  quantity) const

Definition at line 111 of file cached_values.C.

References _cached_vector_values.

Referenced by GRINS::GasRecombinationCatalyticWall< Chemistry >::apply_fluxes(), GRINS::GasSolidCatalyticWall< Chemistry >::apply_fluxes(), and GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >::element_time_derivative().

112  {
113  libmesh_assert( _cached_vector_values.find(quantity) != _cached_vector_values.end() );
114  return _cached_vector_values.find(quantity)->second;
115  }
std::map< unsigned int, std::vector< std::vector< libMesh::Number > > > _cached_vector_values
Definition: cached_values.h:85
bool GRINS::CachedValues::is_active ( unsigned int  quantity)

Definition at line 62 of file cached_values.C.

References _cache_list.

63  {
64  bool value = false;
65 
66  if( _cache_list.find(quantity) != _cache_list.end() )
67  value = true;
68 
69  return value;
70  }
std::set< unsigned int > _cache_list
Definition: cached_values.h:81
void GRINS::CachedValues::set_gradient_values ( unsigned int  quantity,
std::vector< libMesh::Gradient > &  values 
)

Definition at line 78 of file cached_values.C.

References _cached_gradient_values.

Referenced by GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >::compute_element_time_derivative_cache(), and GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >::compute_element_time_derivative_cache().

80  {
81  // Using insert() breaks here. Not entirely sure why...
82  _cached_gradient_values[quantity] = values;
83  return;
84  }
std::map< unsigned int, std::vector< libMesh::Gradient > > _cached_gradient_values
Definition: cached_values.h:84
void GRINS::CachedValues::set_values ( unsigned int  quantity,
std::vector< libMesh::Number > &  values 
)

Definition at line 72 of file cached_values.C.

References _cached_values.

Referenced by GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >::compute_element_time_derivative_cache(), GRINS::LowMachNavierStokes< Viscosity, SpecificHeat, ThermalConductivity >::compute_element_time_derivative_cache(), and main().

73  {
74  _cached_values.insert( std::make_pair( quantity, values ) );
75  return;
76  }
std::map< unsigned int, std::vector< libMesh::Number > > _cached_values
Definition: cached_values.h:83
void GRINS::CachedValues::set_vector_gradient_values ( unsigned int  quantity,
std::vector< std::vector< libMesh::Gradient > > &  values 
)

Definition at line 86 of file cached_values.C.

References _cached_vector_gradient_values.

Referenced by GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >::compute_element_time_derivative_cache().

88  {
89  _cached_vector_gradient_values[quantity] = values;
90  return;
91  }
std::map< unsigned int, std::vector< std::vector< libMesh::Gradient > > > _cached_vector_gradient_values
Definition: cached_values.h:86
void GRINS::CachedValues::set_vector_values ( unsigned int  quantity,
std::vector< std::vector< libMesh::Number > > &  values 
)

Definition at line 93 of file cached_values.C.

References _cached_vector_values.

Referenced by GRINS::ReactingLowMachNavierStokes< Mixture, Evaluator >::compute_element_time_derivative_cache(), and main().

94  {
95  _cached_vector_values[quantity] = values;
96  return;
97  }
std::map< unsigned int, std::vector< std::vector< libMesh::Number > > > _cached_vector_values
Definition: cached_values.h:85
unsigned int GRINS::CachedValues::size ( ) const
inline

Definition at line 91 of file cached_values.h.

References _cache_list.

92  {
93  return _cache_list.size();
94  }
std::set< unsigned int > _cache_list
Definition: cached_values.h:81

Member Data Documentation

std::set<unsigned int> GRINS::CachedValues::_cache_list
protected

Definition at line 81 of file cached_values.h.

Referenced by add_quantities(), add_quantity(), is_active(), and size().

std::map<unsigned int,std::vector<libMesh::Gradient> > GRINS::CachedValues::_cached_gradient_values
protected

Definition at line 84 of file cached_values.h.

Referenced by clear(), get_cached_gradient_values(), and set_gradient_values().

std::map<unsigned int,std::vector<libMesh::Number> > GRINS::CachedValues::_cached_values
protected

Definition at line 83 of file cached_values.h.

Referenced by clear(), get_cached_values(), and set_values().

std::map<unsigned int,std::vector<std::vector<libMesh::Gradient> > > GRINS::CachedValues::_cached_vector_gradient_values
protected
std::map<unsigned int,std::vector<std::vector<libMesh::Number> > > GRINS::CachedValues::_cached_vector_values
protected

Definition at line 85 of file cached_values.h.

Referenced by clear(), get_cached_vector_values(), and set_vector_values().


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

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1