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 "ArrayHFEMDiffusion.h" 11 : 12 : registerMooseObject("MooseApp", ArrayHFEMDiffusion); 13 : 14 : InputParameters 15 14474 : ArrayHFEMDiffusion::validParams() 16 : { 17 14474 : InputParameters params = ArrayDGLowerDKernel::validParams(); 18 14474 : params.addClassDescription("Imposes the constraints on internal sides with HFEM."); 19 14474 : return params; 20 0 : } 21 : 22 109 : ArrayHFEMDiffusion::ArrayHFEMDiffusion(const InputParameters & parameters) 23 109 : : ArrayDGLowerDKernel(parameters) 24 : { 25 109 : } 26 : 27 : void 28 144000 : ArrayHFEMDiffusion::computeQpResidual(Moose::DGResidualType type, RealEigenVector & r) 29 : { 30 144000 : switch (type) 31 : { 32 72000 : case Moose::Element: 33 72000 : r -= _lambda[_qp] * _test[_i][_qp]; 34 72000 : break; 35 : 36 72000 : case Moose::Neighbor: 37 72000 : r += _lambda[_qp] * _test_neighbor[_i][_qp]; 38 72000 : break; 39 : } 40 144000 : } 41 : 42 : void 43 7680 : ArrayHFEMDiffusion::computeLowerDQpResidual(RealEigenVector & r) 44 : { 45 7680 : r += (_u_neighbor[_qp] - _u[_qp]) * _test_lambda[_i][_qp]; 46 7680 : } 47 : 48 : RealEigenVector 49 185472 : ArrayHFEMDiffusion::computeLowerDQpJacobian(Moose::ConstraintJacobianType type) 50 : { 51 185472 : RealEigenVector r = RealEigenVector::Zero(_count); 52 185472 : switch (type) 53 : { 54 45120 : case Moose::LowerPrimary: 55 90240 : return RealEigenVector::Constant(_count, -_test_lambda[_i][_qp] * _phi[_j][_qp]); 56 : 57 45120 : case Moose::LowerSecondary: 58 90240 : return RealEigenVector::Constant(_count, _test_lambda[_i][_qp] * _phi_neighbor[_j][_qp]); 59 : 60 45120 : case Moose::PrimaryLower: 61 90240 : return RealEigenVector::Constant(_count, -_phi_lambda[_j][_qp] * _test[_i][_qp]); 62 : 63 45120 : case Moose::SecondaryLower: 64 90240 : return RealEigenVector::Constant(_count, _phi_lambda[_j][_qp] * _test_neighbor[_i][_qp]); 65 : 66 4992 : default: 67 4992 : break; 68 : } 69 : 70 4992 : return r; 71 185472 : }