LCOV - code coverage report
Current view: top level - src/interfaces - BaseNameInterface.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 16 18 88.9 %
Date: 2025-02-21 01:06:12 Functions: 4 4 100.0 %

          Line data    Source code
       1             : //* This file is part of the RACCOON application
       2             : //* being developed at Dolbow lab at Duke University
       3             : //* http://dolbow.pratt.duke.edu
       4             : 
       5             : #include "BaseNameInterface.h"
       6             : 
       7             : InputParameters
       8        4726 : BaseNameInterface::validParams()
       9             : {
      10        4726 :   InputParameters params = emptyInputParameters();
      11        9452 :   params.addParam<std::string>("base_name",
      12             :                                "Optional parameter that allows the user to define "
      13             :                                "multiple mechanics material systems on the same "
      14             :                                "block, i.e. for multiple phases");
      15        4726 :   return params;
      16           0 : }
      17             : 
      18         422 : BaseNameInterface::BaseNameInterface(const InputParameters & params)
      19         422 :   : _params(params),
      20         422 :     _base_name(_params.isParamValid("base_name") ? _params.get<std::string>("base_name") + "_" : "")
      21             : {
      22         422 : }
      23             : 
      24             : const MaterialPropertyName
      25        1566 : BaseNameInterface::prependBaseName(const MaterialPropertyName s, const bool get_property_name) const
      26             : {
      27        1566 :   if (get_property_name)
      28        1758 :     return _base_name + _params.get<MaterialPropertyName>(s);
      29        1374 :   return _base_name + s;
      30             : }
      31             : 
      32             : const std::vector<MaterialPropertyName>
      33          48 : BaseNameInterface::prependBaseName(const std::vector<MaterialPropertyName> & s) const
      34             : {
      35             :   std::vector<MaterialPropertyName> s_copy;
      36          51 :   for (const auto & si : s)
      37           6 :     s_copy.push_back(prependBaseName(si));
      38          48 :   return s_copy;
      39           0 : }

Generated by: LCOV version 1.16