https://mooseframework.inl.gov
ExtraIDIntegralVectorPostprocessor.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 
14 
20  : public SpatialUserObjectFunctor<ElementVariableVectorPostprocessor>
21 {
22 public:
25 
26  virtual void initialize() override;
27  virtual void execute() override;
28  virtual void finalize() override;
29  virtual void threadJoin(const UserObject & uo) override;
31  const std::vector<VectorPostprocessorValue *> & getUniqueExtraIds() const { return _extra_ids; };
33  const std::vector<VectorPostprocessorValue *> & getIntegrals() const { return _integrals; };
34 
36 
38  virtual Real evaluate(const ElemArg & elem, const Moose::StateArg & state) const override;
40  virtual Real evaluate(const ElemQpArg & qp, const Moose::StateArg & state) const override;
41 
42 protected:
44  Real elementValue(const Elem * elem) const;
46  const bool _average;
48  const unsigned int _nvar;
50  const unsigned int _nprop;
52  const std::vector<MaterialPropertyName> _prop_names;
54  const std::vector<ExtraElementIDName> _extra_id;
56  const unsigned int _n_extra_id;
57  // Map of element ids to parsed vpp ids
58  std::unordered_map<dof_id_type, dof_id_type> _unique_vpp_ids;
60  std::vector<VectorPostprocessorValue *> _extra_ids;
62  std::vector<const MooseVariable *> _vars;
64  std::vector<const VariableValue *> _var_values;
66  std::vector<const MaterialProperty<Real> *> _props;
68  std::vector<VectorPostprocessorValue *> _integrals;
70  std::vector<Real> _volumes;
73 };
const unsigned int _nprop
Number of material properties to be integrated.
virtual void execute() override
Execute method.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
virtual Real evaluate(const ElemArg &elem, const Moose::StateArg &state) const override
Get values for an element based on the element extra element id.
std::vector< VectorPostprocessorValue * > _integrals
Vectors holding integrals over extra IDs.
std::vector< const MooseVariable * > _vars
Coupled MOOSE variables to be integrated.
const unsigned int _n_extra_id
Number of extra IDs in use.
std::vector< const VariableValue * > _var_values
Quadrature point values of coupled MOOSE variables.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< VectorPostprocessorValue * > _extra_ids
Vectors holding extra IDs.
const std::vector< VectorPostprocessorValue * > & getUniqueExtraIds() const
Return extra ID list.
const std::vector< MaterialPropertyName > _prop_names
Name of material properties.
Real elementValue(const Elem *elem) const
Get the value for an element based on the element extra element id.
ExtraIDIntegralVectorPostprocessor(const InputParameters &parameters)
virtual void threadJoin(const UserObject &uo) override
Must override.
unsigned int _spatial_evaluation_index
The index to the values that is used in &#39;evaluate&#39; function.
const unsigned int _nvar
Number of variables to be integrated.
const bool _average
whether or not to compute volume average
const std::vector< ExtraElementIDName > _extra_id
Extra IDs in use.
std::unordered_map< dof_id_type, dof_id_type > _unique_vpp_ids
const std::vector< VectorPostprocessorValue * > & getIntegrals() const
Return Integral values.
std::vector< Real > _volumes
Vector holding the volume of extra IDs.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This ExtraIDIntegralVectorPostprocessor source code is to integrate variables based on parsed extra I...
std::vector< const MaterialProperty< Real > * > _props
Material properties to be integrated.
Base class for creating a user object with the SpatialUserObject and Moose::Functor APIs...
const InputParameters & parameters() const
Get the parameters of the object.
State argument for evaluating functors.
Base class for user-specific data.
Definition: UserObject.h:40