@@ -3540,20 +3540,20 @@ AdaptiveLibMesh::AdaptiveLibMesh(
35403540void AdaptiveLibMesh::set_mesh_tally_amalgamation (
35413541 std::string cluster_element_integer_name)
35423542{
3543-
3543+
35443544 clustering_element_integer_index_ =
35453545 m_->has_elem_integer (cluster_element_integer_name)
35463546 ? m_->get_elem_integer_index (cluster_element_integer_name)
35473547 : -1 ;
35483548 amalgamation_ = (clustering_element_integer_index_ != -1 );
3549-
3549+
35503550 if (amalgamation_) {
35513551 // reseve the hash map for cluster elements
35523552 clustering_element_mapping_.reserve (m_->n_active_elem ());
35533553
35543554 // adding clustering map
35553555 for (auto it = m_->active_elements_begin (); it != m_->active_elements_end ();
3556- it++) {
3556+ it++) {
35573557
35583558 auto elem = *it;
35593559 auto cluster_elem = elem;
@@ -3568,10 +3568,10 @@ void AdaptiveLibMesh::set_mesh_tally_amalgamation(
35683568 }
35693569 clustering_element_mapping_.insert (std::make_pair (elem, cluster_elem));
35703570 }
3571- }
3572- else {
3571+ } else {
35733572 fatal_error (fmt::format (" No extra element integer named: {} found in the "
3574- " mesh" , cluster_element_integer_name));
3573+ " mesh" ,
3574+ cluster_element_integer_name));
35753575 }
35763576}
35773577
@@ -3605,9 +3605,10 @@ void AdaptiveLibMesh::write(const std::string& filename) const
36053605int AdaptiveLibMesh::get_bin_from_element (const libMesh::Elem* elem) const
36063606{
36073607 auto tally_elem = amalgamation_ ? clustering_element_mapping_.at (elem) : elem;
3608- int bin = adaptive_ ? elem_to_bin_map_[tally_elem->id ()]
3609- : tally_elem->id () - first_element_id_;
3610- if (bin >= n_bins () || bin < 0 ) {
3608+ int bin = elem_to_bin_map_[tally_elem->id ()]
3609+
3610+ if (bin >= n_bins () || bin < 0 )
3611+ {
36113612 fatal_error (fmt::format (" Invalid bin: {}" , bin));
36123613 }
36133614 return bin;
0 commit comments