Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd authored Sep 15, 2024
2 parents 5baf1c2 + 9635a82 commit 6fda65d
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pyvista.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
# For pyvista/pyvistaqt
DISPLAY: ":99.0"
PYVISTA_OFF_SCREEN: true
PYVISTA_QT_VERSION: 0.11.0
PYVISTA_VERSION: 0.43.10
PYVISTA_QT_VERSION: 0.11.1
PYVISTA_VERSION: 0.44.1
QT_DEBUG_PLUGINS: 1

PETSC_ARCH: ${{ matrix.petsc_arch }}
Expand Down
6 changes: 5 additions & 1 deletion cpp/cmake/templates/DOLFINXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ find_dependency(MPI REQUIRED)
find_dependency(spdlog REQUIRED)
find_dependency(pugixml REQUIRED)

if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW) # Boost CONFIG mode
endif()

# Check for Boost
if(DEFINED ENV{BOOST_ROOT} OR DEFINED BOOST_ROOT)
set(Boost_NO_SYSTEM_PATHS on)
endif()
set(Boost_USE_MULTITHREADED $ENV{BOOST_USE_MULTITHREADED})
set(Boost_VERBOSE TRUE)
find_dependency(Boost 1.70 REQUIRED COMPONENTS timer)
find_package(Boost 1.70 REQUIRED timer)

