https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
22public:
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
42protected:
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};
Base class VectorPostprocessors operating on elemental variables.
This ExtraIDIntegralVectorPostprocessor source code is to integrate variables based on parsed extra I...
std::vector< VectorPostprocessorValue * > _extra_ids
Vectors holding extra IDs.
virtual void execute() override
Execute method.
std::vector< Real > _volumes
Vector holding the volume of extra IDs.
std::unordered_map< dof_id_type, dof_id_type > _unique_vpp_ids
const unsigned int _nvar
Number of variables to be integrated.
const bool _average
whether or not to compute volume average
const unsigned int _nprop
Number of material properties to be integrated.
Real elementValue(const Elem *elem) const
Get the value for an element based on the element extra element id.
const std::vector< VectorPostprocessorValue * > & getIntegrals() const
Return Integral values.
unsigned int _spatial_evaluation_index
The index to the values that is used in 'evaluate' function.
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< const MooseVariable * > _vars
Coupled MOOSE variables to be integrated.
std::vector< const MaterialProperty< Real > * > _props
Material properties to be integrated.
virtual void threadJoin(const UserObject &uo) override
Must override.
const std::vector< VectorPostprocessorValue * > & getUniqueExtraIds() const
Return extra ID list.
std::vector< const VariableValue * > _var_values
Quadrature point values of coupled MOOSE variables.
const std::vector< ExtraElementIDName > _extra_id
Extra IDs in use.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const std::vector< MaterialPropertyName > _prop_names
Name of material properties.
virtual Real evaluate(const ElemQpArg &qp, const Moose::StateArg &state) const override
Get values for an element on qps based on the element extra element id.
const unsigned int _n_extra_id
Number of extra IDs in use.
std::vector< VectorPostprocessorValue * > _integrals
Vectors holding integrals over extra IDs.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Base class for creating a user object with the SpatialUserObject and Moose::Functor APIs.
Base class for user-specific data.
Definition UserObject.h:20
A structure that is used to evaluate Moose functors logically at an element/cell center.
Argument for requesting functor evaluation at a quadrature point location in an element.
State argument for evaluating functors.