From 32f91ace56eb525656b721c667264ac27c9f859b Mon Sep 17 00:00:00 2001 From: shriwise Date: Fri, 17 Aug 2018 13:36:16 -0500 Subject: [PATCH] Some fixes after the rebase. --- include/openmc/surface.h | 4 ++++ src/cad.cpp | 10 +++++----- src/cell.cpp | 2 -- src/constants.F90 | 4 ++-- src/geometry_header.F90 | 7 ------- src/input_xml.F90 | 8 ++++---- src/surface.cpp | 2 +- 7 files changed, 16 insertions(+), 21 deletions(-) diff --git a/include/openmc/surface.h b/include/openmc/surface.h index 3f7e6ac3ff..7f1feb4b98 100644 --- a/include/openmc/surface.h +++ b/include/openmc/surface.h @@ -404,6 +404,10 @@ extern "C" { int surface_bc(Surface* surf); bool surface_sense(Surface* surf, double xyz[3], double uvw[3]); void surface_reflect(Surface* surf, double xyz[3], double uvw[3]); + /* double surface_distance(Surface* surf, double xyz[3], double uvw[3], */ + /* bool coincident); */ + /* void surface_normal(Surface* surf, double xyz[3], double uvw[3]); */ + /* void surface_to_hdf5(CSGSurface* surf, hid_t group); */ int surface_i_periodic(PeriodicSurface* surf); bool surface_periodic(PeriodicSurface* surf, PeriodicSurface* other, double xyz[3], double uvw[3]); diff --git a/src/cad.cpp b/src/cad.cpp index f49295ae43..a3d1c76480 100644 --- a/src/cad.cpp +++ b/src/cad.cpp @@ -77,7 +77,7 @@ void load_cad_geometry_c() if(DAGMC->is_implicit_complement(vol_handle)) { // assuming implicit complement is void for now - c->material.push_back(openmc::C_MATERIAL_VOID); + c->material.push_back(openmc::MATERIAL_VOID); continue; } @@ -88,7 +88,7 @@ void load_cad_geometry_c() TOLOWER(mat_value); if(mat_value == "void") { - c->material.push_back(openmc::C_MATERIAL_VOID); + c->material.push_back(openmc::MATERIAL_VOID); } else { c->material.push_back(std::stoi(mat_value)); @@ -96,13 +96,13 @@ void load_cad_geometry_c() } else { std::cout << "Warning: volume without material found!" << std::endl; - c->material.push_back(openmc::C_MATERIAL_VOID); + c->material.push_back(openmc::MATERIAL_VOID); } } // initialize surface objects openmc::n_surfaces = DAGMC->num_entities(2); - openmc::surfaces_c = new openmc::Surface*[openmc::n_surfaces]; + openmc::global_surfaces.resize(openmc::n_surfaces); for(int i = 0; i < openmc::n_surfaces; i++) { @@ -144,7 +144,7 @@ void load_cad_geometry_c() } // add to global array and map - openmc::surfaces_c[i] = s; + openmc::global_surfaces[i] = s; openmc::surface_map[s->id] = s->id; } diff --git a/src/cell.cpp b/src/cell.cpp index cfefe0a7fd..d3eba08e50 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -769,8 +769,6 @@ extern "C" { int cell_type(Cell* c) {return c->type_;} - int cell_material(Cell* c, int32_t mat_ind) {return c->material[mat_ind-1];} - #ifdef CAD int32_t next_cell(CADCell* cur_cell, CADSurface *surf_xed ) { diff --git a/src/constants.F90 b/src/constants.F90 index 77b4a06e0b..a3118f84da 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -129,7 +129,7 @@ module constants integer(C_INT), bind(C, name='FILL_LATTICE') :: FILL_LATTICE_C = FILL_LATTICE ! Void material - integer, parameter :: MATERIAL_VOID = -2 + integer, parameter :: MATERIAL_VOID = -1 ! Flag to say that the outside of a lattice is not defined integer, parameter :: NO_OUTER_UNIVERSE = -1 @@ -424,7 +424,7 @@ module constants real(8), parameter :: ERROR_REAL = -huge(0.0_8) * 0.917826354_8 ! Running modes - integer, parameter :: & + integer, parameter :: & MODE_FIXEDSOURCE = 1, & ! Fixed source mode MODE_EIGENVALUE = 2, & ! K eigenvalue mode MODE_PLOTTING = 3, & ! Plotting mode diff --git a/src/geometry_header.F90 b/src/geometry_header.F90 index 3b6c702f34..942a2f77ca 100644 --- a/src/geometry_header.F90 +++ b/src/geometry_header.F90 @@ -27,13 +27,6 @@ module geometry_header integer(C_INT32_T), intent(in), value :: cell_ind type(C_PTR) :: ptr end function cell_pointer - - function cell_material_c(cell_ptr, mat_ind) bind(C, name='cell_material') result(mat_id) - import C_PTR, C_INT32_T - type(C_PTR), intent(in), value :: cell_ptr - integer(C_INT32_T), intent(in), value :: mat_ind - integer(C_INT32_T) :: mat_id - end function cell_material_c function cell_id_c(cell_ptr) bind(C, name='cell_id') result(id) import C_PTR, C_INT32_T diff --git a/src/input_xml.F90 b/src/input_xml.F90 index e58b2eb40a..afb68c946c 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -599,8 +599,8 @@ contains do i = 1, n_cells c => cells(i) ! additional metadata spoofing - allocate(c % material(1)) - c % material(1) = cell_material_c(cell_pointer_c(i-1), 1) +! allocate(c % material(1)) +! c % material(1) = cell_material(cell_pointer(i-1), 1) allocate(c % sqrtKT(1)) c % sqrtkT(1) = 293 c % sqrtkT(:) = sqrt(K_BOLTZMANN * c % sqrtkT(:)) @@ -852,7 +852,7 @@ contains allocate(surfaces(n_surfaces)) do i = 1, n_surfaces - surfaces(i) % ptr = surface_pointer_c(i - 1); + surfaces(i) % ptr = surface_pointer(i - 1); ! Add surface to dictionary call surface_dict % set(surfaces(i) % id(), i) end do @@ -868,7 +868,7 @@ contains do i = 1, n_cells c => cells(i) - c % ptr = cell_pointer_c(i - 1) + c % ptr = cell_pointer(i - 1) ! Check to make sure 'id' hasn't been used if (cell_dict % has(c % id())) then call fatal_error("Two or more cells use the same unique ID: " & diff --git a/src/surface.cpp b/src/surface.cpp index 18947a86bf..174a24deb7 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -249,7 +249,7 @@ CSGSurface::to_hdf5(hid_t group_id) const // CADSurface implementation //============================================================================== #ifdef CAD -CADSurface::CADSurface() :Surface{} {} // empty constructor +CADSurface::CADSurface() : Surface{} {} // empty constructor double CADSurface::evaluate(Position r) const {