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 "IPHDGAssemblyHelper.h" 11 : #include "IPHDGKernel.h" 12 : 13 : using namespace libMesh; 14 : 15 : InputParameters 16 29646 : IPHDGKernel::validParams() 17 : { 18 29646 : auto params = HDGKernel::validParams(); 19 29646 : return params; 20 : } 21 : 22 560 : IPHDGKernel::IPHDGKernel(const InputParameters & params) : HDGKernel(params), _cached_elem(nullptr) 23 : { 24 560 : } 25 : 26 : void 27 1082324 : IPHDGKernel::compute() 28 : { 29 1082324 : auto & iphdg_helper = iphdgHelper(); 30 1082324 : iphdg_helper.resizeResiduals(); 31 1082324 : iphdg_helper.scalarVolume(); 32 1082324 : } 33 : 34 : void 35 3869880 : IPHDGKernel::computeOnSide() 36 : { 37 3869880 : auto & iphdg_helper = iphdgHelper(); 38 3869880 : iphdg_helper.resizeResiduals(); 39 3869880 : iphdg_helper.scalarFace(); 40 3869880 : iphdg_helper.lmFace(); 41 3869880 : } 42 : 43 : void 44 724916 : IPHDGKernel::computeResidual() 45 : { 46 724916 : compute(); 47 2174748 : for (const auto & residual_packet : iphdgHelper().taggingData()) 48 1449832 : addResiduals(_assembly, residual_packet); 49 724916 : } 50 : 51 : void 52 357408 : IPHDGKernel::computeJacobian() 53 : { 54 357408 : compute(); 55 1072224 : for (const auto & residual_packet : iphdgHelper().taggingData()) 56 714816 : addJacobian(_assembly, residual_packet); 57 357408 : } 58 : 59 : void 60 0 : IPHDGKernel::computeResidualAndJacobian() 61 : { 62 0 : compute(); 63 0 : for (const auto & residual_packet : iphdgHelper().taggingData()) 64 0 : addResidualsAndJacobian(_assembly, residual_packet); 65 0 : } 66 : 67 : void 68 2592040 : IPHDGKernel::computeResidualOnSide() 69 : { 70 2592040 : computeOnSide(); 71 7776120 : for (const auto & residual_packet : iphdgHelper().taggingData()) 72 5184080 : addResiduals(_assembly, residual_packet); 73 2592040 : } 74 : 75 : void 76 1277840 : IPHDGKernel::computeJacobianOnSide() 77 : { 78 1277840 : computeOnSide(); 79 3833520 : for (const auto & residual_packet : iphdgHelper().taggingData()) 80 2555680 : addJacobian(_assembly, residual_packet); 81 1277840 : } 82 : 83 : void 84 0 : IPHDGKernel::computeResidualAndJacobianOnSide() 85 : { 86 0 : computeOnSide(); 87 0 : for (const auto & residual_packet : iphdgHelper().taggingData()) 88 0 : addResidualsAndJacobian(_assembly, residual_packet); 89 0 : } 90 : 91 : void 92 696 : IPHDGKernel::jacobianSetup() 93 : { 94 696 : _cached_elem = nullptr; 95 696 : } 96 : 97 : void 98 716216 : IPHDGKernel::computeOffDiagJacobian(const unsigned int) 99 : { 100 716216 : if (_cached_elem != _current_elem) 101 : { 102 357408 : computeJacobian(); 103 357408 : _cached_elem = _current_elem; 104 : } 105 716216 : } 106 : 107 : std::set<std::string> 108 544 : IPHDGKernel::additionalROVariables() 109 : { 110 544 : return iphdgHelper().additionalROVariables(); 111 : } 112 : 113 : const std::unordered_set<unsigned int> & 114 2181 : IPHDGKernel::getMatPropDependencies() const 115 : { 116 2181 : return iphdgHelper().getMatPropDependencies(); 117 : }