p4est  2.8.7
p4est is a software library for parallel adaptive mesh refinement.
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
userdata/userdata_run3.c

A 3D example of managing application data.The workflow is documented more extensively in A demonstration of how to manage application data. The image below is generated from the command

mpirun -np 7 example/userdata/p8est_userdata rotcubes 5 -I

and visualized with Paraview, combining a value threshold of 0.1 and up with an output of level 3 cells colored by MPI rank.

The 3D version of th this demo compiles from the same code as the 2D example userdata/userdata_run2.c with minimal redefinitions. In this sense, the code is mostly dimension independent.

/*
This file is part of p4est.
p4est is a C library to manage a collection (a forest) of multiple
connected adaptive quadtrees or octrees in parallel.
Copyright (C) 2010 The University of Texas System
Additional copyright (C) 2011 individual authors
Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac
p4est is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
p4est is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with p4est; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* the core functionality of the exmple program */
#include <p4est_to_p8est.h>
#include "userdata_run2.c"