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

Userobject class to ghost the required element for calculation on current processor from other processors. More...

#include <GhostElemPD.h>

Inheritance diagram for GhostElemPD:
[legend]

Public Member Functions

 GhostElemPD (const InputParameters &parameters)
 
virtual void meshChanged () override
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 

Protected Member Functions

void ghostElements ()
 Function to ghost/copy element information from other processors. More...
 

Protected Attributes

MooseMesh & _mesh
 Reference to Moose mesh. More...
 
PeridynamicsMesh_pdmesh
 Reference to peridynamics mesh. More...
 
const unsigned int _nnodes
 number of nodes for a edge element More...
 

Detailed Description

Userobject class to ghost the required element for calculation on current processor from other processors.

Definition at line 24 of file GhostElemPD.h.

Constructor & Destructor Documentation

◆ GhostElemPD()

GhostElemPD::GhostElemPD ( const InputParameters &  parameters)

Definition at line 25 of file GhostElemPD.C.

25  : GeneralUserObjectBasePD(parameters)
26 {
27  ghostElements();
28 }

Member Function Documentation

◆ execute()

virtual void GhostElemPD::execute ( )
inlineoverridevirtual

Definition at line 31 of file GhostElemPD.h.

31 {}

◆ finalize()

virtual void GhostElemPD::finalize ( )
inlineoverridevirtual

Definition at line 32 of file GhostElemPD.h.

32 {}

◆ ghostElements()

void GhostElemPD::ghostElements ( )
protected

Function to ghost/copy element information from other processors.

Definition at line 37 of file GhostElemPD.C.

38 {
39  // Loop through the active local elements and ghost elements from other processors due to
40  // formulation nonlocality
41  const MeshBase::const_element_iterator end_elem = _mesh.getMesh().active_local_elements_end();
42  for (MeshBase::const_element_iterator elem = _mesh.getMesh().active_local_elements_begin();
43  elem != end_elem;
44  ++elem)
45  if ((*elem)->type() == 0) // only ghost neighbors for Edge2 elems
46  for (unsigned int i = 0; i < _nnodes; ++i)
47  {
48  std::vector<dof_id_type> neighbors = _pdmesh.getNeighbors((*elem)->node_id(i));
49  for (unsigned int j = 0; j < neighbors.size(); ++j)
50  _subproblem.addGhostedElem(_pdmesh.getBonds((*elem)->node_id(i))[j]);
51  }
52 }

Referenced by GhostElemPD(), and meshChanged().

◆ initialize()

virtual void GhostElemPD::initialize ( )
inlineoverridevirtual

Definition at line 30 of file GhostElemPD.h.

30 {}

◆ meshChanged()

void GhostElemPD::meshChanged ( )
overridevirtual

Definition at line 31 of file GhostElemPD.C.

32 {
33  ghostElements();
34 }

Member Data Documentation

◆ _mesh

MooseMesh& GeneralUserObjectBasePD::_mesh
protectedinherited

Reference to Moose mesh.

Definition at line 27 of file GeneralUserObjectBasePD.h.

Referenced by ghostElements().

◆ _nnodes

const unsigned int GeneralUserObjectBasePD::_nnodes
protectedinherited

number of nodes for a edge element

Definition at line 33 of file GeneralUserObjectBasePD.h.

Referenced by ghostElements().

◆ _pdmesh

PeridynamicsMesh& GeneralUserObjectBasePD::_pdmesh
protectedinherited

Reference to peridynamics mesh.

Definition at line 30 of file GeneralUserObjectBasePD.h.

Referenced by ghostElements().


The documentation for this class was generated from the following files:
GeneralUserObjectBasePD::_nnodes
const unsigned int _nnodes
number of nodes for a edge element
Definition: GeneralUserObjectBasePD.h:33
GeneralUserObjectBasePD::_pdmesh
PeridynamicsMesh & _pdmesh
Reference to peridynamics mesh.
Definition: GeneralUserObjectBasePD.h:30
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::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
GhostElemPD::ghostElements
void ghostElements()
Function to ghost/copy element information from other processors.
Definition: GhostElemPD.C:37
GeneralUserObjectBasePD::GeneralUserObjectBasePD
GeneralUserObjectBasePD(const InputParameters &parameters)
Definition: GeneralUserObjectBasePD.C:23
GeneralUserObjectBasePD::_mesh
MooseMesh & _mesh
Reference to Moose mesh.
Definition: GeneralUserObjectBasePD.h:27