Line data Source code
1 : /********************************************************************/ 2 : /* SOFTWARE COPYRIGHT NOTIFICATION */ 3 : /* Cardinal */ 4 : /* */ 5 : /* (c) 2021 UChicago Argonne, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /* */ 8 : /* Prepared by UChicago Argonne, LLC */ 9 : /* Under Contract No. DE-AC02-06CH11357 */ 10 : /* With the U. S. Department of Energy */ 11 : /* */ 12 : /* Prepared by Battelle Energy Alliance, LLC */ 13 : /* Under Contract No. DE-AC07-05ID14517 */ 14 : /* With the U. S. Department of Energy */ 15 : /* */ 16 : /* See LICENSE for full restrictions */ 17 : /********************************************************************/ 18 : 19 : #ifdef ENABLE_NEK_COUPLING 20 : 21 : #include "NekSidePostprocessor.h" 22 : 23 : InputParameters 24 6529 : NekSidePostprocessor::validParams() 25 : { 26 6529 : InputParameters params = GeneralPostprocessor::validParams(); 27 6529 : params += NekBase::validParams(); 28 13058 : params.addParam<MooseEnum>("mesh", getNekMeshEnum(), "NekRS mesh to compute postprocessor on"); 29 13058 : params.addRequiredParam<std::vector<int>>( 30 : "boundary", "Boundary ID(s) for which to compute the postprocessor"); 31 6529 : return params; 32 0 : } 33 : 34 2103 : NekSidePostprocessor::NekSidePostprocessor(const InputParameters & parameters) 35 : : GeneralPostprocessor(parameters), 36 : NekBase(this, parameters), 37 2103 : _pp_mesh(getParam<MooseEnum>("mesh").getEnum<nek_mesh::NekMeshEnum>()), 38 6309 : _boundary(getParam<std::vector<int>>("boundary")) 39 : { 40 2103 : const auto & filename = getMooseApp().getLastInputFileName(); 41 : 42 : // check that each specified boundary is within the range [1, n_fluid_boundaries] 43 : // that nekRS recognizes for its problem 44 : int first_invalid_id, n_boundaries; 45 2103 : bool valid_ids = nekrs::validBoundaryIDs(_boundary, first_invalid_id, n_boundaries); 46 : 47 2103 : if (!valid_ids) 48 1 : mooseError("Invalid 'boundary' entry: ", 49 : first_invalid_id, 50 : "\n\n" 51 : "nekRS assumes the boundary IDs are ordered contiguously beginning at 1. " 52 : "For this problem, nekRS has ", 53 : n_boundaries, 54 : " boundaries. " 55 1 : "Did you enter a valid 'boundary' in '" + 56 0 : filename + "'?"); 57 2102 : } 58 : 59 : #endif