diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 689a156a7..acc364812 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -69,24 +69,24 @@ namespace openmc { }; -void draw_mesh_lines(ObjectPlot* pl, - std::vector< std::vector< std::vector > > &data); - - -void output_ppm(ObjectPlot* pl, - const std::vector< std::vector< std::vector > > &data); extern "C" void create_ppm(ObjectPlot* pl); extern "C" void create_voxel(ObjectPlot *pl); - -extern "C" void position_rgb(Particle* p, ObjectPlot* pl, int rgb[3], int &id); -extern "C" void voxel_init(hid_t file_id, const hsize_t* dims, hid_t* dspace, +void draw_mesh_lines(ObjectPlot* pl, + std::vector< std::vector< std::vector > > &data); + +void output_ppm(ObjectPlot* pl, + const std::vector< std::vector< std::vector > > &data); + +void position_rgb(Particle* p, ObjectPlot* pl, int rgb[3], int &id); + +void voxel_init(hid_t file_id, const hsize_t* dims, hid_t* dspace, hid_t* dset, hid_t* memspace); -extern "C" void voxel_write_slice(int x, hid_t dspace, hid_t dset, +void voxel_write_slice(int x, hid_t dspace, hid_t dset, hid_t memspace, void* buf); -extern "C" void voxel_finalize(hid_t dspace, hid_t dset, hid_t memspace); +void voxel_finalize(hid_t dspace, hid_t dset, hid_t memspace); } // namespace openmc #endif // OPENMC_PLOT_H diff --git a/src/plot.F90 b/src/plot.F90 index 79b286924..329cbca55 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -2,18 +2,9 @@ module plot use, intrinsic :: ISO_C_BINDING - use constants - use error, only: fatal_error, write_message - use geometry, only: find_cell, check_cell_overlap - use geometry_header, only: Cell, root_universe, cells - use hdf5_interface - use output, only: time_stamp - use material_header, only: materials - use mesh_header, only: meshes, RegularMesh + use error, only: write_message use particle_header use plot_header - use progress_header, only: ProgressBar - use settings, only: check_overlaps use string, only: to_str implicit none @@ -21,20 +12,7 @@ module plot public :: openmc_plot_geometry - integer, parameter :: RED = 1 - integer, parameter :: GREEN = 2 - integer, parameter :: BLUE = 3 - interface - subroutine position_rgb(p, pl, rgb, id) bind(C) - import Particle, ObjectPlot, C_INT - type(Particle), intent(inout) :: p - type(ObjectPlot), intent(in) :: pl - integer(C_INT), intent(out) :: rgb(3) - integer(C_INT), intent(out) :: id - end subroutine position_rgb - - subroutine create_ppm(pl) bind(C) import ObjectPlot type(ObjectPlot), intent(in) :: pl @@ -44,7 +22,6 @@ module plot import ObjectPlot type(ObjectPlot), intent(in) :: pl end subroutine create_voxel - end interface contains diff --git a/src/plot.cpp b/src/plot.cpp index 1042ccd78..a1acebfe6 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -39,16 +39,15 @@ int openmc_plot_geometry() { if (PLOT_TYPE::SLICE == pl->type) { // create 2D image - // create_ppm(pl); + create_ppm(pl); continue; } else if (PLOT_TYPE::VOXEL == pl->type) { // create voxel file for 3D viewing - // create_voxel(pl); + create_voxel(pl); continue; } } - return 0; } @@ -397,7 +396,7 @@ void create_voxel(ObjectPlot *pl) { ll[2] = ll[2] + vox[2] / TWO; int data[pl->pixels[1]][pl->pixels[2]]; - + int rgb[3], id; for (int x = 0; x < pl->pixels[0]; x++) { // progress bar here @@ -424,10 +423,10 @@ void create_voxel(ObjectPlot *pl) { voxel_finalize(dspace, dset, memspace); file_close(file_id); - + } - + void voxel_init(hid_t file_id, const hsize_t* dims, hid_t* dspace, hid_t* dset, hid_t* memspace)