libMesh
Public Types | Public Member Functions | Public Attributes | List of all members
libMesh::SyncElementIntegers Struct Reference

#include <parallel_ghost_sync.h>

Public Types

typedef dof_id_type datum
 

Public Member Functions

 SyncElementIntegers (MeshBase &m, const std::string &integer_name)
 
void gather_data (const std::vector< dof_id_type > &ids, std::vector< datum > &data) const
 
void act_on_data (const std::vector< dof_id_type > &ids, const std::vector< datum > &data) const
 

Public Attributes

MeshBasemesh
 
unsigned int ind
 

Detailed Description

Definition at line 859 of file parallel_ghost_sync.h.

Member Typedef Documentation

◆ datum

Definition at line 869 of file parallel_ghost_sync.h.

Constructor & Destructor Documentation

◆ SyncElementIntegers()

libMesh::SyncElementIntegers::SyncElementIntegers ( MeshBase m,
const std::string &  integer_name 
)
explicit

Definition at line 91 of file parallel_ghost_sync.C.

92  : mesh(m), ind(m.get_elem_integer_index(integer_name))
93 {}

Member Function Documentation

◆ act_on_data()

void libMesh::SyncElementIntegers::act_on_data ( const std::vector< dof_id_type > &  ids,
const std::vector< datum > &  data 
) const

Definition at line 107 of file parallel_ghost_sync.C.

References libMesh::MeshBase::elem_ref(), ind, libMesh::index_range(), mesh, and libMesh::DofObject::set_extra_integer().

109 {
110  for (auto i : index_range(ids))
111  {
112  Elem & elem = mesh.elem_ref(ids[i]);
113  elem.set_extra_integer(ind, integer_ids[i]);
114  }
115 }
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:639
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:117
void set_extra_integer(const unsigned int index, const dof_id_type value)
Sets the value on this object of the extra integer associated with index, which should have been obta...
Definition: dof_object.h:1086

◆ gather_data()

void libMesh::SyncElementIntegers::gather_data ( const std::vector< dof_id_type > &  ids,
std::vector< datum > &  data 
) const

Definition at line 95 of file parallel_ghost_sync.C.

References libMesh::MeshBase::elem_ref(), libMesh::DofObject::get_extra_integer(), ind, and mesh.

97 {
98  ids_out.reserve(ids.size());
99 
100  for (const auto & id : ids)
101  {
102  Elem & elem = mesh.elem_ref(id);
103  ids_out.push_back(elem.get_extra_integer(ind));
104  }
105 }
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:639

Member Data Documentation

◆ ind

unsigned int libMesh::SyncElementIntegers::ind

Definition at line 880 of file parallel_ghost_sync.h.

Referenced by act_on_data(), and gather_data().

◆ mesh

MeshBase& libMesh::SyncElementIntegers::mesh

Definition at line 879 of file parallel_ghost_sync.h.

Referenced by act_on_data(), and gather_data().


The documentation for this struct was generated from the following files: