https://mooseframework.inl.gov
AverageSectionValueSampler.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 
13 #include "libmesh/communicator.h"
14 
16 {
17 public:
19 
21 
22  virtual void initialSetup() override;
23  virtual void meshChanged() override;
24  virtual void initialize() override;
25  virtual void execute() override;
26  virtual void finalize() override;
27 
28 protected:
30  const std::shared_ptr<MooseMesh> & _mesh;
31 
33  std::vector<VariableName> _variables;
34 
36  std::vector<unsigned int> _var_numbers;
37 
39  std::vector<VectorPostprocessorValue *> _output_vector;
40 
41  // Block ids over which this postprocessor does the computation
42  std::vector<SubdomainID> _block_ids;
43 
45  const Point _direction;
46 
48  const Point _reference_point;
49 
51  std::vector<Real> _positions;
52 
55 
58 
61 
64 
67  std::vector<unsigned int> _number_of_nodes;
68 
71 
74 
77 
78 private:
85  Real axialPosition(const Node & node) const;
86 
92 };
const Real _cross_section_maximum_radius
Tolerance to disambiguate cross section locations in different components within the same block...
const bool _have_symmetry_plane
Whether a symmetry plane has been defined by the user.
const bool _require_equal_node_counts
Whether to require the number of nodes at each axial location to be equal.
std::vector< unsigned int > _number_of_nodes
Number of nodes for computing output (local and global).
const Point _direction
Axis direction of the structural component.
void automaticallyLocatePositions()
Automatically identify all axial positions of nodes within the component and store their unique value...
AverageSectionValueSampler(const InputParameters &parameters)
std::vector< SubdomainID > _block_ids
std::vector< unsigned int > _var_numbers
Indices of the variables in their systems.
const Point _reference_point
Starting or reference point of the structural component to locate nodes on the cross section...
RealVectorValue _symmetry_plane
Vector normal to a symmetry plane, optionally defined if the section has a symmetry plane...
static InputParameters validParams()
std::vector< Real > _positions
Axial positions along the component at which average values are computed.
Real axialPosition(const Node &node) const
Determine axial distance of the point from the component&#39;s reference point.
const bool _automatically_locate_positions
Whether to automatically locate positions along section for averaging field values.
const std::shared_ptr< MooseMesh > & _mesh
Reference to the mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< VariableName > _variables
Variables to output.
const Real _tolerance
Tolerance to identify nodes on the user-prescribed cross section.
std::vector< VectorPostprocessorValue * > _output_vector
Vector of outputs, where each entry is the vector of average values for single variable at the select...
virtual void initialSetup() override
const InputParameters & parameters() const
bool _need_mesh_initializations
Whether node locations need to be identified and nodes at positions need to be counted.