www.mooseframework.org
FauxGrainTracker.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef FAUXGRAINTRACKER_H
9 #define FAUXGRAINTRACKER_H
10 
11 #include "FeatureFloodCount.h"
12 #include "GrainTrackerInterface.h"
13 
14 class FauxGrainTracker;
15 
16 template <>
17 InputParameters validParams<FauxGrainTracker>();
18 
26 {
27 public:
28  FauxGrainTracker(const InputParameters & parameters);
29  virtual ~FauxGrainTracker();
30 
31  virtual void initialize() override;
32  virtual void finalize() override;
33  virtual Real getValue() override;
34  virtual void execute() override;
35 
36  // GrainTrackerInterface methods
37  virtual Real getEntityValue(dof_id_type entity_id,
39  std::size_t var_idx) const override;
40  virtual const std::vector<unsigned int> &
41  getVarToFeatureVector(dof_id_type elem_id) const override;
42  virtual unsigned int getFeatureVar(unsigned int feature_id) const override;
43  virtual std::size_t getNumberActiveGrains() const override;
44  virtual std::size_t getTotalFeatureCount() const override;
45  virtual Point getGrainCentroid(unsigned int grain_id) const override;
46  virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override;
47 
48 private:
50  std::map<dof_id_type, unsigned int> _entity_id_to_var_num;
51 
52  std::map<dof_id_type, std::vector<unsigned int>> _entity_var_to_features;
53  std::vector<unsigned int> _empty_var_to_features;
54 
56  std::set<unsigned int> _variables_used;
57 
59  std::size_t _grain_count;
60 
61  // Convenience variable holding the number of variables coupled into this object
62  const std::size_t _n_vars;
63 
65  const int _tracking_step;
66 
68  std::vector<unsigned int> _op_to_grains;
69 
71  std::map<unsigned int, Real> _volume;
72 
74  std::map<unsigned int, unsigned int> _vol_count;
75 
77  std::map<unsigned int, Point> _centroid;
78 };
79 
80 #endif
virtual ~FauxGrainTracker()
std::vector< unsigned int > _empty_var_to_features
This class defines the interface for the GrainTracking objects.
std::map< dof_id_type, std::vector< unsigned int > > _entity_var_to_features
virtual void finalize() override
virtual std::size_t getNumberActiveGrains() const override
Returns the number of active grains current stored in the GrainTracker.
std::vector< unsigned int > _op_to_grains
Order parameter to grain indices (just a reflexive vector)
FauxGrainTracker(const InputParameters &parameters)
virtual std::size_t getTotalFeatureCount() const override
Returns the total feature count (active and inactive ids, useful for sizing vectors) ...
std::map< unsigned int, unsigned int > _vol_count
The count of entities contributing to the volume calculation.
virtual unsigned int getFeatureVar(unsigned int feature_id) const override
Returns the variable representing the passed in feature.
std::set< unsigned int > _variables_used
Used as the lightweight grain counter.
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 void initialize() override
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
const int _tracking_step
Used to emulate the tracking step of the real grain tracker object.
InputParameters validParams< FauxGrainTracker >()
std::map< dof_id_type, unsigned int > _entity_id_to_var_num
The mapping of entities to grains, in this case always the order parameter.
virtual void execute() override
virtual Real getEntityValue(dof_id_type entity_id, FeatureFloodCount::FieldType field_type, std::size_t var_idx) const override
virtual Real getValue() override
virtual Point getGrainCentroid(unsigned int grain_id) const override
Returns the centroid for the given grain number.
std::size_t _grain_count
Total Grain Count.
virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects any boundary.
This class is a fake grain tracker object, it will not actually track grains nor remap them but will ...
std::map< unsigned int, Point > _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...
std::map< unsigned int, Real > _volume
The volume of the feature.
const std::size_t _n_vars