https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ZeroBondStatusUserObjectPD.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
11#include "AuxiliarySystem.h"
12
14
17{
19 params.addClassDescription("Class to assign value of zero to auxilary variable bond status for "
20 "user specified bonds list");
21
22 params.addRequiredParam<std::vector<unsigned int>>(
23 "bond_ids_list", "List of bond IDs to be assigned with value 0");
24
25 params.set<ExecFlagEnum>("execute_on", true) = EXEC_INITIAL;
26
27 return params;
28}
29
31 : GeneralUserObjectBasePD(parameters), _list(getParam<std::vector<unsigned int>>("bond_ids_list"))
32{
33}
34
35void
40
41void
43{
44 for (const auto & bid : _list)
45 {
46 const Elem * current_bond = _pdmesh.elemPtr(bid);
47 if (current_bond->processor_id() == _tid)
48 {
49 dof_id_type dof = current_bond->dof_number(_aux.number(), _bond_status_var->number(), 0);
50 _aux.solution().set(dof, 0); // set the status of bonds in the given list to 0
51 }
52 }
53}
54
55void
const ExecFlagType EXEC_INITIAL
registerMooseObject("PeridynamicsTestApp", ZeroBondStatusUserObjectPD)
void ErrorVector unsigned int
PeridynamicsMesh & _pdmesh
Reference to peridynamics mesh.
AuxiliarySystem & _aux
Reference to auxiliary system.
MooseVariable * _bond_status_var
Bond status aux variable.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
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)
unsigned int number() const
unsigned int number() const
NumericVector< Number > & solution()
const THREAD_ID _tid
User object to set the bond status to zero for a given list of bond IDs.
static InputParameters validParams()
ZeroBondStatusUserObjectPD(const InputParameters &parameters)
std::vector< unsigned int > _list
user specified bond IDs list
virtual void set(const numeric_index_type i, const T value)=0
virtual void close()=0