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.6.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
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
33Mesh create_box(MPI_Comm comm, const std::array<std::array<double, 3>, 2>& p,
34 std::array<std::size_t, 3> n, CellType celltype,
35 const mesh::CellPartitionFunction& partitioner
37
48Mesh create_interval(MPI_Comm comm, std::size_t n, std::array<double, 2> x,
49 const CellPartitionFunction& partitioner
51
53enum class DiagonalType
54{
55 left,
56 right,
57 crossed,
58 shared_facet,
59 left_right,
60 right_left
61};
62
76Mesh create_rectangle(MPI_Comm comm,
77 const std::array<std::array<double, 2>, 2>& p,
78 std::array<std::size_t, 2> n, CellType celltype,
79 DiagonalType diagonal = DiagonalType::right);
80
96Mesh create_rectangle(MPI_Comm comm,
97 const std::array<std::array<double, 2>, 2>& p,
98 std::array<std::size_t, 2> n, CellType celltype,
99 const CellPartitionFunction& partitioner,
100 DiagonalType diagonal = DiagonalType::right);
101} // namespace dolfinx::mesh
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:31
Mesh create_rectangle(MPI_Comm comm, const std::array< std::array< double, 2 >, 2 > &p, std::array< std::size_t, 2 > n, CellType celltype, 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:556
std::function< graph::AdjacencyList< std::int32_t >(MPI_Comm comm, int nparts, int tdim, const graph::AdjacencyList< std::int64_t > &cells)> CellPartitionFunction
Signature for the cell partitioning function. The function should compute the destination rank for ce...
Definition: utils.h:55
Mesh create_box(MPI_Comm comm, const std::array< std::array< double, 3 >, 2 > &p, std::array< std::size_t, 3 > n, CellType celltype, 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:230
DiagonalType
Enum for different diagonal types.
Definition: generation.h:54
Mesh create_interval(MPI_Comm comm, std::size_t n, std::array< double, 2 > x, 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:299
CellType
Cell type identifier.
Definition: cell_types.h:22
CellPartitionFunction create_cell_partitioner(mesh::GhostMode ghost_mode=mesh::GhostMode::none, 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:609