libMesh
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
libMesh::SyncNodalPositions Struct Reference

#include <parallel_ghost_sync.h>

Public Types

typedef Point datum
 

Public Member Functions

 SyncNodalPositions (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 808 of file parallel_ghost_sync.h.

Member Typedef Documentation

◆ datum

Definition at line 818 of file parallel_ghost_sync.h.

Constructor & Destructor Documentation

◆ SyncNodalPositions()

libMesh::SyncNodalPositions::SyncNodalPositions ( MeshBase m)
explicit

Definition at line 26 of file parallel_ghost_sync.C.

27 : mesh(m)
28{}

Member Function Documentation

◆ act_on_data()

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

Definition at line 51 of file parallel_ghost_sync.C.

53{
54 for (auto i : index_range(ids))
55 {
56 // Get a pointer to the node whose position is to be updated.
57 Node & node = mesh.node_ref(ids[i]);
58
59 // Update this node's position. Should call Point::op=
60 node = data[i];
61 } // end for
62} // act_on_data()
virtual const Node & node_ref(const dof_id_type i) const
Definition mesh_base.h:745
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:153

References libMesh::index_range(), mesh, and libMesh::MeshBase::node_ref().

◆ gather_data()

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

Definition at line 32 of file parallel_ghost_sync.C.

34{
35 data.resize(ids.size());
36
37 // Gather (x,y,z) data for all node IDs in the ids vector
38 for (auto i : index_range(ids))
39 {
40 // Look for this node in the mesh
41 const Point & pt = mesh.point(ids[i]);
42
43 // Store this node's position in the data array.
44 // This should call Point::op=
45 data[i] = pt;
46 } // end for
47} // gather_data()
virtual const Point & point(const dof_id_type i) const =0

References libMesh::index_range(), mesh, and libMesh::MeshBase::point().

Member Data Documentation

◆ mesh

MeshBase& libMesh::SyncNodalPositions::mesh

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