Phalanx  Development
 All Classes Functions Variables Typedefs Friends Pages
Public Types | Public Member Functions | List of all members
PHX::FieldManager< Traits > Class Template Reference

Public Types

typedef
PHX::EvaluationContainer_TemplateManager
< Traits >::iterator 
iterator
 

Public Member Functions

void requireFieldForAllEvaluationTypes (const PHX::FieldTag &t)
 
template<typename EvalT >
void requireField (const PHX::FieldTag &t)
 
void registerEvaluatorForAllEvaluationTypes (const Teuchos::RCP< PHX::Evaluator< Traits > > &e)
 
template<typename EvalT >
void registerEvaluator (const Teuchos::RCP< PHX::Evaluator< Traits > > &e)
 
void registerEvaluator (typename PHX::FieldManager< Traits >::iterator it, const Teuchos::RCP< PHX::Evaluator< Traits > > &e)
 
template<typename EvalT , typename DataT , typename Tag0 , typename Tag1 , typename Tag2 , typename Tag3 , typename Tag4 , typename Tag5 , typename Tag6 , typename Tag7 >
void getFieldData (PHX::MDField< DataT, Tag0, Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7 > &f)
 
template<typename EvalT , typename DataT , typename Tag0 , typename Tag1 , typename Tag2 , typename Tag3 , typename Tag4 , typename Tag5 , typename Tag6 , typename Tag7 >
void getFieldData (PHX::MDField< const DataT, Tag0, Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7 > &f)
 
template<typename EvalT , typename DataT , int Rank>
void getFieldData (PHX::Field< DataT, Rank > &f)
 
template<typename EvalT , typename DataT , int Rank>
void getFieldData (PHX::Field< const DataT, Rank > &f)
 
template<typename EvalT , typename DataT >
void getFieldData (const PHX::FieldTag &ft, PHX::View< DataT > &f)
 
template<typename EvalT , typename DataT , typename Tag0 , typename Tag1 , typename Tag2 , typename Tag3 , typename Tag4 , typename Tag5 , typename Tag6 , typename Tag7 >
void setUnmanagedField (PHX::MDField< DataT, Tag0, Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7 > &f)
 Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time. More...
 
template<typename EvalT , typename DataT >
void setUnmanagedField (PHX::MDField< DataT > &f)
 Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time. More...
 
template<typename EvalT , typename DataT , int Rank>
void setUnmanagedField (PHX::Field< DataT, Rank > &f)
 Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time. More...
 
template<typename EvalT , typename DataT >
void setUnmanagedField (const FieldTag &ft, PHX::View< DataT > &f)
 Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time. More...
 
void aliasFieldForAllEvaluationTypes (const PHX::FieldTag &aliasedField, const PHX::FieldTag &targetField)
 Makes two fields point to (alias) the same memory for all evaluation types. More...
 
template<typename EvalT >
void aliasField (const PHX::FieldTag &aliasedField, const PHX::FieldTag &targetField)
 Makes two fields point to (alias) the same memory for a specific evaluation type. More...
 
template<typename EvalT >
void postRegistrationSetupForType (typename Traits::SetupData d, const bool &buildDeviceDAG=false)
 Builds DAG and allocates memory for a single evaluation type.
 
void postRegistrationSetup (typename Traits::SetupData d, const bool &buildDeviceDAG=false)
 Builds DAG and allocates memory for all evaluation types.
 
template<typename EvalT >
void evaluateFields (typename Traits::EvalData d)
 Evalaute fields with a separate parallel_for for each node in the DAG.
 
template<typename EvalT >
void evaluateFieldsDeviceDag (const int &work_size, const int &team_size, const int &vector_size, typename Traits::EvalData d)
 Evalaute fields using Device DAG capability where a single parallel_for evaluates the entire DAG.
 
template<typename EvalT >
void preEvaluate (typename Traits::PreEvalData d)
 
template<typename EvalT >
void postEvaluate (typename Traits::PostEvalData d)
 
template<typename EvalT >
void setKokkosExtendedDataTypeDimensions (const std::vector< PHX::index_size_type > &dims)
 
template<typename EvalT >
const std::vector
< PHX::index_size_type > & 
getKokkosExtendedDataTypeDimensions () const
 
FieldManager::iterator begin ()
 Return iterator to first EvaluationContainer.
 
FieldManager::iterator end ()
 Return iterator to last EvaluationContainer.
 
template<typename EvalT >
void writeGraphvizFile (const std::string filename="graph.dot", bool writeEvaluatedFields=true, bool writeDependentFields=false, bool debugRegisteredEvaluators=false) const
 Writes graphviz dot file for the evaluation type.
 
void writeGraphvizFile (const std::string base_filename="graph", const std::string file_extension=".dot", bool writeEvaluatedFields=true, bool writeDependentFields=false, bool debugRegisteredEvaluators=false) const
 Writes graphviz dot file for all evaluation types (adds eval type to filename).
 
void print (std::ostream &os) const
 
template<typename EvalT >
void analyzeGraph (double &speedup, double &parallelizability) const
 
template<typename EvalT >
void buildDagForType ()
 
template<typename EvalT >
const std::vector
< Teuchos::RCP< PHX::FieldTag > > & 
getFieldTagsForSizing ()
 
template<typename EvalT >
void printEvaluatorStartStopMessage (const Teuchos::RCP< std::ostream > &ostr)
 Print to user specified ostream when each evaluator starts and stops. Useful for debugging. Enabled only in debug builds. More...
 
