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 "NekSideSpatialBinUserObject.h" 22 : #include "PlaneSpatialBinUserObject.h" 23 : 24 : InputParameters 25 113 : NekSideSpatialBinUserObject::validParams() 26 : { 27 113 : InputParameters params = NekVolumeSpatialBinUserObject::validParams(); 28 226 : params.addRequiredParam<std::vector<int>>("boundary", 29 : "Boundary ID(s) over which to compute the bin values"); 30 113 : return params; 31 0 : } 32 : 33 57 : NekSideSpatialBinUserObject::NekSideSpatialBinUserObject(const InputParameters & parameters) 34 114 : : NekVolumeSpatialBinUserObject(parameters), _boundary(getParam<std::vector<int>>("boundary")) 35 : { 36 : int first_invalid_id, n_boundaries; 37 57 : bool valid_ids = nekrs::validBoundaryIDs(_boundary, first_invalid_id, n_boundaries); 38 : 39 57 : if (!valid_ids) 40 2 : mooseError("Invalid 'boundary' entry: ", 41 : first_invalid_id, 42 : "\n\n" 43 : "NekRS assumes the boundary IDs are ordered contiguously beginning at 1. " 44 : "For this problem, NekRS has ", 45 : n_boundaries, 46 : " boundaries.\n" 47 1 : "Did you enter a valid 'boundary' for '" + 48 0 : name() + "'?"); 49 56 : } 50 : 51 : Point 52 1185792 : NekSideSpatialBinUserObject::nekPoint(const int & local_elem_id, 53 : const int & local_face_id, 54 : const int & local_node_id) const 55 : { 56 1185792 : if (_map_space_by_qp) 57 951552 : return nekrs::gllPointFace(local_elem_id, local_face_id, local_node_id); 58 : else 59 234240 : return nekrs::centroidFace(local_elem_id, local_face_id); 60 : } 61 : 62 : #endif