103 std::map<size_t, Active::Region> regions;
106 for (
size_t lon = 0; lon < points->axis[0]->size(); ++lon) {
107 for (
size_t tra = 0; tra < points->axis[1]->size(); ++tra) {
110 for (
size_t ver = 0;
ver < points->axis[2]->size(); ++
ver) {
111 auto point = points->at(lon, tra,
ver);
115 auto found = regions.find(num);
116 if (
found == regions.end()) {
122 throw Exception(
"{0}: Junction {1} does not have top and bottom edges at constant heights",
123 this->
getId(), num - 1);
124 if (tra < region.
left) region.
left = tra;
125 if (tra >= region.
right) region.
right = tra + 1;
126 if (lon < region.
back) region.
back = lon;
127 if (lon >= region.
front) region.
front = lon + 1;
135 if (
found != regions.end()) {
137 if (region.
warn && lon != region.
lon && tra != region.
tra &&
138 *
this->geometry->getMaterial(points->at(lon, tra,
ver)) !=
139 *
this->geometry->getMaterial(points->at(region.
lon, region.
tra,
ver))) {
147 auto found = regions.find(num);
148 if (
found == regions.end()) {
149 regions[num] =
Active::Region(start, points->axis[2]->size(), lon, tra);
152 if (start != region.
bottom || points->axis[2]->size() != region.
top)
153 throw Exception(
"{0}: Junction {1} does not have top and bottom edges at constant heights", this->
getId(),
155 if (tra < region.
left) region.
left = tra;
156 if (tra >= region.
right) region.
right = tra + 1;
157 if (lon < region.
back) region.
back = lon;
158 if (lon >= region.
front) region.
front = lon + 1;
167 for (
auto&
ireg : regions) {
168 size_t num =
ireg.first - 1;
170 double height = this->
mesh->axis[2]->at(reg.
top) - this->
mesh->axis[2]->at(reg.
bottom);
174 this->
writelog(
LOG_DEBUG,
"Junction {0} span: [{1},{3},{5}]-[{2},{4},{6}]", num, reg.
back, reg.
front, reg.
left, reg.
right,