Line data Source code
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 : 12 : #include "InterfaceValueUserObject.h" 13 : 14 : /** 15 : * This is a base class for userobjects collecting values of variables or material properites across 16 : * an interface at each QP. This userobejct class always return a scalar value and can compute the 17 : * current value or current rate or the current increment. The computed scalar depends on the 18 : * given interface_value_type paramters (see IntervafeValueTools). Also, it provides two 19 : * output options to all other MOOSE systems as a qp value (getQpValue) or an element side average 20 : * value (getSideAverageValue). 21 : */ 22 : class InterfaceQpUserObjectBase : public InterfaceValueUserObject 23 : { 24 : public: 25 : static InputParameters validParams(); 26 : /** 27 : * the method defining the returning value type: value, rate or increment 28 : **/ 29 28985 : static MooseEnum valueOptions() { return MooseEnum("value rate increment", "value"); } 30 : 31 : InterfaceQpUserObjectBase(const InputParameters & parameters); 32 231 : virtual ~InterfaceQpUserObjectBase(){}; 33 : virtual void initialSetup() override; 34 1643 : virtual void initialize() override{}; 35 : virtual void execute() override; 36 1628 : virtual void finalize() override{}; 37 15 : virtual void threadJoin(const UserObject & /*uo*/) override{}; 38 : 39 : /** 40 : * method returning the quadrature point value 41 : **/ 42 : Real getQpValue(const dof_id_type elem, const unsigned int side, unsigned int qp) const; 43 : /** 44 : * function returning the element side average value 45 : **/ 46 : Real getSideAverageValue(const dof_id_type elem, const unsigned int side) const; 47 : 48 : protected: 49 : /** 50 : * moose enum deciding this userobject reture value type 51 : **/ 52 : const MooseEnum _value_type; 53 : 54 : /** 55 : * method to overrid in child classes returnig a real value 56 : **/ 57 : virtual Real computeRealValue(const unsigned int /*qp*/) = 0; 58 : 59 : /// these maps are used to store QP data. 60 : ///@{ 61 : std::map<std::pair<dof_id_type, unsigned int>, std::vector<Real>> _map_values; 62 : std::map<std::pair<dof_id_type, unsigned int>, std::vector<Real>> _map_JxW; 63 : ///@} 64 : };