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 "InterfaceValueTools.h" 11 : 12 : // MOOSE includes 13 : #include "MooseEnum.h" 14 : #include "MooseError.h" 15 : 16 : namespace InterfaceValueTools 17 : { 18 : 19 : MooseEnum 20 87266 : InterfaceAverageOptions() 21 : { 22 : return MooseEnum("average jump_primary_minus_secondary jump_secondary_minus_primary " 23 : "jump_abs primary secondary", 24 87266 : "average"); 25 : } 26 : 27 : Real 28 32070 : getQuantity(const MooseEnum interface_value_type, 29 : const Real value_primary, 30 : const Real value_secondary) 31 : { 32 32070 : Real result = 0.; 33 : 34 32070 : switch (interface_value_type) 35 : { 36 11090 : case 0: /*average*/ 37 11090 : result = (value_primary + value_secondary) * 0.5; 38 11090 : break; 39 4112 : case 1: /*jump_primary_minus_secondary*/ 40 4112 : result = (value_primary - value_secondary); 41 4112 : break; 42 4112 : case 2: /*jump_secondary_minus_primary*/ 43 4112 : result = (value_secondary - value_primary); 44 4112 : break; 45 4196 : case 3: /*jump_abs*/ 46 4196 : result = std::abs(value_secondary - value_primary); 47 4196 : break; 48 4448 : case 4: /*primary*/ 49 4448 : result = value_primary; 50 4448 : break; 51 4112 : case 5: /*secondary*/ 52 4112 : result = value_secondary; 53 4112 : break; 54 0 : default: 55 0 : mooseError("InterfaceIntegralMaterialPropertyPostprocessor: the supplied integral " 56 : "type is not in the list. Available options are: ", 57 0 : InterfaceAverageOptions().getRawNames()); 58 : } 59 32070 : return result; 60 : } 61 : }