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 "BoundaryFluxBase.h" 11 : 12 : InputParameters 13 200 : BoundaryFluxBase::validParams() 14 : { 15 200 : InputParameters params = GeneralUserObject::validParams(); 16 200 : return params; 17 : } 18 : 19 115 : BoundaryFluxBase::BoundaryFluxBase(const InputParameters & parameters) 20 : : ThreadedGeneralUserObject(parameters), 21 115 : _cached_flux_elem_id(libMesh::invalid_uint), 22 115 : _cached_flux_side_id(libMesh::invalid_uint), 23 115 : _cached_jacobian_elem_id(libMesh::invalid_uint), 24 115 : _cached_jacobian_side_id(libMesh::invalid_uint) 25 : { 26 115 : } 27 : 28 : void 29 1100 : BoundaryFluxBase::initialize() 30 : { 31 1100 : _cached_flux_elem_id = libMesh::invalid_uint; 32 1100 : _cached_flux_side_id = libMesh::invalid_uint; 33 1100 : _cached_jacobian_elem_id = libMesh::invalid_uint; 34 1100 : _cached_jacobian_side_id = libMesh::invalid_uint; 35 1100 : } 36 : 37 : const std::vector<Real> & 38 996 : BoundaryFluxBase::getFlux(unsigned int iside, 39 : dof_id_type ielem, 40 : const std::vector<Real> & uvec1, 41 : const RealVectorValue & dwave) const 42 : { 43 996 : if (_cached_flux_elem_id != ielem || _cached_flux_side_id != iside) 44 : { 45 996 : _cached_flux_elem_id = ielem; 46 996 : _cached_flux_side_id = iside; 47 : 48 996 : calcFlux(iside, ielem, uvec1, dwave, _flux); 49 : } 50 996 : return _flux; 51 : } 52 : 53 : const DenseMatrix<Real> & 54 122 : BoundaryFluxBase::getJacobian(unsigned int iside, 55 : dof_id_type ielem, 56 : const std::vector<Real> & uvec1, 57 : const RealVectorValue & dwave) const 58 : { 59 122 : if (_cached_jacobian_elem_id != ielem || _cached_jacobian_side_id != iside) 60 : { 61 122 : _cached_jacobian_elem_id = ielem; 62 122 : _cached_jacobian_side_id = iside; 63 : 64 122 : calcJacobian(iside, ielem, uvec1, dwave, _jac1); 65 : } 66 122 : return _jac1; 67 : }