https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
 CachedData (const CachedData &primary)
 Copy constructor.
 
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.
 
Output eval_at_point (const libMesh::FEMContext &, unsigned int, const Point &n, const Real, bool)
 Gets a value at a point.
 
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.
 
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
 Function to evaluate for uncached points.
 
const Real _default_value
 Default value when no point is found.
 

Detailed Description

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

Value request response base class.

Definition at line 654 of file MultiAppGeneralFieldTransfer.h.

Member Typedef Documentation

◆ Cache

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

Definition at line 660 of file MultiAppGeneralFieldTransfer.h.

◆ DofValueType

template<typename Output >
typedef libMesh::TensorTools::MakeBaseNumber<Output>::type GeneralFieldTransfer::CachedData< Output >::DofValueType
protected

Definition at line 657 of file MultiAppGeneralFieldTransfer.h.

◆ FunctorValue

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

Definition at line 664 of file MultiAppGeneralFieldTransfer.h.

◆ RealType

template<typename Output >
typedef libMesh::TensorTools::MakeReal<Output>::type GeneralFieldTransfer::CachedData< Output >::RealType

Definition at line 662 of file MultiAppGeneralFieldTransfer.h.

◆ ValuePushType

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

Definition at line 663 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 671 of file MultiAppGeneralFieldTransfer.h.

672 : _cache(cache), _backup(backup.clone()), _default_value(default_value)
673 {
674 }
std::unique_ptr< libMesh::FunctionBase< Output > > _backup
Function to evaluate for uncached points.
const Cache & _cache
Data to return for cached 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 677 of file MultiAppGeneralFieldTransfer.h.

678 : _cache(primary._cache),
679 _backup(primary._backup->clone()),
680 _default_value(primary._default_value)
681 {
682 }

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 687 of file MultiAppGeneralFieldTransfer.h.

693 {
694 auto it = _cache.find(n);
695 if (it == _cache.end())
696 {
698 return _default_value;
699 else
700 return (*_backup)(n);
701 }
702 else
703 return it->second;
704 }
std::unordered_map< Point, Number, hash_point >::const_iterator end() const
std::unordered_map< Point, Number, hash_point >::const_iterator find(const Point &pt) const

◆ 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 707 of file MultiAppGeneralFieldTransfer.h.

712 {
713 auto it = _cache.find(n);
714 if (it == _cache.end())
715 {
717 return _default_value;
718 else
719 return (*_backup)(n);
720 }
721 else
722 return it->second;
723 }

◆ 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 727 of file MultiAppGeneralFieldTransfer.h.

732 {
733 mooseError("Not implemented");
734 } // 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:311

◆ eval_old_dofs() [1/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 742 of file MultiAppGeneralFieldTransfer.h.

748 {
749 mooseError("Not implemented");
750 }

◆ eval_old_dofs() [2/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 736 of file MultiAppGeneralFieldTransfer.h.

738 {
739 mooseError("Not implemented");
740 }

◆ init_context()

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

Definition at line 684 of file MultiAppGeneralFieldTransfer.h.

684{}

◆ is_grid_projection()

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

Definition at line 725 of file MultiAppGeneralFieldTransfer.h.

725{ 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: