https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
GrainDataTracker< T > Class Template Referenceabstract

GrainTracker derived class template to base objects on which maintain physical parameters for individual grains. More...

#include <GrainDataTracker.h>

Inheritance diagram for GrainDataTracker< T >:
[legend]

Public Types

enum class  RemapCacheMode { FILL , USE , BYPASS }
 
enum class  FieldType {
  UNIQUE_REGION , VARIABLE_COLORING , GHOSTED_ENTITIES , HALOS ,
  CENTROID , ACTIVE_BOUNDS , INTERSECTS_SPECIFIED_BOUNDARY
}
 
enum class  Status : unsigned char { CLEAR = 0x0 , MARKED = 0x1 , DIRTY = 0x2 , INACTIVE = 0x4 }
 This enumeration is used to indicate status of the grains in the _unique_grains data structure. More...
 
enum class  BoundaryIntersection : unsigned char {
  NONE = 0x0 , ANY_BOUNDARY = 0x1 , PRIMARY_PERCOLATION_BOUNDARY = 0x2 , SECONDARY_PERCOLATION_BOUNDARY = 0x4 ,
  SPECIFIED_BOUNDARY = 0x8
}
 This enumeration is used to inidacate status of boundary intersections. More...
 
typedef DataFileName DataFileParameterType
 
typedef FunctorBase< Real > FunctorType
 
typedef Real ValueType
 
typedef typename FunctorReturnType< Real, FunctorEvaluationKind::Gradient >::type GradientType
 
typedef ValueType DotType
 
enum  TEST_TYPE
 

Public Member Functions

 GrainDataTracker (const InputParameters &parameters)
 
const TgetData (unsigned int grain_id) const
 return data for selected grain
 
virtual void meshChanged () override
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
virtual std::size_t getTotalFeatureCount () const override
 Returns the total feature count (active and inactive ids, useful for sizing vectors)
 
virtual Real getEntityValue (dof_id_type node_id, FieldType field_type, std::size_t var_index=0) const override
 
virtual const std::vector< unsigned int > & getVarToFeatureVector (dof_id_type elem_id) const override
 Returns a list of active unique feature ids for a particular element.
 
virtual unsigned int getFeatureVar (unsigned int feature_id) const override
 Returns the variable representing the passed in feature.
 
virtual std::size_t getNumberActiveGrains () const override
 Returns the number of active grains current stored in the GrainTracker.
 
virtual Point getGrainCentroid (unsigned int grain_id) const override
 Returns the centroid for the given grain number.
 
virtual bool doesFeatureIntersectBoundary (unsigned int feature_id) const override
 Returns a Boolean indicating whether this feature intersects any boundary.
 
virtual bool doesFeatureIntersectSpecifiedBoundary (unsigned int feature_id) const override
 Returns a Boolean indicating whether this feature intersects boundaries in a user-supplied list.
 
virtual bool isFeaturePercolated (unsigned int feature_id) const override
 Returns a Boolean indicating whether this feature is percolated (e.g.
 
virtual std::vector< unsigned intgetNewGrainIDs () const override
 This method returns all of the new ids generated in an invocation of the GrainTracker.
 
virtual void initialSetup () override
 
virtual Real getValue () const override
 
std::size_t getNumberActiveFeatures () const
 Return the number of active features.
 
virtual Point featureCentroid (unsigned int feature_id) const
 Returns the centroid of the designated feature (only supported without periodic boundaries)
 
std::size_t numCoupledVars () const
 Returns the number of coupled varaibles.
 
const std::vector< MooseVariable * > & getCoupledVars () const
 Returns a const vector to the coupled variable pointers.
 
const std::vector< MooseVariableFEBase * > & getFECoupledVars () const
 Returns a const vector to the coupled MooseVariableFEBase pointers.
 
bool isElemental () const
 
const std::vector< FeatureData > & getFeatures () const
 Return a constant reference to the vector of all discovered features.
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObjectprimaryThreadCopy ()
 
SubProblemgetSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
void gatherSum (T &value)
 
void gatherMax (T &value)
 
void gatherMin (T &value)
 
void gatherProxyValueMax (T1 &proxy, T2 &value)
 
void gatherProxyValueMin (T1 &proxy, T2 &value)
 
std::set< UserObjectName > getDependObjects () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool needThreadedCopy () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void timestepSetup ()
 
virtual void timestepSetup () override
 
virtual void jacobianSetup ()
 
virtual void jacobianSetup () override
 
virtual void residualSetup ()
 
virtual void residualSetup () override
 
virtual void customSetup (const ExecFlagType &)
 
virtual void customSetup (const ExecFlagType &exec_type) override
 
const ExecFlagEnumgetExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar * > & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (const MaterialPropertyName &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 
std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &name)
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 
std::unordered_map< SubdomainID, std::vector< MaterialBase * > > buildRequiredMaterials (bool allow_stateful=true)
 
void statefulPropertiesAllowed (bool)
 
virtual bool getMaterialPropertyCalled () const
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 
virtual void resolveOptionalProperties ()
 
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
const PostprocessorValuegetCurrentValue () const
 
const std::string & PPName () const
 
virtual bool hasBlocks (SubdomainID) const override
 
bool supportsFaceArg () const override final
 
bool supportsElemSideQpArg () const override final
 
void buildOutputHideVariableList (std::set< std::string > variable_names)
 
const std::set< OutputName > & getOutputs ()
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 
FunctorReturnType< Real, FET >::type genericEvaluate (const Space &r, const State &state) const
 
const MooseFunctorName & functorName () const
 
void setCacheClearanceSchedule (const std::set< ExecFlagType > &clearance_schedule)
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &, const Elem *, const StateArg &) const
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &, const Elem *, const StateArg &) const
 
bool isInternalFace (const FaceInfo &) const
 
virtual bool isConstant () const
 
virtual bool hasFaceSide (const FaceInfo &fi, const bool fi_elem_side) const override
 
void checkFace (const Moose::FaceArg &face) const
 
virtual void threadJoin (const UserObject &) override
 
virtual void threadJoin (const UserObject &) override
 
virtual void subdomainSetup () override
 
virtual void subdomainSetup () override
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const TgetKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const TgetKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
TgetSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
TgetSamplerByName (const SamplerName &name)
 
SamplergetSamplerByName (const SamplerName &name)
 
virtual void meshDisplaced ()
 
