www.mooseframework.org
FeatureVolumeVectorPostprocessor.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 
14 #include "BoundaryRestrictable.h"
15 
16 #include <array>
17 
18 // Forward Declarations
19 class FeatureFloodCount;
20 
34 {
35 public:
37 
39 
40  virtual void initialize() override;
41  virtual void execute() override;
42  virtual void finalize() override;
43 
47  Real getFeatureVolume(unsigned int feature_id) const;
48 
49 protected:
52  const bool _output_centroids;
53 
56 
62 
65 
66 private:
68  void accumulateVolumes(const Elem * elem,
69  const std::vector<unsigned int> & var_to_features,
70  std::size_t num_features);
71 
73  void accumulateBoundaryFaces(const Elem * elem,
74  const std::vector<unsigned int> & var_to_features,
75  std::size_t num_features,
76  unsigned int side);
77 
79  Real computeIntegral(std::size_t var_index) const;
80 
82  Real computeFaceIntegral(std::size_t var_index) const;
83 
84  const std::vector<MooseVariableFEBase *> & _vars;
85  std::vector<const VariableValue *> _coupled_sln;
86 
90  const QBase * const & _qrule;
93  const QBase * const & _qrule_face;
95 
96  std::array<VectorPostprocessorValue *, 3> _centroid;
97 };
void accumulateVolumes(const Elem *elem, const std::vector< unsigned int > &var_to_features, std::size_t num_features)
Add volume contributions to one or entries in the feature volume vector.
This VectorPostprocessor is intended to be used to calculate accurate volumes from the FeatureFloodCo...
std::array< VectorPostprocessorValue *, 3 > _centroid
const std::vector< MooseVariableFEBase * > & _vars
Real getFeatureVolume(unsigned int feature_id) const
Returns the volume for the given grain number.
void accumulateBoundaryFaces(const Elem *elem, const std::vector< unsigned int > &var_to_features, std::size_t num_features, unsigned int side)
When boundary is supplied as input, compute coverage of that boundary by each feature.
bool _is_boundary_restricted
Indicates whether the calculation should be run on volumes or area of a boundary. ...
VectorPostprocessorValue & _intersects_specified_bounds
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
const FeatureFloodCount & _feature_counter
A reference to the feature flood count object.
std::vector< const VariableValue * > _coupled_sln
Real computeFaceIntegral(std::size_t var_index) const
Calculate the integral on the face if boundary is supplied as input.
std::vector< Real > VectorPostprocessorValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const InputParameters & parameters() const
const bool _single_feature_per_elem
A Boolean indicating how the volume is calculated.
Real computeIntegral(std::size_t var_index) const
Calculate the integral value of the passed in variable (index)
FeatureVolumeVectorPostprocessor(const InputParameters &parameters)