https://mooseframework.inl.gov
Public Types | Public Member Functions | Protected Types | Private Attributes | List of all members
GeneralFieldTransfer::CachedData< Output > Class Template Reference

Value request response base class. More...

#include <MultiAppGeneralFieldTransfer.h>

Public Types

typedef PointIndexedMap Cache
 
typedef libMesh::TensorTools::MakeReal< Output >::type RealType
 
typedef DofValueType ValuePushType
 
typedef Output FunctorValue
 

Public Member Functions

 CachedData (const Cache &cache, const libMesh::FunctionBase< Output > &backup, Real default_value)
 Constructor. More...
 
 CachedData (const CachedData &primary)
 Copy constructor. More...
 
void init_context (libMesh::FEMContext &)
 
Output eval_at_node (const libMesh::FEMContext &, unsigned int, unsigned int, const Node &n, bool, const Real)
 Gets a value at the node location. More...
 
Output eval_at_point (const libMesh::FEMContext &, unsigned int, const Point &n, const Real, bool)
 Gets a value at a point. More...
 
bool is_grid_projection ()
 
void eval_mixed_derivatives (const libMesh::FEMContext &, unsigned int, unsigned int, const Node &, std::vector< Output > &)
 
void eval_old_dofs (const Elem &, unsigned int, unsigned int, std::vector< dof_id_type > &, std::vector< Output > &)
 
void eval_old_dofs (const Elem &, const libMesh::FEType &, unsigned int, unsigned int, std::vector< dof_id_type > &, std::vector< Output > &)
 

Protected Types

typedef libMesh::TensorTools::MakeBaseNumber< Output >::type DofValueType
 

Private Attributes

const Cache_cache
 Data to return for cached points. More...
 
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
 Function to evaluate for uncached points. More...
 
const Real _default_value
 Default value when no point is found. More...
 

Detailed Description

template<typename Output>
class GeneralFieldTransfer::CachedData< Output >

Value request response base class.

Definition at line 623 of file MultiAppGeneralFieldTransfer.h.

Member Typedef Documentation

◆ Cache

template<typename Output>
typedef PointIndexedMap GeneralFieldTransfer::CachedData< Output >::Cache

Definition at line 629 of file MultiAppGeneralFieldTransfer.h.

◆ DofValueType

Definition at line 626 of file MultiAppGeneralFieldTransfer.h.

◆ FunctorValue

template<typename Output>
typedef Output GeneralFieldTransfer::CachedData< Output >::FunctorValue

Definition at line 633 of file MultiAppGeneralFieldTransfer.h.

◆ RealType

Definition at line 631 of file MultiAppGeneralFieldTransfer.h.

◆ ValuePushType

template<typename Output>
typedef DofValueType GeneralFieldTransfer::CachedData< Output >::ValuePushType

Definition at line 632 of file MultiAppGeneralFieldTransfer.h.

Constructor & Destructor Documentation

◆ CachedData() [1/2]

template<typename Output>
GeneralFieldTransfer::CachedData< Output >::CachedData ( const Cache cache,
const libMesh::FunctionBase< Output > &  backup,
Real  default_value 
)
inline

Constructor.

Parameters
cachea map/cache to search for points in
backupa function that can be queried for a point value when the cache doesnt have it

Definition at line 640 of file MultiAppGeneralFieldTransfer.h.

641  : _cache(cache), _backup(backup.clone()), _default_value(default_value)
642  {
643  }
const Cache & _cache
Data to return for cached points.
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
Function to evaluate for uncached points.
const Real _default_value
Default value when no point is found.
virtual std::unique_ptr< FunctionBase< Output > > clone() const=0

◆ CachedData() [2/2]

template<typename Output>
GeneralFieldTransfer::CachedData< Output >::CachedData ( const CachedData< Output > &  primary)
inline

Copy constructor.

Definition at line 646 of file MultiAppGeneralFieldTransfer.h.

647  : _cache(primary._cache),
648  _backup(primary._backup->clone()),
649  _default_value(primary._default_value)
650  {
651  }
const Cache & _cache
Data to return for cached points.
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
Function to evaluate for uncached points.
const Real _default_value
Default value when no point is found.

