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 : #include "SideIntegralVariableUserObject.h" 11 : 12 : InputParameters 13 172902 : SideIntegralVariableUserObject::validParams() 14 : { 15 172902 : InputParameters params = SideIntegralUserObject::validParams(); 16 172902 : params.addRequiredCoupledVar("variable", 17 : "The name of the variable that this boundary condition applies to"); 18 172902 : return params; 19 0 : } 20 : 21 745 : SideIntegralVariableUserObject::SideIntegralVariableUserObject(const InputParameters & parameters) 22 : : SideIntegralUserObject(parameters), 23 : MooseVariableInterface<Real>(this, 24 : false, 25 : "variable", 26 : Moose::VarKindType::VAR_ANY, 27 : Moose::VarFieldType::VAR_FIELD_STANDARD), 28 745 : _u(coupledValue("variable")), 29 745 : _grad_u(coupledGradient("variable")), 30 745 : _fv(_fv_variable) 31 : { 32 745 : addMooseVariableDependency(&mooseVariableField()); 33 745 : } 34 : 35 : Real 36 454754 : SideIntegralVariableUserObject::computeQpIntegral() 37 : { 38 454754 : if (_fv) 39 : { 40 : // We should be at the edge of the domain for this variable 41 1278 : const FaceInfo * const fi = _mesh.faceInfo(_current_elem, _current_side); 42 : mooseAssert(fi, "We should have a face info"); 43 : 44 1278 : return MetaPhysicL::raw_value(_fv_variable->getBoundaryFaceValue(*fi, determineState())); 45 : } 46 : else 47 453476 : return _u[_qp]; 48 : }