diff --git a/include/openmc/cell.h b/include/openmc/cell.h index a2910e74cb..d695477218 100644 --- a/include/openmc/cell.h +++ b/include/openmc/cell.h @@ -111,7 +111,8 @@ public: std::vector offset_; //!< Distribcell offset table explicit Cell(pugi::xml_node cell_node); - + inline Cell() {}; + //! Determine if a cell contains the particle at a given location. //! //! The bounds of the cell are detemined by a logical expression involving diff --git a/include/openmc/surface.h b/include/openmc/surface.h index 858cb48461..d1e3f2b49e 100644 --- a/include/openmc/surface.h +++ b/include/openmc/surface.h @@ -113,6 +113,11 @@ public: //! \return Normal direction virtual Direction normal(Position r) const = 0; + //! Write all information needed to reconstruct the surface to an HDF5 group. + //! \param group_id An HDF5 group id. + //TODO: this probably needs to include i_periodic for PeriodicSurface + virtual void to_hdf5(hid_t group_id) const = 0; + }; class CSGSurface : public Surface @@ -121,11 +126,7 @@ class CSGSurface : public Surface explicit CSGSurface(pugi::xml_node surf_node); explicit CSGSurface(); - //! Write all information needed to reconstruct the surface to an HDF5 group. - //! \param group_id An HDF5 group id. - //TODO: this probably needs to include i_periodic for PeriodicSurface void to_hdf5(hid_t group_id) const; - protected: virtual void to_hdf5_inner(hid_t group_id) const = 0; diff --git a/src/cell.cpp b/src/cell.cpp index d3eba08e50..f504ef0bbe 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -351,7 +351,7 @@ CSGCell::CSGCell(pugi::xml_node cell_node) err_msg << "Non-3D translation vector applied to cell " << id_; fatal_error(err_msg); } - translation_ = xyz; + translation_ = *xyz.begin(); } // Read the rotation transform. @@ -371,15 +371,16 @@ CSGCell::CSGCell(pugi::xml_node cell_node) } // Store the rotation angles. + std::vector rot_vec = *rot.begin(); rotation_.reserve(12); - rotation_.push_back(rot[0]); - rotation_.push_back(rot[1]); - rotation_.push_back(rot[2]); + rotation_.push_back(rot_vec[0]); + rotation_.push_back(rot_vec[1]); + rotation_.push_back(rot_vec[2]); // Compute and store the rotation matrix. - auto phi = -rot[0] * PI / 180.0; - auto theta = -rot[1] * PI / 180.0; - auto psi = -rot[2] * PI / 180.0; + auto phi = -rot_vec[0] * PI / 180.0; + auto theta = -rot_vec[1] * PI / 180.0; + auto psi = -rot_vec[2] * PI / 180.0; rotation_.push_back(std::cos(theta) * std::cos(psi)); rotation_.push_back(-std::cos(phi) * std::sin(psi) + std::sin(phi) * std::sin(theta) * std::cos(psi)); @@ -445,7 +446,7 @@ CSGCell::to_hdf5(hid_t cell_group) const // Create a group for this cell. std::stringstream group_name; group_name << "cell " << id_; - auto group = create_group(cells_group, group_name); + auto group = create_group(cell_group, group_name); if (!name_.empty()) { write_string(group, "name", name_, false); @@ -645,7 +646,7 @@ read_cells(pugi::xml_node* node) // Loop over XML cell elements and populate the array. cells.reserve(n_cells); for (pugi::xml_node cell_node: node->children("cell")) { - global_cells.push_back(new CSGCell(cell_node)); + cells.push_back(new CSGCell(cell_node)); } // Populate the Universe vector and map. @@ -811,7 +812,7 @@ extern "C" { { cells.reserve(cells.size() + n); for (int32_t i = 0; i < n; i++) { - global_cells.push_back(new CSGCell()); + cells.push_back(new CSGCell()); } n_cells = cells.size(); } diff --git a/src/geometry.F90 b/src/geometry.F90 index 90bdccb921..c060848881 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -72,14 +72,6 @@ module geometry contains - function cell_contains(c, p) result(in_cell) - type(Cell), intent(in) :: c - type(Particle), intent(in) :: p - logical :: in_cell - in_cell = cell_contains_c(c%ptr, p%coord(p%n_coord)%xyz, & - p%coord(p%n_coord)%uvw, p%surface) - end function cell_contains - #ifdef CAD function next_cell(c, s) result(new_cell) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 9954a9b855..3875bc80aa 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -431,8 +431,6 @@ contains trace_batch = temp_int_array3(1) trace_gen = temp_int_array3(2) trace_particle = int(temp_int_array3(3), 8) ->>>>>>> Updates to meet style guide. ->>>>>>> Updates to meet style guide. end if ! Particle tracks @@ -755,12 +753,6 @@ contains c % ptr = cell_pointer(i - 1) -<<<<<<< 25ab6776f10a1ea974b3aa15f74271aa80748913 -======= - ! Initialize distribcell instances and distribcell index - c % distribcell_index = NONE - ->>>>>>> Updates to meet style guide. ! Get pointer to i-th cell node node_cell = node_cell_list(i) diff --git a/src/source.cpp b/src/source.cpp index 666bbb7838..f2800c1cc4 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -316,7 +316,7 @@ Bank sample_external_source() } // Sample source site from i-th source distribution - Bank site {external_sources[i].sample()}; + Bank site = external_sources[i].sample(); // If running in MG, convert site % E to group if (!settings::run_CE) {