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: f45d79 Lines: 18 19 94.7 %
Date: 2025-07-25 05:00: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 "CZMRealVectorCartesianComponent.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", CZMRealVectorCartesianComponent);
      13             : 
      14             : InputParameters
      15        1416 : CZMRealVectorCartesianComponent::validParams()
      16             : {
      17        1416 :   InputParameters params = InterfaceMaterial::validParams();
      18        1416 :   params.addClassDescription("Access a component of a RealVectorValue defined on a cohesive zone");
      19        2832 :   params.addRequiredParam<std::string>("real_vector_value", "The vector material name");
      20        2832 :   params.addRequiredParam<MaterialPropertyName>(
      21             :       "property_name", "Name of the material property computed by this model");
      22        2832 :   params.addRequiredRangeCheckedParam<unsigned int>(
      23             :       "index", "index >= 0 & index <= 2", "The vector component output (0, 1, 2)");
      24        2832 :   params.addParam<std::string>("base_name", "Material property base name");
      25        1416 :   return params;
      26           0 : }
      27             : 
      28         708 : CZMRealVectorCartesianComponent::CZMRealVectorCartesianComponent(const InputParameters & parameters)
      29             :   : InterfaceMaterial(parameters),
      30        2412 :     _base_name(isParamValid("base_name") && !getParam<std::string>("base_name").empty()
      31         708 :                    ? getParam<std::string>("base_name") + "_"
      32             :                    : ""),
      33        1416 :     _property(declarePropertyByName<Real>(getParam<MaterialPropertyName>("property_name"))),
      34        2124 :     _vector(getMaterialPropertyByName<RealVectorValue>(_base_name +
      35             :                                                        getParam<std::string>("real_vector_value"))),
      36        2124 :     _index(getParam<unsigned int>("index"))
      37             : {
      38         708 : }
      39             : 
      40             : void
      41      285568 : CZMRealVectorCartesianComponent::computeQpProperties()
      42             : {
      43      285568 :   _property[_qp] = _vector[_qp](_index);
      44      285568 : }

Generated by: LCOV version 1.14