https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RBMPresetOldValuePD.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 "RBMPresetOldValuePD.h"
11
13
16{
18 params.addClassDescription("Class to apply a preset BC to nodes with rigid body motion (RBM).");
19
20 // Forcefully preset the BC
21 params.set<bool>("preset") = true;
22 params.suppressParameter<bool>("preset");
23
24 return params;
25}
26
28 : DirichletBCBase(parameters),
29 _pdmesh(dynamic_cast<PeridynamicsMesh &>(_mesh)),
30 _u_old(_var.dofValuesOld()),
31 _bond_status_var(&_subproblem.getStandardVariable(_tid, "bond_status"))
32{
33}
34
35Real
40
41bool
43{
44 // check whether the number of active bonds is less than number of problem dimension
45 unsigned int active_bonds = 0;
46 std::vector<dof_id_type> bonds = _pdmesh.getBonds(_current_node->id());
47
48 for (unsigned int nb = 0; nb < bonds.size(); ++nb)
50 active_bonds++;
51
52 return (active_bonds < _pdmesh.dimension() + 1);
53}
registerMooseObject("PeridynamicsApp", RBMPresetOldValuePD)
static InputParameters validParams()
void suppressParameter(const std::string &name)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
virtual Elem * elemPtr(const dof_id_type i)
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
const Node *const & _current_node
const unsigned int _qp
Peridynamics mesh class.
std::vector< dof_id_type > getBonds(dof_id_type node_id)
Function to return the bond number connected with node node_id.
virtual unsigned int dimension() const override
Class to apply preset BC of old variable solution based on the number of active bonds.
virtual Real computeQpValue() override
virtual bool shouldApply() const override
const VariableValue & _u_old
Value of the unknown variable this BC is acting on at last time step.
PeridynamicsMesh & _pdmesh
Peridynamic mesh.
MooseVariable * _bond_status_var
AuxVariable for number of intact bonds associated with each material point.
static InputParameters validParams()
RBMPresetOldValuePD(const InputParameters &parameters)