LCOV - code coverage report
Current view: top level - src/ics - PolycrystalColoringIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #32971 (54bef8) with base c6cf66 Lines: 13 15 86.7 %
Date: 2026-05-29 20:38:39 Functions: 3 3 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 "PolycrystalColoringIC.h"
      11             : #include "IndirectSort.h"
      12             : #include "MooseMesh.h"
      13             : #include "MooseRandom.h"
      14             : #include "NonlinearSystemBase.h"
      15             : #include "GrainTrackerInterface.h"
      16             : #include "PolycrystalUserObjectBase.h"
      17             : 
      18             : registerMooseObject("PhaseFieldApp", PolycrystalColoringIC);
      19             : 
      20             : InputParameters
      21        7715 : PolycrystalColoringIC::validParams()
      22             : {
      23        7715 :   InputParameters params = InitialCondition::validParams();
      24        7715 :   params.addClassDescription(
      25             :       "Random Voronoi tesselation polycrystal (used by PolycrystalVoronoiICAction)");
      26       15430 :   params.addRequiredParam<UserObjectName>("polycrystal_ic_uo",
      27             :                                           "User object generating a point to grain number mapping");
      28       15430 :   params.addRequiredParam<unsigned int>("op_index", "The index for the current order parameter");
      29             : 
      30        7715 :   return params;
      31           0 : }
      32             : 
      33        4167 : PolycrystalColoringIC::PolycrystalColoringIC(const InputParameters & parameters)
      34             :   : InitialCondition(parameters),
      35        4167 :     _op_index(getParam<unsigned int>("op_index")),
      36        8334 :     _poly_ic_uo(getUserObject<PolycrystalUserObjectBase>("polycrystal_ic_uo"))
      37             : {
      38        4167 : }
      39             : 
      40             : Real
      41     9181916 : PolycrystalColoringIC::value(const Point & p)
      42             : {
      43     9181916 :   if (_current_node)
      44     9181916 :     return _poly_ic_uo.getNodalVariableValue(_op_index, *_current_node);
      45             :   else
      46           0 :     return _poly_ic_uo.getVariableValue(_op_index, p);
      47             : }

Generated by: LCOV version 1.14