PerfGraphperfGraph ()
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const ADVariableValuegetADDefaultValue (const std::string &var_name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars () const
 
const std::vector< MooseVariable * > & getCoupledStandardMooseVars () const
 
const std::vector< VectorMooseVariable * > & getCoupledVectorMooseVars () const
 
const std::vector< ArrayMooseVariable * > & getCoupledArrayMooseVars () const
 
void addFEVariableCoupleableVectorTag (TagID tag)
 
void addFEVariableCoupleableMatrixTag (TagID tag)
 
std::set< TagID > & getFEVariableCoupleableVectorTags ()
 
const std::set< TagID > & getFEVariableCoupleableVectorTags () const
 
std::set< TagID > & getFEVariableCoupleableMatrixTags ()
 
const std::set< TagID > & getFEVariableCoupleableMatrixTags () const
 
auto & getWritableCoupledVariables () const
 
bool hasWritableCoupledVariables () const
 
const ADVectorVariableValuegetADDefaultVectorValue (const std::string &var_name) const
 
const ADVariableGradientgetADDefaultGradient () const
 
const ADVectorVariableGradientgetADDefaultVectorGradient () const
 
const ADVariableSecondgetADDefaultSecond () const
 
const ADVectorVariableCurlgetADDefaultCurl () const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientsByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradient (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradients (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorTagVectorGradientByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorTagVectorGradientsByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorTagVectorGradient (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorTagVectorGradients (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledValues (const std::string &var_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradient (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradients (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValues (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValues (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOld (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDots (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalDots (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradient (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValues (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradients (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValues (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValues (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientsOld (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientsOlder (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDots (const std::string &var_name) const
 
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalDots (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradientByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradientsByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradient (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradients (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValues (const std::string &var_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradient (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradients (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValues (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValues (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValuesOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientsOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValuesOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValuesOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientsOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDots (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalDots (const std::string &var_name) const
 
Moose::Kokkos::Scalar< const Real > kokkosCoupledDotDu (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosZeroValue () const
 
Moose::Kokkos::VariableGradient kokkosZeroGradient () const
 
Moose::Kokkos::VariableValue kokkosZeroNodalValue () const
 
const std::set< MooseVariableFieldBase * > & getMooseVariableDependencies () const
 
std::set< MooseVariableFieldBase * > checkAllVariables (const DofObjectType &dof_object, const std::set< MooseVariableFieldBase * > &vars_to_omit={})
 
virtual std::set< MooseVariableFieldBase * > checkVariables (const libMesh::Node &node, const std::set< MooseVariableFieldBase * > &vars_to_check)
 
std::set< MooseVariableFieldBase * > checkVariables (const libMesh::Elem &element, const std::set< MooseVariableFieldBase * > &vars_to_check)
 
void addMooseVariableDependency (MooseVariableFieldBase *var)
 
void addMooseVariableDependency (const std::vector< MooseVariableFieldBase * > &vars)
 
virtual const std::set< BoundaryID > & boundaryIDs () const
 
const std::vector< BoundaryName > & boundaryNames () const
 
unsigned int numBoundaryIDs () const
 
bool hasBoundary (const BoundaryName &name) const
 
bool hasBoundary (const std::vector< BoundaryName > &names) const
 
bool hasBoundary (const BoundaryID &id) const
 
bool hasBoundary (const std::vector< BoundaryID > &ids, TEST_TYPE type=ALL) const
 
bool hasBoundary (const std::set< BoundaryID > &ids, TEST_TYPE type=ALL) const
 
bool isBoundarySubset (const std::set< BoundaryID > &ids) const
 
bool isBoundarySubset (const std::vector< BoundaryID > &ids) const
 
bool hasBoundaryMaterialProperty (const std::string &prop_name) const
 
virtual bool boundaryRestricted () const
 
const std::set< BoundaryID > & meshBoundaryIDs () const
 
virtual bool checkVariableBoundaryIntegrity () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 
static bool restricted (const std::set< BoundaryID > &ids)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 
 ALL
 
 ANY
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr PropertyValue::id_type default_property_id
 
static constexpr PropertyValue::id_type zero_property_id
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 
static const std::size_t invalid_size_t = std::numeric_limits<std::size_t>::max()
 
static const unsigned int invalid_id = std::numeric_limits<unsigned int>::max()
 
static const processor_id_type invalid_proc_id
 

Protected Member Functions

virtual T newGrain (unsigned int new_grain_id)=0
 implement this method to initialize the data for the new grain
 
virtual void newGrainCreated (unsigned int new_grain_id)
 This method is called when a new grain is detected.
 
virtual void updateFieldInfo () override
 This method is used to populate any of the data structures used for storing field data (nodal or elemental).
 
virtual Real getThreshold (std::size_t current_index) const override
 Return the starting comparison threshold to use when inspecting an entity during the flood stage.
 
void prepopulateState (const FeatureFloodCount &ffc_object)
 This method extracts the necessary state from the passed in object necessary to continue tracking grains.
 
void communicateHaloMap ()
 
void assignGrains ()
 When the tracking phase starts (_t_step == _tracking_step) it assigns a unique id to every FeatureData object found by the FeatureFloodCount object.
 
void trackGrains ()
 On subsequent time_steps, incoming FeatureData objects are compared to previous time_step information to track grains between time steps.
 
void remapGrains ()
 This method is called after trackGrains to remap grains that are too close to each other.
 
void broadcastAndUpdateGrainData ()
 Broadcast essential Grain information to all processors.
 
void computeMinDistancesFromGrain (FeatureData &grain, std::vector< std::list< GrainDistance > > &min_distances)
 Populates and sorts a min_distances vector with the minimum distances to all grains in the simulation for a given grain.
 
bool attemptGrainRenumber (FeatureData &grain, unsigned int depth, unsigned int max_depth)
 This is the recursive part of the remapping algorithm.
 
void swapSolutionValues (FeatureData &grain, std::size_t new_var_index, std::vector< std::map< Node *, CacheValues > > &cache, RemapCacheMode cache_mode)
 A routine for moving all of the solution values from a given grain to a new variable number.
 
void swapSolutionValuesHelper (Node *curr_node, std::size_t curr_var_index, std::size_t new_var_index, std::vector< std::map< Node *, CacheValues > > &cache, RemapCacheMode cache_mode)
 Helper method for actually performing the swaps.
 
Real boundingRegionDistance (std::vector< BoundingBox > &bboxes1, std::vector< BoundingBox > &bboxes2) const
 This method returns the minimum periodic distance between two vectors of bounding boxes.
 
Real centroidRegionDistance (std::vector< BoundingBox > &bboxes1, std::vector< BoundingBox > &bboxes2) const
 This method returns the minimum periodic distance between the centroids of two vectors of bounding boxes.
 
unsigned int getNextUniqueID ()
 Retrieve the next unique grain number if a new grain is detected during trackGrains.
 
template<typename T >
bool isBoundaryEntity (const T *entity) const
 Returns a Boolean indicating whether the entity is on one of the desired boundaries.
 
bool flood (const DofObject *dof_object, std::size_t current_index)
 This method will check if the current entity is above the supplied threshold and "mark" it.
 
virtual Real getConnectingThreshold (std::size_t current_index) const
 Return the "connecting" comparison threshold to use when inspecting an entity during the flood stage.
 
bool compareValueWithThreshold (Real entity_value, Real threshold) const
 This method is used to determine whether the current entity value is part of a feature or not.
 
virtual bool isNewFeatureOrConnectedRegion (const DofObject *dof_object, std::size_t &current_index, FeatureData *&feature, Status &status, unsigned int &new_id)
 Method called during the recursive flood routine that should return whether or not the current entity is part of the current feature (if one is being explored), or if it's the start of a new feature.
 
void expandPointHalos ()
 This method takes all of the partial features and expands the local, ghosted, and halo sets around those regions to account for the diffuse interface.
 
void expandEdgeHalos (unsigned int num_layers_to_expand)
 This method expands the existing halo set by some width determined by the passed in value.
 
template<typename T >
void visitNeighborsHelper (const T *curr_entity, std::vector< const T * > neighbor_entities, FeatureData *feature, bool expand_halos_only, bool topological_neighbor, bool disjoint_only)
 The actual logic for visiting neighbors is abstracted out here.
 
virtual void prepareDataForTransfer ()
 This routine uses the local flooded data to build up the local feature data structures (_partial feature_sets).
 
void serialize (std::string &serialized_buffer, unsigned int var_num=invalid_id)
 This routines packs the _partial_feature_sets data into a structure suitable for parallel communication operations.
 
void deserialize (std::vector< std::string > &serialized_buffers, unsigned int var_num=invalid_id)
 This routine takes the vector of byte buffers (one for each processor), deserializes them into a series of FeatureSet objects, and appends them to the _feature_sets data structure.
 
virtual void mergeSets ()
 This routine is called on the primary rank only and stitches together the partial feature pieces seen on any processor.
 
virtual void consolidateMergedFeatures (std::vector< std::list< FeatureData > > *saved_data=nullptr)
 This method consolidates all of the merged information from _partial_feature_sets into the _feature_sets vectors.
 
virtual bool areFeaturesMergeable (const FeatureData &f1, const FeatureData &f2) const
 Method for determining whether two features are mergeable.
 
virtual processor_id_type numberOfDistributedMergeHelpers () const
 Returns a number indicating the number of merge helpers when running in parallel based on certain implementer decided criteria.
 
void communicateAndMerge ()
 This routine handles all of the serialization, communication and deserialization of the data structures containing FeatureData objects.
 
virtual void restoreOriginalDataStructures (std::vector< std::list< FeatureData > > &)
 
void sortAndLabel ()
 Sort and assign ids to features based on their position in the container after sorting.
 
void scatterAndUpdateRanks ()
 Calls buildLocalToGlobalIndices to build the individual local to global indicies for each rank and scatters that information to all ranks.
 
virtual void buildLocalToGlobalIndices (std::vector< std::size_t > &local_to_global_all, std::vector< int > &counts) const
 This routine populates a stacked vector of local to global indices per rank and the associated count vector for scattering the vector to the ranks.
 
void buildFeatureIdToLocalIndices (unsigned int max_id)
 This method builds a lookup map for retrieving the right local feature (by index) given a global index or id.
 
virtual void clearDataStructures ()
 Helper routine for clearing up data structures during initialize and prior to parallel communication.
 
void updateBoundaryIntersections (FeatureData &feature) const
 Update the feature's attributes to indicate boundary intersections.
 
void appendPeriodicNeighborNodes (FeatureData &feature) const
 This routine adds the periodic node information to our data structure prior to packing the data this makes those periodic neighbors appear much like ghosted nodes in a multiprocessor setting.
 
void updateRegionOffsets ()
 This routine updates the _region_offsets variable which is useful for quickly determining the proper global number for a feature when using multimap mode.
 
std::string deduceFunctorName (const std::string &name) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const ReporterContextBasegetReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValuecoupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 
void markMatPropRequested (const std::string &)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 
const Moose::Functor< T > & getFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctor (const std::string &name, THREAD_ID tid)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
bool isFunctor (const std::string &name) const
 
bool isFunctor (const std::string &name, const SubProblem &subproblem) const
 
Moose::ElemArg makeElemArg (const Elem *elem, bool correct_skewnewss=false) const
 
void checkFunctorSupportsSideIntegration (const std::string &name, bool qp_integration)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name)
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 
bool checkVar (const std::string &var_name, unsigned int comp=0, unsigned int comp_bound=0) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
virtual void coupledCallback (const std::string &, bool) const
 
virtual bool isCoupled (const std::string &var_name, unsigned int i=0) const
 
virtual bool isCoupledConstant (const std::string &var_name) const
 
unsigned int coupledComponents (const std::string &var_name) const
 
VariableName coupledName (const std::string &var_name, unsigned int comp=0) const
 
std::vector< VariableName > coupledNames (const std::string &var_name) const
 
virtual unsigned int coupled (const std::string &var_name, unsigned int comp=0) const
 
std::vector< unsigned intcoupledIndices (const std::string &var_name) const
 
virtual const VariableValuecoupledValue (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledValues (const std::string &var_name) const
 
std::vector< const VectorVariableValue * > coupledVectorValues (const std::string &var_name) const
 
const GenericVariableValue< is_ad > & coupledGenericValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericValue (const std::string &var_name, unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericValue (const std::string &var_name, unsigned int comp) const
 
const GenericVectorVariableValue< is_ad > & coupledGenericVectorValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVectorVariableValue< false > & coupledGenericVectorValue (const std::string &var_name, unsigned int comp) const
 
const GenericVectorVariableValue< true > & coupledGenericVectorValue (const std::string &var_name, unsigned int comp) const
 
std::vector< const GenericVariableValue< is_ad > * > coupledGenericValues (const std::string &var_name) const
 
std::vector< const GenericVariableValue< false > * > coupledGenericValues (const std::string &var_name) const
 
std::vector< const GenericVariableValue< true > * > coupledGenericValues (const std::string &var_name) const
 
const GenericVariableValue< is_ad > & coupledGenericDofValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericDofValue (const std::string &var_name, unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericDofValue (const std::string &var_name, unsigned int comp) const
 
const GenericVariableValue< is_ad > & coupledGenericDot (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericDot (const std::string &var_name, unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericDot (const std::string &var_name, unsigned int comp) const
 
const GenericVariableValue< is_ad > & coupledGenericDotDot (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericDotDot (const std::string &var_name, unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericDotDot (const std::string &var_name, unsigned int comp) const
 
virtual const VariableValuecoupledValueLower (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledValue (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const ADVariableValue * > adCoupledValues (const std::string &var_name) const
 
const ADVariableValueadCoupledLowerValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVectorVariableValueadCoupledVectorValue (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const ADVectorVariableValue * > adCoupledVectorValues (const std::string &var_name) const
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableValue * > coupledVectorTagValues (const std::string &var_names, TagID tag) const
 
std::vector< const VariableValue * > coupledVectorTagValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const ArrayVariableValuecoupledVectorTagArrayValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 
virtual const ArrayVariableValuecoupledVectorTagArrayValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues (const std::string &var_names, TagID tag) const
 
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableGradientcoupledVectorTagGradient (const std::string &var_names, TagID tag, unsigned int index=0) const
 
virtual const VariableGradientcoupledVectorTagGradient (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableGradient * > coupledVectorTagGradients (const std::string &var_names, TagID tag) const
 
std::vector< const VariableGradient * > coupledVectorTagGradients (const std::string &var_names, const std::string &tag_name) const
 
virtual const ArrayVariableGradientcoupledVectorTagArrayGradient (const std::string &var_names, TagID tag, unsigned int index=0) const
 
virtual const ArrayVariableGradientcoupledVectorTagArrayGradient (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const ArrayVariableGradient * > coupledVectorTagArrayGradients (const std::string &var_names, TagID tag) const
 
std::vector< const ArrayVariableGradient * > coupledVectorTagArrayGradients (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableValuecoupledVectorTagDofValue (const std::string &var_name, TagID tag, unsigned int index=0) const
 
virtual const VariableValuecoupledVectorTagDofValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
const ArrayVariableValuecoupledVectorTagArrayDofValue (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledVectorTagDofValues (const std::string &var_names, TagID tag) const
 
std::vector< const VariableValue * > coupledVectorTagDofValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableValue * > coupledMatrixTagValues (const std::string &var_names, TagID tag) const
 
std::vector< const VariableValue * > coupledMatrixTagValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VectorVariableValuecoupledVectorValue (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableValuecoupledArrayValue (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const ArrayVariableValue * > coupledArrayValues (const std::string &var_name) const
 
MooseWritableVariablewritableVariable (const std::string &var_name, unsigned int comp=0)
 
virtual VariableValuewritableCoupledValue (const std::string &var_name, unsigned int comp=0)
 
void checkWritableVar (MooseWritableVariable *var)
 
virtual const VariableValuecoupledValueOld (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledValuesOld (const std::string &var_name) const
 
std::vector< const VectorVariableValue * > coupledVectorValuesOld (const std::string &var_name) const
 
virtual const VariableValuecoupledValueOlder (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledValuesOlder (const std::string &var_name) const
 
virtual const VariableValuecoupledValuePreviousNL (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableValuecoupledVectorValueOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableValuecoupledVectorValueOlder (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableValuecoupledArrayValueOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableValuecoupledArrayValueOlder (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableGradientcoupledGradient (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableGradient * > coupledGradients (const std::string &var_name) const
 
const ADVariableGradientadCoupledGradient (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableGradientadCoupledGradientDot (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const ADVariableGradient * > adCoupledGradients (const std::string &var_name) const
 
const GenericVariableGradient< is_ad > & coupledGenericGradient (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableGradient< false > & coupledGenericGradient (const std::string &var_name, unsigned int comp) const
 
const GenericVariableGradient< true > & coupledGenericGradient (const std::string &var_name, unsigned int comp) const
 
std::vector< const GenericVariableGradient< is_ad > * > coupledGenericGradients (const std::string &var_name) const
 
std::vector< const GenericVariableGradient< false > * > coupledGenericGradients (const std::string &var_name) const
 
std::vector< const GenericVariableGradient< true > * > coupledGenericGradients (const std::string &var_name) const
 
const ADVectorVariableGradientadCoupledVectorGradient (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableSecondadCoupledSecond (const std::string &var_name, unsigned int comp=0) const
 
const ADVectorVariableSecondadCoupledVectorSecond (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableGradientcoupledGradientOld (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableGradient * > coupledGradientsOld (const std::string &var_name) const
 
virtual const VariableGradientcoupledGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableGradientcoupledGradientPreviousNL (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableGradientcoupledGradientDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableGradientcoupledGradientDotDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableGradientcoupledVectorGradient (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableGradientcoupledVectorGradientOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableGradientcoupledVectorGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableGradientcoupledArrayGradient (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableGradientcoupledArrayGradientOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableGradientcoupledArrayGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableGradientcoupledArrayGradientDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableCurlcoupledCurl (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableCurlcoupledCurlOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableCurlcoupledCurlOlder (const std::string &var_name, unsigned int comp=0) const
 
const ADVectorVariableCurladCoupledCurl (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableDivergencecoupledDiv (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableDivergencecoupledDivOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableDivergencecoupledDivOlder (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableSecondcoupledSecond (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableSecondcoupledSecondOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableSecondcoupledSecondOlder (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableSecondcoupledSecondPreviousNL (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledDot (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledDots (const std::string &var_name) const
 
virtual const VariableValuecoupledDotDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledDotOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledDot (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const ADVariableValue * > adCoupledDots (const std::string &var_name) const
 
const ADVariableValueadCoupledDotDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVectorVariableValueadCoupledVectorDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableValuecoupledVectorDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableValuecoupledVectorDotDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableValuecoupledVectorDotOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VectorVariableValuecoupledVectorDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledVectorDotDu (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledVectorDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableValuecoupledArrayDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableValuecoupledArrayDotDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableValuecoupledArrayDotOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const ArrayVariableValuecoupledArrayDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledDotDu (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledArrayDotDu (const std::string &var_name, unsigned int comp=0) const
 
const TcoupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 
const Moose::ADType< T >::typeadCoupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 
const TcoupledNodalValueOld (const std::string &var_name, unsigned int comp=0) const
 
const TcoupledNodalValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const TcoupledNodalValuePreviousNL (const std::string &var_name, unsigned int comp=0) const
 
const TcoupledNodalDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledNodalDotDot (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledNodalDotOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledNodalDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
virtual const VariableValuecoupledDofValues (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledAllDofValues (const std::string &var_name) const
 
virtual const VariableValuecoupledDofValuesOld (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledAllDofValuesOld (const std::string &var_name) const
 
virtual const VariableValuecoupledDofValuesOlder (const std::string &var_name, unsigned int comp=0) const
 
std::vector< const VariableValue * > coupledAllDofValuesOlder (const std::string &var_name) const
 
virtual const ArrayVariableValuecoupledArrayDofValues (const std::string &var_name, unsigned int comp=0) const
 
virtual const ADVariableValueadCoupledDofValues (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadZeroValue () const
 
const ADVariableGradientadZeroGradient () const
 
const ADVariableSecondadZeroSecond () const
 
const GenericVariableValue< is_ad > & genericZeroValue ()
 
const GenericVariableValue< false > & genericZeroValue ()
 
const GenericVariableValue< true > & genericZeroValue ()
 
const GenericVariableGradient< is_ad > & genericZeroGradient ()
 
const GenericVariableGradient< false > & genericZeroGradient ()
 
const GenericVariableGradient< true > & genericZeroGradient ()
 
const GenericVariableSecond< is_ad > & genericZeroSecond ()
 
const GenericVariableSecond< false > & genericZeroSecond ()
 
const GenericVariableSecond< true > & genericZeroSecond ()
 
const MooseVariableFieldBasegetFEVar (const std::string &var_name, unsigned int comp) const
 
const MooseVariableFieldBasegetFieldVar (const std::string &var_name, unsigned int comp) const
 
MooseVariableFieldBasegetFieldVar (const std::string &var_name, unsigned int comp)
 
std::vector< const MooseVariableFieldBase * > getFieldVars (const std::string &var_name) const
 
const TgetVarHelper (const std::string &var_name, unsigned int comp) const
 
TgetVarHelper (const std::string &var_name, unsigned int comp)
 
std::vector< const T * > getVarsHelper (const std::string &var_name) const
 
MooseVariablegetVar (const std::string &var_name, unsigned int comp)
 
const MooseVariablegetVar (const std::string &var_name, unsigned int comp) const
 
VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp)
 
const VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp) const
 
ArrayMooseVariablegetArrayVar (const std::string &var_name, unsigned int comp)
 
const ArrayMooseVariablegetArrayVar (const std::string &var_name, unsigned int comp) const
 
std::vector< TcoupledVectorHelper (const std::string &var_name, const Func &func) const
 
bool hasBoundaryMaterialPropertyHelper (const std::string &prop_name) const
 
KOKKOS_FUNCTION dof_id_type numKokkosBoundaryNodes () const
 
KOKKOS_FUNCTION dof_id_type numKokkosBoundarySides () const
 
KOKKOS_FUNCTION ContiguousNodeID kokkosBoundaryNodeID (Moose::Kokkos::ThreadID tid) const
 
KOKKOS_FUNCTION auto kokkosBoundaryElementSideID (Moose::Kokkos::ThreadID tid) const
 
void visitNodalNeighbors (const Node *node, FeatureData *feature, bool expand_halos_only)
 These two routines are utility routines used by the flood routine and by derived classes for visiting neighbors.
 
void visitElementalNeighbors (const Elem *elem, FeatureData *feature, bool expand_halos_only, bool disjoint_only)
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

std::vector< T > & _grain_data
 per grain data
 
const int _tracking_step
 The timestep to begin tracking grains.
 
const unsigned short _halo_level
 The thickness of the halo surrounding each grain.
 
const unsigned short _max_remap_recursion_depth
 Depth of renumbering recursion (a depth of zero means no recursion)
 
const unsigned short _n_reserve_ops
 The number of reserved order parameters.
 
const std::size_t _reserve_op_index
 The cutoff index where if variable index >= this number, no remapping TO that variable will occur.
 
const Real _reserve_op_threshold
 The threshold above (or below) where a grain may be found on a reserve op field.
 
const Real _bound_value
 Absolute value of the lower bound used to represent a region not assigned to this grain, used when a grain is remapped to another order parameter.
 
const bool _remap
 Inidicates whether remapping should be done or not (remapping is independent of tracking)
 
const bool _tolerate_failure
 Indicates whether we should continue after a remap failure (will result in non-physical results)
 
std::vector< FeatureData_feature_sets_old
 This data structure holds the map of unique grains from the previous time step.
 
const PolycrystalUserObjectBase *const _poly_ic_uo
 An optional IC UserObject which can provide initial data structures to this object.
 
const short _verbosity_level
 Verbosity level controlling the amount of information printed to the console.
 
bool & _first_time
 Boolean to indicate the first time this object executes.
 
const bool _error_on_grain_creation
 Boolean to terminate with an error if a new grain is created during the simulation.
 
std::vector< MooseVariableFEBase * > _fe_vars
 The vector of coupled in variables.
 
std::vector< MooseVariable * > _vars
 The vector of coupled in variables cast to MooseVariable.
 
const DofMap & _dof_map
 Reference to the dof_map containing the coupled variables.
 
const Real _threshold
 The threshold above (or below) where an entity may begin a new region (feature)
 
Real _step_threshold
 
const Real _connecting_threshold
 The threshold above (or below) which neighboring entities are flooded (where regions can be extended but not started)
 
Real _step_connecting_threshold
 
MooseMesh_mesh
 A reference to the mesh.
 
unsigned long _var_number
 This variable is used to build the periodic node map.
 
const bool _single_map_mode
 This variable is used to indicate whether or not multiple maps are used during flooding.
 
const bool _condense_map_info
 
const bool _global_numbering
 This variable is used to indicate whether or not we identify features with unique numbers on multiple maps.
 
const bool _var_index_mode
 This variable is used to indicate whether the maps will contain unique region information or just the variable numbers owning those regions.
 
const bool _compute_halo_maps
 Indicates whether or not to communicate halo map information with all ranks.
 
const bool _compute_var_to_feature_map
 Indicates whether or not the var to feature map is populated.
 
const bool _use_less_than_threshold_comparison
 Use less-than when comparing values against the threshold value.
 
const std::size_t _n_vars
 
const std::size_t _maps_size
 Convenience variable holding the size of all the datastructures size by the number of maps.
 
const processor_id_type _n_procs
 Convenience variable holding the number of processors in this simulation.
 
std::vector< std::set< dof_id_type > > _entities_visited
 This variable keeps track of which nodes have been visited during execution.
 
std::vector< std::map< dof_id_type, int > > _var_index_maps
 This map keeps track of which variables own which nodes.
 
std::unordered_map< dof_id_type, std::vector< const Elem * > > _nodes_to_elem_map
 The data structure used to find neighboring elements give a node ID.
 
std::vector< unsigned int_feature_counts_per_map
 The number of features seen by this object per map.
 
unsigned int _feature_count
 The number of features seen by this object (same as summing _feature_counts_per_map)
 
std::vector< std::list< FeatureData > > _partial_feature_sets
 The data structure used to hold partial and communicated feature data, during the discovery and merging phases.
 
std::vector< FeatureData > & _feature_sets
 The data structure used to hold the globally unique features.
 
std::vector< FeatureData_volatile_feature_sets
 Derived objects (e.g.
 
std::vector< std::map< dof_id_type, int > > _feature_maps
 The feature maps contain the raw flooded node information and eventually the unique grain numbers.
 
std::vector< std::size_t > _local_to_global_feature_map
 The vector recording the local to global feature indices.
 
std::vector< std::size_t > _feature_id_to_local_index
 The vector recording the grain_id to local index (several indices will contain invalid_size_t)
 
libMesh::PeriodicBoundaries_pbs
 A pointer to the periodic boundary constraints object.
 
std::unique_ptr< libMesh::PointLocatorBase_point_locator
 
const PostprocessorValue_element_average_value
 Average value of the domain which can optionally be used to find features in a field.
 
std::map< dof_id_type, int_ghosted_entity_ids
 The map for holding reconstructed ghosted element information.
 
std::vector< std::map< dof_id_type, int > > _halo_ids
 The data structure for looking up halos around features.
 
std::multimap< dof_id_type, dof_id_type > _periodic_node_map
 The data structure which is a list of nodes that are constrained to other nodes based on the imposed periodic boundary conditions.
 
std::unordered_set< dof_id_type > _all_boundary_entity_ids
 The set of entities on the boundary of the domain used for determining if features intersect any boundary.
 
std::map< dof_id_type, std::vector< unsigned int > > _entity_var_to_features
 
std::vector< unsigned int_empty_var_to_features
 
std::vector< BoundaryID_primary_perc_bnds
 
std::vector< BoundaryID_secondary_perc_bnds
 
std::vector< BoundaryID_specified_bnds
 
const bool _is_elemental
 Determines if the flood counter is elements or not (nodes)
 
bool _is_boundary_restricted
 Indicates that this object should only run on one or more boundaries.
 
ConstBndElemRange_bnd_elem_range
 Boundary element range pointer.
 
const bool _is_primary
 Convenience variable for testing primary rank.
 
const Moose::CoordinateSystemType_coord_sys
 
const THREAD_ID _tid
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
Assembly_assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
FEProblemBase_mdi_feproblem
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real & _real_zero
 
const VariableValue_scalar_zero
 
const Point & _point_zero
 
const InputParameters_mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase_mi_feproblem
 
SubProblem_mi_subproblem
 
const THREAD_ID _mi_tid
 
const bool _is_kokkos_object
 
const Moose::MaterialDataType _material_data_type
 
MaterialData_material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int_material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real & _t
 
const Real & _t_old
 
int_t_step
 
Real & _dt
 
Real & _dt_old
 
const std::string & _pp_name
 
const PostprocessorValue_current_value
 
std::unordered_map< std::string, std::vector< std::unique_ptr< VariableValue > > > _default_value
 
const Parallel::Communicator & _communicator
 
const InputParameters_c_parameters
 
const std::string & _c_name
 
const std::string & _c_type
 
FEProblemBase_c_fe_problem
 
const SystemBase *const _c_sys
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
 
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
 
std::vector< MooseVariable * > _coupled_standard_moose_vars
 
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
 
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
 
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
 
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
 
bool _c_nodal
 
bool _c_is_implicit
 
const bool _c_allow_element_to_nodal_coupling
 
THREAD_ID _c_tid
 
std::unordered_map< std::string, std::unique_ptr< MooseArray< ADReal > > > _ad_default_value
 
std::unordered_map< std::string, std::unique_ptr< VectorVariableValue > > _default_vector_value
 
std::unordered_map< std::string, std::unique_ptr< ArrayVariableValue > > _default_array_value
 
std::unordered_map< std::string, std::unique_ptr< MooseArray< ADRealVectorValue > > > _ad_default_vector_value
 
VariableValue _default_value_zero
 
VariableGradient _default_gradient
 
MooseArray< ADRealVectorValue_ad_default_gradient
 
MooseArray< ADRealTensorValue_ad_default_vector_gradient
 
VariableSecond _default_second
 
MooseArray< ADRealTensorValue_ad_default_second
 
MooseArray< ADRealVectorValue_ad_default_curl
 
const VariableValue_zero
 
const VariablePhiValue_phi_zero
 
const MooseArray< ADReal > & _ad_zero
 
const VariableGradient_grad_zero
 
const MooseArray< ADRealVectorValue > & _ad_grad_zero
 
const VariablePhiGradient_grad_phi_zero
 
const VariableSecond_second_zero
 
const MooseArray< ADRealTensorValue > & _ad_second_zero
 
const VariablePhiSecond_second_phi_zero
 
const VectorVariableValue_vector_zero
 
const VectorVariableCurl_vector_curl_zero
 
VectorVariableValue _default_vector_value_zero
 
VectorVariableGradient _default_vector_gradient
 
VectorVariableCurl _default_vector_curl
 
VectorVariableDivergence _default_div
 
ArrayVariableValue _default_array_value_zero
 
ArrayVariableGradient _default_array_gradient
 
bool _coupleable_neighbor
 

Static Protected Attributes

static const std::string _interpolated_old
 
static const std::string _interpolated_older
 

Private Types

typedef Moose::ElemArg ElemArg
 
typedef Moose::ElemQpArg ElemQpArg
 
typedef Moose::ElemSideQpArg ElemSideQpArg
 
typedef Moose::FaceArg FaceArg
 
typedef Moose::ElemPointArg ElemPointArg
 
typedef Moose::NodeArg NodeArg
 
enum  FuncAge
 
enum  VarType
 

Private Member Functions

const Moose::Functor< T > * defaultFunctor (const std::string &name)
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
const Moose::FunctionBasegetKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBasegetUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const TcastUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValuegetVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
RestartableDataValueregisterRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValuegetMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 
const VariableValuegetDefaultValue (const std::string &var_name) const
 
const ADVariableValuegetADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 
const PostprocessorValuedeclareValue (const MooseObject &moose_object)
 
ValueType evaluate (const ElemArg &elem, const Moose::StateArg &state) const override final
 
ValueType evaluate (const FaceArg &face, const Moose::StateArg &state) const override final
 
ValueType evaluate (const ElemQpArg &qp, const Moose::StateArg &state) const override final
 
ValueType evaluate (const ElemSideQpArg &elem_side_qp, const Moose::StateArg &state) const override final
 
ValueType evaluate (const ElemPointArg &elem_point, const Moose::StateArg &state) const override final
 
ValueType evaluate (const NodeArg &node, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const ElemArg &elem, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const FaceArg &face, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const ElemQpArg &qp, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const ElemSideQpArg &elem_side_qp, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const ElemPointArg &elem_point, const Moose::StateArg &state) const override final
 
GradientType evaluateGradient (const NodeArg &node, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const ElemArg &elem, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const FaceArg &face, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const ElemQpArg &qp, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const ElemSideQpArg &elem_side_qp, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const ElemPointArg &elem_point, const Moose::StateArg &state) const override final
 
DotType evaluateDot (const NodeArg &node, const Moose::StateArg &state) const override final
 
void evaluateDotWarning () const
 
virtual bool isADObject () const override
 
void clearCacheData ()
 
ValueType queryQpCache (unsigned int qp, const libMesh::QBase &qrule, std::vector< std::pair< bool, Real > > &qp_cache_data, const SpaceArg &space, const StateArg &state) const
 
ValueType queryFVArgCache (std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const OutputTools< T >::VariableValuevectorTagValueHelper (const std::string &var_names, TagID tag, unsigned int index=0) const
 
const OutputTools< T >::VariableValuevectorTagValueHelper (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
const OutputTools< T >::VariableValuevectorTagDofValueHelper (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const OutputTools< T >::VariableValuevectorTagDofValueHelper (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
void requestStates (const std::string &var_name, const TagName &tag_name, const unsigned int comp)
 
void checkFuncType (const std::string var_name, VarType t, FuncAge age) const
 
const VectorVariableValuegetDefaultVectorValue (const std::string &var_name) const
 
const ArrayVariableValuegetDefaultArrayValue (const std::string &var_name) const
 
const TgetDefaultNodalValue (const std::string &var_name, unsigned int comp=0) const
 
const RealVectorValue & getDefaultNodalValue (const std::string &var_name, unsigned int) const
 
const RealEigenVector & getDefaultNodalValue (const std::string &var_name, unsigned int) const
 
const Moose::Functor< T > & getDefaultFunctor (const std::string &var_name) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagVariable (const std::string &var_name, const std::string &tag_name, unsigned int comp) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagVariables (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagVectorVariable (const std::string &var_name, const std::string &tag_name, unsigned int comp) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagVectorVariables (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::Variable kokkosZeroVariable () const
 
std::set< MooseVariableFieldBase * > checkVariablesHelper (const DofObjectType &dof_object, const std::set< MooseVariableFieldBase * > &vars_to_check)
 
void initializeBoundaryRestrictable ()
 
void initializeKokkosBoundaryRestrictable ()
 

Static Private Member Functions

template<class T >
static void sort (std::set< T > &)
 
template<class T >
static void sort (std::vector< T > &container)
 
template<class T >
static void reserve (std::set< T > &, std::size_t)
 
template<class T >
static void reserve (std::vector< T > &container, std::size_t size)
 
template<class T >
static bool contains (std::set< T > &container, const T &item)
 
template<class T >
static bool contains (std::vector< T > &container, const T &item)
 
static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

unsigned int _reserve_grain_first_index
 Holds the first unique grain index when using _reserve_op (all the remaining indices are sequential)
 
unsigned int _old_max_grain_id
 The previous max grain id (needed to figure out which ids are new in a given step)
 
unsigned int_max_curr_grain_id
 Holds the next "regular" grain ID (a grain found or remapped to the standard op vars)
 
const bool _is_transient
 Boolean to indicate whether this is a Steady or Transient solve.
 
std::vector< std::pair< dof_id_type, dof_id_type > > _all_ranges
 Data structure to hold element ID ranges when using Distributed Mesh (populated on rank 0 only)
 
std::deque< const DofObject * > _entity_queue
 The data structure for maintaining entities to flood during discovery.
 
UserObject_primary_thread_copy
 
std::set< std::string > _supplied_uo
 
const ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject_fni_object
 
const InputParameters_fni_params
 
FEProblemBase_fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject_uoi_moose_object
 
const FEProblemBase_uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const MooseObject_ppi_moose_object
 
const InputParameters_ppi_params
 
const FEProblemBase_ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject_vpi_moose_object
 
const FEProblemBase_vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters_ri_params
 
FEProblemBase_ri_fe_problem_base
 
const ReporterData_ri_reporter_data
 
const MooseObject_ri_moose_object
 
const InputParameters_dni_params
 
FEProblemBase_dni_feproblem
 
const MooseObject *const _dni_moose_object_ptr
 
const InputParameters_si_params
 
FEProblemBase_si_feproblem
 
THREAD_ID _si_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
MooseApp_meta_data_app
 
const MooseObject *const _meta_data_object
 
const InputParameters_sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID_sc_coupleable_vector_tags
 
std::set< TagID_sc_coupleable_matrix_tags
 
const MooseObject_mi_moose_object
 
const bool _mi_boundary_restricted
 
const std::set< SubdomainID > & _mi_block_ids
 
const std::set< BoundaryID > & _mi_boundary_ids
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 
const std::string _ti_name
 
const MooseObject_pp_moose_object
 
MooseApp_oi_moose_app
 
OutputWarehouse_oi_output_warehouse
 
std::set< OutputName > _oi_outputs
 
const InputParameters_fi_params
 
const std::string _fi_name
 
SubProblem *const _fi_subproblem
 
const THREAD_ID _fi_tid
 
std::vector< std::unique_ptr< Moose::Functor< Real > > > _default_real_functors
 
std::vector< std::unique_ptr< Moose::Functor< ADReal > > > _default_ad_real_functors
 
std::set< ExecFlagType_clearance_schedule
 
bool _always_evaluate
 
dof_id_type _current_qp_map_key
 
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
 
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
 
dof_id_type _current_side_qp_map_key
 
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
 
std::unordered_map< dof_id_type, std::vector< std::vector< std::pair< bool, ValueType > > > > _side_qp_to_value
 
std::map< ElemArg, ValueType_elem_arg_to_value
 
std::map< FaceArg, ValueType_face_arg_to_value
 
std::map< NodeArg, ValueType_node_arg_to_value
 
MooseFunctorName _functor_name
 
unsigned int _coupleable_max_qps
 
std::unordered_map< std::string, std::vector< unsigned int > > _optional_var_index
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
 
std::set< TagID_fe_coupleable_vector_tags
 
std::set< TagID_fe_coupleable_matrix_tags
 
const bool _is_fv
 
const MooseObject *const _obj
 
const std::set< std::string > _older_state_tags
 
std::vector< std::set< MooseWritableVariable * > > _writable_coupled_variables
 
const Real _kokkos_default_value_zero
 
std::set< MooseVariableFieldBase * > _moose_variable_dependencies
 
std::vector< libMesh::dof_id_type_dof_indices
 
FEProblemBase_bnd_feproblem
 
MooseMesh_bnd_mesh
 
std::set< BoundaryID_bnd_ids
 
std::vector< BoundaryID_vec_ids
 
std::vector< BoundaryName > _boundary_names
 
const bool _bnd_dual_restrictable
 
const std::set< SubdomainID_empty_block_ids
 
const std::set< SubdomainID > & _block_ids
 
THREAD_ID _bnd_tid
 
const MaterialData_bnd_material_data
 
bool _bnd_nodal
 
const MooseObject_moose_object
 
Moose::Kokkos::Array< ContiguousNodeID_kokkos_node_ids
 
Moose::Kokkos::Array< Moose::Kokkos::Pair< ContiguousElementID, unsigned int > > _kokkos_element_side_ids
 

Detailed Description

template<typename T>
class GrainDataTracker< T >

GrainTracker derived class template to base objects on which maintain physical parameters for individual grains.

Definition at line 19 of file GrainDataTracker.h.

Member Enumeration Documentation

◆ BoundaryIntersection

enum class FeatureFloodCount::BoundaryIntersection : unsigned char
stronginherited

This enumeration is used to inidacate status of boundary intersections.

Enumerator
NONE 
ANY_BOUNDARY 
PRIMARY_PERCOLATION_BOUNDARY 
SECONDARY_PERCOLATION_BOUNDARY 
SPECIFIED_BOUNDARY 

Definition at line 129 of file FeatureFloodCount.h.

◆ FieldType

enum class FeatureFloodCount::FieldType
stronginherited
Enumerator
UNIQUE_REGION 
VARIABLE_COLORING 
GHOSTED_ENTITIES 
HALOS 
CENTROID 
ACTIVE_BOUNDS 
INTERSECTS_SPECIFIED_BOUNDARY 

Definition at line 102 of file FeatureFloodCount.h.

◆ RemapCacheMode

enum class GrainTracker::RemapCacheMode
stronginherited
Enumerator
FILL 
USE 
BYPASS 

Definition at line 51 of file GrainTracker.h.

◆ Status

enum class FeatureFloodCount::Status : unsigned char
stronginherited

This enumeration is used to indicate status of the grains in the _unique_grains data structure.

Enumerator
CLEAR 
MARKED 
DIRTY 
INACTIVE 

Definition at line 120 of file FeatureFloodCount.h.

Constructor & Destructor Documentation

◆ GrainDataTracker()

template<typename T >
GrainDataTracker< T >::GrainDataTracker ( const InputParameters parameters)

Definition at line 38 of file GrainDataTracker.h.

39 : GrainTracker(parameters), _grain_data(declareRestartableData<std::vector<T>>("grain_data"))
40{
41}
std::vector< T > & _grain_data
per grain data
const InputParameters & parameters() const
T & declareRestartableData(const std::string &data_name, Args &&... args)

Member Function Documentation

◆ appendPeriodicNeighborNodes()

void FeatureFloodCount::appendPeriodicNeighborNodes ( FeatureData feature) const
protectedinherited

This routine adds the periodic node information to our data structure prior to packing the data this makes those periodic neighbors appear much like ghosted nodes in a multiprocessor setting.

Definition at line 1821 of file FeatureFloodCount.C.

1822{
1823 if (_is_elemental)
1824 {
1825 for (auto entity : feature._local_ids)
1826 {
1827 Elem * elem = _mesh.elemPtr(entity);
1828
1829 for (const auto node_n : make_range(elem->n_nodes()))
1830 {
1831 auto iters = _periodic_node_map.equal_range(elem->node_id(node_n));
1832
1833 for (auto it = iters.first; it != iters.second; ++it)
1834 {
1835 feature._periodic_nodes.insert(feature._periodic_nodes.end(), it->first);
1836 feature._periodic_nodes.insert(feature._periodic_nodes.end(), it->second);
1837 }
1838 }
1839 }
1840 }
1841 else
1842 {
1843 for (auto entity : feature._local_ids)
1844 {
1845 auto iters = _periodic_node_map.equal_range(entity);
1846
1847 for (auto it = iters.first; it != iters.second; ++it)
1848 {
1849 feature._periodic_nodes.insert(feature._periodic_nodes.end(), it->first);
1850 feature._periodic_nodes.insert(feature._periodic_nodes.end(), it->second);
1851 }
1852 }
1853 }
1854
1855 // TODO: Remove duplicates
1856}
const bool _is_elemental
Determines if the flood counter is elements or not (nodes)
MooseMesh & _mesh
A reference to the mesh.
std::multimap< dof_id_type, dof_id_type > _periodic_node_map
The data structure which is a list of nodes that are constrained to other nodes based on the imposed ...
virtual Elem * elemPtr(const dof_id_type i)
IntRange< T > make_range(T beg, T end)
const dof_id_type n_nodes

Referenced by FeatureFloodCount::prepareDataForTransfer().

◆ areFeaturesMergeable()

bool FeatureFloodCount::areFeaturesMergeable ( const FeatureData f1,
const FeatureData f2 
) const
protectedvirtualinherited

Method for determining whether two features are mergeable.

This routine exists because derived classes may need to override this function rather than use the mergeable method in the FeatureData object.

Reimplemented in PolycrystalUserObjectBase.

Definition at line 1276 of file FeatureFloodCount.C.

1277{
1278 return f1.mergeable(f2);
1279}

Referenced by FeatureFloodCount::mergeSets().

◆ assignGrains()

void GrainTracker::assignGrains ( )
protectedinherited

When the tracking phase starts (_t_step == _tracking_step) it assigns a unique id to every FeatureData object found by the FeatureFloodCount object.

We need to assign grainIDs to get the simulation going. We'll use the default sorting that doesn't require valid grainIDs (relies on _min_entity_id and _var_index). These will be the unique grain numbers that we must track for remainder of the simulation.

Definition at line 450 of file GrainTracker.C.

451{
452 mooseAssert(_first_time, "assignGrains may only be called on the first tracking step");
453
459 if (_is_primary)
460 {
461 // Find the largest grain ID, this requires sorting if the ID is not already set
462 sortAndLabel();
463
464 if (_feature_sets.empty())
465 {
468 }
469 else
470 {
473 }
474
475 for (auto & grain : _feature_sets)
476 grain._status = Status::MARKED; // Mark the grain
477
478 } // is_primary
479
480 /*************************************************************
481 ****************** COLLECTIVE WORK SECTION ******************
482 *************************************************************/
483
484 // Make IDs on all non-primary ranks consistent
486
487 // Build up an id to index map
490
491 // Now trigger the newGrainCreated() callback on all ranks
493 for (unsigned int new_id = 0; new_id <= _max_curr_grain_id; ++new_id)
494 newGrainCreated(new_id);
495}
const bool _is_primary
Convenience variable for testing primary rank.
void buildFeatureIdToLocalIndices(unsigned int max_id)
This method builds a lookup map for retrieving the right local feature (by index) given a global inde...
Status
This enumeration is used to indicate status of the grains in the _unique_grains data structure.
static const unsigned int invalid_id
void scatterAndUpdateRanks()
Calls buildLocalToGlobalIndices to build the individual local to global indicies for each rank and sc...
std::vector< FeatureData > & _feature_sets
The data structure used to hold the globally unique features.
void sortAndLabel()
Sort and assign ids to features based on their position in the container after sorting.
bool & _first_time
Boolean to indicate the first time this object executes.
unsigned int & _max_curr_grain_id
Holds the next "regular" grain ID (a grain found or remapped to the standard op vars)
virtual void newGrainCreated(unsigned int new_grain_id)
This method is called when a new grain is detected.
unsigned int _reserve_grain_first_index
Holds the first unique grain index when using _reserve_op (all the remaining indices are sequential)
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
const Parallel::Communicator & _communicator

Referenced by GrainTracker::finalize().

◆ attemptGrainRenumber()

bool GrainTracker::attemptGrainRenumber ( FeatureData grain,
unsigned int  depth,
unsigned int  max_depth 
)
protectedinherited

This is the recursive part of the remapping algorithm.

It attempts to remap a grain to a new index and recurses until max_depth is reached.

We have two grains that are getting close represented by the same order parameter. We need to map to the variable whose closest grain to this one is furthest away by bounding region to bounding region distance.

We have a vector of the distances to the closest grains represented by each of our variables. We just need to pick a suitable grain to replace with. We will start with the maximum of this this list: (max of the mins), but will settle for next to largest and so forth as we make more attempts at remapping grains. This is a graph coloring problem so more work will be required to optimize this process.

Note: We don't have an explicit check here to avoid remapping a variable to itself. This is unnecessary since the min_distance of a variable is explicitly set up above.

If we get to this case and the best distance is less than -1, we are in big trouble. This means that grains represented by all of the remaining order parameters are overlapping this one in at least two places. We'd have to maintain multiple recursive chains, or just start over from scratch... Let's just return false and see if there is another remapping option.

Propose a new variable index for the current grain and recurse. We don't need to mark the status as DIRTY here since the recursion may fail. For now, we'll just add MARKED to the status.

Definition at line 1251 of file GrainTracker.C.

1252{
1253 // End the recursion of our breadth first search
1254 if (depth > max_depth)
1255 return false;
1256
1257 std::size_t curr_var_index = grain._var_index;
1258
1259 std::vector<std::map<Node *, CacheValues>> cache;
1260
1261 std::vector<std::list<GrainDistance>> min_distances(_vars.size());
1262
1268 computeMinDistancesFromGrain(grain, min_distances);
1269
1280 // clang-format off
1281 std::sort(min_distances.begin(), min_distances.end(),
1282 [](const std::list<GrainDistance> & lhs, const std::list<GrainDistance> & rhs)
1283 {
1284 // Sort lists in reverse order (largest distance first)
1285 // These empty cases are here to make this comparison stable
1286 if (lhs.empty())
1287 return false;
1288 else if (rhs.empty())
1289 return true;
1290 else
1291 return lhs.begin()->_distance > rhs.begin()->_distance;
1292 });
1293 // clang-format on
1294
1295 for (auto & list_ref : min_distances)
1296 {
1297 const auto target_it = list_ref.begin();
1298 if (target_it == list_ref.end())
1299 continue;
1300
1301 // If the distance is positive we can just remap and be done
1302 if (target_it->_distance > 0)
1303 {
1304 if (_verbosity_level > 0)
1305 {
1306 _console << COLOR_GREEN << "- Depth " << depth << ": Remapping grain #" << grain._id
1307 << " from variable index " << curr_var_index << " to " << target_it->_var_index;
1308 if (target_it->_distance == std::numeric_limits<Real>::max())
1309 _console << " which currently contains zero grains.\n\n" << COLOR_DEFAULT;
1310 else
1311 _console << " whose closest grain (#" << target_it->_grain_id << ") is at a distance of "
1312 << std::sqrt(target_it->_distance) << "\n\n"
1313 << COLOR_DEFAULT;
1314 }
1315
1316 grain._status |= Status::DIRTY;
1317 grain._var_index = target_it->_var_index;
1318 return true;
1319 }
1320
1321 // If the distance isn't positive we just need to make sure that none of the grains represented
1322 // by the target variable index would intersect this one if we were to remap
1323 {
1324 auto next_target_it = target_it;
1325 bool intersection_hit = false;
1326 unsigned short num_close_targets = 0;
1327 std::ostringstream oss;
1328 while (!intersection_hit && next_target_it != list_ref.end())
1329 {
1330 if (next_target_it->_distance > 0)
1331 break;
1332
1333 mooseAssert(next_target_it->_grain_index < _feature_sets.size(),
1334 "Error in indexing target grain in attemptGrainRenumber");
1335 FeatureData & next_target_grain = _feature_sets[next_target_it->_grain_index];
1336
1337 // If any grains touch we're done here
1338 if (grain.halosIntersect(next_target_grain))
1339 intersection_hit = true;
1340 else
1341 {
1342 if (num_close_targets > 0)
1343 oss << ", "; // delimiter
1344 oss << "#" << next_target_it->_grain_id;
1345 }
1346
1347 ++next_target_it;
1348 ++num_close_targets;
1349 }
1350
1351 if (!intersection_hit)
1352 {
1353 if (_verbosity_level > 0)
1354 {
1355 _console << COLOR_GREEN << "- Depth " << depth << ": Remapping grain #" << grain._id
1356 << " from variable index " << curr_var_index << " to " << target_it->_var_index;
1357
1358 if (num_close_targets == 1)
1359 _console << " whose closest grain (" << oss.str()
1360 << ") is inside our bounding box but whose halo is not touching.\n\n"
1361 << COLOR_DEFAULT;
1362 else
1363 _console << " whose closest grains (" << oss.str()
1364 << ") are inside our bounding box but whose halos are not touching.\n\n"
1365 << COLOR_DEFAULT;
1366 }
1367
1368 grain._status |= Status::DIRTY;
1369 grain._var_index = target_it->_var_index;
1370 return true;
1371 }
1372 }
1373
1374 // If we reach this part of the loop, there is no simple renumbering that can be done.
1375 mooseAssert(target_it->_grain_index < _feature_sets.size(),
1376 "Error in indexing target grain in attemptGrainRenumber");
1377 FeatureData & target_grain = _feature_sets[target_it->_grain_index];
1378
1386 if (target_it->_distance < -1)
1387 return false;
1388
1389 // Make sure this grain isn't marked. If it is, we can't recurse here
1390 if ((target_grain._status & Status::MARKED) == Status::MARKED)
1391 return false;
1392
1398 grain._var_index = target_it->_var_index;
1399 grain._status |= Status::MARKED;
1400 if (attemptGrainRenumber(target_grain, depth + 1, max_depth))
1401 {
1402 // SUCCESS!
1403 if (_verbosity_level > 0)
1404 _console << COLOR_GREEN << "- Depth " << depth << ": Remapping grain #" << grain._id
1405 << " from variable index " << curr_var_index << " to " << target_it->_var_index
1406 << "\n\n"
1407 << COLOR_DEFAULT;
1408
1409 // Now we need to mark the grain as DIRTY since the recursion succeeded.
1410 grain._status |= Status::DIRTY;
1411 return true;
1412 }
1413 else
1414 // FAILURE, We need to set our var index back after failed recursive step
1415 grain._var_index = curr_var_index;
1416
1417 // ALWAYS "unmark" (or clear the MARKED status) after recursion so it can be used by other remap
1418 // operations
1419 grain._status &= ~Status::MARKED;
1420 }
1421
1422 return false;
1423}
const ConsoleStream _console
std::vector< MooseVariable * > _vars
The vector of coupled in variables cast to MooseVariable.
bool attemptGrainRenumber(FeatureData &grain, unsigned int depth, unsigned int max_depth)
This is the recursive part of the remapping algorithm.
void computeMinDistancesFromGrain(FeatureData &grain, std::vector< std::list< GrainDistance > > &min_distances)
Populates and sorts a min_distances vector with the minimum distances to all grains in the simulation...
const short _verbosity_level
Verbosity level controlling the amount of information printed to the console.

Referenced by GrainTracker::attemptGrainRenumber(), and GrainTracker::remapGrains().

◆ boundingRegionDistance()

Real GrainTracker::boundingRegionDistance ( std::vector< BoundingBox > &  bboxes1,
std::vector< BoundingBox > &  bboxes2 
) const
protectedinherited

This method returns the minimum periodic distance between two vectors of bounding boxes.

If the bounding boxes overlap the result is always -1.0.

The region that each grain covers is represented by a bounding box large enough to encompassing all the points within that grain. When using periodic boundaries, we may have several discrete "pieces" of a grain each represented by a bounding box. The distance between any two grains is defined as the minimum distance between any pair of boxes, one selected from each grain.

Definition at line 1736 of file GrainTracker.C.

1738{
1745 auto min_distance = std::numeric_limits<Real>::max();
1746 for (const auto & bbox1 : bboxes1)
1747 {
1748 for (const auto & bbox2 : bboxes2)
1749 {
1750 // AABB squared distance
1751 Real curr_distance = 0.0;
1752 bool boxes_overlap = true;
1753 for (unsigned int dim = 0; dim < LIBMESH_DIM; ++dim)
1754 {
1755 const auto & min1 = bbox1.min()(dim);
1756 const auto & max1 = bbox1.max()(dim);
1757 const auto & min2 = bbox2.min()(dim);
1758 const auto & max2 = bbox2.max()(dim);
1759
1760 if (min1 > max2)
1761 {
1762 const auto delta = max2 - min1;
1763 curr_distance += delta * delta;
1764 boxes_overlap = false;
1765 }
1766 else if (min2 > max1)
1767 {
1768 const auto delta = max1 - min2;
1769 curr_distance += delta * delta;
1770 boxes_overlap = false;
1771 }
1772 }
1773
1774 if (boxes_overlap)
1775 return -1.0; /* all overlaps are treated the same */
1776
1777 if (curr_distance < min_distance)
1778 min_distance = curr_distance;
1779 }
1780 }
1781
1782 return min_distance;
1783}
unsigned int dim
int delta(unsigned int i, unsigned int j)
Delta function, which returns zero if $i\ne j$ and unity if $i=j$.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by GrainTracker::computeMinDistancesFromGrain().

◆ broadcastAndUpdateGrainData()

void GrainTracker::broadcastAndUpdateGrainData ( )
protectedinherited

Broadcast essential Grain information to all processors.

This method is used to get certain attributes like centroids distributed and whether or not a grain intersects a boundary updated.

Definition at line 387 of file GrainTracker.C.

388{
389 TIME_SECTION("broadcastAndUpdateGrainData", 3, "Broadcasting and Updating Grain Data");
390
391 std::vector<PartialFeatureData> root_feature_data;
392 std::vector<std::string> send_buffer(1), recv_buffer;
393
394 if (_is_primary)
395 {
396 root_feature_data.reserve(_feature_sets.size());
397
398 // Populate a subset of the information in a small data structure
399 std::transform(_feature_sets.begin(),
400 _feature_sets.end(),
401 std::back_inserter(root_feature_data),
402 [](FeatureData & feature)
403 {
404 PartialFeatureData partial_feature;
405 partial_feature.boundary_intersection = feature._boundary_intersection;
406 partial_feature.id = feature._id;
407 partial_feature.centroid = feature._centroid;
408 partial_feature.status = feature._status;
409 return partial_feature;
410 });
411
412 std::ostringstream oss;
413 dataStore(oss, root_feature_data, this);
414 send_buffer[0].assign(oss.str());
415 }
416
417 // Broadcast the data to all ranks
418 _communicator.broadcast_packed_range((void *)(nullptr),
419 send_buffer.begin(),
420 send_buffer.end(),
421 (void *)(nullptr),
422 std::back_inserter(recv_buffer));
423
424 // Unpack and update
425 if (!_is_primary)
426 {
427 std::istringstream iss;
428 iss.str(recv_buffer[0]);
429 iss.clear();
430
431 dataLoad(iss, root_feature_data, this);
432
433 for (const auto & partial_data : root_feature_data)
434 {
435 // See if this processor has a record of this grain
436 if (partial_data.id < _feature_id_to_local_index.size() &&
437 _feature_id_to_local_index[partial_data.id] != invalid_size_t)
438 {
439 auto & grain = _feature_sets[_feature_id_to_local_index[partial_data.id]];
440 grain._boundary_intersection = partial_data.boundary_intersection;
441 grain._centroid = partial_data.centroid;
442 if (partial_data.status == Status::INACTIVE)
443 grain._status = Status::INACTIVE;
444 }
445 }
446 }
447}
void dataLoad(std::istream &stream, GrainTracker::PartialFeatureData &feature, void *context)
void dataStore(std::ostream &stream, GrainTracker::PartialFeatureData &feature, void *context)
std::vector< std::size_t > _feature_id_to_local_index
The vector recording the grain_id to local index (several indices will contain invalid_size_t)
static const std::size_t invalid_size_t
void broadcast_packed_range(const Context *context1, Iter range_begin, const Iter range_end, OutputContext *context2, OutputIter out, const unsigned int root_id=0, std::size_t approx_buffer_size=1000000) const

Referenced by GrainTracker::finalize().

◆ buildFeatureIdToLocalIndices()

void FeatureFloodCount::buildFeatureIdToLocalIndices ( unsigned int  max_id)
protectedinherited

This method builds a lookup map for retrieving the right local feature (by index) given a global index or id.

max_id is passed to size the vector properly and may or may not be a globally consistent number. The assumption is that any id that is later queried from this object that is higher simply doesn't exist on the local processor.

Definition at line 660 of file FeatureFloodCount.C.

661{
662 _feature_id_to_local_index.assign(max_id + 1, invalid_size_t);
663 for (const auto feature_index : index_range(_feature_sets))
664 {
665 if (_feature_sets[feature_index]._status != Status::INACTIVE)
666 {
667 mooseAssert(_feature_sets[feature_index]._id <= max_id,
668 "Feature ID out of range(" << _feature_sets[feature_index]._id << ')');
669 _feature_id_to_local_index[_feature_sets[feature_index]._id] = feature_index;
670 }
671 }
672}
auto index_range(const T &sizable)

Referenced by GrainTracker::assignGrains(), FeatureFloodCount::scatterAndUpdateRanks(), and GrainTracker::trackGrains().

◆ buildLocalToGlobalIndices()

void FeatureFloodCount::buildLocalToGlobalIndices ( std::vector< std::size_t > &  local_to_global_all,
std::vector< int > &  counts 
) const
protectedvirtualinherited

This routine populates a stacked vector of local to global indices per rank and the associated count vector for scattering the vector to the ranks.

The individual vectors can be different sizes. The ith vector will be distributed to the ith processor including the primary rank. e.g. [ ... n_0 ] [ ... n_1 ] ... [ ... n_m ]

It is intended to be overridden in derived classes.

Definition at line 614 of file FeatureFloodCount.C.

616{
617 mooseAssert(_is_primary, "This method must only be called on the root processor");
618
619 counts.assign(_n_procs, 0);
620 // Now size the individual counts vectors based on the largest index seen per processor
621 for (const auto & feature : _feature_sets)
622 for (const auto & local_index_pair : feature._orig_ids)
623 {
624 // local_index_pair.first = ranks, local_index_pair.second = local_index
625 mooseAssert(local_index_pair.first < _n_procs, "Processor ID is out of range");
626 if (local_index_pair.second >= static_cast<std::size_t>(counts[local_index_pair.first]))
627 counts[local_index_pair.first] = local_index_pair.second + 1;
628 }
629
630 // Build the offsets vector
631 unsigned int globalsize = 0;
632 std::vector<int> offsets(_n_procs); // Type is signed for use with the MPI API
633 for (const auto i : index_range(offsets))
634 {
635 offsets[i] = globalsize;
636 globalsize += counts[i];
637 }
638
639 // Finally populate the primary vector
640 local_to_global_all.resize(globalsize, FeatureFloodCount::invalid_size_t);
641 for (const auto & feature : _feature_sets)
642 {
643 // Get the local indices from the feature and build a map
644 for (const auto & local_index_pair : feature._orig_ids)
645 {
646 auto rank = local_index_pair.first;
647 mooseAssert(rank < _n_procs, rank << ", " << _n_procs);
648
649 auto local_index = local_index_pair.second;
650 auto stacked_local_index = offsets[rank] + local_index;
651
652 mooseAssert(stacked_local_index < globalsize,
653 "Global index: " << stacked_local_index << " is out of range");
654 local_to_global_all[stacked_local_index] = feature._id;
655 }
656 }
657}
for(PetscInt i=0;i< nvars;++i)
const processor_id_type _n_procs
Convenience variable holding the number of processors in this simulation.

Referenced by FeatureFloodCount::scatterAndUpdateRanks().

◆ centroidRegionDistance()

Real GrainTracker::centroidRegionDistance ( std::vector< BoundingBox > &  bboxes1,
std::vector< BoundingBox > &  bboxes2 
) const
protectedinherited

This method returns the minimum periodic distance between the centroids of two vectors of bounding boxes.

Find the minimum centroid distance between any to pieces of the grains.

Definition at line 1708 of file GrainTracker.C.

1710{
1714 auto min_distance = std::numeric_limits<Real>::max();
1715 for (const auto & bbox1 : bboxes1)
1716 {
1717 const auto centroid_point1 = (bbox1.max() + bbox1.min()) / 2.0;
1718
1719 for (const auto & bbox2 : bboxes2)
1720 {
1721 const auto centroid_point2 = (bbox2.max() + bbox2.min()) / 2.0;
1722
1723 // Here we'll calculate a distance between the centroids
1724 auto curr_distance =
1725 _mesh.minPeriodicDistance(*_fe_vars[0], centroid_point1, centroid_point2);
1726
1727 if (curr_distance < min_distance)
1728 min_distance = curr_distance;
1729 }
1730 }
1731
1732 return min_distance;
1733}
std::vector< MooseVariableFEBase * > _fe_vars
The vector of coupled in variables.
Real minPeriodicDistance(const unsigned int sys_num, const unsigned int var_num, const Point &p, const Point &q) const

Referenced by GrainTracker::trackGrains().

◆ clearDataStructures()

void FeatureFloodCount::clearDataStructures ( )
protectedvirtualinherited

Helper routine for clearing up data structures during initialize and prior to parallel communication.

Definition at line 316 of file FeatureFloodCount.C.

317{
318}

Referenced by FeatureFloodCount::communicateAndMerge().

◆ communicateAndMerge()

void FeatureFloodCount::communicateAndMerge ( )
protectedinherited

This routine handles all of the serialization, communication and deserialization of the data structures containing FeatureData objects.

The libMesh packed range routines handle the communication of the individual string buffers. Here we need to create a container to hold our type to serialize. It'll always be size one because we are sending a single byte stream of all the data to other processors. The stream need not be the same size on all processors.

Additionally we need to create a different container to hold the received byte buffers. The container type need not match the send container type. However, We do know the number of incoming buffers (num processors) so we'll go ahead and use a vector.

When we distribute merge work, we are reducing computational work by adding more communication. Each of the first _n_vars processors will receive one variable worth of information to merge. After each of those processors has merged that information, it'll be sent to the primary processor where final consolidation will occur.

Send the data from all processors to the first 'n_merging_procs' processors to create a complete global feature maps for each variable.

A call to gather_packed_range seems to populate the receiving buffer on all processors, not just the receiving buffer on the actual receiving processor. If we plan to call this function repeatedly, we must clear the buffers each time on all non-receiving processors. On the actual receiving processor, we'll save off the buffer for use later.

The FeatureFloodCount and derived objects rely on having the original data structures intact on all non-zero ranks. This is because local-only information (local entities) is never communicated and thus must remain intact. However, the distributed merging will destroy that information. The easiest thing to do is to swap out the data structure while we perform the distributed merge work.

Send the data from the merging processors to the root to create a complete global feature map.

Send the data from all processors to the root to create a complete global feature map.

Definition at line 403 of file FeatureFloodCount.C.

404{
405 TIME_SECTION("communicateAndMerge", 3, "Communicating and Merging");
406
407 // First we need to transform the raw data into a usable data structure
409
417 std::vector<std::string> send_buffers(1);
418
425 std::vector<std::string> recv_buffers, deserialize_buffers;
426
433 const auto n_merging_procs = numberOfDistributedMergeHelpers();
434
435 if (n_merging_procs > 1)
436 {
437 auto rank = processor_id();
438 bool is_merging_processor = rank < n_merging_procs;
439
440 if (is_merging_processor)
441 recv_buffers.reserve(_app.n_processors());
442
443 for (const auto i : make_range(n_merging_procs))
444 {
445 serialize(send_buffers[0], i);
446
452 (void *)(nullptr),
453 send_buffers.begin(),
454 send_buffers.end(),
455 std::back_inserter(recv_buffers));
456
463 if (rank == i)
464 recv_buffers.swap(deserialize_buffers);
465 else
466 recv_buffers.clear();
467 }
468
469 // Setup a new communicator for doing merging communication operations
470 Parallel::Communicator merge_comm;
471
472 _communicator.split(is_merging_processor ? 0 : MPI_UNDEFINED, rank, merge_comm);
473
474 if (is_merging_processor)
475 {
483 std::vector<std::list<FeatureData>> tmp_data(_partial_feature_sets.size());
484 tmp_data.swap(_partial_feature_sets);
485
486 deserialize(deserialize_buffers, processor_id());
487
488 send_buffers[0].clear();
489 recv_buffers.clear();
490 deserialize_buffers.clear();
491
492 // Merge one variable's worth of data
493 mergeSets();
494
495 // Now we need to serialize again to send to the primary (only the processors who did work)
496 serialize(send_buffers[0]);
497
498 // Free up as much memory as possible here before we do global communication
500
505 merge_comm.gather_packed_range(0,
506 (void *)(nullptr),
507 send_buffers.begin(),
508 send_buffers.end(),
509 std::back_inserter(recv_buffers));
510
511 if (_is_primary)
512 {
513 // The root process now needs to deserialize all of the data
514 deserialize(recv_buffers);
515
516 send_buffers[0].clear();
517 recv_buffers.clear();
518
519 consolidateMergedFeatures(&tmp_data);
520 }
521 else
522 // Restore our original data on non-zero ranks
523 tmp_data.swap(_partial_feature_sets);
524 }
525 }
526
527 // Serialized merging (primary does all the work)
528 else
529 {
530 if (_is_primary)
531 recv_buffers.reserve(_app.n_processors());
532
533 serialize(send_buffers[0]);
534
535 // Free up as much memory as possible here before we do global communication
537
543 (void *)(nullptr),
544 send_buffers.begin(),
545 send_buffers.end(),
546 std::back_inserter(recv_buffers));
547
548 if (_is_primary)
549 {
550 // The root process now needs to deserialize all of the data
551 deserialize(recv_buffers);
552 recv_buffers.clear();
553
554 mergeSets();
555
557 }
558 }
559
560 if (!_is_primary)
562
563 // Make sure that feature count is communicated to all ranks
565}
virtual void clearDataStructures()
Helper routine for clearing up data structures during initialize and prior to parallel communication.
virtual void prepareDataForTransfer()
This routine uses the local flooded data to build up the local feature data structures (_partial feat...
virtual void mergeSets()
This routine is called on the primary rank only and stitches together the partial feature pieces seen...
unsigned int _feature_count
The number of features seen by this object (same as summing _feature_counts_per_map)
void serialize(std::string &serialized_buffer, unsigned int var_num=invalid_id)
This routines packs the _partial_feature_sets data into a structure suitable for parallel communicati...
virtual processor_id_type numberOfDistributedMergeHelpers() const
Returns a number indicating the number of merge helpers when running in parallel based on certain imp...
void deserialize(std::vector< std::string > &serialized_buffers, unsigned int var_num=invalid_id)
This routine takes the vector of byte buffers (one for each processor), deserializes them into a seri...
std::vector< std::list< FeatureData > > _partial_feature_sets
The data structure used to hold partial and communicated feature data, during the discovery and mergi...
virtual void restoreOriginalDataStructures(std::vector< std::list< FeatureData > > &)
virtual void consolidateMergedFeatures(std::vector< std::list< FeatureData > > *saved_data=nullptr)
This method consolidates all of the merged information from _partial_feature_sets into the _feature_s...
void split(int color, int key, Communicator &target) const
void gather_packed_range(const unsigned int root_id, Context *context, Iter range_begin, const Iter range_end, OutputIter out, std::size_t approx_buffer_size=1000000) const
processor_id_type processor_id() const
processor_id_type n_processors() const

Referenced by FeatureFloodCount::finalize(), and GrainTracker::finalize().

◆ communicateHaloMap()

void GrainTracker::communicateHaloMap ( )
protectedinherited

Finally remove halo markings from interior regions. This step is necessary because we expand halos before we do communication but that expansion can and will likely go into the interior of the grain (from a single processor's perspective). We could expand halos after merging, but that would likely be less scalable.

Definition at line 1623 of file GrainTracker.C.

1624{
1626 {
1627 // rank var_index entity_id
1628 std::vector<std::pair<std::size_t, dof_id_type>> halo_ids_all;
1629
1630 std::vector<int> counts;
1631 std::vector<std::pair<std::size_t, dof_id_type>> local_halo_ids;
1632 std::size_t counter = 0;
1633
1634 const bool isDistributedMesh = _mesh.isDistributedMesh();
1635
1636 if (_is_primary)
1637 {
1638 std::vector<std::vector<std::pair<std::size_t, dof_id_type>>> root_halo_ids(_n_procs);
1639 counts.resize(_n_procs);
1640
1641 // Loop over the _halo_ids "field" and build minimal lists for all of the other ranks
1642 for (const auto var_index : index_range(_halo_ids))
1643 {
1644 for (const auto & entity_pair : _halo_ids[var_index])
1645 {
1646 auto entity_id = entity_pair.first;
1647 if (isDistributedMesh)
1648 {
1649 // Check to see which contiguous range this entity ID falls into
1650 auto range_it =
1651 std::lower_bound(_all_ranges.begin(),
1652 _all_ranges.end(),
1653 entity_id,
1654 [](const std::pair<dof_id_type, dof_id_type> range,
1655 dof_id_type entity_id) { return range.second < entity_id; });
1656
1657 mooseAssert(range_it != _all_ranges.end(), "No range round?");
1658
1659 // Recover the index from the iterator
1660 auto proc_id = std::distance(_all_ranges.begin(), range_it);
1661
1662 // Now add this halo entity to the map for the corresponding proc to scatter latter
1663 root_halo_ids[proc_id].push_back(std::make_pair(var_index, entity_id));
1664 }
1665 else
1666 {
1667 DofObject * halo_entity;
1668 if (_is_elemental)
1669 halo_entity = _mesh.queryElemPtr(entity_id);
1670 else
1671 halo_entity = _mesh.queryNodePtr(entity_id);
1672
1673 if (halo_entity)
1674 root_halo_ids[halo_entity->processor_id()].push_back(
1675 std::make_pair(var_index, entity_id));
1676 }
1677 }
1678 }
1679
1680 // Build up the counts vector for MPI scatter
1681 for (const auto & vector_ref : root_halo_ids)
1682 {
1683 std::copy(vector_ref.begin(), vector_ref.end(), std::back_inserter(halo_ids_all));
1684 counts[counter] = vector_ref.size();
1685 counter++;
1686 }
1687 }
1688
1689 _communicator.scatter(halo_ids_all, counts, local_halo_ids);
1690
1691 // Now add the contributions from the root process to the processor local maps
1692 for (const auto & halo_pair : local_halo_ids)
1693 _halo_ids[halo_pair.first].emplace(std::make_pair(halo_pair.second, halo_pair.first));
1694
1701 for (const auto & grain : _feature_sets)
1702 for (auto local_id : grain._local_ids)
1703 _halo_ids[grain._var_index].erase(local_id);
1704 }
1705}
std::vector< std::map< dof_id_type, int > > _halo_ids
The data structure for looking up halos around features.
const bool _compute_halo_maps
Indicates whether or not to communicate halo map information with all ranks.
std::vector< std::pair< dof_id_type, dof_id_type > > _all_ranges
Data structure to hold element ID ranges when using Distributed Mesh (populated on rank 0 only)
virtual bool isDistributedMesh() const
virtual Elem * queryElemPtr(const dof_id_type i)
virtual const Node * queryNodePtr(const dof_id_type i) const
void scatter(const std::vector< T, A > &data, T &recv, const unsigned int root_id=0) const

Referenced by GrainTracker::updateFieldInfo().

◆ compareValueWithThreshold()

bool FeatureFloodCount::compareValueWithThreshold ( Real  entity_value,
Real  threshold 
) const
protectedinherited

This method is used to determine whether the current entity value is part of a feature or not.

Comparisons can either be greater than or less than the threshold which is controlled via input parameter.

Definition at line 1453 of file FeatureFloodCount.C.

1454{
1455 return ((_use_less_than_threshold_comparison && (entity_value >= threshold)) ||
1456 (!_use_less_than_threshold_comparison && (entity_value <= threshold)));
1457}
const bool _use_less_than_threshold_comparison
Use less-than when comparing values against the threshold value.

Referenced by FeatureFloodCount::isNewFeatureOrConnectedRegion().

◆ computeMinDistancesFromGrain()

void GrainTracker::computeMinDistancesFromGrain ( FeatureData grain,
std::vector< std::list< GrainDistance > > &  min_distances 
)
protectedinherited

Populates and sorts a min_distances vector with the minimum distances to all grains in the simulation for a given grain.

There are _vars.size() entries in the outer vector, one for each order parameter. A list of grains with the same OP are ordered in lists per OP.

In the diagram below assume we have 4 order parameters. The grain with the asterisk needs to be remapped. All order parameters are used in neighboring grains. For all "touching" grains, the value of the corresponding entry in min_distances will be a negative integer representing the number of immediate neighbors with that order parameter.

Note: Only the first member of the pair (the distance) is shown in the array below. e.g. [-2.0, -max, -1.0, -2.0]

After sorting, variable index 2 (value: -1.0) be at the end of the array and will be the first variable we attempt to renumber the current grain to.

   __       ___
     \  0  /   \
   2  \___/  1  \___
      /   \     /   \
   __/  1  \___/  2  \
     \  *  /   \     /
   3  \___/  3  \___/
      /   \     /
   __/  0  \___/

See if we have any completely open OPs (excluding reserve order parameters) or the order parameter corresponding to this grain, we need to put them in the list or the grain tracker won't realize that those vars are available for remapping.

Definition at line 1177 of file GrainTracker.C.

1179{
1203 for (const auto i : index_range(_feature_sets))
1204 {
1205 auto & other_grain = _feature_sets[i];
1206
1207 if (other_grain._var_index == grain._var_index || other_grain._var_index >= _reserve_op_index)
1208 continue;
1209
1210 auto target_var_index = other_grain._var_index;
1211 auto target_grain_index = i;
1212 auto target_grain_id = other_grain._id;
1213
1214 Real curr_bbox_diff = boundingRegionDistance(grain._bboxes, other_grain._bboxes);
1215
1216 GrainDistance grain_distance_obj(
1217 curr_bbox_diff, target_var_index, target_grain_index, target_grain_id);
1218
1219 // To handle touching halos we penalize the top pick each time we see another
1220 if (curr_bbox_diff == -1.0 && !min_distances[target_var_index].empty())
1221 {
1222 Real last_distance = min_distances[target_var_index].begin()->_distance;
1223 if (last_distance < 0)
1224 grain_distance_obj._distance += last_distance;
1225 }
1226
1227 // Insertion sort into a list
1228 auto insert_it = min_distances[target_var_index].begin();
1229 while (insert_it != min_distances[target_var_index].end() && !(grain_distance_obj < *insert_it))
1230 ++insert_it;
1231 min_distances[target_var_index].insert(insert_it, grain_distance_obj);
1232 }
1233
1239 for (const auto var_index : make_range(_reserve_op_index))
1240 {
1241 // Don't put an entry in for matching variable indices (i.e. we can't remap to ourselves)
1242 if (grain._var_index == var_index)
1243 continue;
1244
1245 if (min_distances[var_index].empty())
1246 min_distances[var_index].emplace_front(std::numeric_limits<Real>::max(), var_index);
1247 }
1248}
Real boundingRegionDistance(std::vector< BoundingBox > &bboxes1, std::vector< BoundingBox > &bboxes2) const
This method returns the minimum periodic distance between two vectors of bounding boxes.
const std::size_t _reserve_op_index
The cutoff index where if variable index >= this number, no remapping TO that variable will occur.
This struct is used to hold distance information to other grains in the simulation.

Referenced by GrainTracker::attemptGrainRenumber().

◆ consolidateMergedFeatures()

void FeatureFloodCount::consolidateMergedFeatures ( std::vector< std::list< FeatureData > > *  saved_data = nullptr)
protectedvirtualinherited

This method consolidates all of the merged information from _partial_feature_sets into the _feature_sets vectors.

Now that the merges are complete we need to adjust the centroid, and halos. Additionally, To make several of the sorting and tracking algorithms more straightforward, we will move the features into a flat vector. Finally we can count the final number of features and find the max local index seen on any processor

Note: This is all occurring on rank 0 only!

IMPORTANT: FeatureFloodCount::_feature_count is set on rank 0 at this point but we can't broadcast it here because this routine is not collective.

Definition at line 1193 of file FeatureFloodCount.C.

1194{
1195 TIME_SECTION("consolidateMergedFeatures", 3, "Consolidating Merged Features");
1196
1205 mooseAssert(_is_primary,
1206 "cosolidateMergedFeatures() may only be called on the primary processor");
1207 mooseAssert(saved_data == nullptr || saved_data->size() == _partial_feature_sets.size(),
1208 "Data structure size mismatch");
1209
1210 // Offset where the current set of features with the same variable id starts in the flat vector
1211 unsigned int feature_offset = 0;
1212 // Set the member feature count to zero and start counting the actual features
1213 _feature_count = 0;
1214 for (const auto map_num : index_range(_partial_feature_sets))
1215 {
1216 for (auto & feature : _partial_feature_sets[map_num])
1217 {
1218 if (saved_data)
1219 {
1220 for (auto it = (*saved_data)[map_num].begin(); it != (*saved_data)[map_num].end();
1221 /* no increment */)
1222 {
1223 if (feature.canConsolidate(*it))
1224 {
1225 feature.consolidate(std::move(*it));
1226 it = (*saved_data)[map_num].erase(it); // increment
1227 }
1228 else
1229 ++it;
1230 }
1231 }
1232
1233 // If after merging we still have an inactive feature, discard it
1234 if (feature._status == Status::CLEAR)
1235 {
1236 // First we need to calculate the centroid now that we are doing merging all partial
1237 // features
1238 if (feature._vol_count != 0)
1239 feature._centroid /= feature._vol_count;
1240
1241 _feature_sets.emplace_back(std::move(feature));
1243 }
1244 }
1245
1246 // Record the feature numbers just for the current map
1247 _feature_counts_per_map[map_num] = _feature_count - feature_offset;
1248
1249 // Now update the running feature count so we can calculate the next map's contribution
1250 feature_offset = _feature_count;
1251
1252 // Clean up the "moved" objects
1253 _partial_feature_sets[map_num].clear();
1254 if (saved_data)
1255 (*saved_data)[map_num].clear();
1256 }
1257
1258 // We may have resided our data structures for the communicateAndMerge step. We'll restore the
1259 // original size here just in case we need to loop over the assumed size (i.e. _maps_size)
1260 // elsewhere in this or derived objects.
1261 if (_partial_feature_sets.size() != _maps_size)
1262 {
1264
1267 }
1268
1273}
std::vector< unsigned int > _feature_counts_per_map
The number of features seen by this object per map.
const std::size_t _maps_size
Convenience variable holding the size of all the datastructures size by the number of maps.

Referenced by FeatureFloodCount::communicateAndMerge().

◆ contains() [1/2]

template<class T >
static bool FeatureFloodCount::contains ( std::set< T > &  container,
const T item 
)
inlinestaticprivateinherited

Definition at line 744 of file FeatureFloodCount.h.

745 {
746 return container.find(item) != container.end();
747 }

Referenced by FeatureFloodCount::visitNeighborsHelper().

◆ contains() [2/2]

template<class T >
static bool FeatureFloodCount::contains ( std::vector< T > &  container,
const T item 
)
inlinestaticprivateinherited

Definition at line 750 of file FeatureFloodCount.h.

751 {
752 for (const auto & cont_item : container)
753 if (item == cont_item)
754 return true;
755 return false;
756 }
if(subdm)

◆ deserialize()

void FeatureFloodCount::deserialize ( std::vector< std::string > &  serialized_buffers,
unsigned int  var_num = invalid_id 
)
protectedinherited

This routine takes the vector of byte buffers (one for each processor), deserializes them into a series of FeatureSet objects, and appends them to the _feature_sets data structure.

Note: It is assumed that local processor information may already be stored in the _feature_sets data structure so it is not cleared before insertion.

Usually we have the local processor data already in the _partial_feature_sets data structure. However, if we are doing distributed merge work, we also need to preserve all of the original data for use in later stages of the algorithm so it'll have been swapped out with clean buffers. This leaves us a choice, either we just duplicate the Features from the original data structure after we've swapped out the buffer, or we go ahead and unpack data that we would normally already have. So during distributed merging, that's exactly what we'll do. Later however when the primary is doing the final consolidating, we'll opt to just skip the local unpacking. To tell the difference, between these two modes, we just need to see if a var_num was passed in.

Definition at line 1103 of file FeatureFloodCount.C.

1104{
1105 // The input string stream used for deserialization
1106 std::istringstream iss;
1107
1108 auto rank = processor_id();
1109
1110 for (const auto proc_id : index_range(serialized_buffers))
1111 {
1123 if (var_num == invalid_id && proc_id == rank)
1124 continue;
1125
1126 iss.str(serialized_buffers[proc_id]); // populate the stream with a new buffer
1127 iss.clear(); // reset the string stream state
1128
1129 // Load the gathered data into the data structure.
1130 if (var_num == invalid_id)
1131 dataLoad(iss, _partial_feature_sets, this);
1132 else
1133 dataLoad(iss, _partial_feature_sets[var_num], this);
1134 }
1135}
void dataLoad(std::istream &stream, FeatureFloodCount::FeatureData &feature, void *context)

Referenced by FeatureFloodCount::communicateAndMerge().

◆ doesFeatureIntersectBoundary()

bool GrainTracker::doesFeatureIntersectBoundary ( unsigned int  feature_id) const
overridevirtualinherited

Returns a Boolean indicating whether this feature intersects any boundary.

Reimplemented from FeatureFloodCount.

Definition at line 174 of file GrainTracker.C.

175{
176 // TODO: This data structure may need to be turned into a Multimap
177 mooseAssert(feature_id < _feature_id_to_local_index.size(), "Grain ID out of bounds");
178
179 auto feature_index = _feature_id_to_local_index[feature_id];
180 if (feature_index != invalid_size_t)
181 {
182 mooseAssert(feature_index < _feature_sets.size(), "Grain index out of bounds");
183 return _feature_sets[feature_index]._boundary_intersection != BoundaryIntersection::NONE;
184 }
185
186 return false;
187}

◆ doesFeatureIntersectSpecifiedBoundary()

bool GrainTracker::doesFeatureIntersectSpecifiedBoundary ( unsigned int  feature_id) const
overridevirtualinherited

Returns a Boolean indicating whether this feature intersects boundaries in a user-supplied list.

Reimplemented from FeatureFloodCount.

Definition at line 190 of file GrainTracker.C.

191{
192 // TODO: This data structure may need to be turned into a Multimap
193 mooseAssert(feature_id < _feature_id_to_local_index.size(), "Grain ID out of bounds");
194
195 auto feature_index = _feature_id_to_local_index[feature_id];
196 if (feature_index != invalid_size_t)
197 {
198 mooseAssert(feature_index < _feature_sets.size(), "Grain index out of bounds");
199 return ((_feature_sets[feature_index]._boundary_intersection &
201 }
202
203 return false;
204}

◆ execute()

void GrainTracker::execute ( )
overridevirtualinherited

Reimplemented from FeatureFloodCount.

Definition at line 272 of file GrainTracker.C.

273{
274 // Don't track grains if the current simulation step is before the specified tracking step
276 return;
277
279 return;
280
282}
virtual void execute() override
const PolycrystalUserObjectBase *const _poly_ic_uo
An optional IC UserObject which can provide initial data structures to this object.
const int _tracking_step
The timestep to begin tracking grains.

◆ expandEdgeHalos()

void FeatureFloodCount::expandEdgeHalos ( unsigned int  num_layers_to_expand)
protectedinherited

This method expands the existing halo set by some width determined by the passed in value.

This method does NOT mask off any local IDs.

Create a copy of the halo set so that as we insert new ids into the set we don't continue to iterate on those new ids.

We have to handle disjoint halo IDs slightly differently. Once you are disjoint, you can't go back so make sure that we keep placing these IDs in the disjoint set.

Definition at line 1562 of file FeatureFloodCount.C.

1563{
1564 if (num_layers_to_expand == 0)
1565 return;
1566
1567 TIME_SECTION("expandEdgeHalos", 3, "Expanding Edge Halos");
1568
1569 for (auto & list_ref : _partial_feature_sets)
1570 {
1571 for (auto & feature : list_ref)
1572 {
1573 for (unsigned short halo_level = 0; halo_level < num_layers_to_expand; ++halo_level)
1574 {
1579 FeatureData::container_type orig_halo_ids(feature._halo_ids);
1580 for (auto entity : orig_halo_ids)
1581 {
1582 if (_is_elemental)
1584 &feature,
1585 /*expand_halos_only =*/true,
1586 /*disjoint_only =*/false);
1587 else
1589 &feature,
1590 /*expand_halos_only =*/true);
1591 }
1592
1597 FeatureData::container_type disjoint_orig_halo_ids(feature._disjoint_halo_ids);
1598 for (auto entity : disjoint_orig_halo_ids)
1599 {
1600 if (_is_elemental)
1602
1603 &feature,
1604 /*expand_halos_only =*/true,
1605 /*disjoint_only =*/true);
1606 else
1608
1609 &feature,
1610 /*expand_halos_only =*/true);
1611 }
1612 }
1613 }
1614 }
1615}
std::vector< dof_id_type > container_type
The primary underlying container type used to hold the data in each FeatureData.
void visitNodalNeighbors(const Node *node, FeatureData *feature, bool expand_halos_only)
These two routines are utility routines used by the flood routine and by derived classes for visiting...
void visitElementalNeighbors(const Elem *elem, FeatureData *feature, bool expand_halos_only, bool disjoint_only)
virtual const Node * nodePtr(const dof_id_type i) const

Referenced by GrainTracker::finalize(), and PolycrystalUserObjectBase::finalize().

◆ expandPointHalos()

void FeatureFloodCount::expandPointHalos ( )
protectedinherited

This method takes all of the partial features and expands the local, ghosted, and halo sets around those regions to account for the diffuse interface.

Rather than using any kind of recursion here, we simply expand the region by all "point" neighbors from the actual grain cells since all point neighbors will contain contributions to the region.

To expand the feature element region to the actual flooded region (nodal basis) we need to add in all point neighbors of the current local region for each feature. This is because the elemental variable influence spreads from the elemental data out exactly one element from every mesh point.

Definition at line 1500 of file FeatureFloodCount.C.

1501{
1502 const auto & node_to_elem_map = _mesh.nodeToElemMap();
1503 FeatureData::container_type expanded_local_ids;
1504 auto my_processor_id = processor_id();
1505
1512 for (auto & list_ref : _partial_feature_sets)
1513 {
1514 for (auto & feature : list_ref)
1515 {
1516 expanded_local_ids.clear();
1517
1518 for (auto entity : feature._local_ids)
1519 {
1520 const Elem * elem = _mesh.elemPtr(entity);
1521 mooseAssert(elem, "elem pointer is NULL");
1522
1523 // Get the nodes on a current element so that we can add in point neighbors
1524 auto n_nodes = elem->n_vertices();
1525 for (const auto i : make_range(n_nodes))
1526 {
1527 const Node * current_node = elem->node_ptr(i);
1528
1529 auto elem_vector_it = node_to_elem_map.find(current_node->id());
1530 if (elem_vector_it == node_to_elem_map.end())
1531 mooseError("Error in node to elem map");
1532
1533 const auto & elem_vector = elem_vector_it->second;
1534
1535 std::copy(elem_vector.begin(),
1536 elem_vector.end(),
1537 std::insert_iterator<FeatureData::container_type>(expanded_local_ids,
1538 expanded_local_ids.end()));
1539
1540 // Now see which elements need to go into the ghosted set
1541 for (auto entity : elem_vector)
1542 {
1543 const Elem * neighbor = _mesh.elemPtr(entity);
1544 mooseAssert(neighbor, "neighbor pointer is NULL");
1545
1546 if (neighbor->processor_id() != my_processor_id)
1547 feature._ghosted_ids.insert(feature._ghosted_ids.end(), elem->id());
1548 }
1549 }
1550 }
1551
1552 // Replace the existing local ids with the expanded local ids
1553 feature._local_ids.swap(expanded_local_ids);
1554
1555 // Copy the expanded local_ids into the halo_ids container
1556 feature._halo_ids = feature._local_ids;
1557 }
1558 }
1559}
void mooseError(Args &&... args) const
const std::unordered_map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap()

◆ featureCentroid()

Point FeatureFloodCount::featureCentroid ( unsigned int  feature_id) const
virtualinherited

Returns the centroid of the designated feature (only supported without periodic boundaries)

Definition at line 909 of file FeatureFloodCount.C.

910{
911 if (feature_id >= _feature_id_to_local_index.size())
912 return invalid_id;
913
914 auto local_index = _feature_id_to_local_index[feature_id];
915
916 Real invalid_coord = std::numeric_limits<Real>::max();
917 Point p(invalid_coord, invalid_coord, invalid_coord);
918 if (local_index != invalid_size_t)
919 {
920 mooseAssert(local_index < _feature_sets.size(), "local_index out of bounds");
921 p = _feature_sets[local_index]._centroid;
922 }
923 return p;
924}
const Real p

Referenced by FeatureVolumeVectorPostprocessor::execute().

◆ finalize()

void GrainTracker::finalize ( )
overridevirtualinherited

Assign or Track Grains

Broadcast essential data

Remap Grains

Reimplemented from FeatureFloodCount.

Definition at line 329 of file GrainTracker.C.

330{
331 // Don't track grains if the current simulation step is before the specified tracking step
333 return;
334
335 TIME_SECTION("finalize", 3, "Finalizing GrainTracker");
336
337 // Expand the depth of the halos around all grains
338 auto num_halo_layers = _halo_level >= 1
339 ? _halo_level - 1
340 : 0; // The first level of halos already exists so subtract one
341
344 else
345 {
346 expandEdgeHalos(num_halo_layers);
347
348 // Build up the grain map on the root processor
350 }
351
355 if (_first_time)
356 assignGrains();
357 else
358 trackGrains();
359
360 if (_verbosity_level > 1)
361 _console << "Finished inside of trackGrains" << std::endl;
362
367
371 if (_remap)
372 remapGrains();
373
375 if (_verbosity_level > 1)
376 _console << "Finished inside of updateFieldInfo" << std::endl;
377
378 // Set the first time flag false here (after all methods of finalize() have completed)
379 _first_time = false;
380
381 // TODO: Release non essential memory
382 if (_verbosity_level > 0)
383 _console << "Finished inside of GrainTracker\n" << std::endl;
384}
void communicateAndMerge()
This routine handles all of the serialization, communication and deserialization of the data structur...
void expandEdgeHalos(unsigned int num_layers_to_expand)
This method expands the existing halo set by some width determined by the passed in value.
void remapGrains()
This method is called after trackGrains to remap grains that are too close to each other.
virtual void updateFieldInfo() override
This method is used to populate any of the data structures used for storing field data (nodal or elem...
void assignGrains()
When the tracking phase starts (_t_step == _tracking_step) it assigns a unique id to every FeatureDat...
void prepopulateState(const FeatureFloodCount &ffc_object)
This method extracts the necessary state from the passed in object necessary to continue tracking gra...
const bool _remap
Inidicates whether remapping should be done or not (remapping is independent of tracking)
void trackGrains()
On subsequent time_steps, incoming FeatureData objects are compared to previous time_step information...
void broadcastAndUpdateGrainData()
Broadcast essential Grain information to all processors.
const unsigned short _halo_level
The thickness of the halo surrounding each grain.

◆ flood()

bool FeatureFloodCount::flood ( const DofObject *  dof_object,
std::size_t  current_index 
)
protectedinherited

This method will check if the current entity is above the supplied threshold and "mark" it.

It will then inspect neighboring entities that are above the connecting threshold and add them to the current feature.

Returns
Boolean indicating whether a new feature was found while exploring the current entity.

If we reach this point (i.e. we haven't continued to the next queue entry), we've found a new mesh entity that's part of a feature. We need to mark the entity as visited at this point (and not before!) to avoid infinite recursion. If you mark the node too early you risk not coloring in a whole feature any time a "connecting threshold" is used since we may have already visited this entity earlier but it was in-between two thresholds.

See if this particular entity cell contributes to the centroid calculation. We only deal with elemental floods and only count it if it's owned by the current processor to avoid skewing the result.

Definition at line 1327 of file FeatureFloodCount.C.

1329{
1330 // if (dof_object == nullptr || dof_object == libMesh::remote_elem)
1331 // return false;
1332 mooseAssert(dof_object, "DOF object is nullptr");
1333 mooseAssert(_entity_queue.empty(), "Entity queue is not empty when starting a feature");
1334
1335 // Kick off the exploration of a new feature
1336 _entity_queue.push_front(dof_object);
1337
1338 bool return_value = false;
1339 FeatureData * feature = nullptr;
1340 while (!_entity_queue.empty())
1341 {
1342 const DofObject * curr_dof_object = _entity_queue.back();
1343 const Elem * elem = _is_elemental ? static_cast<const Elem *>(curr_dof_object) : nullptr;
1344 _entity_queue.pop_back();
1345
1346 // Retrieve the id of the current entity
1347 auto entity_id = curr_dof_object->id();
1348
1349 // Has this entity already been marked? - if so move along
1350 if (current_index != invalid_size_t &&
1351 _entities_visited[current_index].find(entity_id) != _entities_visited[current_index].end())
1352 continue;
1353
1354 // Are we outside of the range we should be working in?
1355 if (_is_elemental && !_dof_map.is_evaluable(*elem))
1356 continue;
1357
1358 // See if the current entity either starts a new feature or continues an existing feature
1359 auto new_id = invalid_id; // Writable reference to hold an optional id;
1360 Status status =
1361 Status::INACTIVE; // Status is inactive until we find an entity above the starting threshold
1362
1363 // Make sure that the Assembly object has the right element and subdomain information set
1364 // since we are moving through the mesh in a manual fashion.
1365 if (_is_elemental)
1367
1368 if (!isNewFeatureOrConnectedRegion(curr_dof_object, current_index, feature, status, new_id))
1369 {
1370 // If we have an active feature, we just found a halo entity
1371 if (feature)
1372 feature->_halo_ids.insert(feature->_halo_ids.end(), entity_id);
1373 continue;
1374 }
1375
1376 mooseAssert(current_index != invalid_size_t, "current_index is invalid");
1377
1386 return_value = true;
1387 _entities_visited[current_index].insert(entity_id);
1388
1389 auto map_num = _single_map_mode ? decltype(current_index)(0) : current_index;
1390
1391 // New Feature (we need to create it and add it to our data structure)
1392 if (!feature)
1393 {
1394 _partial_feature_sets[map_num].emplace_back(
1395 current_index, _feature_count++, processor_id(), status);
1396
1397 // Get a handle to the feature we will update (always the last feature in the data structure)
1398 feature = &_partial_feature_sets[map_num].back();
1399
1400 // If new_id is valid, we'll set it in the feature here.
1401 if (new_id != invalid_id)
1402 feature->_id = new_id;
1403 }
1404
1405 // Insert the current entity into the local ids data structure
1406 feature->_local_ids.insert(feature->_local_ids.end(), entity_id);
1407
1413 if (_is_elemental && processor_id() == curr_dof_object->processor_id())
1414 {
1415 // Keep track of how many elements participate in the centroid averaging
1416 feature->_vol_count++;
1417
1418 // Sum the centroid values for now, we'll average them later
1419 feature->_centroid += elem->vertex_average();
1420
1421 // // Does the volume intersect the boundary?
1422 // if (_all_boundary_entity_ids.find(elem->id()) != _all_boundary_entity_ids.end())
1423 // feature->_intersects_boundary = true;
1424 }
1425
1426 if (_is_elemental)
1428 feature,
1429 /*expand_halos_only =*/false,
1430 /*disjoint_only =*/false);
1431 else
1432 visitNodalNeighbors(static_cast<const Node *>(curr_dof_object),
1433 feature,
1434 /*expand_halos_only =*/false);
1435 }
1436
1437 return return_value;
1438}
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
std::vector< std::set< dof_id_type > > _entities_visited
This variable keeps track of which nodes have been visited during execution.
std::deque< const DofObject * > _entity_queue
The data structure for maintaining entities to flood during discovery.
const DofMap & _dof_map
Reference to the dof_map containing the coupled variables.
virtual bool isNewFeatureOrConnectedRegion(const DofObject *dof_object, std::size_t &current_index, FeatureData *&feature, Status &status, unsigned int &new_id)
Method called during the recursive flood routine that should return whether or not the current entity...
const bool _single_map_mode
This variable is used to indicate whether or not multiple maps are used during flooding.
FEProblemBase & _fe_problem
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
MPI_Status status

Referenced by FeatureFloodCount::execute(), and PolycrystalUserObjectBase::execute().

◆ getConnectingThreshold()

Real FeatureFloodCount::getConnectingThreshold ( std::size_t  current_index) const
protectedvirtualinherited

Return the "connecting" comparison threshold to use when inspecting an entity during the flood stage.

Definition at line 1447 of file FeatureFloodCount.C.

1448{
1450}

Referenced by FeatureFloodCount::isNewFeatureOrConnectedRegion().

◆ getCoupledVars()

const std::vector< MooseVariable * > & FeatureFloodCount::getCoupledVars ( ) const
inlineinherited

Returns a const vector to the coupled variable pointers.

Definition at line 97 of file FeatureFloodCount.h.

97{ return _vars; }

Referenced by AverageGrainVolume::AverageGrainVolume(), and FeatureVolumeVectorPostprocessor::FeatureVolumeVectorPostprocessor().

◆ getData()

template<typename T >
const T & GrainDataTracker< T >::getData ( unsigned int  grain_id) const

return data for selected grain

Definition at line 45 of file GrainDataTracker.h.

46{
47 mooseAssert(grain_id < _grain_data.size(), "Requested data for invalid grain index.");
48 return _grain_data[grain_id];
49}

Referenced by ComputePolycrystalElasticityTensor::computeQpElasticityTensor().

◆ getEntityValue()

Real GrainTracker::getEntityValue ( dof_id_type  node_id,
FieldType  field_type,
std::size_t  var_index = 0 
) const
overridevirtualinherited

Reimplemented from FeatureFloodCount.

Definition at line 119 of file GrainTracker.C.

122{
124 return 0;
125
126 return FeatureFloodCount::getEntityValue(entity_id, field_type, var_index);
127}
virtual Real getEntityValue(dof_id_type entity_id, FieldType field_type, std::size_t var_index=0) const

Referenced by OutputEulerAngles::precalculateValue().

◆ getFeatures()

const std::vector< FeatureData > & FeatureFloodCount::getFeatures ( ) const
inlineinherited

Return a constant reference to the vector of all discovered features.

Definition at line 328 of file FeatureFloodCount.h.

328{ return _feature_sets; }

Referenced by GrainTracker::prepopulateState().

◆ getFeatureVar()

unsigned int GrainTracker::getFeatureVar ( unsigned int  feature_id) const
overridevirtualinherited

Returns the variable representing the passed in feature.

Reimplemented from FeatureFloodCount.

Definition at line 136 of file GrainTracker.C.

137{
138 return FeatureFloodCount::getFeatureVar(feature_id);
139}
virtual unsigned int getFeatureVar(unsigned int feature_id) const
Returns the variable representing the passed in feature.

◆ getFECoupledVars()

const std::vector< MooseVariableFEBase * > & FeatureFloodCount::getFECoupledVars ( ) const
inlineinherited

Returns a const vector to the coupled MooseVariableFEBase pointers.

Definition at line 100 of file FeatureFloodCount.h.

100{ return _fe_vars; }

Referenced by AverageGrainVolume::AverageGrainVolume().

◆ getGrainCentroid()

Point GrainTracker::getGrainCentroid ( unsigned int  grain_id) const
overridevirtualinherited

Returns the centroid for the given grain number.

Implements GrainTrackerInterface.

Definition at line 156 of file GrainTracker.C.

157{
158 mooseAssert(grain_id < _feature_id_to_local_index.size(), "Grain ID out of bounds");
159 auto grain_index = _feature_id_to_local_index[grain_id];
160
161 if (grain_index != invalid_size_t)
162 {
163 mooseAssert(_feature_id_to_local_index[grain_id] < _feature_sets.size(),
164 "Grain index out of bounds");
165 // Note: This value is parallel consistent, see GrainTracker::broadcastAndUpdateGrainData()
166 return _feature_sets[_feature_id_to_local_index[grain_id]]._centroid;
167 }
168
169 // Inactive grain
170 return Point();
171}

◆ getNewGrainIDs()

std::vector< unsigned int > GrainTracker::getNewGrainIDs ( ) const
overridevirtualinherited

This method returns all of the new ids generated in an invocation of the GrainTracker.

Reimplemented from GrainTrackerInterface.

Definition at line 897 of file GrainTracker.C.

898{
899 std::vector<unsigned int> new_ids(_max_curr_grain_id - _old_max_grain_id);
900 auto new_id = _old_max_grain_id + 1;
901
902 // Generate the new ids
903 std::iota(new_ids.begin(), new_ids.end(), new_id);
904
905 return new_ids;
906}
unsigned int _old_max_grain_id
The previous max grain id (needed to figure out which ids are new in a given step)

◆ getNextUniqueID()

unsigned int GrainTracker::getNextUniqueID ( )
protectedinherited

Retrieve the next unique grain number if a new grain is detected during trackGrains.

This method handles reserve order parameter indices properly. Direct access to the next index should be avoided.

Get the next unique grain ID but make sure to respect reserve ids. Note, that the first valid ID for a new grain is _reserve_grain_first_index + _n_reserve_ops because _reserve_grain_first_index IS a valid index. It does not point to the last valid index of the non-reserved grains.

Definition at line 1786 of file GrainTracker.C.

1787{
1796 _reserve_grain_first_index + _n_reserve_ops /* no +1 here!*/);
1797
1798 return _max_curr_grain_id;
1799}
const unsigned short _n_reserve_ops
The number of reserved order parameters.

Referenced by GrainTracker::trackGrains().

◆ getNumberActiveFeatures()

std::size_t FeatureFloodCount::getNumberActiveFeatures ( ) const
inherited

Return the number of active features.

Definition at line 806 of file FeatureFloodCount.C.

807{
808 // Note: This value is parallel consistent, see FeatureFloodCount::communicateAndMerge()
809 return _feature_count;
810}

Referenced by AverageGrainVolume::getValue().

◆ getNumberActiveGrains()

std::size_t GrainTracker::getNumberActiveGrains ( ) const
overridevirtualinherited

Returns the number of active grains current stored in the GrainTracker.

This value is the same value reported when the GrainTracker (FeatureFloodObject) is used as a Postprocessor.

Note: This value will count each piece of a split grain (often encountered in EBSD data sets).

Implements GrainTrackerInterface.

Definition at line 142 of file GrainTracker.C.

143{
144 // Note: This value is parallel consistent, see FeatureFloodCount::communicateAndMerge()
145 return _feature_count;
146}

◆ getThreshold()

Real GrainTracker::getThreshold ( std::size_t  current_index) const
overrideprotectedvirtualinherited

Return the starting comparison threshold to use when inspecting an entity during the flood stage.

Reimplemented from FeatureFloodCount.

Definition at line 285 of file GrainTracker.C.

286{
287 // If we are inspecting a reserve op parameter, we need to make sure
288 // that there is an entity above the reserve_op threshold before
289 // starting the flood of the feature.
290 if (var_index >= _reserve_op_index)
292 else
293 return _step_threshold;
294}
const Real _reserve_op_threshold
The threshold above (or below) where a grain may be found on a reserve op field.

◆ getTotalFeatureCount()

std::size_t GrainTracker::getTotalFeatureCount ( ) const
overridevirtualinherited

Returns the total feature count (active and inactive ids, useful for sizing vectors)

Since the FeatureFloodCount object doesn't maintain any information about features between invocations. The maximum id in use is simply the number of features.

Reimplemented from FeatureFloodCount.

Definition at line 149 of file GrainTracker.C.

150{
151 // Note: This value is parallel consistent, see assignGrains()/trackGrains()
153}

◆ getValue()

Real FeatureFloodCount::getValue ( ) const
overridevirtualinherited

Implements GeneralPostprocessor.

Reimplemented in FauxGrainTracker.

Definition at line 800 of file FeatureFloodCount.C.

801{
802 return static_cast<Real>(_feature_count);
803}

◆ getVarToFeatureVector()

const std::vector< unsigned int > & GrainTracker::getVarToFeatureVector ( dof_id_type  elem_id) const
overridevirtualinherited

Returns a list of active unique feature ids for a particular element.

The vector is indexed by variable number with each entry containing either an invalid size_t type (no feature active at that location) or a feature id if the variable is non-zero at that location.

Reimplemented from FeatureFloodCount.

Definition at line 130 of file GrainTracker.C.

131{
133}
virtual const std::vector< unsigned int > & getVarToFeatureVector(dof_id_type elem_id) const
Returns a list of active unique feature ids for a particular element.

Referenced by ComputePolycrystalElasticityTensor::computeQpElasticityTensor(), and ComputeGBMisorientationType::computeQpProperties().

◆ initialize()

void GrainTracker::initialize ( )
overridevirtualinherited

If we are passed the first time, we need to save the existing grains before beginning the tracking on the current step. We'll do that with a swap since the _feature_sets contents will be cleared anyway.

Reimplemented from FeatureFloodCount.

Definition at line 229 of file GrainTracker.C.

230{
231 // Don't track grains if the current simulation step is before the specified tracking step
233 return;
234
240 if (!_first_time)
242
244}
virtual void initialize() override
std::vector< FeatureData > _feature_sets_old
This data structure holds the map of unique grains from the previous time step.

◆ initialSetup()

void FeatureFloodCount::initialSetup ( )
overridevirtualinherited

Size the empty var to features vector to the number of coupled variables. This empty vector (but properly sized) vector is returned for elements that are queried but are not in the structure (which also shouldn't happen). The user is warned in this case but this helps avoid extra bounds checking in user code and avoids segfaults.

Reimplemented from GeneralPostprocessor.

Reimplemented in FauxPolycrystalVoronoi, and PolycrystalUserObjectBase.

Definition at line 263 of file FeatureFloodCount.C.

264{
265 // We need one map per coupled variable for normal runs to support overlapping features
266 _entities_visited.resize(_vars.size());
267
268 // Get a pointer to the PeriodicBoundaries buried in libMesh
270
271 meshChanged();
272
281}
virtual void meshChanged() override
libMesh::PeriodicBoundaries * _pbs
A pointer to the periodic boundary constraints object.
const std::size_t _n_vars
std::vector< unsigned int > _empty_var_to_features
virtual libMesh::DofMap & dofMap()
PeriodicBoundaries * get_periodic_boundaries()

Referenced by PolycrystalUserObjectBase::initialSetup().

◆ isBoundaryEntity()

template<typename T >
bool FeatureFloodCount::isBoundaryEntity ( const T entity) const
protectedinherited

Returns a Boolean indicating whether the entity is on one of the desired boundaries.

Definition at line 1860 of file FeatureFloodCount.C.

1861{
1862 mooseAssert(_bnd_elem_range, "Boundary Element Range is nullptr");
1863
1864 if (entity)
1865 for (const auto & belem : *_bnd_elem_range)
1866 // Only works for Elements
1867 if (belem->_elem->id() == entity->id() && hasBoundary(belem->_bnd_id))
1868 return true;
1869
1870 return false;
1871}
bool hasBoundary(const BoundaryName &name) const
ConstBndElemRange * _bnd_elem_range
Boundary element range pointer.

Referenced by FeatureFloodCount::visitNeighborsHelper().

◆ isElemental()

bool FeatureFloodCount::isElemental ( ) const
inlineinherited

Definition at line 117 of file FeatureFloodCount.h.

117{ return _is_elemental; }

Referenced by FeatureFloodCountAux::FeatureFloodCountAux().

◆ isFeaturePercolated()

bool GrainTracker::isFeaturePercolated ( unsigned int  feature_id) const
overridevirtualinherited

Returns a Boolean indicating whether this feature is percolated (e.g.

intersects at least two different boundaries from sets supplied by the user)

Reimplemented from FeatureFloodCount.

Definition at line 207 of file GrainTracker.C.

208{
209 // TODO: This data structure may need to be turned into a Multimap
210 mooseAssert(feature_id < _feature_id_to_local_index.size(), "Grain ID out of bounds");
211
212 auto feature_index = _feature_id_to_local_index[feature_id];
213 if (feature_index != invalid_size_t)
214 {
215 mooseAssert(feature_index < _feature_sets.size(), "Grain index out of bounds");
216 bool primary = ((_feature_sets[feature_index]._boundary_intersection &
219 bool secondary = ((_feature_sets[feature_index]._boundary_intersection &
222 return (primary && secondary);
223 }
224
225 return false;
226}

◆ isNewFeatureOrConnectedRegion()

bool FeatureFloodCount::isNewFeatureOrConnectedRegion ( const DofObject *  dof_object,
std::size_t &  current_index,
FeatureData *&  feature,
Status status,
unsigned int new_id 
)
protectedvirtualinherited

Method called during the recursive flood routine that should return whether or not the current entity is part of the current feature (if one is being explored), or if it's the start of a new feature.

If the value is only above the connecting threshold, it's still part of a feature but possibly part of one that we'll discard if there is never any starting threshold encountered.

Reimplemented in PolycrystalUserObjectBase.

Definition at line 1460 of file FeatureFloodCount.C.

1465{
1466 // Get the value of the current variable for the current entity
1467 Real entity_value;
1468 if (_is_elemental)
1469 {
1470 const Elem * elem = static_cast<const Elem *>(dof_object);
1471 std::vector<Point> centroid(1, elem->vertex_average());
1472 _subproblem.reinitElemPhys(elem, centroid, 0);
1473 entity_value = _vars[current_index]->sln()[0];
1474 }
1475 else
1476 entity_value = _vars[current_index]->getNodalValue(*static_cast<const Node *>(dof_object));
1477
1478 // If the value compares against our starting threshold, this is definitely part of a feature
1479 // we'll keep
1480 if (compareValueWithThreshold(entity_value, getThreshold(current_index)))
1481 {
1482 Status * status_ptr = &status;
1483
1484 if (feature)
1485 status_ptr = &feature->_status;
1486
1487 // Update an existing feature's status or clear the flag on the passed in status
1488 *status_ptr &= ~Status::INACTIVE;
1489 return true;
1490 }
1491
1496 return compareValueWithThreshold(entity_value, getConnectingThreshold(current_index));
1497}
bool compareValueWithThreshold(Real entity_value, Real threshold) const
This method is used to determine whether the current entity value is part of a feature or not.
virtual Real getThreshold(std::size_t current_index) const
Return the starting comparison threshold to use when inspecting an entity during the flood stage.
virtual Real getConnectingThreshold(std::size_t current_index) const
Return the "connecting" comparison threshold to use when inspecting an entity during the flood stage.
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid)=0
SubProblem & _subproblem

Referenced by FeatureFloodCount::flood().

◆ mergeSets()

void FeatureFloodCount::mergeSets ( )
protectedvirtualinherited

This routine is called on the primary rank only and stitches together the partial feature pieces seen on any processor.

Insert the new entity at the end of the list so that it may be checked against all other partial features again.

Now remove both halves the merged features: it2 contains the "moved" feature cell just inserted at the back of the list, it1 contains the mostly empty other half. We have to be careful about the order in which these two elements are deleted. We delete it2 first since we don't care where its iterator points after the deletion. We are going to break out of this loop anyway. If we delete it1 first, it may end up pointing at the same location as it2 which after the second deletion would cause both of the iterators to be invalidated.

Reimplemented in PolycrystalUserObjectBase.

Definition at line 1138 of file FeatureFloodCount.C.

1139{
1140 TIME_SECTION("mergeSets", 3, "Merging Sets");
1141
1142 // When working with _distribute_merge_work all of the maps will be empty except for one
1143 for (const auto map_num : make_range(_maps_size))
1144 {
1145 for (auto it1 = _partial_feature_sets[map_num].begin();
1146 it1 != _partial_feature_sets[map_num].end();
1147 /* No increment on it1 */)
1148 {
1149 bool merge_occured = false;
1150 for (auto it2 = _partial_feature_sets[map_num].begin();
1151 it2 != _partial_feature_sets[map_num].end();
1152 ++it2)
1153 {
1154 if (it1 != it2 && areFeaturesMergeable(*it1, *it2))
1155 {
1156 it2->merge(std::move(*it1));
1157
1162 _partial_feature_sets[map_num].emplace_back(std::move(*it2));
1163
1173 _partial_feature_sets[map_num].erase(it2);
1174 it1 = _partial_feature_sets[map_num].erase(it1); // it1 is incremented here!
1175
1176 // A merge occurred, this is used to determine whether or not we increment the outer
1177 // iterator
1178 merge_occured = true;
1179
1180 // We need to start the list comparison over for the new it1 so break here
1181 break;
1182 }
1183 } // it2 loop
1184
1185 if (!merge_occured) // No merges so we need to manually increment the outer iterator
1186 ++it1;
1187
1188 } // it1 loop
1189 } // map loop
1190}
virtual bool areFeaturesMergeable(const FeatureData &f1, const FeatureData &f2) const
Method for determining whether two features are mergeable.

Referenced by FeatureFloodCount::communicateAndMerge().

◆ meshChanged()

void GrainTracker::meshChanged ( )
overridevirtualinherited

Reimplemented from FeatureFloodCount.

Definition at line 247 of file GrainTracker.C.

248{
249 // Update the element ID ranges for use when computing halo maps
251 {
252 _all_ranges.clear();
253
254 auto range = std::make_pair(std::numeric_limits<dof_id_type>::max(),
255 std::numeric_limits<dof_id_type>::min());
256 for (const auto & current_elem : _mesh.getMesh().active_local_element_ptr_range())
257 {
258 auto id = current_elem->id();
259 if (id < range.first)
260 range.first = id;
261 else if (id > range.second)
262 range.second = id;
263 }
264
266 }
267
269}
void gather(const unsigned int root_id, const T &send_data, std::vector< T, A > &recv) const
T & getMesh(MooseMesh &mesh)
function to cast mesh
Definition SCM.h:35

◆ newGrain()

template<typename T >
virtual T GrainDataTracker< T >::newGrain ( unsigned int  new_grain_id)
protectedpure virtual

implement this method to initialize the data for the new grain

Implemented in GrainTrackerElasticity.

◆ newGrainCreated()

template<typename T >
void GrainDataTracker< T >::newGrainCreated ( unsigned int  new_grain_id)
protectedvirtual

This method is called when a new grain is detected.

It can be overridden by a derived class to handle setting new properties on the newly created grain.

Reimplemented from GrainTracker.

Definition at line 53 of file GrainDataTracker.h.

54{
55 if (_grain_data.size() <= new_grain_id)
56 _grain_data.resize(new_grain_id + 1);
57
58 _grain_data[new_grain_id] = newGrain(new_grain_id);
59}
virtual T newGrain(unsigned int new_grain_id)=0
implement this method to initialize the data for the new grain

◆ numberOfDistributedMergeHelpers()

processor_id_type FeatureFloodCount::numberOfDistributedMergeHelpers ( ) const
protectedvirtualinherited

Returns a number indicating the number of merge helpers when running in parallel based on certain implementer decided criteria.

This is a communication versus computation trade-off that we are almost always willing to make except for small problems. The decision however may be more complicated for some derived classes.

Reimplemented in PolycrystalUserObjectBase.

Definition at line 397 of file FeatureFloodCount.C.

398{
399 return _app.n_processors() >= _maps_size ? _maps_size : 1;
400}

Referenced by FeatureFloodCount::communicateAndMerge().

◆ numCoupledVars()

std::size_t FeatureFloodCount::numCoupledVars ( ) const
inlineinherited

Returns the number of coupled varaibles.

Definition at line 87 of file FeatureFloodCount.h.

87{ return _n_vars; }

◆ prepareDataForTransfer()

void FeatureFloodCount::prepareDataForTransfer ( )
protectedvirtualinherited

This routine uses the local flooded data to build up the local feature data structures (_partial feature_sets).

This routine does not perform any communication so the _partial_feature_sets data structure will only contain information from the local processor after calling this routine. Any existing data in the _partial_feature_sets structure is destroyed by calling this routine.

_partial_feature_sets layout: The outer vector is sized to one when _single_map_mode == true, otherwise it is sized for the number of coupled variables. The inner list represents the flooded regions (local only after this call but fully populated after parallel communication and stitching).

If using a vector container, we need to sort all of the data structures for later operations such as checking for intersection and merging. The following "sort" function does nothing when invoked on a std::set.

Save off the min entity id present in the feature to uniquely identify the feature regardless of n_procs

Reimplemented in PolycrystalUserObjectBase.

Definition at line 1034 of file FeatureFloodCount.C.

1035{
1036 TIME_SECTION("prepareDataForTransfer", 3, "Preparing Data For Transfer");
1037
1038 MeshBase & mesh = _mesh.getMesh();
1039
1040 FeatureData::container_type local_ids_no_ghost, set_difference;
1041
1042 for (auto & list_ref : _partial_feature_sets)
1043 {
1044 for (auto & feature : list_ref)
1045 {
1046 // See if the feature intersects a boundary or perhaps one of the percolation boundaries.
1048
1049 // Periodic node ids
1051
1057 FeatureFloodCount::sort(feature._ghosted_ids);
1058 FeatureFloodCount::sort(feature._local_ids);
1059 FeatureFloodCount::sort(feature._halo_ids);
1060 FeatureFloodCount::sort(feature._disjoint_halo_ids);
1061 FeatureFloodCount::sort(feature._periodic_nodes);
1062
1063 // Now extend the bounding box by the halo region
1064 if (_is_elemental)
1065 feature.updateBBoxExtremes(mesh);
1066 else
1067 {
1068 for (auto & halo_id : feature._halo_ids)
1069 updateBBoxExtremesHelper(feature._bboxes[0], mesh.point(halo_id));
1070 }
1071
1072 mooseAssert(!feature._local_ids.empty(), "local entity ids cannot be empty");
1073
1078 feature._min_entity_id = *feature._local_ids.begin();
1079 }
1080 }
1081}
void updateBBoxExtremesHelper(BoundingBox &bbox, const Point &node)
void appendPeriodicNeighborNodes(FeatureData &feature) const
This routine adds the periodic node information to our data structure prior to packing the data this ...
static void sort(std::set< T > &)
void updateBoundaryIntersections(FeatureData &feature) const
Update the feature's attributes to indicate boundary intersections.
MeshBase & getMesh()
MeshBase & mesh

Referenced by FeatureFloodCount::communicateAndMerge(), and PolycrystalUserObjectBase::prepareDataForTransfer().

◆ prepopulateState()

void GrainTracker::prepopulateState ( const FeatureFloodCount ffc_object)
protectedinherited

This method extracts the necessary state from the passed in object necessary to continue tracking grains.

This method is meant to be used with the PolycrystalUserobjectBase class that sets up initial conditions for Polycrystal simulations. We can use the state of that object rather than rediscovering everything ourselves.

The minimum information needed to bootstrap the GrainTracker is as follows: _feature_sets _feature_count

Definition at line 297 of file GrainTracker.C.

298{
299 mooseAssert(_first_time, "This method should only be called on the first invocation");
300
301 _feature_sets.clear();
302
308 if (_is_primary)
309 {
310 const auto & features = ffc_object.getFeatures();
311 for (auto & feature : features)
312 _feature_sets.emplace_back(feature.duplicate());
313
315 }
316 else
317 {
318 const auto & features = ffc_object.getFeatures();
319 _partial_feature_sets[0].clear();
320 for (auto & feature : features)
321 _partial_feature_sets[0].emplace_back(feature.duplicate());
322 }
323
324 // Make sure that feature count is communicated to all ranks
326}
const std::vector< FeatureData > & getFeatures() const
Return a constant reference to the vector of all discovered features.

Referenced by GrainTracker::finalize().

◆ remapGrains()

void GrainTracker::remapGrains ( )
protectedinherited

This method is called after trackGrains to remap grains that are too close to each other.

Map used for communicating remap indices to all ranks This map isn't populated until after the remap loop. It's declared here before we enter the root scope since it's needed by all ranks during the broadcast.

The remapping algorithm is recursive. We will use the status variable in each FeatureData to track which grains are currently being remapped so we don't have runaway recursion. To begin we need to clear all of the active (MARKED) flags (CLEAR).

Additionally we need to record each grain's variable index so that we can communicate changes to the non-root ranks later in a single batch.

We're not going to try very hard to look for a suitable remapping. Just set it to what we want and hope it all works out. Make the GrainTracker great again!

Loop over each grain and see if any grains represented by the same variable are "touching"

The remapping loop is complete but only on the primary process. Now we need to build the remap map and communicate it to the remaining processors.

Since the remapping algorithm only runs on the root process, the variable index on the primary's grains is inconsistent from the rest of the ranks. These are the grains with a status of DIRTY. As we build this map we will temporarily switch these variable indices back to the correct value so that all processors use the same algorithm to remap.

Definition at line 909 of file GrainTracker.C.

910{
911 // Don't remap grains if the current simulation step is before the specified tracking step
913 return;
914
915 TIME_SECTION("remapGrains", 3, "Remapping Grains");
916
917 if (_verbosity_level > 1)
918 _console << "Running remap Grains\n" << std::endl;
919
926 std::map<unsigned int, std::size_t> grain_id_to_new_var;
927
928 // Items are added to this list when split grains are found
929 std::list<std::pair<std::size_t, std::size_t>> split_pairs;
930
939 if (_is_primary)
940 {
941 // Build the map to detect difference in _var_index mappings after the remap operation
942 std::map<unsigned int, std::size_t> grain_id_to_existing_var_index;
943 for (auto & grain : _feature_sets)
944 {
945 // Unmark the grain so it can be used in the remap loop
946 grain._status = Status::CLEAR;
947
948 grain_id_to_existing_var_index[grain._id] = grain._var_index;
949 }
950
951 // Make sure that all split pieces of any grain are on the same OP
952 for (const auto i : index_range(_feature_sets))
953 {
954 auto & grain1 = _feature_sets[i];
955
956 for (const auto j : index_range(_feature_sets))
957 {
958 auto & grain2 = _feature_sets[j];
959 if (i == j)
960 continue;
961
962 // The first condition below is there to prevent symmetric checks (duplicate values)
963 if (i < j && grain1._id == grain2._id)
964 {
965 split_pairs.push_front(std::make_pair(i, j));
966 if (grain1._var_index != grain2._var_index)
967 {
968 if (_verbosity_level > 0)
969 _console << COLOR_YELLOW << "Split Grain (#" << grain1._id
970 << ") detected on unmatched OPs (" << grain1._var_index << ", "
971 << grain2._var_index << ") attempting to remap to " << grain1._var_index
972 << ".\n"
973 << COLOR_DEFAULT;
974
979 grain1._var_index = grain2._var_index;
980 grain1._status |= Status::DIRTY;
981 }
982 }
983 }
984 }
985
989 bool grains_remapped;
990
991 std::set<unsigned int> notify_ids;
992 do
993 {
994 grains_remapped = false;
995 notify_ids.clear();
996
997 for (auto & grain1 : _feature_sets)
998 {
999 // We need to remap any grains represented on any variable index above the cuttoff
1000 if (grain1._var_index >= _reserve_op_index)
1001 {
1002 if (_verbosity_level > 0)
1003 _console << COLOR_YELLOW << "\nGrain #" << grain1._id
1004 << " detected on a reserved order parameter #" << grain1._var_index
1005 << ", remapping to another variable\n"
1006 << COLOR_DEFAULT;
1007
1008 for (const auto max : make_range(0, _max_remap_recursion_depth + 1))
1010 {
1011 if (attemptGrainRenumber(grain1, 0, max))
1012 break;
1013 }
1014 else if (!attemptGrainRenumber(grain1, 0, max))
1015 {
1016 _console << std::flush;
1017 std::stringstream oss;
1018 oss << "Unable to find any suitable order parameters for remapping while working "
1019 << "with Grain #" << grain1._id << ", which is on a reserve order parameter.\n"
1020 << "\n\nPossible Resolutions:\n"
1021 << "\t- Add more order parameters to your simulation (8 for 2D, 28 for 3D)\n"
1022 << "\t- Increase adaptivity or reduce your grain boundary widths\n"
1023 << "\t- Make sure you are not starting with too many grains for the mesh size\n";
1024 mooseError(oss.str());
1025 }
1026
1027 grains_remapped = true;
1028 }
1029
1030 for (auto & grain2 : _feature_sets)
1031 {
1032 // Don't compare a grain with itself and don't try to remap inactive grains
1033 if (&grain1 == &grain2)
1034 continue;
1035
1036 if (grain1._var_index == grain2._var_index && // grains represented by same variable?
1037 grain1._id != grain2._id && // are they part of different grains?
1038 grain1.boundingBoxesIntersect(grain2) && // do bboxes intersect (coarse level)?
1039 grain1.halosIntersect(grain2)) // do they actually overlap (fine level)?
1040 {
1041 if (_verbosity_level > 0)
1042 _console << COLOR_YELLOW << "Grain #" << grain1._id << " intersects Grain #"
1043 << grain2._id << " (variable index: " << grain1._var_index << ")\n"
1044 << COLOR_DEFAULT;
1045
1046 for (const auto max : make_range(0, _max_remap_recursion_depth + 1))
1047 {
1049 {
1050 if (attemptGrainRenumber(grain1, 0, max))
1051 {
1052 grains_remapped = true;
1053 break;
1054 }
1055 }
1056 else if (!attemptGrainRenumber(grain1, 0, max) &&
1057 !attemptGrainRenumber(grain2, 0, max))
1058 {
1059 notify_ids.insert(grain1._id);
1060 notify_ids.insert(grain2._id);
1061 }
1062 }
1063 }
1064 }
1065 }
1066 } while (grains_remapped);
1067
1068 if (!notify_ids.empty())
1069 {
1070 _console << std::flush;
1071 std::stringstream oss;
1072 oss << "Unable to find any suitable order parameters for remapping while working "
1073 << "with the following grain IDs:\n"
1074 << Moose::stringify(notify_ids, ", ", "", true) << "\n\nPossible Resolutions:\n"
1075 << "\t- Add more order parameters to your simulation (8 for 2D, 28 for 3D)\n"
1076 << "\t- Increase adaptivity or reduce your grain boundary widths\n"
1077 << "\t- Make sure you are not starting with too many grains for the mesh size\n";
1078
1080 mooseWarning(oss.str());
1081 else
1082 mooseError(oss.str());
1083 }
1084
1085 // Verify that split grains are still intact
1086 for (auto & split_pair : split_pairs)
1087 if (_feature_sets[split_pair.first]._var_index != _feature_sets[split_pair.first]._var_index)
1088 mooseError("Split grain remapped - This case is currently not handled");
1089
1095 for (auto & grain : _feature_sets)
1096 {
1097 mooseAssert(grain_id_to_existing_var_index.find(grain._id) !=
1098 grain_id_to_existing_var_index.end(),
1099 "Missing unique ID");
1100
1101 auto old_var_index = grain_id_to_existing_var_index[grain._id];
1102
1103 if (old_var_index != grain._var_index)
1104 {
1105 mooseAssert(static_cast<bool>(grain._status & Status::DIRTY), "grain status is incorrect");
1106
1107 grain_id_to_new_var.emplace_hint(
1108 grain_id_to_new_var.end(),
1109 std::pair<unsigned int, std::size_t>(grain._id, grain._var_index));
1110
1119 grain._var_index = old_var_index;
1120 // Clear the DIRTY status as well for consistency
1121 grain._status &= ~Status::DIRTY;
1122 }
1123 }
1124
1125 if (!grain_id_to_new_var.empty())
1126 {
1127 if (_verbosity_level > 1)
1128 {
1129 _console << "Final remapping tally:\n";
1130 for (const auto & remap_pair : grain_id_to_new_var)
1131 _console << "Grain #" << remap_pair.first << " var_index "
1132 << grain_id_to_existing_var_index[remap_pair.first] << " -> "
1133 << remap_pair.second << '\n';
1134 _console << "Communicating swaps with remaining processors..." << std::endl;
1135 }
1136 }
1137 } // root processor
1138
1139 // Communicate the std::map to all ranks
1140 _communicator.broadcast(grain_id_to_new_var);
1141
1142 // Perform swaps if any occurred
1143 if (!grain_id_to_new_var.empty())
1144 {
1145 // Cache for holding values during swaps
1146 std::vector<std::map<Node *, CacheValues>> cache(_n_vars);
1147
1148 // Perform the actual swaps on all processors
1149 for (auto & grain : _feature_sets)
1150 {
1151 // See if this grain was remapped
1152 auto new_var_it = grain_id_to_new_var.find(grain._id);
1153 if (new_var_it != grain_id_to_new_var.end())
1154 swapSolutionValues(grain, new_var_it->second, cache, RemapCacheMode::FILL);
1155 }
1156
1157 for (auto & grain : _feature_sets)
1158 {
1159 // See if this grain was remapped
1160 auto new_var_it = grain_id_to_new_var.find(grain._id);
1161 if (new_var_it != grain_id_to_new_var.end())
1162 swapSolutionValues(grain, new_var_it->second, cache, RemapCacheMode::USE);
1163 }
1164
1165 _sys.solution().close();
1168
1169 _sys.system().update();
1170
1171 if (_verbosity_level > 1)
1172 _console << "Swaps complete" << std::endl;
1173 }
1174}
void swapSolutionValues(FeatureData &grain, std::size_t new_var_index, std::vector< std::map< Node *, CacheValues > > &cache, RemapCacheMode cache_mode)
A routine for moving all of the solution values from a given grain to a new variable number.
const unsigned short _max_remap_recursion_depth
Depth of renumbering recursion (a depth of zero means no recursion)
const bool _tolerate_failure
Indicates whether we should continue after a remap failure (will result in non-physical results)
void mooseWarning(Args &&... args) const
NumericVector< Number > & solutionOld()
NumericVector< Number > & solutionOlder()
NumericVector< Number > & solution()
virtual libMesh::System & system()=0
virtual void close()=0
virtual void update()
auto max(const L &left, const R &right)
std::string stringify(const T &t)

Referenced by GrainTracker::finalize().

◆ reserve() [1/2]

template<class T >
static void FeatureFloodCount::reserve ( std::set< T > &  ,
std::size_t   
)
inlinestaticprivateinherited

Definition at line 732 of file FeatureFloodCount.h.

733 {
734 // Sets are trees, no reservations necessary
735 }

Referenced by FeatureFloodCount::FeatureData::consolidate(), FeatureFloodCount::FeatureData::merge(), and FeatureFloodCount::FeatureData::updateBBoxExtremes().

◆ reserve() [2/2]

template<class T >
static void FeatureFloodCount::reserve ( std::vector< T > &  container,
std::size_t  size 
)
inlinestaticprivateinherited

Definition at line 738 of file FeatureFloodCount.h.

739 {
740 container.reserve(size);
741 }

◆ restoreOriginalDataStructures()

virtual void FeatureFloodCount::restoreOriginalDataStructures ( std::vector< std::list< FeatureData > > &  )
inlineprotectedvirtualinherited

Reimplemented in PolycrystalUserObjectBase.

Definition at line 487 of file FeatureFloodCount.h.

487{}

Referenced by FeatureFloodCount::communicateAndMerge().

◆ scatterAndUpdateRanks()

void FeatureFloodCount::scatterAndUpdateRanks ( )
protectedinherited

Calls buildLocalToGlobalIndices to build the individual local to global indicies for each rank and scatters that information to all ranks.

Finally, the non-primary ranks update their own data structures to reflect the global mappings.

On non-root processors we can't maintain the full _feature_sets data structure since we don't have all of the global information. We'll move the items from the partial feature sets into a flat structure maintaining order and update the internal IDs with the proper global ID.

Important: Make sure we clear the local status if we received a valid global index for this feature. It's possible that we have a status of INVALID on the local processor because there was never any starting threshold found. However, the root processor wouldn't have sent an index if it didn't find a starting threshold connected to our local piece.

Definition at line 710 of file FeatureFloodCount.C.

711{
712 // local to global map (one per processor)
713 std::vector<int> counts;
714 std::vector<std::size_t> local_to_global_all;
715 if (_is_primary)
716 buildLocalToGlobalIndices(local_to_global_all, counts);
717
718 // Scatter local_to_global indices to all processors and store in class member variable
719 _communicator.scatter(local_to_global_all, counts, _local_to_global_feature_map);
720
721 std::size_t largest_global_index = std::numeric_limits<std::size_t>::lowest();
722 if (!_is_primary)
723 {
725
732 for (auto & list_ref : _partial_feature_sets)
733 {
734 for (auto & feature : list_ref)
735 {
736 mooseAssert(feature._orig_ids.size() == 1, "feature._orig_ids length doesn't make sense");
737
738 auto global_index = FeatureFloodCount::invalid_size_t;
739 auto local_index = feature._orig_ids.begin()->second;
740
741 if (local_index < _local_to_global_feature_map.size())
742 global_index = _local_to_global_feature_map[local_index];
743
744 if (global_index != FeatureFloodCount::invalid_size_t)
745 {
746 if (global_index > largest_global_index)
747 largest_global_index = global_index;
748
749 // Set the correct global index
750 feature._id = global_index;
751
759 feature._status &= ~Status::INACTIVE;
760
761 // Move the feature into the correct place
762 _feature_sets[local_index] = std::move(feature);
763 }
764 }
765 }
766 }
767 else
768 {
769 for (auto global_index : local_to_global_all)
770 if (global_index != FeatureFloodCount::invalid_size_t && global_index > largest_global_index)
771 largest_global_index = global_index;
772 }
773
774 // communicate the boundary intersection state
775 std::vector<std::pair<unsigned int, int>> intersection_state;
776 for (auto & feature : _feature_sets)
777 intersection_state.emplace_back(feature._id, static_cast<int>(feature._boundary_intersection));
778
779 // gather on root
780 _communicator.gather(0, intersection_state);
781
782 // consolidate
783 std::map<unsigned int, int> consolidated_intersection_state;
784 if (_is_primary)
785 for (const auto & [id, state] : intersection_state)
786 consolidated_intersection_state[id] |= state;
787
788 // broadcast result
789 _communicator.broadcast(consolidated_intersection_state, 0);
790
791 // apply broadcast changes
792 for (auto & feature : _feature_sets)
793 feature._boundary_intersection |=
794 static_cast<BoundaryIntersection>(consolidated_intersection_state[feature._id]);
795
796 buildFeatureIdToLocalIndices(largest_global_index);
797}
void ErrorVector unsigned int
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
std::vector< std::size_t > _local_to_global_feature_map
The vector recording the local to global feature indices.
virtual void buildLocalToGlobalIndices(std::vector< std::size_t > &local_to_global_all, std::vector< int > &counts) const
This routine populates a stacked vector of local to global indices per rank and the associated count ...
BoundaryIntersection
This enumeration is used to inidacate status of boundary intersections.

Referenced by GrainTracker::assignGrains(), FeatureFloodCount::finalize(), and GrainTracker::trackGrains().

◆ serialize()

void FeatureFloodCount::serialize ( std::string &  serialized_buffer,
unsigned int  var_num = invalid_id 
)
protectedinherited

This routines packs the _partial_feature_sets data into a structure suitable for parallel communication operations.

Definition at line 1084 of file FeatureFloodCount.C.

1085{
1086 // stream for serializing the _partial_feature_sets data structure to a byte stream
1087 std::ostringstream oss;
1088
1089 mooseAssert(var_num == invalid_id || var_num < _partial_feature_sets.size(),
1090 "var_num out of range");
1091
1092 // Serialize everything
1093 if (var_num == invalid_id)
1094 dataStore(oss, _partial_feature_sets, this);
1095 else
1096 dataStore(oss, _partial_feature_sets[var_num], this);
1097
1098 // Populate the passed in string pointer with the string stream's buffer contents
1099 serialized_buffer.assign(oss.str());
1100}
void dataStore(std::ostream &stream, FeatureFloodCount::FeatureData &feature, void *context)

Referenced by FeatureFloodCount::communicateAndMerge().

◆ sort() [1/2]

template<class T >
static void FeatureFloodCount::sort ( std::set< T > &  )
inlinestaticprivateinherited

Definition at line 720 of file FeatureFloodCount.h.

721 {
722 // Sets are already sorted, do nothing
723 }

Referenced by FeatureFloodCount::prepareDataForTransfer().

◆ sort() [2/2]

template<class T >
static void FeatureFloodCount::sort ( std::vector< T > &  container)
inlinestaticprivateinherited

Definition at line 726 of file FeatureFloodCount.h.

727 {
728 std::sort(container.begin(), container.end());
729 }

◆ sortAndLabel()

void FeatureFloodCount::sortAndLabel ( )
protectedinherited

Sort and assign ids to features based on their position in the container after sorting.

Perform a sort to give a parallel unique sorting to the identified features. We use the "min_entity_id" inside each feature to assign it's position in the sorted vector.

Sanity check. Now that we've sorted the flattened vector of features we need to make sure that the counts vector still lines up appropriately with each feature's _var_index.

Definition at line 568 of file FeatureFloodCount.C.

569{
570 mooseAssert(_is_primary, "sortAndLabel can only be called on the primary");
571
577 std::sort(_feature_sets.begin(), _feature_sets.end());
578
579#ifndef NDEBUG
585 unsigned int feature_offset = 0;
586 for (const auto map_num : make_range(_maps_size))
587 {
588 // Skip empty map checks
589 if (_feature_counts_per_map[map_num] == 0)
590 continue;
591
592 // Check the begin and end of the current range
593 auto range_front = feature_offset;
594 auto range_back = feature_offset + _feature_counts_per_map[map_num] - 1;
595
596 mooseAssert(range_front <= range_back && range_back < _feature_count,
597 "Indexing error in feature sets");
598
599 if (!_single_map_mode && (_feature_sets[range_front]._var_index != map_num ||
600 _feature_sets[range_back]._var_index != map_num))
601 mooseError("Error in _feature_sets sorting, map index: ", map_num);
602
603 feature_offset += _feature_counts_per_map[map_num];
604 }
605#endif
606
607 // Label the features with an ID based on the sorting (processor number independent value)
608 for (const auto i : index_range(_feature_sets))
609 if (_feature_sets[i]._id == invalid_id)
610 _feature_sets[i]._id = i;
611}

Referenced by GrainTracker::assignGrains(), and FeatureFloodCount::finalize().

◆ swapSolutionValues()

void GrainTracker::swapSolutionValues ( FeatureData grain,
std::size_t  new_var_index,
std::vector< std::map< Node *, CacheValues > > &  cache,
RemapCacheMode  cache_mode 
)
protectedinherited

A routine for moving all of the solution values from a given grain to a new variable number.

It is called with different modes to only cache, or actually do the work, or bypass the cache altogether.

Definition at line 1426 of file GrainTracker.C.

1430{
1431 MeshBase & mesh = _mesh.getMesh();
1432
1433 // Remap the grain
1434 std::set<Node *> updated_nodes_tmp; // Used only in the elemental case
1435 for (auto entity : grain._local_ids)
1436 {
1437 if (_is_elemental)
1438 {
1439 Elem * elem = mesh.query_elem_ptr(entity);
1440 if (!elem)
1441 continue;
1442
1443 for (unsigned int i = 0; i < elem->n_nodes(); ++i)
1444 {
1445 Node * curr_node = elem->node_ptr(i);
1446 if (updated_nodes_tmp.find(curr_node) == updated_nodes_tmp.end())
1447 {
1448 // cache this node so we don't attempt to remap it again within this loop
1449 updated_nodes_tmp.insert(curr_node);
1450 swapSolutionValuesHelper(curr_node, grain._var_index, new_var_index, cache, cache_mode);
1451 }
1452 }
1453 }
1454 else
1456 mesh.query_node_ptr(entity), grain._var_index, new_var_index, cache, cache_mode);
1457 }
1458
1459 // Update the variable index in the unique grain datastructure after swaps are complete
1460 if (cache_mode == RemapCacheMode::USE || cache_mode == RemapCacheMode::BYPASS)
1461 grain._var_index = new_var_index;
1462}
void swapSolutionValuesHelper(Node *curr_node, std::size_t curr_var_index, std::size_t new_var_index, std::vector< std::map< Node *, CacheValues > > &cache, RemapCacheMode cache_mode)
Helper method for actually performing the swaps.

Referenced by GrainTracker::remapGrains().

◆ swapSolutionValuesHelper()

void GrainTracker::swapSolutionValuesHelper ( Node *  curr_node,
std::size_t  curr_var_index,
std::size_t  new_var_index,
std::vector< std::map< Node *, CacheValues > > &  cache,
RemapCacheMode  cache_mode 
)
protectedinherited

Helper method for actually performing the swaps.

Finally zero out the old variable. When using the FILL/USE combination to read/write variables, it's important to zero the variable on the FILL stage and not the USE stage. The reason for this is handling swaps as illustrated in the following diagram


/ \/ \ If adjacent grains (overlapping flood region) end up / 1 /\ 2 \ swapping variable indices and variables are zeroed on \ 2*\/ 1* / "USE", the overlap region will be incorrectly zeroed ___/___/ by whichever variable is written to second.

Definition at line 1465 of file GrainTracker.C.

1470{
1471 if (curr_node && curr_node->processor_id() == processor_id())
1472 {
1473 // Reinit the node so we can get and set values of the solution here
1474 _subproblem.reinitNode(curr_node, 0);
1475
1476 // Local variables to hold values being transferred
1477 Real current, old = 0, older = 0;
1478 // Retrieve the value either from the old variable or cache
1479 if (cache_mode == RemapCacheMode::FILL || cache_mode == RemapCacheMode::BYPASS)
1480 {
1481 current = _vars[curr_var_index]->dofValues()[0];
1482 if (_is_transient)
1483 {
1484 old = _vars[curr_var_index]->dofValuesOld()[0];
1485 older = _vars[curr_var_index]->dofValuesOlder()[0];
1486 }
1487 }
1488 else // USE
1489 {
1490 const auto cache_it = cache[curr_var_index].find(curr_node);
1491 mooseAssert(cache_it != cache[curr_var_index].end(), "Error in cache");
1492 current = cache_it->second.current;
1493 old = cache_it->second.old;
1494 older = cache_it->second.older;
1495 }
1496
1497 // Cache the value or use it!
1498 if (cache_mode == RemapCacheMode::FILL)
1499 {
1500 cache[curr_var_index][curr_node].current = current;
1501 cache[curr_var_index][curr_node].old = old;
1502 cache[curr_var_index][curr_node].older = older;
1503 }
1504 else // USE or BYPASS
1505 {
1506 const auto & dof_index = _vars[new_var_index]->nodalDofIndex();
1507
1508 // Transfer this solution from the old to the current
1509 _sys.solution().set(dof_index, current);
1510 if (_is_transient)
1511 {
1512 _sys.solutionOld().set(dof_index, old);
1513 _sys.solutionOlder().set(dof_index, older);
1514 }
1515 }
1516
1529 if (cache_mode == RemapCacheMode::FILL || cache_mode == RemapCacheMode::BYPASS)
1530 {
1531 const auto & dof_index = _vars[curr_var_index]->nodalDofIndex();
1532
1533 // Set the DOF for the current variable to zero
1534 _sys.solution().set(dof_index, -_bound_value);
1535 if (_is_transient)
1536 {
1537 _sys.solutionOld().set(dof_index, -_bound_value);
1538 _sys.solutionOlder().set(dof_index, -_bound_value);
1539 }
1540 }
1541 }
1542}
const Real _bound_value
Absolute value of the lower bound used to represent a region not assigned to this grain,...
const bool _is_transient
Boolean to indicate whether this is a Steady or Transient solve.
virtual void reinitNode(const Node *node, const THREAD_ID tid)=0
virtual void set(const numeric_index_type i, const T value)=0

Referenced by GrainTracker::swapSolutionValues().

◆ trackGrains()

void GrainTracker::trackGrains ( )
protectedinherited

On subsequent time_steps, incoming FeatureData objects are compared to previous time_step information to track grains between time steps.

This method updates the _feature_sets data structure. This method should only be called on the root processor

Only the primary rank does tracking, the remaining ranks wait to receive local to global indices from the primary.

To track grains across time steps, we will loop over our unique grains and link each one up with one of our new unique grains. The criteria for doing this will be to find the unique grain in the new list with a matching variable index whose centroid is closest to this unique grain.

The _feature_sets vector is constructed by _var_index so we can avoid looping over all indices. We can quickly jump to the first matching index to reduce the number of comparisons and terminate our loop when our variable index stops matching.

Don't try to do any matching unless the bounding boxes at least overlap. This is to avoid the corner case of having a grain split and a grain disappear during the same time step!

It's possible that multiple existing grains will map to a single new grain (indicated by finding multiple matches when we are building this map). This will happen any time a grain disappears during this time step. We need to figure out the rightful owner in this case and inactivate the old grain.

If the grain we just marked inactive was the one whose index was in the new grain to existing grain map (other_old_grain). Then we need to update the map to point to the new match winner.

At this point we have should have only two cases left to handle: Case 1: A grain in the new set who has an unset status (These are new grains, previously untracked) This case is easy to understand. Since we are matching up grains by looking at the old set and finding closest matches in the new set, any grain in the new set that isn't matched up is simply new since some other grain satisfied each and every request from the old set.

Case 2: A grain in the old set who has an unset status (These are inactive grains that haven't been marked) We can only fall into this case when the very last grain on a given variable disappears during the current time step. In that case we never have a matching _var_index in the comparison loop above so that old grain never competes for any new grain which means it can't be marked inactive in the loop above.

Now we need to figure out what kind of "new" grain this is. Is it a nucleating grain that we're just barely seeing for the first time or is it a "splitting" grain. A grain that gets pinched into two or more pieces usually as it is being absorbed by other grains or possibly due to external forces. We have to handle splitting grains this way so as to no confuse them with regular grains that just happen to be in contact in this step.

Splitting Grain: An grain that is unmatched by any old grain on the same order parameter with touching halos.

Nucleating Grain: A completely new grain appearing somewhere in the domain not overlapping any other grain's halo.

To figure out which case we are dealing with, we have to make another pass over all of the existing grains with matching variable indices to see if any of them have overlapping halos.

The "try-harder loop": OK so we still have an extra grain in the new set that isn't matched up against the old set and since the order parameter isn't reserved. We aren't really expecting a new grain. Let's try to make a few more attempts to see if this is a split grain even though it failed to match the criteria above. This might happen if the halo front is advancing too fast!

In this loop we'll make an attempt to match up this new grain to the old halos. If adaptivity is happening this could fail as elements in the new set may be at a different level than in the old set. If we get multiple matches, we'll compare the grain volumes (based on elements, not integrated to choose the closest).

Future ideas: Look at the volume fraction of the new grain and overlay it over the volume fraction of the old grain (would require more saved information, or an aux field hanging around (subject to projection problems).

Note that the old grains we are looking at will already be marked from the earlier tracking phase. We are trying to see if this unmatched grain is part of a larger whole. To do that we'll look at the halos across the time step.

Trigger callback for new grains

Definition at line 498 of file GrainTracker.C.

499{
500 TIME_SECTION("trackGrains", 3, "Tracking Grains");
501
502 mooseAssert(!_first_time, "Track grains may only be called when _tracking_step > _t_step");
503
504 // Used to track indices for which to trigger the new grain callback on (used on all ranks)
506
511 if (_is_primary)
512 {
513 // Reset Status on active unique grains
514 std::vector<unsigned int> map_sizes(_maps_size);
515 for (auto & grain : _feature_sets_old)
516 {
517 if (grain._status != Status::INACTIVE)
518 {
519 grain._status = Status::CLEAR;
520 map_sizes[grain._var_index]++;
521 }
522 }
523
524 // Print out stats on overall tracking changes per var_index
525 if (_verbosity_level > 0)
526 {
527 _console << "\nGrain Tracker Status:";
528 for (const auto map_num : make_range(_maps_size))
529 {
530 _console << "\nGrains active index " << map_num << ": " << map_sizes[map_num] << " -> "
531 << _feature_counts_per_map[map_num];
532 if (map_sizes[map_num] > _feature_counts_per_map[map_num])
533 _console << "--";
534 else if (map_sizes[map_num] < _feature_counts_per_map[map_num])
535 _console << "++";
536 }
537 _console << '\n' << std::endl;
538 }
539
540 // Before we track grains, lets sort them so that we get parallel consistent answers
541 std::sort(_feature_sets.begin(), _feature_sets.end());
542
549 std::vector<std::size_t> new_grain_index_to_existing_grain_index(_feature_sets.size(),
551
552 for (const auto old_grain_index : index_range(_feature_sets_old))
553 {
554 auto & old_grain = _feature_sets_old[old_grain_index];
555
556 if (old_grain._status == Status::INACTIVE) // Don't try to find matches for inactive grains
557 continue;
558
559 std::size_t closest_match_index = invalid_size_t;
560 Real min_centroid_diff = std::numeric_limits<Real>::max();
561
567 // clang-format off
568 auto start_it =
569 std::lower_bound(_feature_sets.begin(), _feature_sets.end(), old_grain._var_index,
570 [](const FeatureData & item, std::size_t var_index)
571 {
572 return item._var_index < var_index;
573 });
574 // clang-format on
575
576 // We only need to examine grains that have matching variable indices
577 bool any_boxes_intersect = false;
578 for (MooseIndex(_feature_sets)
579 new_grain_index = std::distance(_feature_sets.begin(), start_it);
580 new_grain_index < _feature_sets.size() &&
581 _feature_sets[new_grain_index]._var_index == old_grain._var_index;
582 ++new_grain_index)
583 {
584 auto & new_grain = _feature_sets[new_grain_index];
585
590 if (new_grain.boundingBoxesIntersect(old_grain))
591 {
592 any_boxes_intersect = true;
593 Real curr_centroid_diff = centroidRegionDistance(old_grain._bboxes, new_grain._bboxes);
594 if (curr_centroid_diff <= min_centroid_diff)
595 {
596 closest_match_index = new_grain_index;
597 min_centroid_diff = curr_centroid_diff;
598 }
599 }
600 }
601
602 if (_verbosity_level > 2 && !any_boxes_intersect)
603 _console << "\nNo intersecting bounding boxes found while trying to match grain "
604 << old_grain;
605
606 // found a match
607 if (closest_match_index != invalid_size_t)
608 {
615 auto curr_index = new_grain_index_to_existing_grain_index[closest_match_index];
616 if (curr_index != invalid_size_t)
617 {
618 // The new feature being competed for
619 auto & new_grain = _feature_sets[closest_match_index];
620
621 // The other old grain competing to match up to the same new grain
622 auto & other_old_grain = _feature_sets_old[curr_index];
623
624 auto centroid_diff1 = centroidRegionDistance(new_grain._bboxes, old_grain._bboxes);
625 auto centroid_diff2 = centroidRegionDistance(new_grain._bboxes, other_old_grain._bboxes);
626
627 auto & inactive_grain = (centroid_diff1 < centroid_diff2) ? other_old_grain : old_grain;
628
629 inactive_grain._status = Status::INACTIVE;
630 if (_verbosity_level > 0)
631 {
632 _console << COLOR_GREEN << "Marking Grain " << inactive_grain._id
633 << " as INACTIVE (variable index: " << inactive_grain._var_index << ")\n"
634 << COLOR_DEFAULT;
635 if (_verbosity_level > 1)
636 _console << inactive_grain;
637 }
638
644 if (&inactive_grain == &other_old_grain)
645 new_grain_index_to_existing_grain_index[closest_match_index] = old_grain_index;
646 }
647 else
648 new_grain_index_to_existing_grain_index[closest_match_index] = old_grain_index;
649 }
650 }
651
652 // Mark all resolved grain matches
653 for (const auto new_index : index_range(new_grain_index_to_existing_grain_index))
654 {
655 auto curr_index = new_grain_index_to_existing_grain_index[new_index];
656
657 // This may be a new grain, we'll handle that case below
658 if (curr_index == invalid_size_t)
659 continue;
660
661 mooseAssert(_feature_sets_old[curr_index]._id != invalid_id,
662 "Invalid ID in old grain structure");
663
664 _feature_sets[new_index]._id = _feature_sets_old[curr_index]._id; // Transfer ID
665 _feature_sets[new_index]._status = Status::MARKED; // Mark the status in the new set
666 _feature_sets_old[curr_index]._status = Status::MARKED; // Mark the status in the old set
667 }
668
683 // Case 1 (new grains in _feature_sets):
684 for (const auto grain_num : index_range(_feature_sets))
685 {
686 auto & grain = _feature_sets[grain_num];
687
688 // New Grain
689 if (grain._status == Status::CLEAR)
690 {
709 // clang-format off
710 auto start_it =
711 std::lower_bound(_feature_sets.begin(), _feature_sets.end(), grain._var_index,
712 [](const FeatureData & item, std::size_t var_index)
713 {
714 return item._var_index < var_index;
715 });
716 // clang-format on
717
718 // Loop over matching variable indices
719 for (MooseIndex(_feature_sets)
720 new_grain_index = std::distance(_feature_sets.begin(), start_it);
721 new_grain_index < _feature_sets.size() &&
722 _feature_sets[new_grain_index]._var_index == grain._var_index;
723 ++new_grain_index)
724 {
725 auto & other_grain = _feature_sets[new_grain_index];
726
727 // Splitting grain?
728 if (grain_num != new_grain_index && // Make sure indices aren't pointing at the same grain
729 other_grain._status == Status::MARKED && // and that the other grain is indeed marked
730 other_grain.boundingBoxesIntersect(grain) && // and the bboxes intersect
731 other_grain.halosIntersect(grain)) // and the halos also intersect
732 // TODO: Inspect combined volume and see if it's "close" to the expected value
733 {
734 grain._id = other_grain._id; // Set the duplicate ID
735 grain._status = Status::MARKED; // Mark it
736
737 if (_verbosity_level > 0)
738 _console << COLOR_YELLOW << "Split Grain Detected #" << grain._id
739 << " (variable index: " << grain._var_index << ")\n"
740 << COLOR_DEFAULT;
741 if (_verbosity_level > 1)
742 _console << grain << other_grain;
743 }
744 }
745
746 if (grain._var_index < _reserve_op_index)
747 {
766 if (_verbosity_level > 1)
767 _console << COLOR_YELLOW
768 << "Trying harder to detect a split grain while examining grain on variable "
769 "index "
770 << grain._var_index << '\n'
771 << COLOR_DEFAULT;
772
773 std::vector<std::size_t> old_grain_indices;
774 for (const auto old_grain_index : index_range(_feature_sets_old))
775 {
776 auto & old_grain = _feature_sets_old[old_grain_index];
777
778 if (old_grain._status == Status::INACTIVE)
779 continue;
780
786 if (grain._var_index == old_grain._var_index &&
787 grain.boundingBoxesIntersect(old_grain) && grain.halosIntersect(old_grain))
788 old_grain_indices.push_back(old_grain_index);
789 }
790
791 if (old_grain_indices.size() == 1)
792 {
793 grain._id = _feature_sets_old[old_grain_indices[0]]._id;
794 grain._status = Status::MARKED;
795
796 if (_verbosity_level > 0)
797 _console << COLOR_YELLOW << "Split Grain Detected #" << grain._id
798 << " (variable index: " << grain._var_index << ")\n"
799 << COLOR_DEFAULT;
800 }
801 else if (old_grain_indices.size() > 1)
803 << COLOR_RED << "Split Grain Likely Detected #" << grain._id
804 << " Need more information to find correct candidate - contact a developer!\n\n"
805 << COLOR_DEFAULT;
806 }
807
808 // Must be a nucleating grain (status is still not set)
809 if (grain._status == Status::CLEAR)
810 {
811 auto new_index = getNextUniqueID();
812 grain._id = new_index; // Set the ID
813 grain._status = Status::MARKED; // Mark it
814
815 if (_verbosity_level > 0)
816 _console << COLOR_YELLOW << "Nucleating Grain Detected "
817 << " (variable index: " << grain._var_index << ")\n"
818 << COLOR_DEFAULT;
819 if (_verbosity_level > 1)
820 _console << grain;
821 }
822 }
823 }
824
825 // Case 2 (inactive grains in _feature_sets_old)
826 for (auto & grain : _feature_sets_old)
827 {
828 if (grain._status == Status::CLEAR)
829 {
830 grain._status = Status::INACTIVE;
831 if (_verbosity_level > 0)
832 {
833 _console << COLOR_GREEN << "Marking Grain " << grain._id
834 << " as INACTIVE (variable index: " << grain._var_index << ")\n"
835 << COLOR_DEFAULT;
836 if (_verbosity_level > 1)
837 _console << grain;
838 }
839 }
840 }
841 } // is_primary
842
843 /*************************************************************
844 ****************** COLLECTIVE WORK SECTION ******************
845 *************************************************************/
846
847 // Make IDs on all non-primary ranks consistent
849
850 // Build up an id to index map
853
858 {
859 for (auto new_id = _old_max_grain_id + 1; new_id <= _max_curr_grain_id; ++new_id)
860 {
861 // Don't trigger the callback on the reserve IDs
863 {
864 // See if we've been instructed to terminate with an error
867 "Error: New grain detected and \"error_on_new_grain_creation\" is set to true");
868 else
869 newGrainCreated(new_id);
870 }
871 }
872 }
873}
const bool _error_on_grain_creation
Boolean to terminate with an error if a new grain is created during the simulation.
unsigned int getNextUniqueID()
Retrieve the next unique grain number if a new grain is detected during trackGrains.
Real centroidRegionDistance(std::vector< BoundingBox > &bboxes1, std::vector< BoundingBox > &bboxes2) const
This method returns the minimum periodic distance between the centroids of two vectors of bounding bo...

Referenced by GrainTracker::finalize().

◆ updateBoundaryIntersections()

void FeatureFloodCount::updateBoundaryIntersections ( FeatureData feature) const
protectedinherited

Update the feature's attributes to indicate boundary intersections.

Definition at line 1774 of file FeatureFloodCount.C.

1775{
1776 if (_is_elemental)
1777 {
1778 for (auto entity : feature._local_ids)
1779 {
1780 // See if this feature is on a boundary if we haven't already figured that out
1781 if ((feature._boundary_intersection & BoundaryIntersection::ANY_BOUNDARY) ==
1783 {
1784 Elem * elem = _mesh.elemPtr(entity);
1785 if (elem && elem->on_boundary())
1786 feature._boundary_intersection |= BoundaryIntersection::ANY_BOUNDARY;
1787 }
1788
1789 // Now see if the feature touches the primary and/or secondary boundary IDs if we haven't
1790 // figured that out already
1791 if ((feature._boundary_intersection & BoundaryIntersection::PRIMARY_PERCOLATION_BOUNDARY) ==
1793 {
1794 for (auto primary_id : _primary_perc_bnds)
1795 if (_mesh.isBoundaryElem(entity, primary_id))
1796 feature._boundary_intersection |= BoundaryIntersection::PRIMARY_PERCOLATION_BOUNDARY;
1797 }
1798
1799 if ((feature._boundary_intersection & BoundaryIntersection::SECONDARY_PERCOLATION_BOUNDARY) ==
1801 {
1802 for (auto secondary_id : _secondary_perc_bnds)
1803 if (_mesh.isBoundaryElem(entity, secondary_id))
1804 feature._boundary_intersection |= BoundaryIntersection::SECONDARY_PERCOLATION_BOUNDARY;
1805 }
1806
1807 // See if the feature contacts any of the user-specified boundaries if we haven't
1808 // done so already
1809 if ((feature._boundary_intersection & BoundaryIntersection::SPECIFIED_BOUNDARY) ==
1811 {
1812 for (auto specified_id : _specified_bnds)
1813 if (_mesh.isBoundaryElem(entity, specified_id))
1814 feature._boundary_intersection |= BoundaryIntersection::SPECIFIED_BOUNDARY;
1815 }
1816 }
1817 }
1818}
std::vector< BoundaryID > _specified_bnds
std::vector< BoundaryID > _secondary_perc_bnds
std::vector< BoundaryID > _primary_perc_bnds

Referenced by FeatureFloodCount::prepareDataForTransfer().

◆ updateFieldInfo()

void GrainTracker::updateFieldInfo ( )
overrideprotectedvirtualinherited

This method is used to populate any of the data structures used for storing field data (nodal or elemental).

It is called at the end of finalize and can make use of any of the data structures created during the execution of this postprocessor.

Reimplemented from FeatureFloodCount.

Definition at line 1545 of file GrainTracker.C.

1546{
1547 TIME_SECTION("updateFieldInfo", 3, "Updating Field Info");
1548
1549 for (const auto map_num : make_range(_maps_size))
1550 _feature_maps[map_num].clear();
1551
1552 std::map<dof_id_type, Real> tmp_map;
1553
1554 for (const auto & grain : _feature_sets)
1555 {
1556 std::size_t curr_var = grain._var_index;
1557 std::size_t map_index = (_single_map_mode || _condense_map_info) ? 0 : curr_var;
1558
1559 for (auto entity : grain._local_ids)
1560 {
1561 // Highest variable value at this entity wins
1562 Real entity_value = std::numeric_limits<Real>::lowest();
1563 if (_is_elemental)
1564 {
1565 const Elem * elem = _mesh.elemPtr(entity);
1566 std::vector<Point> centroid(1, elem->vertex_average());
1567 if (_poly_ic_uo && _first_time)
1568 {
1569 entity_value = _poly_ic_uo->getVariableValue(grain._var_index, centroid[0]);
1570 }
1571 else
1572 {
1573 _fe_problem.reinitElemPhys(elem, centroid, 0);
1574 entity_value = _vars[curr_var]->sln()[0];
1575 }
1576 }
1577 else
1578 {
1579 auto node_ptr = _mesh.nodePtr(entity);
1580 entity_value = _vars[curr_var]->getNodalValue(*node_ptr);
1581 }
1582
1583 if (entity_value != std::numeric_limits<Real>::lowest() &&
1584 (tmp_map.find(entity) == tmp_map.end() || entity_value > tmp_map[entity]))
1585 {
1586 mooseAssert(grain._id != invalid_id, "Missing Grain ID");
1587 _feature_maps[map_index][entity] = grain._id;
1588
1589 if (_var_index_mode)
1590 _var_index_maps[map_index][entity] = grain._var_index;
1591
1592 tmp_map[entity] = entity_value;
1593 }
1594
1596 {
1597 auto insert_pair = moose_try_emplace(
1598 _entity_var_to_features, entity, std::vector<unsigned int>(_n_vars, invalid_id));
1599 auto & vec_ref = insert_pair.first->second;
1600
1601 if (insert_pair.second)
1602 {
1603 // insert the reserve op numbers (if appropriate)
1604 for (const auto reserve_index : make_range(_n_reserve_ops))
1605 vec_ref[reserve_index] = _reserve_grain_first_index + reserve_index;
1606 }
1607 vec_ref[grain._var_index] = grain._id;
1608 }
1609 }
1610
1612 for (auto entity : grain._halo_ids)
1613 _halo_ids[grain._var_index][entity] = grain._var_index;
1614
1615 for (auto entity : grain._ghosted_ids)
1616 _ghosted_entity_ids[entity] = 1;
1617 }
1618
1620}
std::pair< typename M::iterator, bool > moose_try_emplace(M &m, const typename M::key_type &k, Args &&... args)
sideset clear()
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override
const bool _var_index_mode
This variable is used to indicate whether the maps will contain unique region information or just the...
std::vector< std::map< dof_id_type, int > > _feature_maps
The feature maps contain the raw flooded node information and eventually the unique grain numbers.
std::vector< std::map< dof_id_type, int > > _var_index_maps
This map keeps track of which variables own which nodes.
const bool _condense_map_info
std::map< dof_id_type, std::vector< unsigned int > > _entity_var_to_features
const bool _compute_var_to_feature_map
Indicates whether or not the var to feature map is populated.
std::map< dof_id_type, int > _ghosted_entity_ids
The map for holding reconstructed ghosted element information.
void communicateHaloMap()
virtual Real getVariableValue(unsigned int op_index, const Point &p) const =0
Returns the variable value for a given op_index and mesh point.

Referenced by GrainTracker::finalize().

◆ updateRegionOffsets()

void FeatureFloodCount::updateRegionOffsets ( )
protectedinherited

This routine updates the _region_offsets variable which is useful for quickly determining the proper global number for a feature when using multimap mode.

◆ validParams()

InputParameters GrainTracker::validParams ( )
staticinherited

Definition at line 49 of file GrainTracker.C.

50{
53
54 // FeatureFloodCount adds a relationship manager, but we need to extend that for GrainTracker
56
58 "ElementSideNeighborLayers",
59 Moose::RelationshipManagerType::GEOMETRIC,
60
61 [](const InputParameters & obj_params, InputParameters & rm_params)
62 { rm_params.set<unsigned short>("layers") = obj_params.get<unsigned short>("halo_level"); }
63
64 );
65
66 params.addRelationshipManager("ElementSideNeighborLayers",
67 Moose::RelationshipManagerType::ALGEBRAIC);
68
69 // The GrainTracker requires non-volatile storage for tracking grains across invocations.
70 params.set<bool>("restartable_required") = true;
71
72 params.addParam<Real>("bound_value",
73 0.0,
74 "Absolute value of the lower bound for the variable value that represents "
75 "a region not assigned to the grain. Must be positive, but the actual "
76 "value used is -bound_value.");
77
78 params.addClassDescription("Grain Tracker object for running reduced order parameter simulations "
79 "without grain coalescence.");
80
81 return params;
82}
static InputParameters validParams()
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
void addRelationshipManager(const std::string &name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback input_parameter_callback=nullptr)
void clearRelationshipManagers()
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)

Referenced by GrainTrackerElasticity::validParams().

◆ visitElementalNeighbors()

void FeatureFloodCount::visitElementalNeighbors ( const Elem *  elem,
FeatureData feature,
bool  expand_halos_only,
bool  disjoint_only 
)
protectedinherited

Retrieve only the active neighbors for each side of this element, append them to the list of active neighbors

In general, {evaluable elements} >= {local elements} U {algebraic ghosting elements}. That is, the number of evaluable elements does NOT necessarily equal to the number of local and algebraic ghosting elements. The neighbors of evaluable elements can be remote even though we have two layers of geometric ghosting elements.

If the current element (passed into this method) doesn't have a connected neighbor but does have a topological neighbor, this might be a new disjoint region that we'll need to represent with a separate bounding box. To find out for sure, we'll need see if the new neighbors are present in any of the halo or disjoint halo sets. If they are not present, this is a new region.

In general, {evaluable elements} >= {local elements} U {algebraic ghosting elements}. That is, the number of evaluable elements does NOT necessarily equal to the number of local and algebraic ghosting elements. The neighbors of evaluable elements can be remote even though we have two layers of geometric ghosting elements.

This neighbor is NULL which means we need to expand the bounding box here in case this grain is up against multiple domain edges so we don't end up with a degenerate bounding box.

Definition at line 1618 of file FeatureFloodCount.C.

1622{
1623 mooseAssert(elem, "Elem is NULL");
1624
1625 std::vector<const Elem *> all_active_neighbors;
1626 MeshBase & mesh = _mesh.getMesh();
1627
1628 // Loop over all neighbors (at the the same level as the current element)
1629 for (const auto i : make_range(elem->n_neighbors()))
1630 {
1631 const Elem * neighbor_ancestor = nullptr;
1632 bool topological_neighbor = false;
1633
1638 neighbor_ancestor = elem->neighbor_ptr(i);
1639
1640 if (neighbor_ancestor)
1641 {
1648 if (neighbor_ancestor->is_remote())
1649 continue;
1650
1651 neighbor_ancestor->active_family_tree_by_neighbor(all_active_neighbors, elem, false);
1652 }
1653 else
1654 {
1655 neighbor_ancestor = elem->topological_neighbor(i, mesh, *_point_locator, _pbs);
1656
1664 if (neighbor_ancestor)
1665 {
1672 if (neighbor_ancestor->is_remote())
1673 continue;
1674
1675 neighbor_ancestor->active_family_tree_by_topological_neighbor(
1676 all_active_neighbors, elem, mesh, *_point_locator, _pbs, false);
1677
1678 topological_neighbor = true;
1679 }
1680 else
1681 {
1687 updateBBoxExtremesHelper(feature->_bboxes[0], *elem);
1688 }
1689 }
1690
1692 all_active_neighbors,
1693 feature,
1694 expand_halos_only,
1695 topological_neighbor,
1696 disjoint_only);
1697
1698 all_active_neighbors.clear();
1699 }
1700}
void visitNeighborsHelper(const T *curr_entity, std::vector< const T * > neighbor_entities, FeatureData *feature, bool expand_halos_only, bool topological_neighbor, bool disjoint_only)
The actual logic for visiting neighbors is abstracted out here.
std::unique_ptr< libMesh::PointLocatorBase > _point_locator

Referenced by FeatureFloodCount::expandEdgeHalos(), and FeatureFloodCount::flood().

◆ visitNeighborsHelper()

template<typename T >
void FeatureFloodCount::visitNeighborsHelper ( const T curr_entity,
std::vector< const T * >  neighbor_entities,
FeatureData feature,
bool  expand_halos_only,
bool  topological_neighbor,
bool  disjoint_only 
)
protectedinherited

The actual logic for visiting neighbors is abstracted out here.

This method is templated to handle the Nodal and Elemental cases together.

Only recurse where we own this entity and it's a topologically connected entity. We shouldn't even attempt to flood to the periodic boundary because we won't have solution information and if we are using DistributedMesh we probably won't have geometric information either.

When we only recurse on entities we own, we can never get more than one away from a local entity which should be in the ghosted zone.

Premark neighboring entities with a halo mark. These entities may or may not end up being part of the feature. We will not update the _entities_visited data structure here.

Definition at line 1717 of file FeatureFloodCount.C.

1723{
1724 // Loop over all active element neighbors
1725 for (const auto neighbor : neighbor_entities)
1726 {
1727 if (neighbor && (!_is_boundary_restricted || isBoundaryEntity(neighbor)))
1728 {
1729 if (expand_halos_only)
1730 {
1731 auto entity_id = neighbor->id();
1732
1733 if (topological_neighbor || disjoint_only)
1734 feature->_disjoint_halo_ids.insert(feature->_disjoint_halo_ids.end(), entity_id);
1735 else if (!FeatureFloodCount::contains(feature->_local_ids, entity_id))
1736 feature->_halo_ids.insert(feature->_halo_ids.end(), entity_id);
1737 }
1738 else
1739 {
1740 auto my_processor_id = processor_id();
1741
1742 if (!topological_neighbor && neighbor->processor_id() != my_processor_id)
1743 feature->_ghosted_ids.insert(feature->_ghosted_ids.end(), curr_entity->id());
1744
1754 if (curr_entity->processor_id() == my_processor_id ||
1755 neighbor->processor_id() == my_processor_id)
1756 {
1763 if (topological_neighbor || disjoint_only)
1764 feature->_disjoint_halo_ids.insert(feature->_disjoint_halo_ids.end(), neighbor->id());
1765 else
1766 _entity_queue.push_front(neighbor);
1767 }
1768 }
1769 }
1770 }
1771}
bool isBoundaryEntity(const T *entity) const
Returns a Boolean indicating whether the entity is on one of the desired boundaries.
static bool contains(std::set< T > &container, const T &item)
bool _is_boundary_restricted
Indicates that this object should only run on one or more boundaries.

Referenced by FeatureFloodCount::visitElementalNeighbors(), and FeatureFloodCount::visitNodalNeighbors().

◆ visitNodalNeighbors()

void FeatureFloodCount::visitNodalNeighbors ( const Node *  node,
FeatureData feature,
bool  expand_halos_only 
)
protectedinherited

These two routines are utility routines used by the flood routine and by derived classes for visiting neighbors.

Since the logic is different for the elemental versus nodal case it's easier to split them up.

Definition at line 1703 of file FeatureFloodCount.C.

1706{
1707 mooseAssert(node, "Node is NULL");
1708
1709 std::vector<const Node *> all_active_neighbors;
1710 MeshTools::find_nodal_neighbors(_mesh.getMesh(), *node, _nodes_to_elem_map, all_active_neighbors);
1711
1712 visitNeighborsHelper(node, all_active_neighbors, feature, expand_halos_only, false, false);
1713}
std::unordered_map< dof_id_type, std::vector< const Elem * > > _nodes_to_elem_map
The data structure used to find neighboring elements give a node ID.

Referenced by FeatureFloodCount::expandEdgeHalos(), and FeatureFloodCount::flood().

Member Data Documentation

◆ _all_boundary_entity_ids

std::unordered_set<dof_id_type> FeatureFloodCount::_all_boundary_entity_ids
protectedinherited

The set of entities on the boundary of the domain used for determining if features intersect any boundary.

Definition at line 695 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::meshChanged().

◆ _all_ranges

std::vector<std::pair<dof_id_type, dof_id_type> > GrainTracker::_all_ranges
privateinherited

Data structure to hold element ID ranges when using Distributed Mesh (populated on rank 0 only)

Definition at line 250 of file GrainTracker.h.

Referenced by GrainTracker::communicateHaloMap(), and GrainTracker::meshChanged().

◆ _bnd_elem_range

ConstBndElemRange* FeatureFloodCount::_bnd_elem_range
protectedinherited

Boundary element range pointer.

Definition at line 713 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::execute(), and FeatureFloodCount::isBoundaryEntity().

◆ _bound_value

const Real GrainTracker::_bound_value
protectedinherited

Absolute value of the lower bound used to represent a region not assigned to this grain, used when a grain is remapped to another order parameter.

The actual value used is -_bound_value

Definition at line 201 of file GrainTracker.h.

Referenced by GrainTracker::swapSolutionValuesHelper().

◆ _compute_halo_maps

const bool FeatureFloodCount::_compute_halo_maps
protectedinherited

Indicates whether or not to communicate halo map information with all ranks.

Definition at line 588 of file FeatureFloodCount.h.

Referenced by GrainTracker::communicateHaloMap(), GrainTracker::meshChanged(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _compute_var_to_feature_map

const bool FeatureFloodCount::_compute_var_to_feature_map
protectedinherited

Indicates whether or not the var to feature map is populated.

Definition at line 591 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::getVarToFeatureVector(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _condense_map_info

const bool FeatureFloodCount::_condense_map_info
protectedinherited

◆ _connecting_threshold

const Real FeatureFloodCount::_connecting_threshold
protectedinherited

The threshold above (or below) which neighboring entities are flooded (where regions can be extended but not started)

Definition at line 561 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::initialize().

◆ _dof_map

const DofMap& FeatureFloodCount::_dof_map
protectedinherited

Reference to the dof_map containing the coupled variables.

Definition at line 553 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::flood().

◆ _element_average_value

const PostprocessorValue& FeatureFloodCount::_element_average_value
protectedinherited

Average value of the domain which can optionally be used to find features in a field.

Definition at line 676 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::initialize().

◆ _empty_var_to_features

std::vector<unsigned int> FeatureFloodCount::_empty_var_to_features
protectedinherited

◆ _entities_visited

std::vector<std::set<dof_id_type> > FeatureFloodCount::_entities_visited
protectedinherited

This variable keeps track of which nodes have been visited during execution.

We don't use the _feature_map for this since we don't want to explicitly store data for all the unmarked nodes in a serialized datastructures. This keeps our overhead down since this variable never needs to be communicated.

Definition at line 615 of file FeatureFloodCount.h.

Referenced by PolycrystalUserObjectBase::execute(), FeatureFloodCount::flood(), FeatureFloodCount::initialize(), FeatureFloodCount::initialSetup(), and PolycrystalUserObjectBase::isNewFeatureOrConnectedRegion().

◆ _entity_queue

std::deque<const DofObject *> FeatureFloodCount::_entity_queue
privateinherited

The data structure for maintaining entities to flood during discovery.

Definition at line 759 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::flood(), and FeatureFloodCount::visitNeighborsHelper().

◆ _entity_var_to_features

std::map<dof_id_type, std::vector<unsigned int> > FeatureFloodCount::_entity_var_to_features
protectedinherited

◆ _error_on_grain_creation

const bool GrainTracker::_error_on_grain_creation
protectedinherited

Boolean to terminate with an error if a new grain is created during the simulation.

This is for simulations where new grains are not expected. Note, this does not impact the initial callback to newGrainCreated() nor does it get triggered for splitting grains.

Definition at line 234 of file GrainTracker.h.

Referenced by GrainTracker::trackGrains().

◆ _fe_vars

std::vector<MooseVariableFEBase *> FeatureFloodCount::_fe_vars
protectedinherited

The vector of coupled in variables.

Definition at line 548 of file FeatureFloodCount.h.

Referenced by GrainTracker::centroidRegionDistance(), FeatureFloodCount::FeatureFloodCount(), and FeatureFloodCount::getFECoupledVars().

◆ _feature_count

unsigned int FeatureFloodCount::_feature_count
protectedinherited

◆ _feature_counts_per_map

std::vector<unsigned int> FeatureFloodCount::_feature_counts_per_map
protectedinherited

◆ _feature_id_to_local_index

std::vector<std::size_t> FeatureFloodCount::_feature_id_to_local_index
protectedinherited

◆ _feature_maps

std::vector<std::map<dof_id_type, int> > FeatureFloodCount::_feature_maps
protectedinherited

The feature maps contain the raw flooded node information and eventually the unique grain numbers.

We have a vector of them so we can create one per variable if that level of detail is desired.

Definition at line 662 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::getEntityValue(), FeatureFloodCount::initialize(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _feature_sets

std::vector<FeatureData>& FeatureFloodCount::_feature_sets
protectedinherited

The data structure used to hold the globally unique features.

The sorting of the vector is implementation defined and may not correspond to anything useful. The ID of each feature should be queried from the FeatureData objects.

Definition at line 646 of file FeatureFloodCount.h.

Referenced by GrainTracker::assignGrains(), PolycrystalUserObjectBase::assignOpsToGrains(), GrainTracker::attemptGrainRenumber(), GrainTracker::broadcastAndUpdateGrainData(), FeatureFloodCount::buildFeatureIdToLocalIndices(), PolycrystalUserObjectBase::buildGrainAdjacencyMatrix(), FeatureFloodCount::buildLocalToGlobalIndices(), GrainTracker::communicateHaloMap(), GrainTracker::computeMinDistancesFromGrain(), FeatureFloodCount::consolidateMergedFeatures(), FeatureFloodCount::doesFeatureIntersectBoundary(), GrainTracker::doesFeatureIntersectBoundary(), FeatureFloodCount::doesFeatureIntersectSpecifiedBoundary(), GrainTracker::doesFeatureIntersectSpecifiedBoundary(), FeatureFloodCount::featureCentroid(), PolycrystalUserObjectBase::finalize(), FeatureFloodCount::getEntityValue(), FeatureFloodCount::getFeatures(), FeatureFloodCount::getFeatureVar(), GrainTracker::getGrainCentroid(), FeatureFloodCount::initialize(), GrainTracker::initialize(), FeatureFloodCount::isFeaturePercolated(), GrainTracker::isFeaturePercolated(), GrainTracker::newGrainCreated(), GrainTracker::prepopulateState(), GrainTracker::remapGrains(), FeatureFloodCount::scatterAndUpdateRanks(), FeatureFloodCount::sortAndLabel(), GrainTracker::trackGrains(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _feature_sets_old

std::vector<FeatureData> GrainTracker::_feature_sets_old
protectedinherited

This data structure holds the map of unique grains from the previous time step.

The information is updated each timestep to track grains over time.

Definition at line 213 of file GrainTracker.h.

Referenced by GrainTracker::initialize(), and GrainTracker::trackGrains().

◆ _first_time

bool& GrainTracker::_first_time
protectedinherited

Boolean to indicate the first time this object executes.

Note: _tracking_step isn't enough if people skip initial or execute more than once per step.

Definition at line 227 of file GrainTracker.h.

Referenced by GrainTracker::assignGrains(), GrainTracker::execute(), GrainTracker::finalize(), GrainTracker::initialize(), GrainTracker::newGrainCreated(), GrainTracker::prepopulateState(), GrainTracker::trackGrains(), and GrainTracker::updateFieldInfo().

◆ _ghosted_entity_ids

std::map<dof_id_type, int> FeatureFloodCount::_ghosted_entity_ids
protectedinherited

The map for holding reconstructed ghosted element information.

Definition at line 679 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::getEntityValue(), FeatureFloodCount::initialize(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _global_numbering

const bool FeatureFloodCount::_global_numbering
protectedinherited

This variable is used to indicate whether or not we identify features with unique numbers on multiple maps.

Definition at line 581 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::updateFieldInfo().

◆ _grain_data

template<typename T >
std::vector<T>& GrainDataTracker< T >::_grain_data
protected

per grain data

Definition at line 34 of file GrainDataTracker.h.

◆ _halo_ids

std::vector<std::map<dof_id_type, int> > FeatureFloodCount::_halo_ids
protectedinherited

The data structure for looking up halos around features.

The outer vector is for splitting out the information per variable. The inner map holds the actual halo information

Definition at line 685 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::FeatureData::clear(), GrainTracker::communicateHaloMap(), FeatureFloodCount::getEntityValue(), FeatureFloodCount::FeatureData::halosIntersect(), FeatureFloodCount::initialize(), FeatureFloodCount::FeatureData::merge(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _halo_level

const unsigned short GrainTracker::_halo_level
protectedinherited

The thickness of the halo surrounding each grain.

Definition at line 182 of file GrainTracker.h.

Referenced by GrainTracker::finalize().

◆ _is_boundary_restricted

bool FeatureFloodCount::_is_boundary_restricted
protectedinherited

Indicates that this object should only run on one or more boundaries.

Definition at line 710 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::execute(), FeatureFloodCount::FeatureFloodCount(), and FeatureFloodCount::visitNeighborsHelper().

◆ _is_elemental

const bool FeatureFloodCount::_is_elemental
protectedinherited

◆ _is_primary

const bool FeatureFloodCount::_is_primary
protectedinherited

◆ _is_transient

const bool GrainTracker::_is_transient
privateinherited

Boolean to indicate whether this is a Steady or Transient solve.

Definition at line 247 of file GrainTracker.h.

Referenced by GrainTracker::swapSolutionValuesHelper().

◆ _local_to_global_feature_map

std::vector<std::size_t> FeatureFloodCount::_local_to_global_feature_map
protectedinherited

The vector recording the local to global feature indices.

Definition at line 665 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::scatterAndUpdateRanks().

◆ _maps_size

const std::size_t FeatureFloodCount::_maps_size
protectedinherited

◆ _max_curr_grain_id

unsigned int& GrainTracker::_max_curr_grain_id
privateinherited

Holds the next "regular" grain ID (a grain found or remapped to the standard op vars)

Definition at line 244 of file GrainTracker.h.

Referenced by GrainTracker::assignGrains(), GrainTracker::getNewGrainIDs(), GrainTracker::getNextUniqueID(), GrainTracker::getTotalFeatureCount(), and GrainTracker::trackGrains().

◆ _max_remap_recursion_depth

const unsigned short GrainTracker::_max_remap_recursion_depth
protectedinherited

Depth of renumbering recursion (a depth of zero means no recursion)

Definition at line 185 of file GrainTracker.h.

Referenced by GrainTracker::remapGrains().

◆ _mesh

MooseMesh& FeatureFloodCount::_mesh
protectedinherited

◆ _n_procs

const processor_id_type FeatureFloodCount::_n_procs
protectedinherited

Convenience variable holding the number of processors in this simulation.

Definition at line 607 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::buildLocalToGlobalIndices(), and GrainTracker::communicateHaloMap().

◆ _n_reserve_ops

const unsigned short GrainTracker::_n_reserve_ops
protectedinherited

The number of reserved order parameters.

Definition at line 188 of file GrainTracker.h.

Referenced by GrainTracker::getNextUniqueID(), GrainTracker::trackGrains(), and GrainTracker::updateFieldInfo().

◆ _n_vars

const std::size_t FeatureFloodCount::_n_vars
protectedinherited

◆ _nodes_to_elem_map

std::unordered_map<dof_id_type, std::vector<const Elem *> > FeatureFloodCount::_nodes_to_elem_map
protectedinherited

The data structure used to find neighboring elements give a node ID.

Definition at line 626 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::meshChanged(), and FeatureFloodCount::visitNodalNeighbors().

◆ _old_max_grain_id

unsigned int GrainTracker::_old_max_grain_id
privateinherited

The previous max grain id (needed to figure out which ids are new in a given step)

Definition at line 241 of file GrainTracker.h.

Referenced by GrainTracker::getNewGrainIDs(), and GrainTracker::trackGrains().

◆ _partial_feature_sets

std::vector<std::list<FeatureData> > FeatureFloodCount::_partial_feature_sets
protectedinherited

◆ _pbs

libMesh::PeriodicBoundaries* FeatureFloodCount::_pbs
protectedinherited

◆ _periodic_node_map

std::multimap<dof_id_type, dof_id_type> FeatureFloodCount::_periodic_node_map
protectedinherited

The data structure which is a list of nodes that are constrained to other nodes based on the imposed periodic boundary conditions.

Definition at line 691 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::appendPeriodicNeighborNodes(), FauxGrainTracker::getEntityValue(), FeatureFloodCount::getEntityValue(), and FeatureFloodCount::meshChanged().

◆ _point_locator

std::unique_ptr<libMesh::PointLocatorBase> FeatureFloodCount::_point_locator
protectedinherited

◆ _poly_ic_uo

const PolycrystalUserObjectBase* const GrainTracker::_poly_ic_uo
protectedinherited

An optional IC UserObject which can provide initial data structures to this object.

Definition at line 216 of file GrainTracker.h.

Referenced by GrainTracker::execute(), GrainTracker::finalize(), GrainTracker::GrainTracker(), and GrainTracker::updateFieldInfo().

◆ _primary_perc_bnds

std::vector<BoundaryID> FeatureFloodCount::_primary_perc_bnds
protectedinherited

◆ _remap

const bool GrainTracker::_remap
protectedinherited

Inidicates whether remapping should be done or not (remapping is independent of tracking)

Definition at line 204 of file GrainTracker.h.

Referenced by GrainTracker::finalize().

◆ _reserve_grain_first_index

unsigned int GrainTracker::_reserve_grain_first_index
privateinherited

Holds the first unique grain index when using _reserve_op (all the remaining indices are sequential)

Definition at line 238 of file GrainTracker.h.

Referenced by GrainTracker::assignGrains(), GrainTracker::getNextUniqueID(), GrainTracker::trackGrains(), and GrainTracker::updateFieldInfo().

◆ _reserve_op_index

const std::size_t GrainTracker::_reserve_op_index
protectedinherited

The cutoff index where if variable index >= this number, no remapping TO that variable will occur.

Definition at line 192 of file GrainTracker.h.

Referenced by GrainTracker::computeMinDistancesFromGrain(), GrainTracker::getThreshold(), GrainTracker::remapGrains(), and GrainTracker::trackGrains().

◆ _reserve_op_threshold

const Real GrainTracker::_reserve_op_threshold
protectedinherited

The threshold above (or below) where a grain may be found on a reserve op field.

Definition at line 195 of file GrainTracker.h.

Referenced by GrainTracker::getThreshold().

◆ _secondary_perc_bnds

std::vector<BoundaryID> FeatureFloodCount::_secondary_perc_bnds
protectedinherited

◆ _single_map_mode

const bool FeatureFloodCount::_single_map_mode
protectedinherited

This variable is used to indicate whether or not multiple maps are used during flooding.

Definition at line 575 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::flood(), PolycrystalUserObjectBase::PolycrystalUserObjectBase(), FeatureFloodCount::sortAndLabel(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _specified_bnds

std::vector<BoundaryID> FeatureFloodCount::_specified_bnds
protectedinherited

◆ _step_connecting_threshold

Real FeatureFloodCount::_step_connecting_threshold
protectedinherited

◆ _step_threshold

Real FeatureFloodCount::_step_threshold
protectedinherited

◆ _threshold

const Real FeatureFloodCount::_threshold
protectedinherited

The threshold above (or below) where an entity may begin a new region (feature)

Definition at line 556 of file FeatureFloodCount.h.

Referenced by FauxGrainTracker::execute(), and FeatureFloodCount::initialize().

◆ _tolerate_failure

const bool GrainTracker::_tolerate_failure
protectedinherited

Indicates whether we should continue after a remap failure (will result in non-physical results)

Definition at line 207 of file GrainTracker.h.

Referenced by GrainTracker::GrainTracker(), and GrainTracker::remapGrains().

◆ _tracking_step

const int GrainTracker::_tracking_step
protectedinherited

◆ _use_less_than_threshold_comparison

const bool FeatureFloodCount::_use_less_than_threshold_comparison
protectedinherited

Use less-than when comparing values against the threshold value.

True by default. If false, then greater-than comparison is used instead.

Definition at line 598 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::compareValueWithThreshold(), and FauxGrainTracker::execute().

◆ _var_index_maps

std::vector<std::map<dof_id_type, int> > FeatureFloodCount::_var_index_maps
protectedinherited

This map keeps track of which variables own which nodes.

We need a vector of them for multimap mode where multiple variables can own a single mode.

Note: This map is only populated when "show_var_coloring" is set to true.

Definition at line 623 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::FeatureFloodCount(), FeatureFloodCount::getEntityValue(), FeatureFloodCount::initialize(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _var_index_mode

const bool FeatureFloodCount::_var_index_mode
protectedinherited

This variable is used to indicate whether the maps will contain unique region information or just the variable numbers owning those regions.

Definition at line 585 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::FeatureFloodCount(), FeatureFloodCount::getEntityValue(), FeatureFloodCount::initialize(), FeatureFloodCount::updateFieldInfo(), and GrainTracker::updateFieldInfo().

◆ _var_number

unsigned long FeatureFloodCount::_var_number
protectedinherited

This variable is used to build the periodic node map.

Assumption: We are going to assume that either all variables are periodic or none are. This assumption can be relaxed at a later time if necessary.

Definition at line 572 of file FeatureFloodCount.h.

Referenced by FeatureFloodCount::meshChanged().

◆ _vars

std::vector<MooseVariable *> FeatureFloodCount::_vars
protectedinherited

◆ _verbosity_level

const short GrainTracker::_verbosity_level
protectedinherited

Verbosity level controlling the amount of information printed to the console.

Definition at line 221 of file GrainTracker.h.

Referenced by GrainTracker::attemptGrainRenumber(), GrainTracker::finalize(), GrainTracker::remapGrains(), and GrainTracker::trackGrains().

◆ _volatile_feature_sets

std::vector<FeatureData> FeatureFloodCount::_volatile_feature_sets
protectedinherited

Derived objects (e.g.

the GrainTracker) may require restartable data to track information across time steps. The FeatureFloodCounter however does not. This container is here so that we have the flexabilty to switch between volatile and non-volatile storage. The _feature_sets data structure can conditionally refer to this structure or a MOOSE-provided structure, which is backed up.

Definition at line 655 of file FeatureFloodCount.h.

◆ invalid_id

const unsigned int FeatureFloodCount::invalid_id = std::numeric_limits<unsigned int>::max()
staticinherited

◆ invalid_proc_id

const processor_id_type FeatureFloodCount::invalid_proc_id
staticinherited
Initial value:
=
std::numeric_limits<processor_id_type>::max()

Definition at line 93 of file FeatureFloodCount.h.

Referenced by PolycrystalUserObjectBase::numberOfDistributedMergeHelpers().

◆ invalid_size_t

const std::size_t FeatureFloodCount::invalid_size_t = std::numeric_limits<std::size_t>::max()
staticinherited

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