LCOV - code coverage report
Current view: top level - src/materials - PeridynamicsMaterialBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #31405 (292dce) with base fef103 Lines: 19 21 90.5 %
Date: 2025-09-04 07:55:08 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 "PeridynamicsMaterialBase.h"
      11             : 
      12             : InputParameters
      13        1552 : PeridynamicsMaterialBase::validParams()
      14             : {
      15        1552 :   InputParameters params = Material::validParams();
      16        1552 :   params.addClassDescription("Base class for peridynamics material models");
      17             : 
      18        1552 :   return params;
      19           0 : }
      20             : 
      21        1221 : PeridynamicsMaterialBase::PeridynamicsMaterialBase(const InputParameters & parameters)
      22             :   : Material(parameters),
      23           0 :     _pdmesh(dynamic_cast<PeridynamicsMesh &>(_mesh)),
      24        1221 :     _dim(_pdmesh.dimension()),
      25        1221 :     _nnodes(2),
      26        1221 :     _horizon_radius(_nnodes),
      27        1221 :     _node_vol(_nnodes),
      28        2442 :     _horizon_vol(_nnodes)
      29             : {
      30        1221 : }
      31             : 
      32             : void
      33     3195885 : PeridynamicsMaterialBase::setupMeshRelatedData()
      34             : {
      35     9587655 :   for (unsigned int nd = 0; nd < _nnodes; ++nd)
      36             :   {
      37     6391770 :     _horizon_radius[nd] = _pdmesh.getHorizon(_current_elem->node_id(nd));
      38     6391770 :     _node_vol[nd] = _pdmesh.getNodeVolume(_current_elem->node_id(nd));
      39     6391770 :     _horizon_vol[nd] = _pdmesh.getHorizonVolume(_current_elem->node_id(nd));
      40             :   }
      41             : 
      42     3195885 :   _origin_vec = _pdmesh.getNodeCoord(_current_elem->node_id(1)) -
      43     3195885 :                 _pdmesh.getNodeCoord(_current_elem->node_id(0));
      44     3195885 : }

Generated by: LCOV version 1.14