https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FauxGrainTracker.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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"
14
22{
23public:
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
46private:
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};
This class is a fake grain tracker object, it will not actually track grains nor remap them but will ...
const std::size_t _n_vars
static InputParameters validParams()
virtual void finalize() 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.
std::map< unsigned int, unsigned int > _vol_count
The count of entities contributing to the volume calculation.
virtual void initialize() override
virtual std::size_t getTotalFeatureCount() const override
Returns the total feature count (active and inactive ids, useful for sizing vectors)
std::map< unsigned int, Point > _centroid
The centroid of the feature (average of coordinates from entities participating in the volume calcula...
std::size_t _grain_count
Total Grain Count.
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 std::size_t getNumberActiveGrains() const override
Returns the number of active grains current stored in the GrainTracker.
virtual void execute() override
virtual Real getValue() const override
virtual Real getEntityValue(dof_id_type entity_id, FeatureFloodCount::FieldType field_type, std::size_t var_idx) const override
const int _tracking_step
Used to emulate the tracking step of the real grain tracker object.
virtual bool doesFeatureIntersectBoundary(unsigned int feature_id) const override
Returns a Boolean indicating whether this feature intersects any boundary.
std::vector< unsigned int > _empty_var_to_features
virtual Point getGrainCentroid(unsigned int grain_id) const override
Returns the centroid for the given grain number.
std::set< unsigned int > _variables_used
Used as the lightweight grain counter.
virtual unsigned int getFeatureVar(unsigned int feature_id) const override
Returns the variable representing the passed in feature.
virtual ~FauxGrainTracker()
std::vector< unsigned int > _op_to_grains
Order parameter to grain indices (just a reflexive vector)
std::map< dof_id_type, std::vector< unsigned int > > _entity_var_to_features
std::map< unsigned int, Real > _volume
The volume of the feature.
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
This class defines the interface for the GrainTracking objects.
const InputParameters & parameters() const