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

Add an option to use axis-aligned geometry for hex/quad/lines in hype… #747

Merged
merged 34 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f09ca12
Add an option to use axis-aligned geometry for hex/quad/lines in hype…
Davknapp Sep 13, 2023
636abd2
Adapt construction of tree-vertices
Davknapp Sep 14, 2023
4d15fe0
Make use_axis_aligned const
Davknapp Sep 14, 2023
b5af4a8
Update variable name
Davknapp Sep 14, 2023
07b6474
Add documentation
Davknapp Sep 14, 2023
bce7486
Merge remote-tracking branch 'origin/main' into enhance_hypercube_pad
Davknapp Sep 14, 2023
e753f3a
Merge branch 'main' into enhance_hypercube_pad
sandro-elsweijer Sep 15, 2023
72ef89a
restructre hypercube_pad for axis_aligned geometries
Davknapp Sep 15, 2023
335880c
add documentation
Davknapp Sep 15, 2023
1411fcc
Add another check
Davknapp Sep 15, 2023
af2497b
Correct index
Davknapp Sep 15, 2023
1b94268
Use the geometry as an argument to pass to hypercube_pad
Davknapp Oct 6, 2023
f2fd9d6
Merge remote-tracking branch 'origin/main' into enhance_hypercube_pad
Davknapp Oct 6, 2023
41651c9
Indentation
Davknapp Oct 6, 2023
954d101
Remove debug-flags from is_axis_aligned_check
Davknapp Oct 6, 2023
48bb7d9
Clean-up
Davknapp Oct 6, 2023
cbf9d32
Merge branch 'main' into enhance_hypercube_pad
Davknapp Nov 22, 2023
23a300a
Merge branch 'main' into enhance_hypercube_pad
Davknapp Nov 23, 2023
cbdc704
Merge branch 'main' into enhance_hypercube_pad
sandro-elsweijer Nov 27, 2023
e5694d2
Remove DEBUG-Makros
Davknapp Nov 28, 2023
ccf1f3d
Simplify check
Davknapp Nov 28, 2023
2311415
Remove Debug-Makros
Davknapp Nov 28, 2023
30a2b50
Simplify check
Davknapp Nov 28, 2023
7d25f63
Update src/t8_geometry/t8_geometry_implementations/t8_geometry_linear…
Davknapp Nov 28, 2023
5d403fb
Update src/t8_geometry/t8_geometry_implementations/t8_geometry_linear…
Davknapp Nov 28, 2023
76433f9
Update geometry_check
Davknapp Nov 28, 2023
81aebc7
Merge remote-tracking branch 'origin/enhance_hypercube_pad' into enha…
Davknapp Nov 28, 2023
45f9af2
Merge branch 'main' into enhance_hypercube_pad
sandro-elsweijer Jan 15, 2024
2f4843f
remove deprecated indent markers
sandro-elsweijer Jan 15, 2024
0145609
add include
sandro-elsweijer Jan 15, 2024
254e12a
streamline geometries and make them all structs
sandro-elsweijer Jan 15, 2024
ed0896a
add missing c implementation of t8_geom_get_type
sandro-elsweijer Jan 16, 2024
d134c7c
add missing include
sandro-elsweijer Jan 16, 2024
fd7278d
use c implementation of t8_geom_get_type
sandro-elsweijer Jan 16, 2024
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
2 changes: 1 addition & 1 deletion example/cmesh/t8_cmesh_hypercube_pad.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ main (int argc, char **argv)
t8_init (SC_LP_PRODUCTION);

/* Add hypercube with given element class. */
t8_cmesh_t cmesh = t8_cmesh_new_hypercube_pad (T8_ECLASS_HEX, sc_MPI_COMM_WORLD, boundary_coords, 3, 3, 3);
t8_cmesh_t cmesh = t8_cmesh_new_hypercube_pad (T8_ECLASS_HEX, sc_MPI_COMM_WORLD, boundary_coords, 3, 3, 3, 0);

/* Compute local and global number of trees. */
local_num_trees = t8_cmesh_get_num_local_trees (cmesh);
Expand Down
3 changes: 2 additions & 1 deletion example/remove/t8_example_empty_trees.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ t8_strip_of_quads (t8_gloidx_t num_trees, t8_gloidx_t empty_tree, const char **v

const double boundary_coords[12] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0 };

