https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GhostElemPD.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 "GhostElemPD.h"
11#include "PeridynamicsMesh.h"
12
13registerMooseObject("PeridynamicsApp", GhostElemPD);
14
17{
19 params.addClassDescription("Class for ghosting elements accross processors");
20
21 return params;
22}
23
25{
27}
28
29void
34
35void
37{
38 // Loop through the active local elements and ghost elements from other processors due to
39 // formulation nonlocality
40 const MeshBase::const_element_iterator end_elem = _mesh.getMesh().active_local_elements_end();
41 for (MeshBase::const_element_iterator elem = _mesh.getMesh().active_local_elements_begin();
42 elem != end_elem;
43 ++elem)
44 if ((*elem)->type() == 0) // only ghost neighbors for Edge2 elems
45 for (unsigned int i = 0; i < _nnodes; ++i)
46 {
47 std::vector<dof_id_type> neighbors = _pdmesh.getNeighbors((*elem)->node_id(i));
48 for (unsigned int j = 0; j < neighbors.size(); ++j)
49 _subproblem.addGhostedElem(_pdmesh.getBonds((*elem)->node_id(i))[j]);
50 }
51}
registerMooseObject("PeridynamicsApp", GhostElemPD)
PeridynamicsMesh & _pdmesh
Reference to peridynamics mesh.
const unsigned int _nnodes
number of nodes for a edge element
static InputParameters validParams()
MooseMesh & _mesh
Reference to Moose mesh.
Userobject class to ghost the required element for calculation on current processor from other proces...
Definition GhostElemPD.h:20
virtual void meshChanged() override
Definition GhostElemPD.C:30
GhostElemPD(const InputParameters &parameters)
Definition GhostElemPD.C:24
void ghostElements()
Function to ghost/copy element information from other processors.
Definition GhostElemPD.C:36
static InputParameters validParams()
Definition GhostElemPD.C:16
void addClassDescription(const std::string &doc_string)
MeshBase & getMesh()
std::vector< dof_id_type > getBonds(dof_id_type node_id)
Function to return the bond number connected with node node_id.
std::vector< dof_id_type > getNeighbors(dof_id_type node_id)
Function to return neighbor nodes indices for node node_id.
virtual void addGhostedElem(dof_id_type elem_id)=0
SubProblem & _subproblem