Skip to content

Commit fb663fd

Browse files
committed
trigger CI
1 parent 416417e commit fb663fd

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

include/openmc/mesh.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,7 @@ class LibMesh : public UnstructuredMesh {
991991

992992
libMesh::MeshBase* mesh_ptr() const { return m_; };
993993

994-
995-
//!setter for mesh tally amalgamtion
994+
//! setter for mesh tally amalgamtion
996995
void set_mesh_tally_amalgamation(std::string cluster_element_integer_name);
997996

998997
private:
@@ -1035,16 +1034,18 @@ class LibMesh : public UnstructuredMesh {
10351034
std::vector<int> elem_to_bin_map_; //!< mapping dof indices to bin indices for
10361035
//!< active elements
10371036

1038-
bool amalgamation_ = false ; //!< whether we are doing mesh and tally amalgamation
1039-
//!< by default it's turned off.
1037+
bool amalgamation_ = false; //!< whether we are doing mesh and tally
1038+
//!< amalgamation by default it's turned off.
10401039

1041-
int cluster_element_integer_index_ = -1 ; //!< extra element integer index for element clustering
1042-
/*create a hash map where every element in a cluster would map to the first element of in that cluster
1043-
* if the element isn't part of a cluster then it will point to it self
1044-
* <any_element_in_a_cluster, first element in that cluster >
1040+
int cluster_element_integer_index_ =
1041+
-1; //!< extra element integer index for element clustering
1042+
/*create a hash map where every element in a cluster would map to the first
1043+
* element of in that cluster if the element isn't part of a cluster then it
1044+
* will point to it self <any_element_in_a_cluster, first element in that
1045+
* cluster >
10451046
*/
1046-
std::unordered_map<const libMesh::Elem*, const libMesh::Elem*> clustering_element_mapping_;
1047-
1047+
std::unordered_map<const libMesh::Elem*, const libMesh::Elem*>
1048+
clustering_element_mapping_;
10481049
};
10491050

10501051
#endif

src/mesh.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
33673366
Position 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
35713570
int 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

Comments
 (0)