LCOV - code coverage report
Current view: top level - src/interfacekernels - AnalysisStepUOInterface.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 11 12 91.7 %
Date: 2025-07-25 05:00:39 Functions: 1 1 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             : // MOOSE includes
      11             : #include "AnalysisStepUOInterface.h"
      12             : #include "AnalysisStepUserObject.h"
      13             : 
      14             : void
      15        1184 : AnalysisStepUOInterface::getAnalysisStepUserObject(const FEProblemBase & fe_problem,
      16             :                                                    const AnalysisStepUserObject *& step_user_object,
      17             :                                                    const std::string & name)
      18             : {
      19             :   std::vector<const UserObject *> uos;
      20        2368 :   fe_problem.theWarehouse().query().condition<AttribSystem>("UserObject").queryIntoUnsorted(uos);
      21             : 
      22             :   std::vector<const AnalysisStepUserObject *> step_uos;
      23        2034 :   for (const auto & uo : uos)
      24             :   {
      25         850 :     const AnalysisStepUserObject * possible_step_uo =
      26         850 :         dynamic_cast<const AnalysisStepUserObject *>(uo);
      27         850 :     if (possible_step_uo)
      28         224 :       step_uos.push_back(possible_step_uo);
      29             :   }
      30             : 
      31        1184 :   if (step_uos.size() > 1)
      32           0 :     mooseError("Your input file has multiple AnalysisStepUserObjects. MOOSE currently only support "
      33             :                "one in ",
      34             :                name,
      35             :                ". \n");
      36        1184 :   else if (step_uos.size() == 1)
      37             :     mooseInfo("A AnalysisStepUserObject, has been identified and will be used to drive stepping "
      38             :               "behavior in ",
      39             :               name,
      40             :               ".");
      41             : 
      42        1184 :   step_user_object = step_uos.size() == 1 ? step_uos[0] : nullptr;
      43        1184 : }

Generated by: LCOV version 1.14