Skip to content

Commit

Permalink
Merge branch 'main' into testing_interval
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells authored Sep 15, 2024
2 parents ee1e794 + 9635a82 commit de0d05c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions cpp/dolfinx/mesh/generation.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,36 @@ std::tuple<std::vector<T>, std::vector<std::int64_t>>
create_interval_cells(std::array<double, 2> p, std::int64_t n);

template <std::floating_point T>
Mesh<T> build_tri(MPI_Comm comm, std::array<std::array<double, 2>, 2> p,
Mesh<T> build_tri(MPI_Comm comm, std::array<std::array<T, 2>, 2> p,
std::array<std::int64_t, 2> n,
const CellPartitionFunction& partitioner,
DiagonalType diagonal);

template <std::floating_point T>
Mesh<T> build_quad(MPI_Comm comm, const std::array<std::array<double, 2>, 2> p,
Mesh<T> build_quad(MPI_Comm comm, const std::array<std::array<T, 2>, 2> p,
std::array<std::int64_t, 2> n,
const CellPartitionFunction& partitioner);

template <std::floating_point T>
std::vector<T> create_geom(MPI_Comm comm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n);

template <std::floating_point T>
Mesh<T> build_tet(MPI_Comm comm, MPI_Comm subcomm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n,
const CellPartitionFunction& partitioner);

template <std::floating_point T>
Mesh<T> build_hex(MPI_Comm comm, MPI_Comm subcomm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n,
const CellPartitionFunction& partitioner);

template <std::floating_point T>
Mesh<T> build_prism(MPI_Comm comm, MPI_Comm subcomm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n,
const CellPartitionFunction& partitioner);
} // namespace impl
Expand All @@ -98,7 +98,7 @@ Mesh<T> build_prism(MPI_Comm comm, MPI_Comm subcomm,
/// @return Mesh
template <std::floating_point T = double>
Mesh<T> create_box(MPI_Comm comm, MPI_Comm subcomm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n, CellType celltype,
CellPartitionFunction partitioner = nullptr)
{
Expand Down Expand Up @@ -144,7 +144,7 @@ Mesh<T> create_box(MPI_Comm comm, MPI_Comm subcomm,
/// across MPI ranks.
/// @return Mesh
template <std::floating_point T = double>
Mesh<T> create_box(MPI_Comm comm, std::array<std::array<double, 3>, 2> p,
Mesh<T> create_box(MPI_Comm comm, std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n, CellType celltype,
const CellPartitionFunction& partitioner = nullptr)
{
Expand All @@ -168,7 +168,7 @@ Mesh<T> create_box(MPI_Comm comm, std::array<std::array<double, 3>, 2> p,
/// @param[in] diagonal Direction of diagonals
/// @return Mesh
template <std::floating_point T = double>
Mesh<T> create_rectangle(MPI_Comm comm, std::array<std::array<double, 2>, 2> p,
Mesh<T> create_rectangle(MPI_Comm comm, std::array<std::array<T, 2>, 2> p,
std::array<std::int64_t, 2> n, CellType celltype,
CellPartitionFunction partitioner,
DiagonalType diagonal = DiagonalType::right)
Expand Down Expand Up @@ -211,7 +211,7 @@ Mesh<T> create_rectangle(MPI_Comm comm, std::array<std::array<double, 2>, 2> p,
/// @param[in] diagonal Direction of diagonals
/// @return Mesh
template <std::floating_point T = double>
Mesh<T> create_rectangle(MPI_Comm comm, std::array<std::array<double, 2>, 2> p,
Mesh<T> create_rectangle(MPI_Comm comm, std::array<std::array<T, 2>, 2> p,
std::array<std::int64_t, 2> n, CellType celltype,
DiagonalType diagonal = DiagonalType::right)
{
Expand All @@ -232,7 +232,7 @@ Mesh<T> create_rectangle(MPI_Comm comm, std::array<std::array<double, 2>, 2> p,
/// across MPI ranks.
/// @return A mesh.
template <std::floating_point T = double>
Mesh<T> create_interval(MPI_Comm comm, std::int64_t n, std::array<double, 2> p,
Mesh<T> create_interval(MPI_Comm comm, std::int64_t n, std::array<T, 2> p,
mesh::GhostMode ghost_mode = mesh::GhostMode::none,
CellPartitionFunction partitioner = nullptr)
{
Expand Down Expand Up @@ -294,7 +294,7 @@ create_interval_cells(std::array<double, 2> p, std::int64_t n)

template <std::floating_point T>
std::vector<T> create_geom(MPI_Comm comm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n)
{
// Extract data
Expand Down Expand Up @@ -343,7 +343,7 @@ std::vector<T> create_geom(MPI_Comm comm,

template <std::floating_point T>
Mesh<T> build_tet(MPI_Comm comm, MPI_Comm subcomm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n,
const CellPartitionFunction& partitioner)
{
Expand Down Expand Up @@ -391,7 +391,7 @@ Mesh<T> build_tet(MPI_Comm comm, MPI_Comm subcomm,

template <std::floating_point T>
mesh::Mesh<T> build_hex(MPI_Comm comm, MPI_Comm subcomm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n,
const CellPartitionFunction& partitioner)
{
Expand Down Expand Up @@ -434,7 +434,7 @@ mesh::Mesh<T> build_hex(MPI_Comm comm, MPI_Comm subcomm,

template <std::floating_point T>
Mesh<T> build_prism(MPI_Comm comm, MPI_Comm subcomm,
std::array<std::array<double, 3>, 2> p,
std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n,
const CellPartitionFunction& partitioner)
{
Expand Down Expand Up @@ -480,7 +480,7 @@ Mesh<T> build_prism(MPI_Comm comm, MPI_Comm subcomm,
}

template <std::floating_point T>
Mesh<T> build_tri(MPI_Comm comm, std::array<std::array<double, 2>, 2> p,
Mesh<T> build_tri(MPI_Comm comm, std::array<std::array<T, 2>, 2> p,
std::array<std::int64_t, 2> n,
const CellPartitionFunction& partitioner,
DiagonalType diagonal)
Expand Down Expand Up @@ -637,7 +637,7 @@ Mesh<T> build_tri(MPI_Comm comm, std::array<std::array<double, 2>, 2> p,
}

template <std::floating_point T>
Mesh<T> build_quad(MPI_Comm comm, const std::array<std::array<double, 2>, 2> p,
Mesh<T> build_quad(MPI_Comm comm, const std::array<std::array<T, 2>, 2> p,
std::array<std::int64_t, 2> n,
const CellPartitionFunction& partitioner)
{
Expand Down
6 changes: 3 additions & 3 deletions python/dolfinx/wrappers/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void declare_mesh(nb::module_& m, std::string type)
std::string create_interval("create_interval_" + type);
m.def(
create_interval.c_str(),
[](MPICommWrapper comm, std::int64_t n, std::array<double, 2> p,
[](MPICommWrapper comm, std::int64_t n, std::array<T, 2> p,
dolfinx::mesh::GhostMode ghost_mode,
const PythonCellPartitionFunction& part)
{
Expand All @@ -254,7 +254,7 @@ void declare_mesh(nb::module_& m, std::string type)
std::string create_rectangle("create_rectangle_" + type);
m.def(
create_rectangle.c_str(),
[](MPICommWrapper comm, std::array<std::array<double, 2>, 2> p,
[](MPICommWrapper comm, std::array<std::array<T, 2>, 2> p,
std::array<std::int64_t, 2> n, dolfinx::mesh::CellType celltype,
const PythonCellPartitionFunction& part,
dolfinx::mesh::DiagonalType diagonal)
Expand All @@ -269,7 +269,7 @@ void declare_mesh(nb::module_& m, std::string type)
std::string create_box("create_box_" + type);
m.def(
create_box.c_str(),
[](MPICommWrapper comm, std::array<std::array<double, 3>, 2> p,
[](MPICommWrapper comm, std::array<std::array<T, 3>, 2> p,
std::array<std::int64_t, 3> n, dolfinx::mesh::CellType celltype,
const PythonCellPartitionFunction& part)
{
Expand Down

0 comments on commit de0d05c

Please sign in to comment.