diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 5438500649..d8164a1590 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -77,7 +77,7 @@ public: //! \param[out] Whether any bank sites are outside the mesh //! \return Array indicating number of sites in each mesh/energy bin virtual xt::xarray - count_sites(const std::vector& bank, bool* outside) const = 0; + count_sites(const std::vector& bank, bool* outside) const; virtual double get_volume_frac(int bin = -1) const = 0; @@ -216,6 +216,7 @@ public: //! \return Whether the line segment connecting r0 and r1 intersects mesh bool intersects(Position& r0, Position r1, int* ijk) const; + //! Count number of bank sites in each mesh bin / energy bin // //! \param[in] bank Array of bank sites @@ -226,6 +227,14 @@ public: // Data members + + //! Write mesh data to an HDF5 group + // + //! \param[in] group HDF5 group + // void to_hdf5(hid_t group) const; + + // std::string get_label_for_bin(int bin) const; + //std::string get_label_for_bin(int bin) const; //double get_volume_frac(int bin = -1) const; @@ -339,9 +348,6 @@ public: std::string get_label_for_bin(int bin) const; - xt::xarray - count_sites(const std::vector& bank, bool* outside) const; - double get_volume_frac(int bin = -1) const; int num_bins() const; diff --git a/src/mesh.cpp b/src/mesh.cpp index a0e259c123..ad79b2714c 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -795,11 +795,12 @@ void RegularMesh::to_hdf5(hid_t group) const } xt::xtensor + RegularMesh::count_sites(const Particle::Bank* bank, int64_t length, - bool* outside) const + bool* outside) const { // Determine shape of array for counts - std::size_t m = xt::prod(shape_)(); + std::size_t m = num_bins(); std::vector shape = {m}; // Create array of zeros @@ -1413,7 +1414,6 @@ RegularMesh* get_regular_mesh(int32_t index) { return dynamic_cast(model::meshes[index].get()); } - //! Extend the meshes array by n elements extern "C" int openmc_extend_meshes(int32_t n, int32_t* index_start, int32_t* index_end) @@ -1686,8 +1686,9 @@ void UnstructuredMesh::surface_bins_crossed(const Particle* p, std::vector& } std::string UnstructuredMesh::get_label_for_bin(int bin) const { - std::string s; - return s; + std::stringstream out; + out << "MOAB EntityHandle: " << get_ent_handle_from_bin(bin); + return out.str(); } int @@ -1700,7 +1701,6 @@ UnstructuredMesh::get_bin(Position r) const { } } - void UnstructuredMesh::compute_barycentric_data(const moab::Range& all_tets) { moab::ErrorCode rval; @@ -1760,7 +1760,6 @@ UnstructuredMesh::point_in_tet(const Position& r, moab::EntityHandle tet) const bary_coords[0] + bary_coords[1] + bary_coords[2] <= 1.); return in_tet; - } int @@ -1774,13 +1773,6 @@ UnstructuredMesh::get_ent_handle_from_bin(int bin) const { return ehs_[bin]; } -xt::xarray -UnstructuredMesh::count_sites(const std::vector& bank, - bool* outside) const { - xt::xarray out; - return out; - } - double UnstructuredMesh::get_volume_frac(int bin) const { return 0.0; }