https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NodalDamageIndexPD.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 "NodalDamageIndexPD.h"
11#include "PeridynamicsMesh.h"
12#include "AuxiliarySystem.h"
13
15
18{
20 params.addClassDescription("Class for computing damage index for each material point in "
21 "peridynamic fracture modeling and simulation");
22
23 params.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL, EXEC_TIMESTEP_END};
24
25 return params;
26}
27
32
33void
34NodalDamageIndexPD::computeValue(unsigned int id, dof_id_type dof)
35{
36 Real neighbor_vol = _pdmesh.getNodeVolume(_current_elem->node_id(1 - id));
37 Real node_vol_sum = _pdmesh.getHorizonVolume(_current_elem->node_id(id));
38
40 _aux.solution().add(dof, neighbor_vol / node_vol_sum);
41}
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_INITIAL
registerMooseObject("PeridynamicsApp", NodalDamageIndexPD)
PeridynamicsMesh & _pdmesh
Reference to Peridynamic mesh.
AuxiliarySystem & _aux
Reference to auxiliary system.
MooseVariable * _bond_status_var
Bond status aux variable.
const Elem *const & _current_elem
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
UserObject base class to compute nodal quantities stored as AuxVariable at a material point based on ...
UserObject class to compute damage index for each material point in PD fracture modeling and simulati...
static InputParameters validParams()
NodalDamageIndexPD(const InputParameters &parameters)
virtual void computeValue(unsigned int id, dof_id_type dof) override
Function to assemble elemental quantities to nodal AuxVariable at a material point.
Real getNodeVolume(dof_id_type node_id)
Function to return nodal volume for node node_id.
Real getHorizonVolume(dof_id_type node_id)
Function to return summation of neighbor nodal volumes for node node_id.
NumericVector< Number > & solution()
virtual void add(const numeric_index_type i, const T value)=0