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

Merge queue test - [vtk_to_cmesh 1/6] #455

Merged
merged 8 commits into from
Mar 28, 2023
Merged
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: 1 addition & 1 deletion benchmarks/ExtremeScaling/bunny.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <t8.h>
#include <t8_cmesh.h>
#include <t8_cmesh_tetgen.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_forest.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/time_forest_partition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <p4est_connectivity.h>
#include <t8_cmesh.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include <t8_cmesh/t8_cmesh_occ.hxx>
#include <t8_cmesh_readmshfile.h>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/time_partition.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <sc_options.h>
#include <p4est_connectivity.h>
#include <t8_cmesh.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include "t8_cmesh/t8_cmesh_types.h"
#include <t8_cmesh/t8_cmesh_examples.h>
Expand Down
2 changes: 1 addition & 1 deletion example/IO/cmesh/gmsh/t8_load_and_refine_square_w_hole.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <sc_refcount.h>
#include <t8_cmesh.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_forest.h>
Expand Down
3 changes: 1 addition & 2 deletions example/IO/cmesh/gmsh/t8_read_msh_file.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@

#include <sc_options.h>
#include <t8.h>
#include <t8_cmesh.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_cmesh_vtk.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>

/* Output a cmesh in .vtk format. Process i writes to the file
Expand Down
2 changes: 1 addition & 1 deletion example/IO/cmesh/t8_cmesh_load_save.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <sc_options.h>
#include <t8_cmesh.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
Expand Down
2 changes: 1 addition & 1 deletion example/IO/cmesh/tetgen/t8_forest_from_tetgen.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <t8_cmesh.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include <t8_cmesh_tetgen.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
#include <t8_forest.h>

Expand Down
2 changes: 1 addition & 1 deletion example/IO/cmesh/tetgen/t8_read_tetgen_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <t8_cmesh.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include <t8_cmesh_tetgen.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>

void
t8_read_tetgen_file_build_cmesh (const char *prefix, int do_dup,
Expand Down
2 changes: 1 addition & 1 deletion example/IO/cmesh/tetgen/t8_time_tetgen_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <t8.h>
#include <t8_cmesh.h>
#include <t8_cmesh_tetgen.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <sc_flops.h>
#include <sc_statistics.h>
#include <sc_options.h>
Expand Down
2 changes: 1 addition & 1 deletion example/IO/cmesh/triangle/t8_read_triangle_file.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <t8.h>
#include <t8_cmesh.h>
#include <t8_cmesh_triangle.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>

void
Expand Down
2 changes: 1 addition & 1 deletion example/advect/t8_advection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <example/common/t8_example_common.h>
#include <t8_cmesh.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_vec.h>

Expand Down
2 changes: 1 addition & 1 deletion example/cmesh/t8_cmesh_create_partitioned.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>

/* Create a coarse mesh that is partitioned across two processes
* (if mpisize >= 2).
Expand Down
2 changes: 1 addition & 1 deletion example/cmesh/t8_cmesh_partition.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <sc_refcount.h>
#include <t8_forest/t8_forest_adapt.h>
#include <t8_forest.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_partition.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <p4est_connectivity.h>
Expand Down
2 changes: 1 addition & 1 deletion example/cmesh/t8_cmesh_refine.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

#include <t8_cmesh.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>

Expand Down
2 changes: 1 addition & 1 deletion example/forest/t8_test_face_iterate.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <t8_forest.h>
#include <t8_cmesh.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_data/t8_containers.h>

Expand Down
2 changes: 1 addition & 1 deletion example/forest/t8_test_ghost.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <t8_forest.h>
#include <t8_cmesh.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <example/common/t8_example_common.h>

Expand Down
2 changes: 1 addition & 1 deletion example/forest/t8_test_ghost_large_level_diff.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <sc_statistics.h>
#include <sc_options.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_schemes/t8_default/t8_default_prism/t8_dprism.h>
#include <t8_schemes/t8_default/t8_default_tet/t8_dtet.h>
Expand Down
2 changes: 1 addition & 1 deletion example/geometry/t8_example_geometries.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <sc_refcount.h>
#include <t8_schemes/t8_default/t8_default_cxx.hxx>
#include <t8_forest.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_geometry/t8_geometry_base.hxx>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_analytic.hxx>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx>
Expand Down
1 change: 1 addition & 0 deletions scripts/t8indent_custom_datatypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ t8_shmem_array_t
t8_stash_attribute_struct_t
t8_stash_t
t8_vtk_data_field_t
vtk_file_type_t

6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ libt8_installed_headers = \
src/t8_element_c_interface.h \
src/t8_refcount.h src/t8_cmesh.h src/t8_cmesh_triangle.h \
src/t8_cmesh_tetgen.h src/t8_cmesh_readmshfile.h \
src/t8_cmesh_vtk.h \
src/t8_cmesh_vtk_writer.h \
src/t8_cmesh_vtk_reader.hxx \
src/t8_forest.h \
src/t8_vec.h \
src/t8_version.h \
Expand Down Expand Up @@ -84,7 +85,8 @@ libt8_compiled_sources = \
src/t8_refcount.c src/t8_cmesh/t8_cmesh.c \
src/t8_cmesh/t8_cmesh_occ.cxx \
src/t8_cmesh/t8_cmesh_cxx.cxx src/t8_cmesh/t8_cmesh_triangle.c \
src/t8_cmesh/t8_cmesh_vtk.c src/t8_cmesh/t8_cmesh_stash.c \
src/t8_cmesh/t8_cmesh_vtk_writer.c src/t8_cmesh/t8_cmesh_stash.c \
src/t8_cmesh/t8_cmesh_vtk_reader.cxx \
src/t8_cmesh/t8_cmesh_save.c \
src/t8_cmesh/t8_cmesh_netcdf.c \
src/t8_cmesh/t8_cmesh_trees.c src/t8_cmesh/t8_cmesh_commit.c \
Expand Down
2 changes: 1 addition & 1 deletion src/t8_cmesh/t8_cmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <sc_statistics.h>
#include <t8_cmesh.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_geometry.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.h>
#include <t8_refcount.h>
Expand Down
2 changes: 1 addition & 1 deletion src/t8_cmesh/t8_cmesh_examples.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_cmesh/t8_cmesh_geometry.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>

/* TODO: In p4est a tree edge is joined with itself to denote a domain boundary.
* Will we do it the same in t8code? This is not yet decided, however the
Expand Down
2 changes: 1 addition & 1 deletion src/t8_cmesh/t8_cmesh_occ.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <t8_cmesh/t8_cmesh_occ.hxx>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_occ.hxx>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>

#if T8_WITH_OCC
#include <gp_Pnt.hxx>
Expand Down
2 changes: 1 addition & 1 deletion src/t8_cmesh/t8_cmesh_readmshfile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <t8_eclass.h>
#include <t8_cmesh_readmshfile.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.hxx>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_occ.hxx>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_occ.h>
Expand Down
2 changes: 1 addition & 1 deletion src/t8_cmesh/t8_cmesh_triangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <t8_cmesh_triangle.h>
#include <t8_cmesh_tetgen.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_geometry/t8_geometry_implementations/t8_geometry_linear.h>
#include "t8_cmesh_types.h"
#include "t8_cmesh_stash.h"
Expand Down
47 changes: 47 additions & 0 deletions src/t8_cmesh/t8_cmesh_vtk_reader.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
This file is part of t8code.
t8code is a C library to manage a collection (a forest) of multiple
connected adaptive space-trees of general element classes in parallel.

Copyright (C) 2015 the developers

t8code 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.

t8code 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 t8code; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/** \file t8_cmesh_vtk_reader.cxx
* Implementation of a Reader for vtk/vtu files using the vtk-library.
* The functions can only be used when t8code is linked with the vtk-library.
*/

