https://mooseframework.inl.gov
HeatSourceBPD.C
Go to the documentation of this file.
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 "HeatSourceBPD.h"
11 #include "PeridynamicsMesh.h"
12 #include "Function.h"
13 
14 registerMooseObject("PeridynamicsApp", HeatSourceBPD);
15 
18 {
20  params.addClassDescription(
21  "Class for calculating the residual from heat source for the bond-based "
22  "peridynamic heat conduction formulation");
23 
24  params.addRequiredParam<FunctionName>("power_density", "Volumetric heat source density");
25 
26  return params;
27 }
28 
30  : PeridynamicsKernelBase(parameters), _power_density(getFunction("power_density"))
31 {
32 }
33 
34 void
36 {
37  for (unsigned int nd = 0; nd < _nnodes; ++nd)
38  {
39  std::vector<dof_id_type> neighbors = _pdmesh.getNeighbors(_current_elem->node_id(nd));
40  _local_re(nd) = -_power_density.value(_t) * _node_vol[nd] / neighbors.size();
41  }
42 }
Base kernel class for peridynamic models.
std::vector< Real > _node_vol
std::vector< dof_id_type > getNeighbors(dof_id_type node_id)
Function to return neighbor nodes indices for node node_id.
Kernel class to implement hear source term for peridynamic heat conduction models.
Definition: HeatSourceBPD.h:17
static InputParameters validParams()
Definition: HeatSourceBPD.C:17
const Function & _power_density
Power density function.
Definition: HeatSourceBPD.h:28
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("PeridynamicsApp", HeatSourceBPD)
static InputParameters validParams()
Real & _t
virtual void computeLocalResidual() override
Function to compute local contribution to the residual at the current nodes.
Definition: HeatSourceBPD.C:35
DenseVector< Number > _local_re
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem
virtual Real value(Real t, const Point &p) const
HeatSourceBPD(const InputParameters &parameters)
Definition: HeatSourceBPD.C:29
PeridynamicsMesh & _pdmesh
Parameters for peridynamic mesh information.