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 : #pragma once 11 : 12 : #include "Kernel.h" 13 : #include "Assembly.h" 14 : #include "SystemBase.h" 15 : #include "PeridynamicsMesh.h" 16 : 17 : /** 18 : * Base kernel class for peridynamic models 19 : */ 20 : class PeridynamicsKernelBase : public Kernel 21 : { 22 : public: 23 : static InputParameters validParams(); 24 : 25 : PeridynamicsKernelBase(const InputParameters & parameters); 26 : 27 : virtual void computeResidual() override; 28 : virtual void computeJacobian() override; 29 0 : virtual Real computeQpResidual() override { return 0.0; } 30 : 31 : protected: 32 : /** 33 : * Function to compute local contribution to the residual at the current nodes 34 : */ 35 : virtual void computeLocalResidual() = 0; 36 : 37 : /** 38 : * Function to compute nonlocal contribution to the residual at the current nodes 39 : */ 40 4752533 : virtual void computeNonlocalResidual(){}; 41 : 42 : /** 43 : * Function to compute local contribution to the diagonal Jacobian at the current nodes 44 : */ 45 61520 : virtual void computeLocalJacobian(){}; 46 : 47 : /** 48 : * Function to precalculate data which will be used in the derived classes 49 : */ 50 : virtual void prepare(); 51 : 52 : /// Bond_status variable 53 : MooseVariable * _bond_status_var; 54 : 55 : /// Option to use full jacobian including nonlocal constribution or not 56 : const bool _use_full_jacobian; 57 : 58 : ///@{ Parameters for peridynamic mesh information 59 : PeridynamicsMesh & _pdmesh; 60 : const unsigned int _dim; 61 : const unsigned int _nnodes; 62 : std::vector<Real> _node_vol; 63 : std::vector<Real> _dg_vol_frac; 64 : std::vector<Real> _horizon_radius; 65 : std::vector<Real> _horizon_vol; 66 : ///@} 67 : 68 : ///Vector for current bond under undefored configuration 69 : RealGradient _origin_vec; 70 : 71 : /// Bond status of current bond/edge2 72 : Real _bond_status; 73 : };