Commit 45af0dbb authored by snuverink_j's avatar snuverink_j
Browse files

Resolve "Logical error in Boundarygeometry"

parent 28407252
...@@ -420,7 +420,7 @@ void ElementBase::BoundingBox::print(std::ostream & out) const { ...@@ -420,7 +420,7 @@ void ElementBase::BoundingBox::print(std::ostream & out) const {
std::vector<std::vector<unsigned int>> paths{{0, 1, 2, 3}, {0, 1, 7, 6}, {1, 2, 4, 7}, {2, 3, 5, 4}, {3, 0, 6, 5}, {4, 5, 6, 7}}; std::vector<std::vector<unsigned int>> paths{{0, 1, 2, 3}, {0, 1, 7, 6}, {1, 2, 4, 7}, {2, 3, 5, 4}, {3, 0, 6, 5}, {4, 5, 6, 7}};
out << std::setprecision(8); out << std::setprecision(8);
for (const std::vector<unsigned int> path: paths) { for (const std::vector<unsigned int>& path: paths) {
for (unsigned int i : {0, 1, 2, 3, 0}) { for (unsigned int i : {0, 1, 2, 3, 0}) {
const Vector_t & corner = corners[path[i]]; const Vector_t & corner = corners[path[i]];
out << std::setw(16) << corner(0) out << std::setw(16) << corner(0)
......
...@@ -46,7 +46,7 @@ FlexibleCollimator::FlexibleCollimator(const FlexibleCollimator &right): ...@@ -46,7 +46,7 @@ FlexibleCollimator::FlexibleCollimator(const FlexibleCollimator &right):
lossDs_m(nullptr), lossDs_m(nullptr),
parmatint_m(NULL) parmatint_m(NULL)
{ {
for (const std::shared_ptr<mslang::Base> obj: right.holes_m) { for (const std::shared_ptr<mslang::Base>& obj: right.holes_m) {
holes_m.emplace_back(obj->clone()); holes_m.emplace_back(obj->clone());
} }
......
...@@ -571,7 +571,7 @@ Statement *OpalParser::readStatement(TokenStream *is) const { ...@@ -571,7 +571,7 @@ Statement *OpalParser::readStatement(TokenStream *is) const {
stat = readStatement(is); stat = readStatement(is);
} else if(token.isDel('?')) { } else if(token.isDel('?')) {
// Give help. // Give help.
*gmsg << "\ntry typing \"HELP\" or \"SHOW\" for help.\n" << endl; *gmsg << "\ntry typing \"HELP\" for help.\n" << endl;
stat = readStatement(is); stat = readStatement(is);
} else if(! token.isEOF()) { } else if(! token.isEOF()) {
stat = new SimpleStatement(token.getFile(), token.getLine()); stat = new SimpleStatement(token.getFile(), token.getLine());
......
...@@ -446,7 +446,7 @@ std::map<std::string, std::vector<double> > OpalSimulation::getData(const std::v ...@@ -446,7 +446,7 @@ std::map<std::string, std::vector<double> > OpalSimulation::getData(const std::v
std::vector<double> values; std::vector<double> values;
values.reserve(column.size()); values.reserve(column.size());
auto type = parser.getColumnType(var); auto type = parser.getColumnType(var);
for (const auto val: column) { for (const auto& val: column) {
values.push_back(parser.getBoostVariantValue<double>(val,(int)type)); values.push_back(parser.getBoostVariantValue<double>(val,(int)type));
} }
ret.insert(std::make_pair(var, values)); ret.insert(std::make_pair(var, values));
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
std::vector<std::string> dvars({std::istream_iterator<std::string>{iss}, std::vector<std::string> dvars({std::istream_iterator<std::string>{iss},
std::istream_iterator<std::string>{}}); std::istream_iterator<std::string>{}});
size_t j = 0; size_t j = 0;
for (const std::string str: dvars) { for (const std::string& str: dvars) {
if (str == dvarName_m) break; if (str == dvarName_m) break;
++ j; ++ j;
} }
......
...@@ -595,9 +595,9 @@ static inline int ...@@ -595,9 +595,9 @@ static inline int
SIGN3 ( SIGN3 (
Vector_t A Vector_t A
) { ) {
return ((A[0] < EPS) ? 4 : 0 | (A[0] > -EPS) ? 32 : 0 | return (((A[0] < EPS) ? 4 : 0) | ((A[0] > -EPS) ? 32 : 0) |
(A[1] < EPS) ? 2 : 0 | (A[1] > -EPS) ? 16 : 0 | ((A[1] < EPS) ? 2 : 0) | ((A[1] > -EPS) ? 16 : 0) |
(A[2] < EPS) ? 1 : 0 | (A[2] > -EPS) ? 8 : 0); ((A[2] < EPS) ? 1 : 0) | ((A[2] > -EPS) ? 8 : 0));
} }
static int static int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment