PRISMS-PF Manual v3.0-pre
Loading...
Searching...
No Matches
FloodFiller.h
1#ifndef INCLUDE_FLOODFILLER_H_
2#define INCLUDE_FLOODFILLER_H_
3
4#include <deal.II/base/quadrature.h>
5#include <deal.II/dofs/dof_handler.h>
6#include <deal.II/fe/fe_q.h>
7#include <deal.II/fe/fe_system.h>
8#include <deal.II/fe/fe_values.h>
9#include <deal.II/grid/tria_accessor.h>
10#include <deal.II/grid/tria_iterator.h>
11#include <deal.II/lac/la_parallel_vector.h>
12#include <deal.II/matrix_free/fe_evaluation.h>
13
18template <int dim>
20{
21public:
25 void
26 setGrainIndex(unsigned int _grain_index)
27 {
28 grain_index = _grain_index;
29 };
30
34 [[nodiscard]] unsigned int
36 {
37 return grain_index;
38 };
39
43 void
44 setOrderParameterIndex(unsigned int _order_parameter_index)
45 {
46 order_parameter_index = _order_parameter_index;
47 };
48
52 [[nodiscard]] unsigned int
54 {
55 return order_parameter_index;
56 };
57
61 void
62 addVertexList(std::vector<dealii::Point<dim>> _vertices)
63 {
64 list_of_vertices.push_back(_vertices);
65 };
66
70 std::vector<std::vector<dealii::Point<dim>>>
72 {
73 return list_of_vertices;
74 };
75
76private:
80 unsigned int grain_index;
81
85 unsigned int order_parameter_index;
86
91 std::vector<std::vector<dealii::Point<dim>>> list_of_vertices;
92};
93
99template <int dim, int degree>
101{
102public:
106 FloodFiller(dealii::FESystem<dim> &_fe, dealii::QGaussLobatto<dim> _quadrature)
107 : quadrature(_quadrature)
108 , num_quad_points(_quadrature.size())
110 , fe(&_fe) {};
111
116 void
117 calcGrainSets(dealii::FESystem<dim> &finite_element,
118 dealii::DoFHandler<dim> &dof_handler,
119 dealii::LinearAlgebra::distributed::Vector<double> *solution_field,
120 double threshold_lower,
121 double threshold_upper,
122 int min_id,
123 unsigned int order_parameter_index,
124 std::vector<GrainSet<dim>> &grain_sets);
125
126protected:
130 template <typename T>
131 void
132 recursiveFloodFill(T cell,
133 T cell_end,
134 dealii::LinearAlgebra::distributed::Vector<double> *solution_field,
135 double threshold_lower,
136 double threshold_upper,
137 int min_id,
138 unsigned int &grain_index,
139 std::vector<GrainSet<dim>> &grain_sets,
140 bool &grain_assigned);
141
145 void
146 createGlobalGrainSetList(std::vector<GrainSet<dim>> &grain_sets) const;
147
152 void
153 mergeSplitGrains(std::vector<GrainSet<dim>> &grain_sets) const;
154
159 dealii::QGaussLobatto<dim> quadrature;
160
164 const unsigned int num_quad_points;
165
169 const unsigned int dofs_per_cell;
170
174 dealii::FESystem<dim> *fe;
175};
176
177#endif
Definition FloodFiller.h:101
void recursiveFloodFill(T cell, T cell_end, dealii::LinearAlgebra::distributed::Vector< double > *solution_field, double threshold_lower, double threshold_upper, int min_id, unsigned int &grain_index, std::vector< GrainSet< dim > > &grain_sets, bool &grain_assigned)
Definition FloodFiller.cc:81
void calcGrainSets(dealii::FESystem< dim > &finite_element, dealii::DoFHandler< dim > &dof_handler, dealii::LinearAlgebra::distributed::Vector< double > *solution_field, double threshold_lower, double threshold_upper, int min_id, unsigned int order_parameter_index, std::vector< GrainSet< dim > > &grain_sets)
Definition FloodFiller.cc:5
const unsigned int num_quad_points
Definition FloodFiller.h:164
const unsigned int dofs_per_cell
Definition FloodFiller.h:169
void mergeSplitGrains(std::vector< GrainSet< dim > > &grain_sets) const
Definition FloodFiller.cc:345
void createGlobalGrainSetList(std::vector< GrainSet< dim > > &grain_sets) const
Definition FloodFiller.cc:191
dealii::QGaussLobatto< dim > quadrature
Definition FloodFiller.h:159
dealii::FESystem< dim > * fe
Definition FloodFiller.h:174
FloodFiller(dealii::FESystem< dim > &_fe, dealii::QGaussLobatto< dim > _quadrature)
Definition FloodFiller.h:106
Definition FloodFiller.h:20
void setGrainIndex(unsigned int _grain_index)
Definition FloodFiller.h:26
unsigned int getOrderParameterIndex() const
Definition FloodFiller.h:53
unsigned int getGrainIndex() const
Definition FloodFiller.h:35
std::vector< std::vector< dealii::Point< dim > > > getVertexList() const
Definition FloodFiller.h:71
void addVertexList(std::vector< dealii::Point< dim > > _vertices)
Definition FloodFiller.h:62
void setOrderParameterIndex(unsigned int _order_parameter_index)
Definition FloodFiller.h:44