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 "GeometricSearchInterface.h" 11 : 12 : // MOOSE includes 13 : #include "GeometricSearchData.h" 14 : #include "MooseObject.h" 15 : #include "NearestNodeLocator.h" 16 : #include "PenetrationLocator.h" 17 : #include "SubProblem.h" 18 : #include "SystemBase.h" 19 : 20 : InputParameters 21 2522636 : GeometricSearchInterface::validParams() 22 : { 23 2522636 : InputParameters params = emptyInputParameters(); 24 : 25 : MooseEnum search_methods("nearest_node_connected_sides all_proximate_sides", 26 10090544 : "nearest_node_connected_sides"); 27 : 28 10090544 : params.addParam<MooseEnum>( 29 : "search_method", 30 : search_methods, 31 : "Choice of search algorithm. All options begin by finding the nearest node in the " 32 : "primary boundary to a query point in the secondary boundary. In the default " 33 : "nearest_node_connected_sides algorithm, primary boundary elements are searched iff " 34 : "that nearest node is one of their nodes. This is fast to determine via a " 35 : "pregenerated node-to-elem map and is robust on conforming meshes. In the optional " 36 : "all_proximate_sides algorithm, primary boundary elements are searched iff they touch " 37 : "that nearest node, even if they are not topologically connected to it. This is " 38 : "more CPU-intensive but is necessary for robustness on any boundary surfaces which " 39 : "has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes " 40 : "in adaptively h-refined meshes)."); 41 : 42 7567908 : params.addParamNamesToGroup("search_method", "Advanced"); 43 : 44 5045272 : return params; 45 2522636 : } 46 : 47 281209 : GeometricSearchInterface::GeometricSearchInterface(const MooseObject * moose_object) 48 281209 : : _geometric_search_data(moose_object->parameters() 49 843627 : .getCheckedPointerParam<SubProblem *>("_subproblem") 50 281209 : ->geomSearchData()), 51 281209 : _requires_geometric_search(false) 52 : { 53 843627 : if (moose_object->getParam<MooseEnum>("search_method") == "all_proximate_sides") 54 39 : _geometric_search_data.setSearchUsingPointLocator(true); 55 281209 : } 56 : 57 : #ifdef MOOSE_KOKKOS_ENABLED 58 113369 : GeometricSearchInterface::GeometricSearchInterface(const GeometricSearchInterface & object, 59 113369 : const Moose::Kokkos::FunctorCopy &) 60 113369 : : _geometric_search_data(object._geometric_search_data), 61 113369 : _requires_geometric_search(object._requires_geometric_search) 62 : { 63 113369 : } 64 : #endif 65 : 66 : PenetrationLocator & 67 12634 : GeometricSearchInterface::getPenetrationLocator(const BoundaryName & primary, 68 : const BoundaryName & secondary, 69 : Order order) 70 : { 71 12634 : _requires_geometric_search = true; 72 12634 : return _geometric_search_data.getPenetrationLocator(primary, secondary, order); 73 : } 74 : 75 : PenetrationLocator & 76 119 : GeometricSearchInterface::getQuadraturePenetrationLocator(const BoundaryName & primary, 77 : const BoundaryName & secondary, 78 : Order order) 79 : { 80 119 : _requires_geometric_search = true; 81 119 : return _geometric_search_data.getQuadraturePenetrationLocator(primary, secondary, order); 82 : } 83 : 84 : NearestNodeLocator & 85 78 : GeometricSearchInterface::getNearestNodeLocator(const BoundaryName & primary, 86 : const BoundaryName & secondary) 87 : { 88 78 : _requires_geometric_search = true; 89 78 : return _geometric_search_data.getNearestNodeLocator(primary, secondary); 90 : } 91 : 92 : NearestNodeLocator & 93 26 : GeometricSearchInterface::getQuadratureNearestNodeLocator(const BoundaryName & primary, 94 : const BoundaryName & secondary) 95 : { 96 26 : _requires_geometric_search = true; 97 26 : return _geometric_search_data.getQuadratureNearestNodeLocator(primary, secondary); 98 : }