t8_cmesh_t cmesh = t8_cmesh_new_hypercube_pad (T8_ECLASS_QUAD, sc_MPI_COMM_WORLD, boundary_coords, num_trees, 1, 0);
t8_cmesh_t cmesh
= t8_cmesh_new_hypercube_pad (T8_ECLASS_QUAD, sc_MPI_COMM_WORLD, boundary_coords, num_trees, 1, 0, 1);

t8_forest_t forest = t8_forest_new_uniform (cmesh, t8_scheme_new_default_cxx (), 0, 0, sc_MPI_COMM_WORLD);

Expand Down
16 changes: 12 additions & 4 deletions src/t8_cmesh/t8_cmesh_examples.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <t8_cmesh/t8_cmesh_helpers.h>
#include <t8_cmesh/t8_cmesh_geometry.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear_axis_aligned.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_examples.h>
#include <t8_vec.h>
#include <t8_mat.h>
Expand Down Expand Up @@ -1194,7 +1195,7 @@ t8_cmesh_set_vertices_3D (t8_cmesh_t cmesh, const t8_eclass_t eclass, const doub

t8_cmesh_t
t8_cmesh_new_hypercube_pad (const t8_eclass_t eclass, sc_MPI_Comm comm, const double *boundary, t8_locidx_t polygons_x,
t8_locidx_t polygons_y, t8_locidx_t polygons_z)
t8_locidx_t polygons_y, t8_locidx_t polygons_z, int use_axis_aligned)
{
SC_CHECK_ABORT (eclass != T8_ECLASS_PYRAMID, "Pyramids are not yet supported.");
const int dim = t8_eclass_to_dimension[eclass];
Expand All @@ -1215,9 +1216,16 @@ t8_cmesh_new_hypercube_pad (const t8_eclass_t eclass, sc_MPI_Comm comm, const do
t8_cmesh_t cmesh;
t8_cmesh_init (&cmesh);

/* We use standard linear geometry */
const t8_geometry_c *linear_geom = t8_geometry_linear_new (dim);
t8_cmesh_register_geometry (cmesh, linear_geom);
if (use_axis_aligned && (eclass == T8_ECLASS_HEX || eclass == T8_ECLASS_QUAD || eclass == T8_ECLASS_LINE)) {
/* We use axis aligned geometries */
const t8_geometry_c *axis_aligned_geom = t8_geometry_linear_axis_aligned_new (dim);
t8_cmesh_register_geometry (cmesh, axis_aligned_geom);
sandro-elsweijer marked this conversation as resolved.
Show resolved Hide resolved
}
else {
/* We use standard linear geometry */
const t8_geometry_c *linear_geom = t8_geometry_linear_new (dim);
t8_cmesh_register_geometry (cmesh, linear_geom);
}

/* Number of trees inside each polygon of given eclass. */
const t8_locidx_t num_trees_for_single_hypercube[T8_ECLASS_COUNT] = { 1, 1, 1, 2, 1, 6, 2, -1 };
Expand Down
2 changes: 1 addition & 1 deletion src/t8_cmesh/t8_cmesh_examples.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ t8_cmesh_new_hypercube (t8_eclass_t eclass, sc_MPI_Comm comm, int do_bcast, int
*/
t8_cmesh_t
t8_cmesh_new_hypercube_pad (const t8_eclass_t eclass, sc_MPI_Comm comm, const double *boundary, t8_locidx_t polygons_x,
t8_locidx_t polygons_y, t8_locidx_t polygons_z);
t8_locidx_t polygons_y, t8_locidx_t polygons_z, int use_axis_aligned);
sandro-elsweijer marked this conversation as resolved.
Show resolved Hide resolved

/** Hybercube with 6 Tets, 6 Prism, 4 Hex.
* \param [in] comm The mpi communicator to be used.
Expand Down
2 changes: 1 addition & 1 deletion test/t8_cmesh/t8_gtest_cmesh_set_join_by_vertices.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ TEST (t8_cmesh_set_join_by_vertices, test_cmesh_set_join_by_vertices)
const double boundary_coords[24] = { 1, 0, 0, 4, 0, 0, 0, 6, 0, 5, 5, 0, -1, -2, 8, 9, 0, 10, 0, 8, 9, 10, 10, 10 };

t8_eclass_t eclass = T8_ECLASS_HEX;
t8_cmesh_t cmesh = t8_cmesh_new_hypercube_pad (eclass, comm, boundary_coords, 2, 2, 2);
t8_cmesh_t cmesh = t8_cmesh_new_hypercube_pad (eclass, comm, boundary_coords, 2, 2, 2, 0);
test_with_cmesh (cmesh);
t8_cmesh_destroy (&cmesh);
}
Expand Down