Skip to content

Commit

Permalink
Fix #949: compiler errors of egs_mesh on mac
Browse files Browse the repository at this point in the history
Fix the used of [] instead of .at() for arrays in egs_mesh, and include
the array library explicitly. This avoids compiler errors that occurred
on mac.
  • Loading branch information
rtownson committed Jan 3, 2023
1 parent 962cf5d commit 5a425d1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions HEN_HOUSE/egs++/geometry/egs_mesh/egs_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include <memory>
#include <sstream>
#include <vector>
#include <array>

#include "egs_base_geometry.h"
#include "egs_vector.h"
Expand Down Expand Up @@ -306,10 +307,10 @@ class EGS_MESH_EXPORT EGS_Mesh : public EGS_BaseGeometry {
<< " \t2: " << n.C.x << " " << n.C.y << " " << n.C.z << "\n"
<< " \t3: " << n.D.x << " " << n.C.y << " " << n.C.z << "\n"
<< " \tNeighbour elements:\n"
<< " \t\tOn face 0: " << neighbours_[i][0] << "\n"
<< " \t\tOn face 1: " << neighbours_[i][1] << "\n"
<< " \t\tOn face 2: " << neighbours_[i][2] << "\n"
<< " \t\tOn face 3: " << neighbours_[i][3] << "\n"
<< " \t\tOn face 0: " << neighbours_.at(i).at(0) << "\n"
<< " \t\tOn face 1: " << neighbours_.at(i).at(1) << "\n"
<< " \t\tOn face 2: " << neighbours_.at(i).at(2) << "\n"
<< " \t\tOn face 3: " << neighbours_.at(i).at(3) << "\n"
<< std::boolalpha
<< " \tBoundary element: " << is_boundary(i) << "\n"
<< " \tMedia index: "<< medium_indices_[i] << "\n";
Expand Down Expand Up @@ -363,10 +364,10 @@ class EGS_MESH_EXPORT EGS_Mesh : public EGS_BaseGeometry {
Nodes element_nodes(int element) const {
const auto &node_indices = elt_node_indices_.at(element);
return Nodes {
nodes_.at(node_indices[0]),
nodes_.at(node_indices[1]),
nodes_.at(node_indices[2]),
nodes_.at(node_indices[3])
nodes_.at(node_indices.at(0)),
nodes_.at(node_indices.at(1)),
nodes_.at(node_indices.at(2)),
nodes_.at(node_indices.at(3))
};
}

Expand Down

0 comments on commit 5a425d1

Please sign in to comment.