Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/d6/d6c/generation_8h_source.html
DOLFINx  0.5.1
DOLFINx C++ interface
generation.h
1 // Copyright (C) 2005-2017 Anders Logg and Garth N. Wells
2 //
3 // This file is part of DOLFINx (https://www.fenicsproject.org)
4 //
5 // SPDX-License-Identifier: LGPL-3.0-or-later
6 
7 #pragma once
8 
9 #include "Mesh.h"
10 #include "cell_types.h"
11 #include "utils.h"
12 #include <array>
13 #include <cstddef>
14 #include <mpi.h>
15 
16 namespace dolfinx::mesh
17 {
18 
34 Mesh create_box(MPI_Comm comm, const std::array<std::array<double, 3>, 2>& p,
35  std::array<std::size_t, 3> n, CellType celltype,
36  GhostMode ghost_mode,
37  const mesh::CellPartitionFunction& partitioner
39 
51 Mesh create_interval(MPI_Comm comm, std::size_t n, std::array<double, 2> x,
52  GhostMode ghost_mode,
53  const CellPartitionFunction& partitioner
55 
57 enum class DiagonalType
58 {
59  left,
60  right,
61  crossed,
62  shared_facet,
63  left_right,
64  right_left
65 };
66 
81 Mesh create_rectangle(MPI_Comm comm,
82  const std::array<std::array<double, 2>, 2>& p,
83  std::array<std::size_t, 2> n, CellType celltype,
84  GhostMode ghost_mode,
85  DiagonalType diagonal = DiagonalType::right);
86 
103 Mesh create_rectangle(MPI_Comm comm,
104  const std::array<std::array<double, 2>, 2>& p,
105  std::array<std::size_t, 2> n, CellType celltype,
106  GhostMode ghost_mode,
107  const CellPartitionFunction& partitioner,
108  DiagonalType diagonal = DiagonalType::right);
109 } // namespace dolfinx::mesh
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:30
Mesh create_rectangle(MPI_Comm comm, const std::array< std::array< double, 2 >, 2 > &p, std::array< std::size_t, 2 > n, CellType celltype, GhostMode ghost_mode, DiagonalType diagonal=DiagonalType::right)
Create a uniform mesh::Mesh over the rectangle spanned by the two points p. The order of the two poin...
Definition: generation.cpp:562
Mesh create_box(MPI_Comm comm, const std::array< std::array< double, 3 >, 2 > &p, std::array< std::size_t, 3 > n, CellType celltype, GhostMode ghost_mode, const mesh::CellPartitionFunction &partitioner=create_cell_partitioner())
Create a uniform mesh::Mesh over the rectangular prism spanned by the two points p....
Definition: generation.cpp:233
CellPartitionFunction create_cell_partitioner(const graph::partition_fn &partfn=&graph::partition_graph)
Create a function that computes destination rank for mesh cells in this rank by applying the default ...
Definition: utils.cpp:604
Mesh create_interval(MPI_Comm comm, std::size_t n, std::array< double, 2 > x, GhostMode ghost_mode, const CellPartitionFunction &partitioner=create_cell_partitioner())
Interval mesh of the 1D line [a, b]. Given n cells in the axial direction, the total number of interv...
Definition: generation.cpp:303
GhostMode
Enum for different partitioning ghost modes.
Definition: utils.h:29
DiagonalType
Enum for different diagonal types.
Definition: generation.h:58
CellType
Cell type identifier.
Definition: cell_types.h:22
std::function< dolfinx::graph::AdjacencyList< std::int32_t >(MPI_Comm comm, int nparts, int tdim, const dolfinx::graph::AdjacencyList< std::int64_t > &cells, dolfinx::mesh::GhostMode ghost_mode)> CellPartitionFunction
Signature for the cell partitioning function. The function should compute the destination rank for ce...
Definition: utils.h:54