Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.vtu
*.pvtu
8 changes: 4 additions & 4 deletions examples/t8_step1_coarsemesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# In this example we build a coarse mesh with a cube geometry.
# The cube is meshed with 6 coarse tetrahedra.
# We then output it in vtu format and destroy it.
#
#
# How you can experiment here:
# - Use Paraview to visualize the output files.
# - Change the parameters of t8_cmesh_new_hypercube
Expand All @@ -27,7 +27,7 @@ function t8_step1_build_tetcube_coarse_mesh(comm)
# You can modify the first parameter to build a cube with different
# tree shapes, i.e. T8_ECLASS_QUAD for a unit square with 1 quadrilateral tree.
# See t8_eclass.h, t8_cmesh.h for all possible shapes.
#
#
# The second argument is the MPI communicator to use for this cmesh.
# The remaining arguments are 3 flags that control
# do_bcast - If non-zero only the root process will build the cmesh and will broadcast it to the other processes. The result is the same.
Expand All @@ -42,12 +42,12 @@ end
# Write vtk (or more accurately vtu) files of the cmesh.
# \param [in] cmesh A coarse mesh.
# \param [in] prefix A string that is used as a prefix of the output files.
#
#
# This will create the file prefix.pvtu and the file prefix_0000.vtu.
# If the coarse mesh would be repartitioned, then it would write the .pvtu file
# and additionally one file prefix_MPIRANK.vtu per MPI rank.
function t8_step1_write_cmesh_vtk(cmesh, prefix)
t8_cmesh_vtk_write_file(cmesh, prefix, 1.0)
t8_cmesh_vtk_write_file(cmesh, prefix)
end

# Destroy a cmesh. This will free all allocated memory.
Expand Down
4 changes: 2 additions & 2 deletions examples/t8_step4_partition_balance_ghost.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ forest = t8_step4_partition_ghost(forest)
t8_global_productionf(" [step4] Repartitioned forest and built ghost layer.\n")
t8_step3_print_forest_information(forest)

# Write forest to vtu files.
t8_forest_write_vtk(forest, prefix_partition_ghost)
# Write forest to vtu files, including ghost layer.
t8_forest_write_vtk_ext(forest, prefix_partition_ghost, 1, 1, 1, 1, 1, 0, 1, 0, C_NULL);

#
# Balance
Expand Down
20 changes: 10 additions & 10 deletions examples/t8_tutorial_build_cmesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function t8_cmesh_new_periodic_hybrid_2d(comm)
cmesh = cmesh_ref[]

# 3. Definition of the geometry.
linear_geom = t8_geometry_linear_new(2)
linear_geom = t8_geometry_linear_new()
t8_cmesh_register_geometry(cmesh, linear_geom) # Use linear geometry.

# 4. Definition of the classes of the different trees.
Expand All @@ -175,12 +175,12 @@ function t8_cmesh_new_periodic_hybrid_2d(comm)
t8_cmesh_set_tree_class(cmesh, 5, T8_ECLASS_TRIANGLE)

# 5. Classification of the vertices for each tree.
t8_cmesh_set_tree_vertices(cmesh, 0, vertices, 3)
t8_cmesh_set_tree_vertices(cmesh, 1, vertices + 9, 3)
t8_cmesh_set_tree_vertices(cmesh, 2, vertices + 18, 4)
t8_cmesh_set_tree_vertices(cmesh, 3, vertices + 30, 4)
t8_cmesh_set_tree_vertices(cmesh, 4, vertices + 42, 3)
t8_cmesh_set_tree_vertices(cmesh, 5, vertices + 51, 3)
t8_cmesh_set_tree_vertices(cmesh, 0, pointer(vertices,0), 3)
t8_cmesh_set_tree_vertices(cmesh, 1, pointer(vertices,9), 3)
t8_cmesh_set_tree_vertices(cmesh, 2, pointer(vertices,18), 4)
t8_cmesh_set_tree_vertices(cmesh, 3, pointer(vertices,30), 4)
t8_cmesh_set_tree_vertices(cmesh, 4, pointer(vertices,42), 3)
t8_cmesh_set_tree_vertices(cmesh, 5, pointer(vertices,51), 3)

# 6. Definition of the face neighbors between the different trees.
t8_cmesh_set_join(cmesh, 0, 1, 1, 2, 0)
Expand Down Expand Up @@ -208,7 +208,7 @@ end
# The mesh consists of two tetrahedra, two prisms, one pyramid, and one hexahedron.
function t8_cmesh_new_hybrid_gate_3d(comm)
vertices = Vector{Cdouble}(undef, 24)
linear_geom = t8_geometry_linear_new(3)
linear_geom = t8_geometry_linear_new()

# Initialization of the mesh.
cmesh_ref = Ref(t8_cmesh_t())
Expand Down Expand Up @@ -409,9 +409,9 @@ cmesh_3D = t8_cmesh_new_hybrid_gate_3d(comm)
t8_global_productionf("[tutorial] A 3D hybrid cmesh (in style of a gate) has been created.\n")

# Output the meshes to vtu files.
t8_cmesh_vtk_write_file(cmesh_2D, prefix_2D, 1.0)
t8_cmesh_vtk_write_file(cmesh_2D, prefix_2D)
t8_global_productionf("[tutorial] Wrote the 2D cmesh to vtu files.\n")
t8_cmesh_vtk_write_file(cmesh_3D, prefix_3D, 1.0)
t8_cmesh_vtk_write_file(cmesh_3D, prefix_3D)
t8_global_productionf("[tutorial] Wrote the 3D cmesh to vtu files.\n")

#
Expand Down
Loading