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)
 
void act_on_data (const std::vector< dof_id_type > &ids, std::vector< datum > &data)
 

Public Attributes

MeshBasemesh
 

Detailed Description

Definition at line 440 of file parallel_ghost_sync.h.

Member Typedef Documentation

Constructor & Destructor Documentation

SyncNodalPositions::SyncNodalPositions ( MeshBase m)
explicit

Definition at line 4 of file parallel_ghost_sync.C.

5  : mesh(m)
6 {}

Member Function Documentation

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

Definition at line 34 of file parallel_ghost_sync.C.

References libMesh::err, mesh, and libMesh::MeshBase::node_ptr().

35 {
36  for (std::size_t i=0; i<ids.size(); ++i)
37  {
38 
39  // Get a pointer to the node whose position is to be updated.
40  Node* node = mesh.node_ptr(ids[i]);
41 
42  if (node == NULL)
43  {
44  libMesh::err << "Error! Mesh returned a NULL node pointer in SyncNodalPosition::act_on_data()." << std::endl;
45  libmesh_error();
46  }
47 
48  // Update this node's position. Should call Point::op=
49  *node = data[i];
50  } // end for
51 } // act_on_data()
void SyncNodalPositions::gather_data ( const std::vector< dof_id_type > &  ids,
std::vector< datum > &  data 
)

Definition at line 10 of file parallel_ghost_sync.C.

References libMesh::err, mesh, and libMesh::MeshBase::node_ptr().

11 {
12  data.resize(ids.size());
13 
14  // Gather (x,y,z) data for all node IDs in the ids vector
15  for (std::size_t i=0; i<ids.size(); ++i)
16  {
17  // Look for this node in the mesh
18  Node *node = mesh.node_ptr(ids[i]);
19 
20  if (node == NULL)
21  {
22  libMesh::err << "Error! Mesh returned a NULL node pointer in SyncNodalPosition::gather_data()." << std::endl;
23  libmesh_error();
24  }
25 
26  // Store this node's position in the data array.
27  // This should call Point::op=
28  data[i] = *node;
29  } // end for
30 } // gather_data()

Member Data Documentation

MeshBase& libMesh::SyncNodalPositions::mesh

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

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:28 UTC

Hosted By:
SourceForge.net Logo