Skip to content

Commit

Permalink
Merge branch 'main' into test-add_linear_axis_aligned_geometry_test
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro-elsweijer committed Feb 26, 2024
2 parents ca26f78 + 77713f8 commit 50fc8bc
Show file tree
Hide file tree
Showing 136 changed files with 6,901 additions and 6,503 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/add_release_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,27 @@ jobs:
if: ${{ env.MINOR_RELEASE == 'true' }}
run: |
cd t8code-website/content
# Generate new folder for the newest documentation and copy documentation
mkdir -p doc/$GITHUB_REF_NAME
cp -r ../../t8code/build_debug/doc/html/* doc/$GITHUB_REF_NAME/
# Add a link to the newest documentation in the documentation webpage
cd pages
today=`date +'%Y-%m-%d %H:%M'`
sed -i s/"^Date:.*"/"Date: $today"/g 4_Documentation.md
csplit -z 4_Documentation.md /"t8code dev"/+1
# Split documentation webpage after t8code latest and append newest documentation
csplit -z 4_Documentation.md /"t8code latest"/+1
mv xx00 4_Documentation.md
echo " - [t8code $GITHUB_REF_NAME](../doc/$GITHUB_REF_NAME/index.html)" >> 4_Documentation.md
cat xx01 >> 4_Documentation.md
rm xx01
# Refresh redirect to t8code latest
cd ../doc
echo '<meta http-equiv="refresh" content="0; URL=$GITHUB_REF_NAME/index.html" />' > latest.html
# Refresh redirections for complete latest documentation
./generate_redirections.sh $GITHUB_REF_NAME
- name: Create Pull Request at DLR-AMR/t8code-website
if: ${{ env.MINOR_RELEASE == 'true' }}
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
path: t8code-website
title: Add documentation for t8code ${{ github.ref_name }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests_t8code_linkage_parallel_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,25 +205,25 @@ jobs:
- name: check OpenCASCADE
run: echo "Checking OpenCASCADE with MPI in debugging mode"
- name: configure MPI OpenCASCADE debug
run: mkdir build_occ && cd build_occ && ../configure $CONFIG_DEBUG --with-occ CFLAGS="$CFLAGS_var -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -I/usr/include/opencascade"
run: mkdir build_cad && cd build_cad && ../configure $CONFIG_DEBUG --with-occ CFLAGS="$CFLAGS_var -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -I/usr/include/opencascade"
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: config_occ_debug_MPI.log
path: build_occ/config.log
name: config_cad_debug_MPI.log
path: build_cad/config.log
- name: make
run: cd build_occ && make $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
run: cd build_cad && make $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
- name: make install
run: cd build_occ && make install $MAKEFLAGS
run: cd build_cad && make install $MAKEFLAGS
- name: make check
run: cd build_occ && make check $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
run: cd build_cad && make check $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-suite_occ.log
path: build_occ/test-suite.log
name: test-suite_cad.log
path: build_cad/test-suite.log
# configure and test with MPI and VTK (debug mode)
- name: check VTK
run: echo "Checking VTK with MPI in debugging mode"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests_t8code_linkage_parallel_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,25 +205,25 @@ jobs:
- name: check OpenCASCADE
run: echo "Checking OpenCASCADE with MPI in release mode"
- name: configure MPI OpenCASCADE release
run: mkdir build_occ && cd build_occ && ../configure $CONFIG_RELEASE --with-occ CFLAGS="$CFLAGS_var -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -I/usr/include/opencascade"
run: mkdir build_cad && cd build_cad && ../configure $CONFIG_RELEASE --with-cad CFLAGS="$CFLAGS_var -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -I/usr/include/opencascade"
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: config_occ_release_MPI.log
path: build_occ/config.log
name: config_cad_release_MPI.log
path: build_cad/config.log
- name: make
run: cd build_occ && make $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
run: cd build_cad && make $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
- name: make install
run: cd build_occ && make install $MAKEFLAGS
run: cd build_cad && make install $MAKEFLAGS
- name: make check
run: cd build_occ && make check $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
run: cd build_cad && make check $MAKEFLAGS CFLAGS="$CFLAGS_var -Werror -I/usr/include/opencascade" CXXFLAGS="$CXXFLAGS_var -Werror -I/usr/include/opencascade"
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-suite_occ.log
path: build_occ/test-suite.log
name: test-suite_cad.log
path: build_cad/test-suite.log
# configure and test with MPI and VTK (release mode)
- name: check VTK
run: echo "Checking VTK with MPI in release mode"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sc/
p4est/
build-aux/
build/

.deps/
.libs/
Expand Down Expand Up @@ -87,7 +88,7 @@ test/t8_geometry/t8_test_geometry
test/t8_geometry/t8_test_point_inside
test/t8_gtest_main
test/t8_schemes/t8_test_descendant
test/t8_schemes/t8_test_element_count_leafs
test/t8_schemes/t8_test_element_count_leaves
test/t8_schemes/t8_test_find_parent
test/t8_schemes/t8_test_init_linear_id
test/t8_schemes/t8_test_pyra_face_descendant
Expand Down
68 changes: 68 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
cmake_minimum_required( VERSION 3.16 )
project( T8CODE DESCRIPTION "Parallel algorithms and data structures for tree-based AMR with arbitrary element shapes." LANGUAGES C CXX )
include( CTest )


option( T8CODE_BUILD_AS_SHARED_LIBRARY "Whether t8code should be built as a shared or a static library" ON )
option( T8CODE_BUILD_TESTS "Build t8code's automated tests" ON )
option( T8CODE_BUILD_TUTORIALS "Build t8code's tutorials" ON )
option( T8CODE_BUILD_EXAMPLES "Build t8code's examples" ON )

option( T8CODE_ENABLE_MPI "Enable t8code's features which rely on MPI" ON )
option( T8CODE_ENABLE_VTK "Enable t8code's features which rely on VTK" OFF )


if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE "Release" )
endif()

set( CMAKE_C_STANDARD 11 )
set( CMAKE_C_STANDARD_REQUIRED ON )
set( CMAKE_C_EXTENSIONS OFF )
list( APPEND CMAKE_C_FLAGS "-Wall" )

set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )
list( APPEND CMAKE_CXX_FLAGS "-Wall" )


if( T8CODE_ENABLE_MPI )
find_package( MPI COMPONENTS C REQUIRED )
if( NOT MPIEXEC_EXECUTABLE )
message( FATAL_ERROR "MPIEXEC was not found" )
endif()
set( SC_ENABLE_MPI ON )
set( mpi ON ) # This is very dirty, we should consider fixing this in the p4est repo
endif()

if( T8CODE_ENABLE_VTK )
find_package( VTK REQUIRED )
endif()

# Override default for this libsc option
set( BUILD_SHARED_LIBS ON CACHE BOOL "Build libsc as a shared library" )

# Prevent `libsc` and `p4est` from overwriting the default install prefix.
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)

# Rpath options necessary for shared library install to work correctly in user projects.
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)

add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/sc )
add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/p4est )
add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/src )

if ( T8CODE_BUILD_TESTS )
add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/test )
endif()

if ( T8CODE_BUILD_TUTORIALS )
add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/tutorials )
endif()

if ( T8CODE_BUILD_EXAMPLES )
add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/example )
endif()
4 changes: 2 additions & 2 deletions benchmarks/t8_time_set_join_by_vertices.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ main (int argc, char **argv)
const int dim = 3;
const int main_proc = 0;
const int partition = 0;
const int use_occ_geometry = 0;
const int use_cad_geometry = 0;

t8_cmesh_t cmesh;

Expand All @@ -173,7 +173,7 @@ main (int argc, char **argv)
sc_flops_start (&fi);
sc_flops_snap (&fi, &snapshot);

cmesh = t8_cmesh_from_msh_file (meshfile, partition, sc_MPI_COMM_WORLD, dim, main_proc, use_occ_geometry);
cmesh = t8_cmesh_from_msh_file (meshfile, partition, sc_MPI_COMM_WORLD, dim, main_proc, use_cad_geometry);

/* Measure passed time. */
sc_flops_shot (&fi, &snapshot);
Expand Down
44 changes: 22 additions & 22 deletions benchmarks/time_forest_partition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include <t8_cmesh/t8_cmesh_occ.hxx>
#include <t8_cmesh/t8_cmesh_cad.hxx>
#include <t8_cmesh_readmshfile.h>
#include <t8_forest/t8_forest_general.h>
#include <t8_forest/t8_forest_io.h>
Expand Down Expand Up @@ -254,7 +254,7 @@ t8_time_forest_cmesh_mshfile (t8_cmesh_t cmesh, const char *vtu_prefix, sc_MPI_C
snprintf (forest_vtu, BUFSIZ, "%s_forest_partition_%03d", vtu_prefix, time_step);
snprintf (cmesh_vtu, BUFSIZ, "%s_cmesh_partition_%03d", vtu_prefix, time_step);
t8_forest_write_vtk (forest_partition, forest_vtu);
t8_cmesh_vtk_write_file (t8_forest_get_cmesh (forest_partition), cmesh_vtu, 1.0);
t8_cmesh_vtk_write_file (t8_forest_get_cmesh (forest_partition), cmesh_vtu);
t8_debugf ("Wrote partitioned forest and cmesh\n");
}
if (cmesh_is_partitioned) {
Expand Down Expand Up @@ -288,7 +288,7 @@ t8_time_forest_cmesh_mshfile (t8_cmesh_t cmesh, const char *vtu_prefix, sc_MPI_C
* file and mesh_dim must be specified. */
t8_cmesh_t
t8_time_forest_create_cmesh (const char *msh_file, int mesh_dim, const char *cmesh_file, int num_files,
sc_MPI_Comm comm, int init_level, int stride, int use_occ)
sc_MPI_Comm comm, int init_level, int stride, int use_cad)
{
t8_cmesh_t cmesh;
t8_cmesh_t cmesh_partition;
Expand All @@ -297,7 +297,7 @@ t8_time_forest_create_cmesh (const char *msh_file, int mesh_dim, const char *cme
T8_ASSERT (msh_file == NULL || cmesh_file == NULL);

if (msh_file != NULL) {
if (use_occ) {
if (use_cad) {
partition = 0;
t8_global_productionf ("The cmesh is not partitioned due to the usage of the curved mesh option. \n"
"Timing will not be comparable to non-curved meshes. \n");
Expand All @@ -306,7 +306,7 @@ t8_time_forest_create_cmesh (const char *msh_file, int mesh_dim, const char *cme
partition = 1;
}
/* Create a cmesh from the given mesh files */
cmesh = t8_cmesh_from_msh_file ((char *) msh_file, partition, comm, mesh_dim, 0, use_occ);
cmesh = t8_cmesh_from_msh_file ((char *) msh_file, partition, comm, mesh_dim, 0, use_cad);
}
else {
T8_ASSERT (cmesh_file != NULL);
Expand Down Expand Up @@ -337,9 +337,9 @@ main (int argc, char *argv[])
int mpiret, mpisize;
int first_argc;
int level, level_diff;
int help = 0, no_vtk, do_ghost, do_balance, use_occ;
int help = 0, no_vtk, do_ghost, do_balance, use_cad;
int dim, num_files;
int test_tet, test_linear_cylinder, test_occ_cylinder;
int test_tet, test_linear_cylinder, test_cad_cylinder;
int stride;
int cmesh_level;
double T, delta_t, cfl;
Expand Down Expand Up @@ -384,16 +384,16 @@ main (int argc, char *argv[])
"Use a cmesh that tests all tet face-to-face connections."
" If this option is used -o is enabled automatically. Not allowed with -f and -c.");
sc_options_add_switch (opt, 'L', "test-linear-cylinder", &test_linear_cylinder,
"Use a linear cmesh to compare linear and occ geometry performance."
"Use a linear 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, 'O', "test-occ-cylinder", &test_occ_cylinder,
"Use a occ cmesh to compare linear and occ geometry performance."
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_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.");
sc_options_add_int (opt, '\0', "cmesh-level", &cmesh_level, -1,
"Starting level of the linear or occ cmesh, default is 0. Only viable with -L or -O.");
"Starting level of the linear or cad cmesh, default is 0. Only viable with -L or -O.");
sc_options_add_double (opt, 'x', "xmin", x_min_max, 0, "The minimum x coordinate in the mesh.");
sc_options_add_double (opt, 'X', "xmax", x_min_max + 1, 1, "The maximum x coordinate in the mesh.");
sc_options_add_double (opt, 'T', "time", &T, 1,
Expand All @@ -406,20 +406,20 @@ main (int argc, char *argv[])
"Overwrites any other delta_t setting.");
sc_options_add_switch (opt, 'g', "ghost", &do_ghost, "Create ghost elements.");
sc_options_add_switch (opt, 'b', "balance", &do_balance, "Establish a 2:1 balance in the forest.");
sc_options_add_switch (opt, 'z', "use_occ", &use_occ,
sc_options_add_switch (opt, 'z', "use_cad", &use_cad,
"If used, meshes will be curved to original geometries (msh- and brep-files necessary).");

/* parse command line options */
first_argc = sc_options_parse (t8_get_package_id (), SC_LP_DEFAULT, opt, argc, 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_occ_cylinder == 0
|| (cmeshfileprefix == NULL && mshfileprefix == NULL && test_tet == 0 && test_cad_cylinder == 0
&& test_linear_cylinder == 0)
|| stride <= 0 || (num_files - 1) * stride >= mpisize || cfl < 0 || T <= 0
|| test_tet + test_linear_cylinder + test_occ_cylinder > 1
|| (cmesh_level >= 0 && (!test_linear_cylinder && !test_occ_cylinder))
|| ((mshfileprefix != NULL || cmeshfileprefix != NULL) && (test_linear_cylinder || test_occ_cylinder || test_tet))
|| (mshfileprefix == NULL && use_occ)) {
|| 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))
|| (mshfileprefix == NULL && use_cad)) {
sc_options_print_usage (t8_get_package_id (), SC_LP_ERROR, opt, NULL);
return 1;
}
Expand All @@ -438,25 +438,25 @@ main (int argc, char *argv[])
}
t8_global_productionf ("Using delta_t = %f\n", delta_t);
if (mshfileprefix != NULL) {
cmesh = t8_time_forest_create_cmesh (mshfileprefix, dim, NULL, -1, sc_MPI_COMM_WORLD, level, stride, use_occ);
cmesh = t8_time_forest_create_cmesh (mshfileprefix, dim, NULL, -1, sc_MPI_COMM_WORLD, level, stride, use_cad);
vtu_prefix = mshfileprefix;
}
else if (test_tet) {
cmesh = t8_cmesh_new_tet_orientation_test (sc_MPI_COMM_WORLD);
vtu_prefix = "test_tet";
}
else if (test_linear_cylinder || test_occ_cylinder) {
else if (test_linear_cylinder || test_cad_cylinder) {
if (cmesh_level < 0) {
cmesh_level = 0;
}
cmesh = t8_cmesh_new_hollow_cylinder (sc_MPI_COMM_WORLD, 4 * sc_intpow (2, cmesh_level),
sc_intpow (2, cmesh_level), sc_intpow (2, cmesh_level), test_occ_cylinder);
test_linear_cylinder ? vtu_prefix = "test_linear_cylinder" : vtu_prefix = "test_occ_cylinder";
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 {
T8_ASSERT (cmeshfileprefix != NULL);
cmesh
= t8_time_forest_create_cmesh (NULL, -1, cmeshfileprefix, num_files, sc_MPI_COMM_WORLD, level, stride, use_occ);
= t8_time_forest_create_cmesh (NULL, -1, cmeshfileprefix, num_files, sc_MPI_COMM_WORLD, level, stride, use_cad);
vtu_prefix = cmeshfileprefix;
}
t8_time_forest_cmesh_mshfile (cmesh, vtu_prefix, sc_MPI_COMM_WORLD, level, level + level_diff, no_vtk, x_min_max, T,
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/time_partition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ t8_time_cmesh_partition_brick (int x, int y, int z, sc_MPI_Comm comm, int no_vtk

mpiret = sc_MPI_Comm_rank (comm, &mpirank);
SC_CHECK_MPI (mpiret);
t8_cmesh_vtk_write_file (cmesh_partition, "cmesh_box_partition", 1.0);
t8_cmesh_vtk_write_file (cmesh_partition, "cmesh_box_partition");
}
/* memory clean-up */
t8_cmesh_destroy (&cmesh_partition);
Expand Down
1 change: 1 addition & 0 deletions doc/author_dutka.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I place my contributions to t8code under the FreeBSD license. Alexandre Dutka <[email protected]>
Loading

0 comments on commit 50fc8bc

Please sign in to comment.