Member Function Documentation

◆ eval_at_node()

template<typename Output>
Output GeneralFieldTransfer::CachedData< Output >::eval_at_node ( const libMesh::FEMContext ,
unsigned  int,
unsigned  int,
const Node &  n,
bool  ,
const Real   
)
inline

Gets a value at the node location.

Definition at line 656 of file MultiAppGeneralFieldTransfer.h.

662  {
663  auto it = _cache.find(n);
664  if (it == _cache.end())
665  {
667  return _default_value;
668  else
669  return (*_backup)(n);
670  }
671  else
672  return it->second;
673  }
std::unordered_map< Point, Number, hash_point >::const_iterator end() const
const Cache & _cache
Data to return for cached points.
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
Function to evaluate for uncached points.
std::unordered_map< Point, Number, hash_point >::const_iterator find(const Point &pt) const
const Real _default_value
Default value when no point is found.

◆ eval_at_point()

template<typename Output>
Output GeneralFieldTransfer::CachedData< Output >::eval_at_point ( const libMesh::FEMContext ,
unsigned  int,
const Point &  n,
const Real  ,
bool   
)
inline

Gets a value at a point.

Definition at line 676 of file MultiAppGeneralFieldTransfer.h.

681  {
682  auto it = _cache.find(n);
683  if (it == _cache.end())
684  {
686  return _default_value;
687  else
688  return (*_backup)(n);
689  }
690  else
691  return it->second;
692  }
std::unordered_map< Point, Number, hash_point >::const_iterator end() const
const Cache & _cache
Data to return for cached points.
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
Function to evaluate for uncached points.
std::unordered_map< Point, Number, hash_point >::const_iterator find(const Point &pt) const
const Real _default_value
Default value when no point is found.

◆ eval_mixed_derivatives()

template<typename Output>
void GeneralFieldTransfer::CachedData< Output >::eval_mixed_derivatives ( const libMesh::FEMContext ,
unsigned  int,
unsigned  int,
const Node &  ,
std::vector< Output > &   
)
inline

Definition at line 696 of file MultiAppGeneralFieldTransfer.h.

701  {
702  mooseError("Not implemented");
703  } // this is only for grid projections
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ eval_old_dofs() [1/2]

template<typename Output>
void GeneralFieldTransfer::CachedData< Output >::eval_old_dofs ( const Elem &  ,
unsigned  int,
unsigned  int,
std::vector< dof_id_type > &  ,
std::vector< Output > &   
)
inline

Definition at line 705 of file MultiAppGeneralFieldTransfer.h.

707  {
708  mooseError("Not implemented");
709  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ eval_old_dofs() [2/2]

template<typename Output>
void GeneralFieldTransfer::CachedData< Output >::eval_old_dofs ( const Elem &  ,
const libMesh::FEType ,
unsigned  int,
unsigned  int,
std::vector< dof_id_type > &  ,
std::vector< Output > &   
)
inline

Definition at line 711 of file MultiAppGeneralFieldTransfer.h.

717  {
718  mooseError("Not implemented");
719  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ init_context()

template<typename Output>
void GeneralFieldTransfer::CachedData< Output >::init_context ( libMesh::FEMContext )
inline

Definition at line 653 of file MultiAppGeneralFieldTransfer.h.

653 {}

◆ is_grid_projection()

template<typename Output>
bool GeneralFieldTransfer::CachedData< Output >::is_grid_projection ( )
inline

Definition at line 694 of file MultiAppGeneralFieldTransfer.h.

694 { return false; }

Member Data Documentation

◆ _backup

template<typename Output>
std::unique_ptr<libMesh::FunctionBase<Output> > GeneralFieldTransfer::CachedData< Output >::_backup
private

◆ _cache

template<typename Output>
const Cache& GeneralFieldTransfer::CachedData< Output >::_cache
private

◆ _default_value

template<typename Output>
const Real GeneralFieldTransfer::CachedData< Output >::_default_value
private

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