LCOV - code coverage report
Current view: top level - src/materials/cohesive_zone_model - CZMRealVectorCartesianComponent.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 18 19 94.7 %
Date: 2025-09-04 07:57:23 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 "CZMRealVectorCartesianComponent.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", CZMRealVectorCartesianComponent);
      13             : 
      14             : InputParameters
      15        1652 : CZMRealVectorCartesianComponent::validParams()
      16             : {
      17        1652 :   InputParameters params = InterfaceMaterial::validParams();
      18        1652 :   params.addClassDescription("Access a component of a RealVectorValue defined on a cohesive zone");
      19        3304 :   params.addRequiredParam<std::string>("real_vector_value", "The vector material name");
      20        3304 :   params.addRequiredParam<MaterialPropertyName>(
      21             :       "property_name", "Name of the material property computed by this model");
      22        3304 :   params.addRequiredRangeCheckedParam<unsigned int>(
      23             :       "index", "index >= 0 & index <= 2", "The vector component output (0, 1, 2)");
      24        3304 :   params.addParam<std::string>("base_name", "Material property base name");
      25        1652 :   return params;
      26           0 : }
      27             : 
      28         826 : CZMRealVectorCartesianComponent::CZMRealVectorCartesianComponent(const InputParameters & parameters)
      29             :   : InterfaceMaterial(parameters),
      30        2814 :     _base_name(isParamValid("base_name") && !getParam<std::string>("base_name").empty()
      31         826 :                    ? getParam<std::string>("base_name") + "_"
      32             :                    : ""),
      33        1652 :     _property(declarePropertyByName<Real>(getParam<MaterialPropertyName>("property_name"))),
      34        2478 :     _vector(getMaterialPropertyByName<RealVectorValue>(_base_name +
      35             :                                                        getParam<std::string>("real_vector_value"))),
      36        2478 :     _index(getParam<unsigned int>("index"))
      37             : {
      38         826 : }
      39             : 
      40             : void
      41      376656 : CZMRealVectorCartesianComponent::computeQpProperties()
      42             : {
      43      376656 :   _property[_qp] = _vector[_qp](_index);
      44      376656 : }

Generated by: LCOV version 1.14