Skip to content

Commit

Permalink
Bring dolfinx::refinement::refine up to date with dolfinx 0.9.0 (#160)
Browse files Browse the repository at this point in the history
* Pin versions in CI workflow for release 0.9.0

* Add files generate by cmake to .gitignore

* Bring dolfinx::refinement::refine up to date with dolfinx 0.9.0

Due to changes in
FEniCS/dolfinx#3322
FEniCS/dolfinx#3444
  • Loading branch information
francesco-ballarin authored Nov 3, 2024
1 parent 1b092bc commit 7ce8d7f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ jobs:
with:
path: ./dolfinx
repository: FEniCS/dolfinx
ref: main
ref: v0.9.0

- name: Install FEniCS Python components
run: |
apt-get -qq update
apt-get -y install libboost-program-options-dev
pip3 install --break-system-packages pip --upgrade
pip3 install --break-system-packages git+https://github.com/FEniCS/ufl.git
pip3 install --break-system-packages git+https://github.com/FEniCS/basix.git
pip3 install --break-system-packages git+https://github.com/FEniCS/ffcx
pip3 install --break-system-packages git+https://github.com/FEniCS/ufl.git@2024.2.0
pip3 install --break-system-packages git+https://github.com/FEniCS/basix.git@v0.9.0
pip3 install --break-system-packages git+https://github.com/FEniCS/ffcx@v0.9.0
- name: Build dolfinx cpp
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build -S dolfinx/cpp/
Expand Down
9 changes: 9 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CMakeCache.txt
CMakeFiles/
Elasticity.c
Elasticity.h
Makefile
Poisson.c
Poisson.h
cmake_install.cmake
dolfinx-scaling-test
15 changes: 12 additions & 3 deletions src/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ create_cube_mesh(MPI_Comm comm, std::size_t target_dofs, bool target_dofs_total,
for (int i = 0; i < r; ++i)
{
mesh.topology_mutable()->create_connectivity(3, 1);
auto [new_mesh, _x, _y] = dolfinx::refinement::refine(mesh, std::nullopt, false);
auto [new_mesh, _parent_edges, _parent_facet] = dolfinx::refinement::refine(
mesh, std::nullopt,
dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::shared_facet),
dolfinx::refinement::Option::parent_cell_and_facet);
mesh = std::move(new_mesh);
}

Expand Down Expand Up @@ -366,7 +369,10 @@ create_spoke_mesh(MPI_Comm comm, std::size_t target_dofs,
+ mesh->topology()->index_map(1)->size_global()
< target)
{
auto [new_mesh, _x, _y] = dolfinx::refinement::refine(*mesh, std::nullopt, false);
auto [new_mesh, _parent_edges, _parent_facet] = dolfinx::refinement::refine(
*mesh, std::nullopt,
dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::shared_facet),
dolfinx::refinement::Option::parent_cell_and_facet);
mesh = std::make_shared<dolfinx::mesh::Mesh<double>>(new_mesh);
mesh->topology_mutable()->create_entities(1);
}
Expand Down Expand Up @@ -401,7 +407,10 @@ create_spoke_mesh(MPI_Comm comm, std::size_t target_dofs,
if (i % 2000 < nmarked)
marked_edges.push_back(i);

auto [new_mesh, _x, _y] = dolfinx::refinement::refine(*mesh, marked_edges, false);
auto [new_mesh, _parent_edges, _parent_facet] = dolfinx::refinement::refine(
*mesh, marked_edges,
dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::shared_facet),
dolfinx::refinement::Option::parent_cell_and_facet);
meshi = std::make_shared<dolfinx::mesh::Mesh<double>>(new_mesh);

double actual_fraction
Expand Down

0 comments on commit 7ce8d7f

Please sign in to comment.