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 "MassMatrixIntegratedBC.h" 11 : 12 : registerMooseObject("NavierStokesApp", MassMatrixIntegratedBC); 13 : 14 : InputParameters 15 97 : MassMatrixIntegratedBC::validParams() 16 : { 17 97 : InputParameters params = IntegratedBC::validParams(); 18 97 : params.addClassDescription("Computes a finite element mass matrix meant for use in " 19 : "preconditioning schemes which require one"); 20 194 : params.addParam<Real>("density", 1, "Optional density for scaling the computed mass."); 21 194 : params.set<MultiMooseEnum>("vector_tags") = ""; 22 194 : params.set<MultiMooseEnum>("matrix_tags") = ""; 23 97 : params.suppressParameter<MultiMooseEnum>("vector_tags"); 24 97 : params.suppressParameter<std::vector<TagName>>("extra_vector_tags"); 25 97 : params.suppressParameter<std::vector<TagName>>("absolute_value_vector_tags"); 26 97 : params.set<bool>("matrix_only") = true; 27 97 : return params; 28 0 : } 29 : 30 50 : MassMatrixIntegratedBC::MassMatrixIntegratedBC(const InputParameters & parameters) 31 100 : : IntegratedBC(parameters), _density(getParam<Real>("density")), _hmax(0) 32 : { 33 100 : if (!isParamValid("matrix_tags") && !isParamValid("extra_matrix_tags")) 34 0 : mooseError("One of 'matrix_tags' or 'extra_matrix_tags' must be provided"); 35 50 : } 36 : 37 : Real 38 0 : MassMatrixIntegratedBC::computeQpResidual() 39 : { 40 0 : mooseError("should never be called"); 41 : } 42 : 43 : void 44 9180 : MassMatrixIntegratedBC::precalculateJacobian() 45 : { 46 9180 : _hmax = _current_side_elem->hmax(); 47 9180 : } 48 : 49 : Real 50 1829232 : MassMatrixIntegratedBC::computeQpJacobian() 51 : { 52 1829232 : return _test[_i][_qp] * _density * _hmax * _phi[_j][_qp]; 53 : }