www.mooseframework.org
FauxGrainTracker.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "FeatureFloodCount.h"
13 #include "GrainTrackerInterface.h"
14 
22 {
23 public:
25 
27  virtual ~FauxGrainTracker();
28 
29  virtual void initialize() override;
30  virtual void finalize() override;
31  virtual Real getValue() const override;
32  virtual void execute() override;
33 
34  // GrainTrackerInterface methods
35  virtual Real getEntityValue(dof_id_type entity_id,
37  std::size_t var_idx) const override;
38  virtual const std::vector<unsigned int> &
39  getVarToFeatureVector(dof_id_type elem_id) const override;
40  virtual unsigned int getFeatureVar(unsigned int feature_id) const override;
41  virtual std::size_t getNumberActiveGrains() const override;
42  virtual std::size_t getTotalFeatureCount() const override;
43  virtual Point getGrainCentroid(unsigned int grain_id) const override;
44  virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override;
45 
46 private:
48  std::map<dof_id_type, unsigned int> _entity_id_to_var_num;
49 
50  std::map<dof_id_type, std::vector<unsigned int>> _entity_var_to_features;
51  std::vector<unsigned int> _empty_var_to_features;
52 
54  std::set<unsigned int> _variables_used;
55 
57  std::size_t _grain_count;
58 
59  // Convenience variable holding the number of variables coupled into this object
60  const std::size_t _n_vars;
61 
63  const int _tracking_step;
64 
66  std::vector<unsigned int> _op_to_grains;
67 
69  std::map<unsigned int, Real> _volume;
70 
72  std::map<unsigned int, unsigned int> _vol_count;
73 
75  std::map<unsigned int, Point> _centroid;
76 };
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
static InputParameters validParams()
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 finalize() override
std::vector< unsigned int > _op_to_grains
Order parameter to grain indices (just a reflexive vector)
FauxGrainTracker(const InputParameters &parameters)
virtual Point getGrainCentroid(unsigned int grain_id) const override
Returns the centroid for the given grain number.
std::map< unsigned int, unsigned int > _vol_count
The count of entities contributing to the volume calculation.
virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects any boundary.
virtual std::size_t getTotalFeatureCount() const override
Returns the total feature count (active and inactive ids, useful for sizing vectors) ...
std::set< unsigned int > _variables_used
Used as the lightweight grain counter.
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.
virtual Real getEntityValue(dof_id_type entity_id, FeatureFloodCount::FieldType field_type, std::size_t var_idx) const override
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
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::size_t getNumberActiveGrains() const override
Returns the number of active grains current stored in the GrainTracker.
std::size_t _grain_count
Total Grain Count.
const InputParameters & parameters() const
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
uint8_t dof_id_type
virtual unsigned int getFeatureVar(unsigned int feature_id) const override
Returns the variable representing the passed in feature.
virtual Real getValue() const override