mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Fixes after rebase. Non-CAD build is working.
This commit is contained in:
parent
122cce8ed4
commit
53dc9b4e48
6 changed files with 19 additions and 32 deletions
|
|
@ -111,7 +111,8 @@ public:
|
|||
std::vector<int32_t> 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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
21
src/cell.cpp
21
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<double> 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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue