-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16632 from peterrum/compute_active_cell_halo_laye…
…r_pbc GridTools::compute_active_cell_halo_layer() for periodic meshes
- Loading branch information
Showing
5 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Fixed: The function GridTools::compute_active_cell_halo_layer() now | ||
also supports perodic meshes. | ||
<br> | ||
(Peter Munch, 2024/02/12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// --------------------------------------------------------------------- | ||
// | ||
// Copyright (C) 2024 by the deal.II authors | ||
// | ||
// This file is part of the deal.II library. | ||
// | ||
// The deal.II library is free software; you can use it, redistribute | ||
// it, and/or modify it under the terms of the GNU Lesser General | ||
// Public License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or (at your option) any later version. | ||
// The full text of the license can be found in the file LICENSE.md at | ||
// the top level directory of deal.II. | ||
// | ||
// --------------------------------------------------------------------- | ||
|
||
|
||
// Test shared triangulations (with artificial cells) for periodic | ||
// boundary conditions. | ||
|
||
#include <deal.II/distributed/shared_tria.h> | ||
|
||
#include <deal.II/dofs/dof_tools.h> | ||
|
||
#include <deal.II/fe/fe_q.h> | ||
|
||
#include <deal.II/grid/grid_generator.h> | ||
#include <deal.II/grid/grid_out.h> | ||
#include <deal.II/grid/grid_tools.h> | ||
|
||
#include "../tests.h" | ||
|
||
template <int dim> | ||
void | ||
test() | ||
{ | ||
parallel::shared::Triangulation<dim> tria(MPI_COMM_WORLD, | ||
Triangulation<dim>::none, | ||
true); | ||
|
||
GridGenerator::hyper_cube(tria, 0, 1, true); | ||
|
||
std::vector< | ||
GridTools::PeriodicFacePair<typename Triangulation<dim>::cell_iterator>> | ||
face_pairs; | ||
for (unsigned int d = 0; d < dim; ++d) | ||
GridTools::collect_periodic_faces(tria, 2 * d, 2 * d + 1, d, face_pairs); | ||
tria.add_periodicity(face_pairs); | ||
|
||
tria.refine_global(6 - dim); | ||
|
||
DoFHandler<dim> dof_handler(tria); | ||
dof_handler.distribute_dofs(FE_Q<dim>(1)); | ||
|
||
AffineConstraints<double> constraints; | ||
|
||
constraints.reinit(DoFTools::extract_locally_relevant_dofs(dof_handler)); | ||
for (unsigned int d = 0; d < dim; ++d) | ||
DoFTools::make_periodicity_constraints( | ||
dof_handler, 2 * d, 2 * d + 1, d, constraints); | ||
constraints.close(); | ||
|
||
deallog << "OK" << std::endl; | ||
} | ||
|
||
int | ||
main(int argc, char **argv) | ||
{ | ||
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); | ||
|
||
MPILogInitAll all; | ||
|
||
test<1>(); | ||
test<2>(); | ||
test<3>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
DEAL:0::OK | ||
DEAL:0::OK | ||
DEAL:0::OK | ||
|
||
DEAL:1::OK | ||
DEAL:1::OK | ||
DEAL:1::OK | ||
|