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