DOLFIN
DOLFIN C++ interface
HDF5Utility.h
1 // Copyright (C) 2013 Chris N. Richardson
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 //
19 // First added: 2013-05-07
20 // Last changed: 2013-06-18
21 
22 #ifndef __DOLFIN_HDF5UTILITY_H
23 #define __DOLFIN_HDF5UTILITY_H
24 
25 #include <string>
26 #include <vector>
27 
28 #include "dolfin/common/types.h"
29 
30 namespace dolfin
31 {
32  class LocalMeshData;
33  class GenericDofMap;
34  class Mesh;
35 
39 
41  {
42  public:
43 
50  static void
51  map_gdof_to_cell(const MPI_Comm mpi_comm,
52  const std::vector<std::size_t>& input_cells,
53  const std::vector<dolfin::la_index>& input_cell_dofs,
54  const std::vector<std::size_t>& x_cell_dofs,
55  const std::pair<dolfin::la_index, dolfin::la_index>
56  vector_range,
57  std::vector<std::size_t>& global_cells,
58  std::vector<std::size_t>& remote_local_dofi);
59 
64  static void get_global_dof(
65  MPI_Comm mpi_comm,
66  const std::vector<std::pair<std::size_t, std::size_t>>& cell_ownership,
67  const std::vector<std::size_t>& remote_local_dofi,
68  std::pair<std::size_t, std::size_t> vector_range,
69  const GenericDofMap& dofmap,
70  std::vector<dolfin::la_index>& global_dof);
71 
74  static std::vector<std::pair<std::size_t, std::size_t>>
75  cell_owners(const Mesh& mesh, const std::vector<std::size_t>& cells);
76 
79  static void cell_owners_in_range(
80  std::vector<std::pair<std::size_t, std::size_t>>& global_owner,
81  const Mesh& mesh);
82 
85  static void build_local_mesh(Mesh& mesh, const LocalMeshData& mesh_data);
86 
88  static void set_local_vector_values(
89  MPI_Comm mpi_comm,
90  GenericVector& x,
91  const Mesh& mesh,
92  const std::vector<size_t>& cells,
93  const std::vector<dolfin::la_index>& cell_dofs,
94  const std::vector<std::size_t>& x_cell_dofs,
95  const std::vector<double>& vector,
96  std::pair<dolfin::la_index, dolfin::la_index> input_vector_range,
97  const GenericDofMap& dofmap);
98  };
99 
100 }
101 
102 #endif
static void cell_owners_in_range(std::vector< std::pair< std::size_t, std::size_t >> &global_owner, const Mesh &mesh)
Definition: HDF5Utility.cpp:254
This class provides a generic interface for dof maps.
Definition: GenericDofMap.h:49
Definition: adapt.h:29
This class stores mesh data on a local processor corresponding to a portion of a (larger) global mesh...
Definition: LocalMeshData.h:58
static std::vector< std::pair< std::size_t, std::size_t > > cell_owners(const Mesh &mesh, const std::vector< std::size_t > &cells)
Definition: HDF5Utility.cpp:185
static void build_local_mesh(Mesh &mesh, const LocalMeshData &mesh_data)
Definition: HDF5Utility.cpp:304
Definition: HDF5Utility.h:40
static void map_gdof_to_cell(const MPI_Comm mpi_comm, const std::vector< std::size_t > &input_cells, const std::vector< dolfin::la_index > &input_cell_dofs, const std::vector< std::size_t > &x_cell_dofs, const std::pair< dolfin::la_index, dolfin::la_index > vector_range, std::vector< std::size_t > &global_cells, std::vector< std::size_t > &remote_local_dofi)
Definition: HDF5Utility.cpp:44
static void get_global_dof(MPI_Comm mpi_comm, const std::vector< std::pair< std::size_t, std::size_t >> &cell_ownership, const std::vector< std::size_t > &remote_local_dofi, std::pair< std::size_t, std::size_t > vector_range, const GenericDofMap &dofmap, std::vector< dolfin::la_index > &global_dof)
Definition: HDF5Utility.cpp:119
static void set_local_vector_values(MPI_Comm mpi_comm, GenericVector &x, const Mesh &mesh, const std::vector< size_t > &cells, const std::vector< dolfin::la_index > &cell_dofs, const std::vector< std::size_t > &x_cell_dofs, const std::vector< double > &vector, std::pair< dolfin::la_index, dolfin::la_index > input_vector_range, const GenericDofMap &dofmap)
Missing docstring.
Definition: HDF5Utility.cpp:341
This class defines a common interface for vectors.
Definition: GenericVector.h:47
Definition: Mesh.h:82