diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 99b43637a..5bdb5353f 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -340,9 +340,8 @@ public: #ifdef DAGMC class MOABMesh : public UnstructuredMesh { - public: - + // Constructors MOABMesh() = default; MOABMesh(pugi::xml_node); MOABMesh(const std::string& filename); @@ -488,7 +487,6 @@ private: #ifdef LIBMESH class LibMesh : public UnstructuredMesh { - public: // Constructors LibMesh(pugi::xml_node node); diff --git a/openmc/mesh.py b/openmc/mesh.py index 54eba9a9d..459b48a69 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -652,7 +652,7 @@ class UnstructuredMesh(MeshBase): @library.setter def library(self, lib): - cv.check_value('mesh_lib', lib, ('moab', 'libmesh')) + cv.check_value('Unstructured mesh library', lib, ('moab', 'libmesh')) self._library = lib @property @@ -706,7 +706,7 @@ class UnstructuredMesh(MeshBase): def __repr__(self): string = super().__repr__() string += '{: <16}=\t{}\n'.format('\tFilename', self.filename) - string += '{0: <16}=\t{}\n'.format('\tMesh Library', self.mesh_lib) + string += '{: <16}=\t{}\n'.format('\tMesh Library', self.mesh_lib) return string def write_data_to_vtk(self, filename, datasets, volume_normalization=True): diff --git a/src/initialize.cpp b/src/initialize.cpp index 5e4c86fd1..c3c7411ab 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -69,8 +69,7 @@ int openmc_init(int argc, char* argv[], const void* intracomm) // initialize libMesh if it hasn't been initialized already // (if initialized externally, the LMI object needs to be provided also) -if (!settings::LMI && !libMesh::initialized()) -{ +if (!settings::LMI && !libMesh::initialized()) { #ifdef OPENMC_MPI // pass command line args, empty MPI communicator, and number of threads. // Because libMesh was not initialized, we assume that OpenMC is the primary diff --git a/src/mesh.cpp b/src/mesh.cpp index 3a2f76861..4cc7efc1c 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1780,7 +1780,7 @@ double MOABMesh::volume(int bin) const std::string MOABMesh::library() const { - return "moab"; + return "moab"; } double MOABMesh::tet_volume(moab::EntityHandle tet) const @@ -2138,7 +2138,7 @@ void LibMesh::initialize() } // create an equation system for storing values - eq_system_name_ = "mesh_" + std::to_string(id_) + "_system"; + eq_system_name_ = fmt::format("mesh_{}_system", id_); equation_systems_ = std::make_unique(*m_); libMesh::ExplicitSystem& eq_sys = @@ -2167,7 +2167,7 @@ void LibMesh::initialize() Position LibMesh::centroid(int bin) const { - auto& elem = this->get_element_from_bin(bin); + const auto& elem = this->get_element_from_bin(bin); auto centroid = elem.centroid(); return {centroid(0), centroid(1), centroid(2)}; } @@ -2302,7 +2302,7 @@ LibMesh::get_bin(Position r) const int LibMesh::get_bin_from_element(const libMesh::Elem* elem) const { - int bin = elem->id() - first_element_->id(); + int bin = elem->id() - first_element_->id(); if (bin >= n_bins() || bin < 0) { fatal_error(fmt::format("Invalid bin: {}", bin)); } diff --git a/src/state_point.cpp b/src/state_point.cpp index 263fd0ae8..33c682a1e 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -55,8 +55,8 @@ openmc_statepoint_write(const char* filename, bool* write_source) write_message("Creating state point " + filename_ + "...", 5); #if defined(LIBMESH) || defined(DAGMC) - // write unstructured mesh tallies to VTK - write_unstructured_mesh_results(); + // write unstructured mesh tallies to VTK + write_unstructured_mesh_results(); #endif hid_t file_id;