26 #ifndef __LOCAL_MESH_DATA_H 27 #define __LOCAL_MESH_DATA_H 32 #include <boost/multi_array.hpp> 33 #include <dolfin/common/MPI.h> 34 #include <dolfin/common/Variable.h> 76 std::string
str(
bool verbose)
const;
117 num_global_vertices = -1;
118 vertex_coordinates.resize(boost::extents[0][0]);
119 vertex_indices.clear();
165 num_global_cells = -1;
166 num_vertices_per_cell = -1;
167 cell_vertices.resize(boost::extents[0][0]);
168 global_cell_indices.clear();
169 cell_partition.clear();
174 void unpack_cell_vertices(
const std::vector<std::int64_t>& values);
182 std::map<std::size_t, std::vector<std::pair<std::pair<std::size_t,
187 {
return _mpi_comm.comm(); }
Common base class for DOLFIN variables.
Definition: Variable.h:35
LocalMeshData(const MPI_Comm mpi_comm)
Create empty local mesh data.
Definition: LocalMeshData.cpp:36
void extract_mesh_data(const Mesh &mesh)
Copy data from mesh.
Definition: LocalMeshData.cpp:125
void clear()
Clear data.
Definition: LocalMeshData.h:162
void unpack_vertex_coordinates(const std::vector< double > &values)
Unpack received vertex coordinates.
Definition: LocalMeshData.cpp:295
This class stores mesh data on a local processor corresponding to a portion of a (larger) global mesh...
Definition: LocalMeshData.h:58
std::string str(bool verbose) const
Return informal string representation (pretty-print)
Definition: LocalMeshData.cpp:69
std::map< std::size_t, std::vector< std::pair< std::pair< std::size_t, std::size_t >, std::size_t > > > domain_data
Mesh domain data [dim](line, (cell_index, local_index, value))
Definition: LocalMeshData.h:183
Holder for topology data.
Definition: LocalMeshData.h:130
std::vector< int > cell_partition
Optional process owner for each cell in global_cell_indices.
Definition: LocalMeshData.h:151
std::int64_t num_global_cells
Global number of cells.
Definition: LocalMeshData.h:139
Geometry geometry
Geometry data.
Definition: LocalMeshData.h:127
std::vector< std::size_t > cell_weight
Optional weight for each cell for partitioning.
Definition: LocalMeshData.h:154
Type
Enum for different cell types.
Definition: CellType.h:51
int dim
Topological dimension.
Definition: LocalMeshData.h:136
Topology()
Constructor.
Definition: LocalMeshData.h:133
boost::multi_array< double, 2 > vertex_coordinates
Coordinates for all vertices stored on local processor.
Definition: LocalMeshData.h:107
void receive_mesh_data(const MPI_Comm mpi_comm)
Receive mesh data from main process.
Definition: LocalMeshData.cpp:251
CellType::Type cell_type
Cell type.
Definition: LocalMeshData.h:159
int dim
Geometric dimension.
Definition: LocalMeshData.h:101
boost::multi_array< std::int64_t, 2 > cell_vertices
Global vertex indices for all cells stored on local processor.
Definition: LocalMeshData.h:145
Geometry()
Constructor.
Definition: LocalMeshData.h:98
int num_vertices_per_cell
Number of vertices per cell.
Definition: LocalMeshData.h:142
std::int64_t num_global_vertices
Global number of vertices.
Definition: LocalMeshData.h:104
void check() const
Definition: LocalMeshData.cpp:60
~LocalMeshData()
Destructor.
Definition: LocalMeshData.cpp:55
void clear()
Clear data.
Definition: LocalMeshData.h:114
std::vector< std::int64_t > global_cell_indices
Global cell numbers for all cells stored on local processor.
Definition: LocalMeshData.h:148
void reorder()
Reorder cell data.
Definition: LocalMeshData.cpp:327
Topology topology
Holder for topology data.
Definition: LocalMeshData.h:179
MPI_Comm mpi_comm() const
Return MPI communicator.
Definition: LocalMeshData.h:186
std::vector< std::int64_t > vertex_indices
Definition: LocalMeshData.h:111
Holder for geometry data.
Definition: LocalMeshData.h:95
void broadcast_mesh_data(const MPI_Comm mpi_comm)
Definition: LocalMeshData.cpp:171
void clear()
Clear all data.
Definition: LocalMeshData.cpp:118