www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
RBMPresetOldValuePD Class Reference

Class to apply preset BC of old variable solution based on the singularity of nodal shape tensor. More...

#include <RBMPresetOldValuePD.h>

Inheritance diagram for RBMPresetOldValuePD:
[legend]

Public Member Functions

 RBMPresetOldValuePD (const InputParameters &parameters)
 
virtual Real computeQpValue () override
 
virtual bool shouldApply () override
 

Protected Attributes

PeridynamicsMesh_pdmesh
 Peridynamic mesh. More...
 
const VariableValue & _u_old
 Value of the unknown variable this BC is acting on at last time step. More...
 
MooseVariable * _bond_status_var
 AuxVariable for number of intact bonds associated with each material point. More...
 

Detailed Description

Class to apply preset BC of old variable solution based on the singularity of nodal shape tensor.

Used to fix nodes with rigid body motion.

Definition at line 24 of file RBMPresetOldValuePD.h.

Constructor & Destructor Documentation

◆ RBMPresetOldValuePD()

RBMPresetOldValuePD::RBMPresetOldValuePD ( const InputParameters &  parameters)

Definition at line 28 of file RBMPresetOldValuePD.C.

29  : DirichletBCBase(parameters),
30  _pdmesh(dynamic_cast<PeridynamicsMesh &>(_mesh)),
31  _u_old(_var.dofValuesOld()),
32  _bond_status_var(&_subproblem.getStandardVariable(_tid, "bond_status"))
33 {
34 }

Member Function Documentation

◆ computeQpValue()

Real RBMPresetOldValuePD::computeQpValue ( )
overridevirtual

Definition at line 37 of file RBMPresetOldValuePD.C.

38 {
39  return _u_old[_qp];
40 }

◆ shouldApply()

bool RBMPresetOldValuePD::shouldApply ( )
overridevirtual

Definition at line 43 of file RBMPresetOldValuePD.C.

44 {
45  bool should_apply = true;
46 
47  // check whether the node shape tensor is singular
48  unsigned int dim = _pdmesh.dimension();
49  Real horiz_size = _pdmesh.getHorizon(_current_node->id());
50  std::vector<dof_id_type> neighbors = _pdmesh.getNeighbors(_current_node->id());
51  std::vector<dof_id_type> bonds = _pdmesh.getBonds(_current_node->id());
52 
53  RankTwoTensor shape_tensor;
54  if (dim == 2)
55  shape_tensor(2, 2) = 1.0;
56 
57  RealGradient ori_vec(dim);
58  for (unsigned int i = 0; i < neighbors.size(); ++i)
59  if (_bond_status_var->getElementalValue(_pdmesh.elemPtr(bonds[i])) > 0.5)
60  {
61  Real vol_i = _pdmesh.getPDNodeVolume(neighbors[i]);
62  ori_vec = *(_pdmesh.nodePtr(neighbors[i])) - *_current_node;
63  for (unsigned int j = 0; j < dim; ++j)
64  for (unsigned int k = 0; k < dim; ++k)
65  shape_tensor(j, k) += horiz_size / ori_vec.norm() * ori_vec(j) * ori_vec(k) * vol_i;
66  }
67 
68  if (!MooseUtils::absoluteFuzzyEqual(shape_tensor.det(), 0.0))
69  should_apply = false;
70 
71  return should_apply;
72 }

Member Data Documentation

◆ _bond_status_var

MooseVariable* RBMPresetOldValuePD::_bond_status_var
protected

AuxVariable for number of intact bonds associated with each material point.

Definition at line 40 of file RBMPresetOldValuePD.h.

Referenced by shouldApply().

◆ _pdmesh

PeridynamicsMesh& RBMPresetOldValuePD::_pdmesh
protected

Peridynamic mesh.

Definition at line 34 of file RBMPresetOldValuePD.h.

Referenced by shouldApply().

◆ _u_old

const VariableValue& RBMPresetOldValuePD::_u_old
protected

Value of the unknown variable this BC is acting on at last time step.

Definition at line 37 of file RBMPresetOldValuePD.h.

Referenced by computeQpValue().


The documentation for this class was generated from the following files:
RBMPresetOldValuePD::_u_old
const VariableValue & _u_old
Value of the unknown variable this BC is acting on at last time step.
Definition: RBMPresetOldValuePD.h:37
PeridynamicsMesh::getPDNodeVolume
Real getPDNodeVolume(dof_id_type node_id)
Function to return nodal volume for node node_id.
Definition: PeridynamicsMesh.C:435
RBMPresetOldValuePD::_bond_status_var
MooseVariable * _bond_status_var
AuxVariable for number of intact bonds associated with each material point.
Definition: RBMPresetOldValuePD.h:40
libMesh::RealGradient
VectorValue< Real > RealGradient
Definition: GrainForceAndTorqueInterface.h:17
RBMPresetOldValuePD::_pdmesh
PeridynamicsMesh & _pdmesh
Peridynamic mesh.
Definition: RBMPresetOldValuePD.h:34
PeridynamicsMesh::dimension
virtual unsigned int dimension() const override
Definition: PeridynamicsMesh.C:120
PeridynamicsMesh::getNeighbors
std::vector< dof_id_type > getNeighbors(dof_id_type node_id)
Function to return neighbor nodes indices for node node_id.
Definition: PeridynamicsMesh.C:362
PeridynamicsMesh::getHorizon
Real getHorizon(dof_id_type node_id)
Function to return horizon size.
Definition: PeridynamicsMesh.C:471
PeridynamicsMesh::getBonds
std::vector< dof_id_type > getBonds(dof_id_type node_id)
Function to return the bond number connected with node node_id.
Definition: PeridynamicsMesh.C:382
RankTwoTensorTempl< Real >