if(@ufcx_FOUND@)
find_dependency(ufcx)
Expand Down
34 changes: 17 additions & 17 deletions cpp/dolfinx/mesh/generation.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,36 @@ enum class DiagonalType
namespace impl
{
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 @@ -93,7 +93,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 @@ -139,7 +139,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 @@ -163,7 +163,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 @@ -206,7 +206,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 @@ -227,7 +227,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 @@ -278,7 +278,7 @@ namespace impl
{
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 @@ -327,7 +327,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 @@ -375,7 +375,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 @@ -418,7 +418,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 @@ -464,7 +464,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 @@ -621,7 +621,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
4 changes: 2 additions & 2 deletions docker/Dockerfile.end-user
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# echo "FROM dolfinx/dolfinx-onbuild:nightly" | docker build -f- .
#

ARG PYVISTA_VERSION=0.43.8
ARG PYVISTA_VERSION=0.44.1

# Used to set the correct PYTHONPATH for the real and complex install of
# DOLFINx
Expand Down Expand Up @@ -170,7 +170,7 @@ RUN dpkgArch="$(dpkg --print-architecture)"; \
pip install --no-cache-dir pyvista[trame]==${PYVISTA_VERSION} ;; \
esac; \
case "$dpkgArch" in arm64) \
pip install --no-cache-dir https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.3.0-cp312/vtk-9.3.0.dev0-cp312-cp312-linux_aarch64.whl && \
pip install --no-cache-dir https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.3.0-cp312/vtk-9.3.0.dev0-cp312-cp312-linux_aarch64.whl && \
pip install --no-cache-dir pyvista[trame]==${PYVISTA_VERSION} ;; \
esac; \
pip cache purge
Expand Down
12 changes: 5 additions & 7 deletions docker/Dockerfile.redhat
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ FROM rockylinux/rockylinux:9

ARG BUILD_NP=4

ARG HDF5_SERIES=1.14
ARG HDF5_PATCH=3
ARG HDF5_FIX=
ARG PETSC_VERSION=3.21.3
ARG HDF5_VERSION=1.14.4.3
ARG PETSC_VERSION=3.21.5
ARG MPICH_VERSION=4.2.2

WORKDIR /tmp
Expand Down Expand Up @@ -54,9 +52,9 @@ RUN curl -L -O https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${M
rm -rf /tmp/*

# Build HDF5
RUN curl -L -O https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_SERIES}/hdf5-${HDF5_SERIES}.${HDF5_PATCH}/src/hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \
tar -xf hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \
cd hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX} && \
RUN curl -L -O https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_${HDF5_VERSION}.tar.gz && \
tar -xf hdf5_${HDF5_VERSION}.tar.gz && \
cd hdf5-hdf5_${HDF5_VERSION} && \
./configure --prefix=/usr/local --enable-parallel --enable-shared --enable-static=no && \
make -j${BUILD_NP} install && \
rm -rf /tmp/*
Expand Down
26 changes: 9 additions & 17 deletions docker/Dockerfile.test-env
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
#

ARG ADIOS2_VERSION=2.10.1
ARG DOXYGEN_VERSION=1_11_0
ARG DOXYGEN_VERSION=1_12_0
ARG GMSH_VERSION=4_13_1
ARG HDF5_SERIES=1.14
ARG HDF5_PATCH=3
ARG HDF5_FIX=
ARG HDF5_VERSION=1.14.4.3
ARG KAHIP_VERSION=3.16
ARG NUMPY_VERSION=1.26.4
ARG PETSC_VERSION=3.21.3
ARG NUMPY_VERSION=2.1.1
ARG PETSC_VERSION=3.21.5
ARG SLEPC_VERSION=3.21.1

ARG MPICH_VERSION=4.2.2
Expand All @@ -35,9 +33,7 @@ LABEL description="FEniCS testing and development environment with PETSc real, c

ARG DOXYGEN_VERSION
ARG GMSH_VERSION
ARG HDF5_SERIES
ARG HDF5_PATCH
ARG HDF5_FIX
ARG HDF5_VERSION
ARG PETSC_VERSION
ARG SLEPC_VERSION
ARG ADIOS2_VERSION
Expand Down Expand Up @@ -149,7 +145,7 @@ RUN python3 -m venv ${VIRTUAL_ENV}

# Install Python packages (via pip)
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir numpy==${NUMPY_VERSION} && \
pip install --no-cache-dir cython numpy==${NUMPY_VERSION} && \
pip install --no-cache-dir --no-build-isolation mpi4py

# Install KaHIP
Expand All @@ -165,9 +161,9 @@ RUN wget -nc --quiet https://github.com/kahip/kahip/archive/v${KAHIP_VERSION}.ta
# HDF5 overrides CMAKE_INSTALL_PREFIX by default, hence it is set
# below to ensure that HDF5 is installed into a path where it can be
# found.
RUN wget -nc --quiet https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_SERIES}/hdf5-${HDF5_SERIES}.${HDF5_PATCH}/src/hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \
tar xfz hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX}.tar.gz && \
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DHDF5_ENABLE_PARALLEL=on -DHDF5_ENABLE_Z_LIB_SUPPORT=on -B build-dir -S hdf5-${HDF5_SERIES}.${HDF5_PATCH}${HDF5_FIX} && \
RUN wget -nc --quiet https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_${HDF5_VERSION}.tar.gz && \
tar xfz hdf5_${HDF5_VERSION}.tar.gz && \
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DHDF5_ENABLE_PARALLEL=on -DHDF5_ENABLE_Z_LIB_SUPPORT=on -B build-dir -S hdf5-hdf5_${HDF5_VERSION} && \
cmake --build build-dir && \
cmake --install build-dir && \
rm -rf /tmp/*
Expand Down Expand Up @@ -316,9 +312,7 @@ RUN apt-get -qq update && \
make PETSC_ARCH=linux-gnu-complex128-64 ${MAKEFLAGS} all && \
# Install petsc4py
cd src/binding/petsc4py && \
pip install --no-cache-dir cython && \
PETSC_ARCH=linux-gnu-real32-32:linux-gnu-complex64-32:linux-gnu-real64-32:linux-gnu-complex128-32:linux-gnu-real64-64:linux-gnu-complex128-64 pip -v install --no-cache-dir --no-build-isolation . && \
pip3 uninstall --yes cython && \
# Cleanup
apt-get -y purge bison flex && \
apt-get -y autoremove && \
Expand Down Expand Up @@ -359,9 +353,7 @@ RUN git clone --depth=1 -b v${SLEPC_VERSION} https://gitlab.com/slepc/slepc.git
make && \
# Install slepc4py
cd src/binding/slepc4py && \
pip3 install --no-cache-dir cython && \
PETSC_ARCH=linux-gnu-real32-32:linux-gnu-complex64-32:linux-gnu-real64-32:linux-gnu-complex128-32:linux-gnu-real64-64:linux-gnu-complex128-64 pip -v install --no-cache-dir --no-build-isolation . && \
pip3 uninstall --yes cython && \
rm -rf ${SLEPC_DIR}/CTAGS ${SLEPC_DIR}/TAGS ${SLEPC_DIR}/docs ${SLEPC_DIR}/src/ ${SLEPC_DIR}/**/obj/ ${SLEPC_DIR}/**/test/ && \
rm -rf /tmp/*

Expand Down
2 changes: 1 addition & 1 deletion python/dolfinx/wrappers/la.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void declare_objects(nb::module_& m, const std::string& type)
std::size_t nrows = self.num_all_rows() * bs[0];
std::size_t ncols = self.index_map(1)->size_global() * bs[1];
auto dense = self.to_dense();
assert(nrows*ncols == dense.size());
assert(nrows * ncols == dense.size());
return dolfinx_wrappers::as_nbarray(std::move(self.to_dense()),
{nrows, ncols});
})
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
5 changes: 3 additions & 2 deletions python/dolfinx/wrappers/refinement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ void export_refinement_with_variable_mesh_type(nb::module_& m)
[](const dolfinx::mesh::Mesh<T>& mesh, bool redistribute,
dolfinx::mesh::GhostMode ghost_mode)
{
auto [mesh_refined, parent_cells] = dolfinx::refinement::refine_interval(
mesh, std::nullopt, redistribute, ghost_mode);
auto [mesh_refined, parent_cells]
= dolfinx::refinement::refine_interval(mesh, std::nullopt,
redistribute, ghost_mode);
return std::tuple(std::move(mesh_refined),
as_nbarray(std::move(parent_cells)));
},
Expand Down

0 comments on commit 6fda65d

Please sign in to comment.