template<typename Traits>
void registerEvaluator (FieldManager::iterator it, const Teuchos::RCP< PHX::Evaluator< Traits > > &e)
 

Member Function Documentation

template<typename Traits >
template<typename EvalT >
void PHX::FieldManager< Traits >::aliasField ( const PHX::FieldTag aliasedField,
const PHX::FieldTag targetField 
)

Makes two fields point to (alias) the same memory for a specific evaluation type.

WARNING: this is a very dangerous power user capability. This allows users to tell the FieldManager to create a new field that points to the same underlying memory as another field. The user must be sure that the DataLayouts and Scalar types are the same. Only use this BEFORE postRegistrationSetup() is called. This injects extra dependencies that must be accounted for during DAG construction.

This is intended for the use case where a user wants to reuse an evaluator with hard coded field names but would like to rename the evaluated fields without adding naming logic to the evaluator.

Parameters
aliasedFieldField that is aliased to the target field's memory
targetFieldField whos memory is pointed to by the aliased field
template<typename Traits >
void PHX::FieldManager< Traits >::aliasFieldForAllEvaluationTypes ( const PHX::FieldTag aliasedField,
const PHX::FieldTag targetField 
)

Makes two fields point to (alias) the same memory for all evaluation types.

WARNING: this is a very dangerous power user capability. This allows users to tell the FieldManager to create a new field that points to the same underlying memory as another field. The user must be sure that the DataLayouts and Scalar types are the same. Only use this BEFORE postRegistrationSetup() is called. This injects extra dependencies that must be accounted for during DAG construction.

This is intended for the use case where a user wants to reuse an evaluator with hard coded field names but would like to rename the evaluated fields without adding naming logic to the evaluator.

Parameters
aliasedFieldField that is aliased to the target field's memory
targetFieldField whos memory is pointed to by the aliased field
template<typename Traits >
template<typename EvalT >
void PHX::FieldManager< Traits >::buildDagForType ( )

Builds the DAG for the evalaution type. This should only be called after all evaluators are registered and all required fields are requested. This method is for power users only. This is automatically called during postRegistrationSetup() and normally does not have to be called by the users. This method allows users to build the DAG but then perform other activities prior to allocating the fields. An example use case is to delay the sizing of the fields in the DataLayouts until right before allocation. The user could create the dag and access a list of required fields and then do sizing based on information aboutrequired fields.

template<typename Traits >
template<typename EvalT >
const std::vector< Teuchos::RCP< PHX::FieldTag > > & PHX::FieldManager< Traits >::getFieldTagsForSizing ( )

Returns the FieldTags for all fields involved in the evaluation. Will return an empty vector unless the user has built the DAG using one of the following calls: postRegistrationSetup(), postRegistrationSetupForType() or buildDagForType().

WARNING: This is a dangerous power user feature. It returns non-const field tags so that the fields can be sized after the DAG has been created.

template<typename Traits >
template<typename EvalT >
void PHX::FieldManager< Traits >::printEvaluatorStartStopMessage ( const Teuchos::RCP< std::ostream > &  ostr)

Print to user specified ostream when each evaluator starts and stops. Useful for debugging. Enabled only in debug builds.

Parameters
[in]ostrRCP to output stream. If set to null, this disables printing.
template<typename Traits >
template<typename EvalT , typename DataT , typename Tag0 , typename Tag1 , typename Tag2 , typename Tag3 , typename Tag4 , typename Tag5 , typename Tag6 , typename Tag7 >
void PHX::FieldManager< Traits >::setUnmanagedField ( PHX::MDField< DataT, Tag0, Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7 > &  f)
inline

Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time.

This overrides the field allocated to this array in the FieldManager. The fieldManager then sets this new memory pointer in all evaluator fields that use it.

NOTE: this is a very dangerous power user capability as the user must allocate the field correctly (remember Sacado AD types must have the extra dimensions sized correctly).

template<typename Traits >
template<typename EvalT , typename DataT >
void PHX::FieldManager< Traits >::setUnmanagedField ( PHX::MDField< DataT > &  f)
inline

Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time.

This overrides the field allocated to this array in the FieldManager. The fieldManager then sets this new memory pointer in all evaluator fields that use it.

NOTE: this is a very dangerous power user capability as the user must allocate the field correctly (remember Sacado AD types must have the extra dimensions sized correctly).

template<typename Traits >
template<typename EvalT , typename DataT , int Rank>
void PHX::FieldManager< Traits >::setUnmanagedField ( PHX::Field< DataT, Rank > &  f)
inline

Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time.

This overrides the field allocated to this array in the FieldManager. The fieldManager then sets this new memory pointer in all evaluator fields that use it.

NOTE: this is a very dangerous power user capability as the user must allocate the field correctly (remember Sacado AD types must have the extra dimensions sized correctly).

References PHX::Field< DataT, Rank >::get_static_view().

template<typename Traits >
template<typename EvalT , typename DataT >
void PHX::FieldManager< Traits >::setUnmanagedField ( const FieldTag ft,
PHX::View< DataT > &  f 
)
inline

Allows the user to manage the memory allocation of a particular field and dynamically set/swap the memory at any time.

This overrides the field allocated to this array in the FieldManager. The fieldManager then sets this new memory pointer in all evaluator fields that use it.

NOTE: this is a very dangerous power user capability as the user must allocate the field correctly (remember Sacado AD types must have the extra dimensions sized correctly).


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