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

Update points example #212

Merged
merged 20 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,8 @@ WARN_LOGFILE =

INPUT = @top_srcdir@/src \
@top_srcdir@/doc/mainpage.dox \
@top_srcdir@/doc/examples.dox
@top_srcdir@/doc/examples.dox \
@top_srcdir@/doc/example_points.dox

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
78 changes: 78 additions & 0 deletions doc/example_points.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
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
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.
*/

/** \page example_points Documentation for the point example program
*
* The points example refines a domain according to a given set of points.
*/

/** \example points/generate_points2.c
*
* Auxiliary program to generate a file of points in parallel.
* It uses the MPI I/O functionality of libsc to create one large file.
* The file is written to in parallel and using partitioned file access.
*
* The file contains first a binary integer \ref p4est_gloidx_t
* storing the global number of points and then the list of point
* coordinates as 3-tuples of binary type double.
*
* The usage of the program is
*
* p4est_points_generate <configuration> <globalnumpoints> <prefix>
*
* where configuration is one of
*
* - `unit` The 2D unit square,
* - `brick` A 2x3 grid of squares,
* - `three` Three squares meeting at a non-planary angle,
* - `moebius` A five-square moebius strip embedded in 3D space,
* - `star` A star composed of six rhomboids,
* - `periodic` The all-periodic unit square
*
* and prefix is an output basename or filename to which we append `.pts`.
*/

/** \example points/generate_points3.c
*
* Auxiliary program to generate a file of points in parallel.
* It uses the MPI I/O functionality of libsc to create one large file.
* The file is written to in parallel and using partitioned file access.
*
* The file contains first a binary integer \ref p4est_gloidx_t
* storing the global number of points and then the list of point
* coordinates as 3-tuples of binary type double.
*
* The usage of the program is
*
* p8est_points_generate <configuration> <globalnumpoints> <prefix>
*
* where configuration is one of
*
* - `unit` The unit cube,
* - `brick` An example brick connectivity using configuration
* (2,3,4) as the number of trees per direction.
* - `periodic` The unit cube with all-periodic boundary conditions.
* - `rotwrap` The unit cube with various self-periodic b.c.
* - `twocubes` Two connected cubes.
* - `rotcubes` A collection of six connected rotated cubes.
*/
2 changes: 1 addition & 1 deletion doc/examples.dox
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/** \page Examples Documentation for selected example programs
/** \page examples Documentation for selected example programs
*
* The p4est library comes with various example programs.
* They are kept under the subdirectory
Expand Down
25 changes: 15 additions & 10 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ configure_file(
endfunction()

# --- setup examples

p4est_example(points2 points/points2.c "point")
if(enable_p8est)
p8est_example(points3 points/points3.c "point")
endif()

p4est_example(generate_points2 points/generate_points2.c "point")
if(enable_p8est)
p8est_example(generate_points3 points/generate_points3.c "point")
endif()


if(P4EST_HAVE_GETOPT_H)

set(n particles)
Expand All @@ -59,13 +71,6 @@ if(enable_p8est)
endif()
p4est_copy_resource(${n} separt.pl)

set(n p4est_step3)
p4est_example(${n} steps/${n}.c "steps")
if(enable_p8est)
set(n p8est_step3)
p8est_example(${n} steps/${n}.c "steps")
endif()

set(n spheres)
p4est_example(${n}2 "${n}/${n}2.c;${n}/p4est_${n}.c" ${n})
if(enable_p8est)
Expand Down Expand Up @@ -95,7 +100,7 @@ if(enable_p8est)
p8est_example(${n}3 balance/${n}3.c "balance")
endif()

foreach(n mesh points simple)
foreach(n mesh simple)
p4est_example(${n}2 ${n}/${n}2.c ${n})
if(enable_p8est)
p8est_example(${n}3 ${n}/${n}3.c ${n})
Expand All @@ -110,7 +115,7 @@ if(enable_p8est)
endif()

set(s steps)
foreach(i 1 2 4)
foreach(i 1 2 3 4 5)
set(n p4est_step${i})
p4est_example(${n} ${s}/${n}.c ${s})

Expand All @@ -128,7 +133,7 @@ if(enable_p8est)
p4est_copy_resource(${s} hole_3d_${n})
endforeach()
endif()

set(t tetgen)
foreach(n read_conn write_conn)
p4est_example(${n}2 ${t}/${n}2.c ${t})
Expand Down
6 changes: 6 additions & 0 deletions example/points/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ if P4EST_ENABLE_BUILD_2D
bin_PROGRAMS += example/points/p4est_points
example_points_p4est_points_SOURCES = example/points/points2.c

bin_PROGRAMS += example/points/p4est_points_generate
example_points_p4est_points_generate_SOURCES = example/points/generate_points2.c

LINT_CSOURCES += $(example_points_p4est_points_SOURCES)
endif

if P4EST_ENABLE_BUILD_3D
bin_PROGRAMS += example/points/p8est_points
example_points_p8est_points_SOURCES = example/points/points3.c

bin_PROGRAMS += example/points/p8est_points_generate
example_points_p8est_points_generate_SOURCES = example/points/generate_points3.c

LINT_CSOURCES += $(example_points_p8est_points_SOURCES)
endif
Loading