https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NodalAuxVariableUserObjectBasePD.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#include "PeridynamicsMesh.h"
13#include "MooseVariable.h"
14
17{
19 params.addClassDescription("Base class for computing value for nodal AuxVariable from elemental "
20 "information in a peridynamic model");
21
22 params.addRequiredCoupledVar("variable", "Name of AuxVariable this userobject is acting on");
23
24 return params;
25}
26
28 const InputParameters & parameters)
29 : ElementUserObjectBasePD(parameters), _var(getVar("variable", 0))
30{
31}
32
33void
35{
36 std::vector<std::string> zero_vars;
37 zero_vars.push_back(_var->name());
38 _aux.zeroVariables(zero_vars);
39
41}
42
43void
45{
46 for (unsigned int i = 0; i < _nnodes; ++i)
47 {
48 dof_id_type dof = _current_elem->node_ptr(i)->dof_number(_aux.number(), _var->number(), 0);
49
50 computeValue(i, dof);
51 }
52}
53
54void
Base element userobject class for peridynamics.
static InputParameters validParams()
AuxiliarySystem & _aux
Reference to auxiliary system.
const unsigned int _nnodes
number of nodes for a edge element
const Elem *const & _current_elem
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const std::string & name() const
unsigned int number() const
virtual void computeValue(unsigned int id, dof_id_type dof)=0
Function to assemble elemental quantities to nodal AuxVariable at a material point.
MooseVariable * _var
Pointer to the aux variable this userobject operates on.
NodalAuxVariableUserObjectBasePD(const InputParameters &parameters)
virtual void zeroVariables(std::vector< std::string > &vars_to_be_zeroed)
unsigned int number() const
NumericVector< Number > & solution()
virtual void close()=0