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 "NodalDamageIndexPD.h" 11 : #include "PeridynamicsMesh.h" 12 : #include "AuxiliarySystem.h" 13 : 14 : registerMooseObject("PeridynamicsApp", NodalDamageIndexPD); 15 : 16 : InputParameters 17 22 : NodalDamageIndexPD::validParams() 18 : { 19 22 : InputParameters params = NodalAuxVariableUserObjectBasePD::validParams(); 20 22 : params.addClassDescription("Class for computing damage index for each material point in " 21 : "peridynamic fracture modeling and simulation"); 22 : 23 88 : params.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL, EXEC_TIMESTEP_END}; 24 : 25 22 : return params; 26 22 : } 27 : 28 12 : NodalDamageIndexPD::NodalDamageIndexPD(const InputParameters & parameters) 29 12 : : NodalAuxVariableUserObjectBasePD(parameters) 30 : { 31 12 : } 32 : 33 : void 34 28496 : NodalDamageIndexPD::computeValue(unsigned int id, dof_id_type dof) 35 : { 36 28496 : Real neighbor_vol = _pdmesh.getNodeVolume(_current_elem->node_id(1 - id)); 37 28496 : Real node_vol_sum = _pdmesh.getHorizonVolume(_current_elem->node_id(id)); 38 : 39 28496 : if (_bond_status_var->getElementalValue(_current_elem) < 0.5) 40 1236 : _aux.solution().add(dof, neighbor_vol / node_vol_sum); 41 28496 : }