LCOV - code coverage report
Current view: top level - src/geomsearch - GeometricSearchInterface.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 7323e9 Lines: 32 32 100.0 %
Date: 2025-11-05 20:01:15 Functions: 7 7 100.0 %
Legend: Lines: hit not hit

          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    10052143 : GeometricSearchInterface::validParams()
      22             : {
      23    10052143 :   InputParameters params = emptyInputParameters();
      24             : 
      25             :   MooseEnum search_methods("nearest_node_connected_sides all_proximate_sides",
      26    40208572 :                            "nearest_node_connected_sides");
      27             : 
      28    40208572 :   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    30156429 :   params.addParamNamesToGroup("search_method", "Advanced");
      43             : 
      44    20104286 :   return params;
      45    10052143 : }
      46             : 
      47      305297 : GeometricSearchInterface::GeometricSearchInterface(const MooseObject * moose_object)
      48      305297 :   : _geometric_search_data(moose_object->parameters()
      49      915891 :                                .getCheckedPointerParam<SubProblem *>("_subproblem")
      50      305297 :                                ->geomSearchData()),
      51      305297 :     _requires_geometric_search(false)
      52             : {
      53      915891 :   if (moose_object->getParam<MooseEnum>("search_method") == "all_proximate_sides")
      54          42 :     _geometric_search_data.setSearchUsingPointLocator(true);
      55      305297 : }
      56             : 
      57             : #ifdef MOOSE_KOKKOS_ENABLED
      58       62812 : GeometricSearchInterface::GeometricSearchInterface(const GeometricSearchInterface & object,
      59       62812 :                                                    const Moose::Kokkos::FunctorCopy &)
      60       62812 :   : _geometric_search_data(object._geometric_search_data),
      61       62812 :     _requires_geometric_search(object._requires_geometric_search)
      62             : {
      63       62812 : }
      64             : #endif
      65             : 
      66             : PenetrationLocator &
      67       13619 : GeometricSearchInterface::getPenetrationLocator(const BoundaryName & primary,
      68             :                                                 const BoundaryName & secondary,
      69             :                                                 Order order)
      70             : {
      71       13619 :   _requires_geometric_search = true;
      72       13619 :   return _geometric_search_data.getPenetrationLocator(primary, secondary, order);
      73             : }
      74             : 
      75             : PenetrationLocator &
      76         129 : GeometricSearchInterface::getQuadraturePenetrationLocator(const BoundaryName & primary,
      77             :                                                           const BoundaryName & secondary,
      78             :                                                           Order order)
      79             : {
      80         129 :   _requires_geometric_search = true;
      81         129 :   return _geometric_search_data.getQuadraturePenetrationLocator(primary, secondary, order);
      82             : }
      83             : 
      84             : NearestNodeLocator &
      85          84 : GeometricSearchInterface::getNearestNodeLocator(const BoundaryName & primary,
      86             :                                                 const BoundaryName & secondary)
      87             : {
      88          84 :   _requires_geometric_search = true;
      89          84 :   return _geometric_search_data.getNearestNodeLocator(primary, secondary);
      90             : }
      91             : 
      92             : NearestNodeLocator &
      93          28 : GeometricSearchInterface::getQuadratureNearestNodeLocator(const BoundaryName & primary,
      94             :                                                           const BoundaryName & secondary)
      95             : {
      96          28 :   _requires_geometric_search = true;
      97          28 :   return _geometric_search_data.getQuadratureNearestNodeLocator(primary, secondary);
      98             : }

Generated by: LCOV version 1.14