https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15
18{
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
34void
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}
registerMooseObject("PeridynamicsApp", HeatSourceBPD)
virtual Real value(Real t, const Point &p) const
Kernel class to implement hear source term for peridynamic heat conduction models.
const Function & _power_density
Power density function.
HeatSourceBPD(const InputParameters &parameters)
static InputParameters validParams()
virtual void computeLocalResidual() override
Function to compute local contribution to the residual at the current nodes.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem
Base kernel class for peridynamic models.
static InputParameters validParams()
std::vector< Real > _node_vol
PeridynamicsMesh & _pdmesh
Parameters for peridynamic mesh information.
std::vector< dof_id_type > getNeighbors(dof_id_type node_id)
Function to return neighbor nodes indices for node node_id.
DenseVector< Number > _local_re
Real & _t