Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost interface #1278

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d0a95a8
first ghost-interface draft
antjeHP Jun 24, 2024
4d72771
work status
antjeHP Jun 24, 2024
b8c6e37
update ghost_interface_unref, update set_ghost (not final), add debug…
antjeHP Jul 1, 2024
11db7f3
updated ghost_interface_face
antjeHP Jul 4, 2024
3786648
edit balance for ghost_interface
antjeHP Jul 4, 2024
cfa63f1
updated ghost_creat_ext to ghost_interface
antjeHP Jul 4, 2024
65fc4e4
delete unnecesssary prints
antjeHP Jul 4, 2024
c61a5a4
commed out the members ghost_type and ghost_algorithm in forest
antjeHP Jul 4, 2024
4bca580
fix ghost interface bug in blanace
antjeHP Aug 5, 2024
bf5add2
header for ghost interface
antjeHP Aug 5, 2024
d548aec
change includes for ghost interface
antjeHP Aug 5, 2024
b5ba195
update t8_forest_ghost_create_ext for ghost interface
antjeHP Aug 5, 2024
9b693d4
remove debuging print statmens
antjeHP Aug 5, 2024
dbfb924
add hypercube hybrid to benchmarks
antjeHP Aug 5, 2024
ce0a928
update Makefile for ghost_interface
antjeHP Aug 11, 2024
c47c536
fix benachmark bug
antjeHP Aug 11, 2024
a52d1f6
Merge remote-tracking branch 'origin/main' into feature-ghost_interface
antjeHP Aug 12, 2024
06fd2e2
add ghost_interface implemenation
antjeHP Aug 12, 2024
ba64acb
add ghost interface to makefile
antjeHP Aug 12, 2024
137c189
add more cubetests
antjeHP Aug 26, 2024
cd88e76
add ghost stencil
antjeHP Sep 9, 2024
0d74a11
update function name of step 2 of ghost interface
antjeHP Sep 9, 2024
53de48d
update ghost stencil
antjeHP Sep 11, 2024
febd5b1
add stencil find owner function
antjeHP Sep 16, 2024
c9bb0f4
typos
antjeHP Sep 30, 2024
5010b09
Detailed description of ghost interface functions
antjeHP Oct 7, 2024
39ca690
deleted unused file t8_forest_ghost_interface_faces.hxx
antjeHP Oct 23, 2024
b83d99a
Merge branch 'main' into feature-ghost_interface
antjeHP Oct 24, 2024
af2926a
remove unused variable in add_stencil
antjeHP Oct 29, 2024
68fb1e9
Apply suggestions from code review for const
antjeHP Nov 26, 2024
bea8572
assertion in t8_forest_set_ghost_ext_new
antjeHP Nov 26, 2024
11fbc50
updated year in copyright notice
antjeHP Nov 26, 2024
e93e2e9
add const
antjeHP Nov 26, 2024
bdbf825
update comments
antjeHP Dec 5, 2024
3582bc2
unused varable in realise
antjeHP Dec 5, 2024
a4d2b4e
add doc file
antjeHP Dec 5, 2024
b8c3a67
add more doc
antjeHP Dec 17, 2024
2930add
add doc to t8_forest_ghost_tree_num_elements
antjeHP Jan 17, 2025
6b1d87b
change ghost_interface to ghost_definiton in files
antjeHP Jan 17, 2025
328b312
Merge branch 'feature-ghost_interface' of github.com:DLR-AMR/t8code i…
antjeHP Jan 21, 2025
f4ef4b7
change ghost_interface to ghost_deinition
antjeHP Jan 21, 2025
30c6f6b
doc
antjeHP Jan 21, 2025
812ddad
Update benchmarks/time_forest_partition.cxx
antjeHP Feb 6, 2025
a4d8dfe
Update src/t8_forest/t8_forest.cxx
antjeHP Feb 6, 2025
a0b55ab
Update src/t8_forest/t8_forest.cxx
antjeHP Feb 6, 2025
5089a0d
Update src/t8_forest/t8_forest_balance.cxx
antjeHP Feb 6, 2025
bf15785
Update src/t8_forest/t8_forest_general.h
antjeHP Feb 6, 2025
e1eb4e2
Update src/t8_forest/t8_forest_general.h
antjeHP Feb 6, 2025
b9f52d4
Apply suggestions from code review
antjeHP Feb 6, 2025
c75f44c
changes from review
antjeHP Feb 6, 2025
a12f1e3
typo
antjeHP Feb 6, 2025
28fbbaf
universal return value for success
antjeHP Feb 12, 2025
7fb763e
remove stencil
antjeHP Feb 12, 2025
7213c0f
solve merge conflicts
antjeHP Feb 12, 2025
59cfa28
resolve conflict
antjeHP Feb 12, 2025
96ce4ca
indent
antjeHP Feb 12, 2025
de1980c
update do_ghost for new scheme
antjeHP Feb 12, 2025
91ec4fe
Merge branch 'main' into feature-ghost_interface
sandro-elsweijer Feb 13, 2025
ee8f0af
update set_ghost_ext
antjeHP Feb 13, 2025
302a374
Merge branch 'main' into feature-ghost_interface
sandro-elsweijer Feb 17, 2025
b099c7e
typo
antjeHP Feb 24, 2025
12f2369
Merge branch 'feature-ghost_interface' of github.com:DLR-AMR/t8code i…
antjeHP Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions benchmarks/t8_time_forest_partition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ main (int argc, char *argv[])
int level, level_diff;
int help = 0, no_vtk, do_ghost, do_balance, use_cad;
int dim, num_files;
int test_tet, test_linear_cylinder, test_cad_cylinder;
int test_tet, test_linear_cylinder, test_cad_cylinder, test_hybrid_cube, test_hex_cube;
int stride;
int cmesh_level;
double T, delta_t, cfl;
Expand Down Expand Up @@ -391,6 +391,12 @@ main (int argc, char *argv[])
sc_options_add_switch (opt, 'O', "test-cad-cylinder", &test_cad_cylinder,
"Use a cad cmesh to compare linear and cad geometry performance."
" If this option is used -o is enabled automatically. Not allowed with -f and -c.");
sc_options_add_switch (opt, 'C', "test-hybridcube", &test_hybrid_cube,
"Use a hypercube with Tet, Prism and Hex elements as cmesh."
" If this option is used -o is enabled automatically. Not allowed with -f and -c.");
sc_options_add_switch (opt, 'H', "test-hexcube", &test_hex_cube,
"Use a hypercube with Hex elements as cmesh."
" If this option is used -o is enabled automatically. Not allowed with -f and -c.");
sc_options_add_int (opt, 'l', "level", &level, 0, "The initial uniform refinement level of the forest.");
sc_options_add_int (opt, 'r', "rlevel", &level_diff, 1,
"The number of levels that the forest is refined from the initial level.");
Expand All @@ -416,11 +422,12 @@ main (int argc, char *argv[])
/* check for wrong usage of arguments */
if (first_argc < 0 || first_argc != argc || dim < 2 || dim > 3
|| (cmeshfileprefix == NULL && mshfileprefix == NULL && test_tet == 0 && test_cad_cylinder == 0
&& test_linear_cylinder == 0)
&& test_linear_cylinder == 0 && test_hybrid_cube == 0 && test_hex_cube == 0)
|| stride <= 0 || (num_files - 1) * stride >= mpisize || cfl < 0 || T <= 0
|| test_tet + test_linear_cylinder + test_cad_cylinder > 1
|| (cmesh_level >= 0 && (!test_linear_cylinder && !test_cad_cylinder))
|| ((mshfileprefix != NULL || cmeshfileprefix != NULL) && (test_linear_cylinder || test_cad_cylinder || test_tet))
|| test_tet + test_linear_cylinder + test_cad_cylinder + test_hybrid_cube + test_hex_cube > 1
|| (cmesh_level >= 0 && (!test_linear_cylinder && !test_cad_cylinder && !test_hybrid_cube && !test_hex_cube))
|| ((mshfileprefix != NULL || cmeshfileprefix != NULL)
&& (test_linear_cylinder || test_cad_cylinder || test_tet || test_hybrid_cube || test_hex_cube))
|| (mshfileprefix == NULL && use_cad)) {
sc_options_print_usage (t8_get_package_id (), SC_LP_ERROR, opt, NULL);
return 1;
Expand Down Expand Up @@ -455,6 +462,14 @@ main (int argc, char *argv[])
sc_intpow (2, cmesh_level), sc_intpow (2, cmesh_level), test_cad_cylinder);
test_linear_cylinder ? vtu_prefix = "test_linear_cylinder" : vtu_prefix = "test_cad_cylinder";
}
else if (test_hybrid_cube) {
cmesh = t8_cmesh_new_hypercube_hybrid (sc_MPI_COMM_WORLD, 0, 0);
vtu_prefix = "test_hypercube_hybrid";
}
else if (test_hex_cube) {
cmesh = t8_cmesh_new_hypercube (T8_ECLASS_HEX, sc_MPI_COMM_WORLD, 0, 0, 0);
vtu_prefix = "test_hypercube_hex";
}
else {
T8_ASSERT (cmeshfileprefix != NULL);
cmesh
Expand Down
1 change: 1 addition & 0 deletions doc/author_henricpetri.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I place my contributions to t8code under the FreeBSD license. Antje Henric-Petri ([email protected])
3 changes: 2 additions & 1 deletion example/forest/t8_test_ghost.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <t8_forest/t8_forest_general.h>
#include <t8_forest/t8_forest_io.h>
#include <t8_forest/t8_forest_profiling.h>
#include <t8_forest/t8_forest_ghost_search.hxx>
#include <t8_cmesh.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_vtk/t8_vtk_writer.h>
Expand Down Expand Up @@ -187,7 +188,7 @@ t8_test_ghost_refine_and_partition (t8_cmesh_t cmesh, const int level, sc_MPI_Co
/* Set the forest for partitioning */
t8_forest_set_partition (forest_ghost, forest, 0);
/* Activate ghost creation */
t8_forest_set_ghost_ext (forest_ghost, 1, T8_GHOST_FACES, ghost_version);
t8_forest_set_ghost_ext (forest_ghost, 1, new t8_forest_ghost_face (ghost_version));
/* Activate timers */
t8_forest_set_profiling (forest_ghost, 1);

Expand Down
3 changes: 2 additions & 1 deletion example/forest/t8_test_ghost_large_level_diff.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <t8_forest/t8_forest_adapt.h>
#include <t8_forest/t8_forest_io.h>
#include <t8_forest/t8_forest_profiling.h>
#include <t8_forest/t8_forest_ghost_search.hxx>
#include <t8_schemes/t8_default/t8_default.hxx>

/* The refinement criterion
Expand Down Expand Up @@ -179,7 +180,7 @@ t8_ghost_large_level_diff (const char *prefix, int dim, int level, int refine, i
/* Partition */
t8_forest_init (&forest_partition);
t8_forest_set_partition (forest_partition, forest_adapt, 0);
t8_forest_set_ghost_ext (forest_partition, 1, T8_GHOST_FACES, 3);
t8_forest_set_ghost_ext (forest_partition, 1, new t8_forest_ghost_face (3));
t8_forest_set_profiling (forest_partition, 1);
t8_forest_commit (forest_partition);
if (!no_vtk) {
Expand Down
5 changes: 5 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ libt8_installed_headers_forest = \
src/t8_forest/t8_forest_profiling.h \
src/t8_forest/t8_forest_io.h \
src/t8_forest/t8_forest_adapt.h \
src/t8_forest/t8_forest_iterate.h src/t8_forest/t8_forest_partition.h \
=======
src/t8_forest/t8_forest_iterate.h \
src/t8_forest/t8_forest_partition.h \
src/t8_forest/t8_forest_ghost_definition_wrapper.h \
src/t8_forest/t8_forest_ghost_definition.h \
src/t8_forest/t8_forest_ghost_definition.hxx \
src/t8_forest/t8_forest_search/t8_forest_search.hxx
libt8_installed_headers_geometry = \
src/t8_geometry/t8_geometry.h \
Expand Down
4 changes: 4 additions & 0 deletions src/t8.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ t8_init (int log_threshold);
void *
t8_sc_array_index_locidx (const sc_array_t *array, const t8_locidx_t it);

/** Return values for subroutines, if they failed */
#define T8_SUBROUTINE_SUCCESS 1 /* true */
#define T8_SUBROUTINE_FAILED 0 /* false */

/* call this at the end of a header file to match T8_EXTERN_C_BEGIN (). */
T8_EXTERN_C_END ();

Expand Down
6 changes: 3 additions & 3 deletions src/t8_cmesh/t8_cmesh_readmshfile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ T8_EXTERN_C_BEGIN ();
/* This is a helper function to properly register the
* geometries for the cmesh created in t8_cmesh_from_msh_file.
* It should be called by all processes of the cmesh.
* Returns 1 on success, 0 on cad usage error: use_cad_geometry true, but OCC not linked.
* Returns T8_SUBROUTINE_SUCCESS on success, T8_SUBROUTINE_FAILED on cad usage error: use_cad_geometry true, but OCC not linked.
* The linear_geometry pointer will point to the newly created linear geometry.
* The cad_geometry pointer will point to the newly created cad geometry, or to NULL if
* no cad geometry is used.
Expand All @@ -1775,10 +1775,10 @@ t8_cmesh_from_msh_file_register_geometries (t8_cmesh_t cmesh, const int use_cad_
*cad_geometry = t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, std::string (fileprefix));
#else /* !T8_WITH_OCC */
*cad_geometry = NULL;
return 0;
return T8_SUBROUTINE_FAILED;
#endif
}
return 1;
return T8_SUBROUTINE_SUCCESS;
}

t8_cmesh_t
Expand Down
12 changes: 6 additions & 6 deletions src/t8_cmesh/t8_cmesh_triangle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ t8_cmesh_triangle_read_eles (t8_cmesh_t cmesh, int corner_offset, char *filename
}

/* Open .neigh file and read element neighbor information
* On success 0 is returned.
* On failure -1 is returned. */
* On success T8_SUBROUTINE_SUCCESS is returned.
* On failure T8_SUBROUTINE_FAILED is returned. */
static int
t8_cmesh_triangle_read_neigh (t8_cmesh_t cmesh, int element_offset, char *filename, int dim)
{
Expand Down Expand Up @@ -497,7 +497,7 @@ t8_cmesh_triangle_read_neigh (t8_cmesh_t cmesh, int element_offset, char *filena
}
T8_FREE (tneighbors);
free (line);
return 0;
return T8_SUBROUTINE_SUCCESS;
die_neigh:
/* Clean up on error. */
T8_FREE (tneighbors);
Expand All @@ -506,7 +506,7 @@ t8_cmesh_triangle_read_neigh (t8_cmesh_t cmesh, int element_offset, char *filena
fclose (fp);
}
free (line);
return -1;
return T8_SUBROUTINE_FAILED;
}

/* TODO: remove do_dup argument */
Expand Down Expand Up @@ -559,7 +559,7 @@ t8_cmesh_from_tetgen_or_triangle_file (char *fileprefix, int partition, sc_MPI_C
/* read .neigh file */
snprintf (current_file, BUFSIZ, "%s.neigh", fileprefix);
retval = t8_cmesh_triangle_read_neigh (cmesh, corner_offset, current_file, dim);
if (retval != 0) {
if (retval == T8_SUBROUTINE_FAILED) {
t8_global_errorf ("Error while parsing file %s.\n", current_file);
t8_cmesh_unref (&cmesh);
return NULL;
Expand Down Expand Up @@ -639,7 +639,7 @@ t8_cmesh_from_tetgen_or_triangle_file_time (char *fileprefix, int partition, sc_
/* read .neigh file */
snprintf (current_file, BUFSIZ, "%s.neigh", fileprefix);
retval = t8_cmesh_triangle_read_neigh (cmesh, corner_offset, current_file, dim);
if (retval != 0) {
if (retval == T8_SUBROUTINE_FAILED) {
t8_global_errorf ("Error while parsing file %s.\n", current_file);
t8_cmesh_unref (&cmesh);
}
Expand Down
72 changes: 46 additions & 26 deletions src/t8_forest/t8_forest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <t8_forest/t8_forest_partition.h>
#include <t8_forest/t8_forest_private.h>
#include <t8_forest/t8_forest_ghost.h>
#include <t8_forest/t8_forest_ghost_definition_wrapper.h>
#include <t8_forest/t8_forest_balance.h>
#include <t8_schemes/t8_scheme.hxx>
#include <t8_cmesh/t8_cmesh_trees.h>
Expand All @@ -38,6 +39,8 @@
#include <t8_forest/t8_forest_adapt.h>
#include <t8_vtk/t8_vtk_writer.h>
#include <t8_geometry/t8_geometry_base.hxx>
#include <t8_forest/t8_forest_ghost_definition.hxx>
#include <t8_forest/t8_forest_ghost_search.hxx>
#if T8_ENABLE_DEBUG
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h>
Expand Down Expand Up @@ -2895,14 +2898,41 @@ t8_forest_set_balance (t8_forest_t forest, const t8_forest_t set_from, int no_re
}

void
t8_forest_set_ghost_ext (t8_forest_t forest, int do_ghost, t8_ghost_type_t ghost_type, int ghost_version)
t8_forest_set_ghost_ext (t8_forest_t forest, const int do_ghost, t8_forest_ghost_definition_c *ghost_definition)
{
T8_ASSERT (t8_forest_is_initialized (forest));
/* We currently only support face ghosts */

if (do_ghost != 0) {
if (ghost_definition == NULL) {
/* If forest has a ghost_definition, activate ghost, otherwise abort. */
if (forest->ghost_definition != NULL) {
forest->do_ghost = 1;
}
else {
SC_ABORT ("Want to aktivat ghost, without ghost_definition.\n");
}
}
else {
/* Unref the old ghost_definition (if it exists) and set the new one. */
if (forest->ghost_definition != NULL) {
t8_forest_ghost_definition_unref (&(forest->ghost_definition));
}
forest->do_ghost = 1;
forest->ghost_definition = ghost_definition;
}
}
else {
/* Deactivate ghost for the forest, but do not overwrite an old ghost_definition of the forest. */
forest->do_ghost = 0;
}
}

void
t8_forest_set_ghost (t8_forest_t forest, int do_ghost, t8_ghost_type_t ghost_type)
{
/* Use ghost version 3, top-down search and for unbalanced forests. */
SC_CHECK_ABORT (do_ghost == 0 || ghost_type == T8_GHOST_FACES,
"Ghost neighbors other than face-neighbors are not supported.\n");
SC_CHECK_ABORT (1 <= ghost_version && ghost_version <= 3, "Invalid choice for ghost version. Choose 1, 2, or 3.\n");

if (ghost_type == T8_GHOST_NONE) {
/* none type disables ghost */
forest->do_ghost = 0;
Expand All @@ -2911,18 +2941,10 @@ t8_forest_set_ghost_ext (t8_forest_t forest, int do_ghost, t8_ghost_type_t ghost
forest->do_ghost = (do_ghost != 0); /* True if and only if do_ghost != 0 */
}
if (forest->do_ghost) {
forest->ghost_type = ghost_type;
forest->ghost_algorithm = ghost_version;
t8_forest_set_ghost_ext (forest, do_ghost, new t8_forest_ghost_face (3));
}
}

void
t8_forest_set_ghost (t8_forest_t forest, int do_ghost, t8_ghost_type_t ghost_type)
{
/* Use ghost version 3, top-down search and for unbalanced forests. */
t8_forest_set_ghost_ext (forest, do_ghost, ghost_type, 3);
}

void
t8_forest_set_adapt (t8_forest_t forest, const t8_forest_t set_from, t8_forest_adapt_t adapt_fn, int recursive)
{
Expand Down Expand Up @@ -3201,6 +3223,11 @@ t8_forest_commit (t8_forest_t forest)
forest->scheme = forest->set_from->scheme;
forest->global_num_trees = forest->set_from->global_num_trees;

if (forest->ghost_definition == NULL && forest->set_from->ghost_definition != NULL) {
forest->ghost_definition = forest->set_from->ghost_definition;
forest->ghost_definition->ref ();
}

/* Compute the maximum allowed refinement level */
t8_forest_compute_maxlevel (forest);
if (forest->from_method == T8_FOREST_FROM_COPY) {
Expand Down Expand Up @@ -3355,19 +3382,7 @@ t8_forest_commit (t8_forest_t forest)
/* Construct a ghost layer, if desired */
if (forest->do_ghost) {
/* TODO: ghost type */
switch (forest->ghost_algorithm) {
case 1:
t8_forest_ghost_create_balanced_only (forest);
break;
case 2:
t8_forest_ghost_create (forest);
break;
case 3:
t8_forest_ghost_create_topdown (forest);
break;
default:
SC_ABORT ("Invalid choice of ghost algorithm");
}
t8_forest_ghost_create_ext (forest);
}
forest->do_ghost = 0;
}
Expand Down Expand Up @@ -4217,6 +4232,11 @@ t8_forest_reset (t8_forest_t *pforest)
if (forest->ghosts != NULL) {
t8_forest_ghost_unref (&forest->ghosts);
}
/* Unref the ghost_definition class if it exist */
if (forest->ghost_definition != NULL) {
forest->ghost_definition->unref ();
forest->ghost_definition = NULL;
}
/* we have taken ownership on calling t8_forest_set_* */
if (forest->scheme != NULL) {
forest->scheme->unref ();
Expand Down
19 changes: 17 additions & 2 deletions src/t8_forest/t8_forest_balance.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
t8code is a C library to manage a collection (a forest) of multiple
connected adaptive space-trees of general element classes in parallel.

Copyright (C) 2015 the developers
Copyright (C) 2024 the developers

t8code is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -25,6 +25,8 @@
#include <t8_forest/t8_forest_types.h>
#include <t8_forest/t8_forest_private.h>
#include <t8_forest/t8_forest_ghost.h>
#include <t8_forest/t8_forest_ghost_definition.hxx>
#include <t8_forest/t8_forest_ghost_definition_wrapper.h>
#include <t8_forest/t8_forest_general.h>
#include <t8_forest/t8_forest_profiling.h>
#include <t8_schemes/t8_scheme.hxx>
Expand Down Expand Up @@ -137,6 +139,7 @@ t8_forest_balance (t8_forest_t forest, int repartition)
int count_partition_stats = 0;
double ada_time, ghost_time, part_time;
sc_statinfo_t *adap_stats, *ghost_stats, *partition_stats;
int create_ghost_definition = 0; /* flag if create ghost_definition */

t8_global_productionf ("Into t8_forest_balance with %lli global elements.\n",
(long long) t8_forest_get_global_num_elements (forest->set_from));
Expand Down Expand Up @@ -169,9 +172,21 @@ t8_forest_balance (t8_forest_t forest, int repartition)
/* This function is reference neutral regarding forest_from */
t8_forest_ref (forest_from);

/* if the set_from forest of the current forest has no ghost layer computed,
* compute a ghost layer for the set_from forest */
if (forest->set_from->ghosts == NULL) {
forest->set_from->ghost_type = T8_GHOST_FACES;
/* If the forest does not yet have a ghost_definition */
if (forest->set_from->ghost_definition == NULL) {
/* create a ghost_definition of type face with top-down-search */
forest->set_from->ghost_definition = t8_forest_ghost_definition_face_new (3);
create_ghost_definition = 1;
}
/* compute ghost layer for set_from forest */
t8_forest_ghost_create_topdown (forest->set_from);
if (create_ghost_definition) { /* if a ghost_definition has been created, it will be deleted here */
t8_forest_ghost_definition_unref (&(forest->set_from->ghost_definition));
forest->set_from->ghost_definition = NULL;
}
}

while (!done_global) {
Expand Down
Loading