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

#include <parallel_ghost_sync.h>

Public Types

typedef subdomain_id_type datum
 

Public Member Functions

 SyncSubdomainIds (MeshBase &m)
 
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
 

Detailed Description

Definition at line 833 of file parallel_ghost_sync.h.

Member Typedef Documentation

◆ datum

Definition at line 843 of file parallel_ghost_sync.h.

Constructor & Destructor Documentation

◆ SyncSubdomainIds()

libMesh::SyncSubdomainIds::SyncSubdomainIds ( MeshBase m)
explicit

Definition at line 65 of file parallel_ghost_sync.C.

66  : mesh(m)
67 {}

Member Function Documentation

◆ act_on_data()

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

Definition at line 81 of file parallel_ghost_sync.C.

References libMesh::MeshBase::elem_ref(), libMesh::index_range(), mesh, and libMesh::Elem::subdomain_id().

83 {
84  for (auto i : index_range(ids))
85  {
86  Elem & elem = mesh.elem_ref(ids[i]);
87  elem.subdomain_id()=subdomain_ids[i];
88  }
89 }
subdomain_id_type subdomain_id() const
Definition: elem.h:2582
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

◆ gather_data()

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

Definition at line 69 of file parallel_ghost_sync.C.

References libMesh::MeshBase::elem_ref(), mesh, and libMesh::Elem::subdomain_id().

71 {
72  ids_out.reserve(ids.size());
73 
74  for (const auto & id : ids)
75  {
76  Elem & elem = mesh.elem_ref(id);
77  ids_out.push_back(elem.subdomain_id());
78  }
79 }
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:639

Member Data Documentation

◆ mesh

MeshBase& libMesh::SyncSubdomainIds::mesh

Definition at line 853 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: