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 
12 #include "GeneralVectorPostprocessor.h"
13 #include "MooseVariableDependencyInterface.h"
14 #include "BoundaryRestrictable.h"
15 
16 // Forward Declarations
18 class FeatureFloodCount;
19 
20 template <>
22 
33 class FeatureVolumeVectorPostprocessor : public GeneralVectorPostprocessor,
34  public MooseVariableDependencyInterface,
35  public BoundaryRestrictable
36 {
37 public:
38  FeatureVolumeVectorPostprocessor(const InputParameters & parameters);
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 
57  VectorPostprocessorValue & _var_num;
58  VectorPostprocessorValue & _feature_volumes;
59  VectorPostprocessorValue & _intersects_bounds;
60  VectorPostprocessorValue & _intersects_specified_bounds;
61  VectorPostprocessorValue & _percolated;
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 
87  MooseMesh & _mesh;
88  Assembly & _assembly;
89  const MooseArray<Point> & _q_point;
90  const QBase * const & _qrule;
91  const MooseArray<Real> & _JxW;
92  const MooseArray<Real> & _coord;
93  const QBase * const & _qrule_face;
94  const MooseArray<Real> & _JxW_face;
95 };
FeatureVolumeVectorPostprocessor::_single_feature_per_elem
const bool _single_feature_per_elem
A Boolean indicating how the volume is calculated.
Definition: FeatureVolumeVectorPostprocessor.h:51
FeatureVolumeVectorPostprocessor::accumulateVolumes
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.
Definition: FeatureVolumeVectorPostprocessor.C:192
FeatureVolumeVectorPostprocessor::execute
virtual void execute() override
Definition: FeatureVolumeVectorPostprocessor.C:85
FeatureVolumeVectorPostprocessor::_qrule
const QBase *const & _qrule
Definition: FeatureVolumeVectorPostprocessor.h:90
FeatureFloodCount
This object will mark nodes or elements of continuous regions all with a unique number for the purpos...
Definition: FeatureFloodCount.h:44
FeatureVolumeVectorPostprocessor::getFeatureVolume
Real getFeatureVolume(unsigned int feature_id) const
Returns the volume for the given grain number.
Definition: FeatureVolumeVectorPostprocessor.C:185
FeatureVolumeVectorPostprocessor::_qrule_face
const QBase *const & _qrule_face
Definition: FeatureVolumeVectorPostprocessor.h:93
FeatureVolumeVectorPostprocessor::_JxW_face
const MooseArray< Real > & _JxW_face
Definition: FeatureVolumeVectorPostprocessor.h:94
FeatureVolumeVectorPostprocessor::finalize
virtual void finalize() override
Definition: FeatureVolumeVectorPostprocessor.C:178
FeatureVolumeVectorPostprocessor::_q_point
const MooseArray< Point > & _q_point
Definition: FeatureVolumeVectorPostprocessor.h:89
FeatureVolumeVectorPostprocessor::_feature_volumes
VectorPostprocessorValue & _feature_volumes
Definition: FeatureVolumeVectorPostprocessor.h:58
FeatureVolumeVectorPostprocessor::_intersects_specified_bounds
VectorPostprocessorValue & _intersects_specified_bounds
Definition: FeatureVolumeVectorPostprocessor.h:60
FeatureVolumeVectorPostprocessor::_var_num
VectorPostprocessorValue & _var_num
Definition: FeatureVolumeVectorPostprocessor.h:57
FeatureVolumeVectorPostprocessor::_coupled_sln
std::vector< const VariableValue * > _coupled_sln
Definition: FeatureVolumeVectorPostprocessor.h:85
FeatureVolumeVectorPostprocessor::_output_centroids
const bool _output_centroids
Definition: FeatureVolumeVectorPostprocessor.h:52
FeatureVolumeVectorPostprocessor::_feature_counter
const FeatureFloodCount & _feature_counter
A reference to the feature flood count object.
Definition: FeatureVolumeVectorPostprocessor.h:55
FeatureVolumeVectorPostprocessor::computeFaceIntegral
Real computeFaceIntegral(std::size_t var_index) const
Calculate the integral on the face if boundary is supplied as input.
Definition: FeatureVolumeVectorPostprocessor.C:281
FeatureVolumeVectorPostprocessor::_percolated
VectorPostprocessorValue & _percolated
Definition: FeatureVolumeVectorPostprocessor.h:61
FeatureVolumeVectorPostprocessor::_is_boundary_restricted
bool _is_boundary_restricted
Indicates whether the calculation should be run on volumes or area of a boundary.
Definition: FeatureVolumeVectorPostprocessor.h:64
FeatureVolumeVectorPostprocessor::accumulateBoundaryFaces
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.
Definition: FeatureVolumeVectorPostprocessor.C:242
FeatureVolumeVectorPostprocessor::initialize
virtual void initialize() override
Definition: FeatureVolumeVectorPostprocessor.C:80
FeatureVolumeVectorPostprocessor
This VectorPostprocessor is intended to be used to calculate accurate volumes from the FeatureFloodCo...
Definition: FeatureVolumeVectorPostprocessor.h:33
FeatureVolumeVectorPostprocessor::computeIntegral
Real computeIntegral(std::size_t var_index) const
Calculate the integral value of the passed in variable (index)
Definition: FeatureVolumeVectorPostprocessor.C:231
FeatureVolumeVectorPostprocessor::_intersects_bounds
VectorPostprocessorValue & _intersects_bounds
Definition: FeatureVolumeVectorPostprocessor.h:59
FeatureVolumeVectorPostprocessor::_coord
const MooseArray< Real > & _coord
Definition: FeatureVolumeVectorPostprocessor.h:92
FeatureVolumeVectorPostprocessor::_vars
const std::vector< MooseVariableFEBase * > & _vars
Definition: FeatureVolumeVectorPostprocessor.h:84
FeatureVolumeVectorPostprocessor::FeatureVolumeVectorPostprocessor
FeatureVolumeVectorPostprocessor(const InputParameters &parameters)
Definition: FeatureVolumeVectorPostprocessor.C:47
validParams< FeatureVolumeVectorPostprocessor >
InputParameters validParams< FeatureVolumeVectorPostprocessor >()
Definition: FeatureVolumeVectorPostprocessor.C:25
FeatureVolumeVectorPostprocessor::_assembly
Assembly & _assembly
Definition: FeatureVolumeVectorPostprocessor.h:88
FeatureVolumeVectorPostprocessor::_mesh
MooseMesh & _mesh
Definition: FeatureVolumeVectorPostprocessor.h:87
FeatureVolumeVectorPostprocessor::_JxW
const MooseArray< Real > & _JxW
Definition: FeatureVolumeVectorPostprocessor.h:91