DOLFINx
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
16namespace dolfinx::mesh
17{
18
34Mesh 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
51Mesh create_interval(MPI_Comm comm, std::size_t n, std::array<double, 2> x,
52 GhostMode ghost_mode,
53 const CellPartitionFunction& partitioner
55
57enum class DiagonalType
58{
59 left,
60 right,
61 crossed,
62 shared_facet,
63 left_right,
64 right_left
65};
66
81Mesh 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
103Mesh 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:622
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:250
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:520
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:327
GhostMode
Enum for different partitioning ghost modes.
Definition: utils.h:27
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:52