@@ -3238,28 +3238,31 @@ LibMesh::LibMesh(libMesh::MeshBase& input_mesh, double length_multiplier)
32383238 initialize ();
32393239}
32403240
3241+ void LibMesh::set_mesh_tally_amalgamation (
3242+ std::string cluster_element_integer_name)
3243+ {
32413244
3242- void
3243- LibMesh::set_mesh_tally_amalgamation (std::string cluster_element_integer_name){
3244-
3245- cluster_element_integer_index_ = m_->has_elem_integer (cluster_element_integer_name)
3246- ? m_->get_elem_integer_index (cluster_element_integer_name)
3247- : -1 ;
3245+ cluster_element_integer_index_ =
3246+ m_->has_elem_integer (cluster_element_integer_name)
3247+ ? m_->get_elem_integer_index (cluster_element_integer_name)
3248+ : -1 ;
32483249 amalgamation_ = (cluster_element_integer_index_ != -1 );
32493250
3250- // should we add a warning if amalgamation is false?
3251+ // should we add a warning if amalgamation is false?
32513252
32523253 if (amalgamation_) {
32533254
3254- // reseve the hash map for cluster elements
3255+ // reseve the hash map for cluster elements
32553256 clustering_element_mapping_.reserve (m_->n_active_elem ());
32563257
3257- // adding clustering map
3258- for (auto it = m_->active_elements_begin (); it != m_->active_elements_end (); it++) {
3258+ // adding clustering map
3259+ for (auto it = m_->active_elements_begin (); it != m_->active_elements_end ();
3260+ it++) {
32593261
32603262 auto elem = *it;
32613263 auto cluster_elem = elem;
3262- unsigned int cluster_id = elem->get_extra_integer (cluster_element_integer_index_);
3264+ unsigned int cluster_id =
3265+ elem->get_extra_integer (cluster_element_integer_index_);
32633266
32643267 if (cluster_id != -1 ) {
32653268 auto first_element_in_a_cluster = m_->elem_ptr (cluster_id);
@@ -3268,11 +3271,8 @@ LibMesh::set_mesh_tally_amalgamation(std::string cluster_element_integer_name){
32683271 cluster_elem = first_element_in_a_cluster;
32693272 }
32703273 clustering_element_mapping_.insert (std::make_pair (elem, cluster_elem));
3271-
32723274 }
32733275 }
3274-
3275-
32763276}
32773277
32783278// create the mesh from an input file
@@ -3346,7 +3346,7 @@ void LibMesh::initialize()
33463346 bin_to_elem_map_.reserve (m_->n_active_elem ());
33473347 elem_to_bin_map_.resize (m_->n_elem (), -1 );
33483348 for (auto it = m_->active_elements_begin (); it != m_->active_elements_end ();
3349- it++) {
3349+ it++) {
33503350 auto elem = *it;
33513351
33523352 bin_to_elem_map_.push_back (elem->id ());
@@ -3362,7 +3362,6 @@ void LibMesh::initialize()
33623362 upper_right_ = {ur (0 ), ur (1 ), ur (2 )};
33633363}
33643364
3365-
33663365// Sample position within a tet for LibMesh type tets
33673366Position LibMesh::sample_element (int32_t bin, uint64_t * seed) const
33683367{
@@ -3506,7 +3505,7 @@ void LibMesh::set_score_data(const std::string& var_name,
35063505 unsigned int std_dev_num = variable_map_.at (std_dev_name);
35073506
35083507 for (auto it = m_->local_elements_begin (); it != m_->local_elements_end ();
3509- it++) {
3508+ it++) {
35103509 if (!(*it)->active ()) {
35113510 continue ;
35123511 }
@@ -3571,7 +3570,8 @@ int LibMesh::get_bin(Position r) const
35713570int LibMesh::get_bin_from_element (const libMesh::Elem* elem) const
35723571{
35733572 auto tally_elem = amalgamation_ ? clustering_element_mapping_.at (elem) : elem;
3574- int bin = adaptive_ ? elem_to_bin_map_[tally_elem->id ()] : tally_elem->id () - first_element_id_;
3573+ int bin = adaptive_ ? elem_to_bin_map_[tally_elem->id ()]
3574+ : tally_elem->id () - first_element_id_;
35753575
35763576 if (bin >= n_bins () || bin < 0 ) {
35773577 fatal_error (fmt::format (" Invalid bin: {}" , bin));
0 commit comments