#include <t8_cmesh_vtk_reader.hxx>

T8_EXTERN_C_BEGIN ();

t8_cmesh_t
t8_cmesh_vtk_reader (const char *filename, const int partition,
const int main_proc, sc_MPI_Comm comm,
const vtk_file_type_t vtk_file_type)
{
#if T8_WITH_VTK
SC_ABORT ("This function is not yet implemented.\n");
#else
/* Return NULL if not linked against vtk */
t8_global_errorf
("WARNING: t8code is not linked against the vtk library. Without proper linking t8code cannot use the vtk-reader\n");
#endif
return NULL;
}

T8_EXTERN_C_END ();
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_vtk.h>
#include "t8_cmesh_trees.h"
#include "t8_cmesh_types.h"
Expand Down
67 changes: 67 additions & 0 deletions src/t8_cmesh_vtk_reader.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
This file is part of t8code.
t8code is a C library to manage a collection (a forest) of multiple
connected adaptive space-trees of general element classes in parallel.

Copyright (C) 2015 the developers

t8code 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.

t8code 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 t8code; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/** \file t8_cmesh_vtk_reader.hxx
* Header for the vtk-reader.
*/

#ifndef T8_CMESH_VTK_READER
#define T8_CMESH_VTK_READER

#include <t8_cmesh.h>

#if T8_WITH_VTK
#include <vtkSmartPointer.h>
#include <vtkCellData.h>
#include <vtkDataSet.h>
#endif

T8_EXTERN_C_BEGIN ();
/**
* Enumerator for all types of files readable by t8code.
*/
typedef enum vtk_file_type
{
VTK_UNSTRUCTURED_FILE = 0,
VTK_POLYDATA_FILE = 1
} vtk_file_type_t;

/**
* Construct a cmesh given a filename refering to a vtk-file either containing an
* unstructured grid, or vtk-polydata, most likely constructed by vtk.
*
* \param[in] filename The name of the file
* \param[in] partition Flag if the constructed mesh should be partitioned
* \param[in] main_proc The main reading processor
* \param[in] comm An mpi-communicator
* \param[in] vtk_file_type A vtk-filetype that is readable by t8code.
* \return A commited cmesh.
*/
t8_cmesh_t t8_cmesh_vtk_reader (const char *filename,
const int partition,
const int main_proc,
sc_MPI_Comm comm,
const vtk_file_type_t vtk_file_type);

T8_EXTERN_C_END ();

#endif /* T8_CMESH_VTK_READER */
File renamed without changes.
2 changes: 1 addition & 1 deletion src/t8_vtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/** file t8_vtk.h
* This header file collects macros that are needed for
* the forest and cmesh vtk routines.
* \see t8_forest_vtk.h \see t8_cmesh_vtk.h
* \see t8_forest_vtk.h \see t8_cmesh_vtk_writer.h \see t8_cmesh_vtk_reader.hxx
*/

#ifndef T8_VTK_H
Expand Down
2 changes: 1 addition & 1 deletion test/t8_geometry/t8_gtest_point_inside.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <sc_functions.h>
#include <t8_eclass.h>
#include <t8_cmesh.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>
#include <t8_forest.h>
#include <t8_forest/t8_forest_iterate.h>
Expand Down
2 changes: 1 addition & 1 deletion tutorials/general/t8_step1_coarsemesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include <t8.h>
#include <t8_cmesh.h>
#include <t8_cmesh_vtk.h>
#include <t8_cmesh_vtk_writer.h>
#include <t8_cmesh/t8_cmesh_examples.h>

/* Builds cmesh of 6 tetrahedra that build up a unit cube.
Expand Down