27 : _surface_list(other_base.getSurfaceList()),
78std::unique_ptr<CSGBase>
81 std::unique_ptr<CSGBase>
clone = std::make_unique<CSGBase>(*
this);
84 std::map<std::string, std::reference_wrapper<const CSGSurface>> identical_surface_refs;
85 auto & surf_list_map =
clone->getSurfaceList().getSurfaceListMap();
86 for (
const auto & [surf_name, surf_ptr] : surf_list_map)
87 identical_surface_refs.insert({surf_name,
clone->getSurfaceByName(surf_name)});
90 for (
auto & [cell_name, cell_ptr] : clone->getCellList().getCellListMap())
91 cell_ptr->updateCellRegionSurfaces(identical_surface_refs);
97CSGBase::addSurface(std::unique_ptr<CSGSurface> surf)
99 if (surfaceToEngUnit(*surf))
102 "' is a CSGSurfaceEngUnit and must be added via addEngUnit(), not addSurface().");
103 return _surface_list.addSurface(std::move(surf));
107CSGBase::prepareSurfaceDeletion(
const CSGSurface & surface)
const
109 for (
const auto & cell_ref : _cell_list.getAllCells())
111 const auto & cell = cell_ref.get();
112 for (
const auto & region_surf : cell.getRegion().getSurfaces())
113 if (region_surf.get() == surface)
114 mooseError(
"Cannot delete surface with name ",
116 " as it is used in region definition of cell with name ",
124 if (!checkSurfaceInBase(surface))
127 " cannot be deleted as it is different from the surface of the same name in the "
128 "CSGBase instance.");
130 prepareSurfaceDeletion(surface);
131 if (
const auto * eng_unit = surfaceToEngUnit(surface))
132 _eng_unit_list.removeEngUnit(*eng_unit);
133 _surface_list.getSurfaceListMap().erase(surface.
getName());
140 const auto name = cell.
getName();
141 if (_cell_list.hasCell(name))
142 return _cell_list.getCell(name);
145 if (cellToEngUnit(cell))
148 "' is a CSGCellEngUnit and must be added via addEngUnit(), not addCellToList().");
153 if (fill_type ==
"VOID")
154 return _cell_list.addVoidCell(name, region);
155 else if (fill_type ==
"CSG_MATERIAL")
158 return _cell_list.addMaterialCell(name, mat_name, region);
160 else if (fill_type ==
"LATTICE")
164 return _cell_list.addLatticeCell(name, lattice, region);
168 else if (fill_type ==
"UNIVERSE")
171 return _cell_list.addUniverseCell(name, univ, region);
174 mooseError(
"Cell " + name +
" has unrecognized fill type " + fill_type);
181 const auto name = univ.
getName();
182 if (_universe_list.hasUniverse(name))
183 return _universe_list.getUniverse(name);
186 if (universeToEngUnit(univ))
189 "' is a CSGUniverseEngUnit and must be added via addEngUnit(), not "
190 "addUniverseToList().");
196 std::vector<std::reference_wrapper<const CSGCell>> current_univ_cells;
197 for (
const auto & univ_cell : univ_cells)
198 current_univ_cells.push_back(addCellToList(univ_cell));
199 return createUniverse(name, current_univ_cells);
206 const auto name = lattice.
getName();
207 if (_lattice_list.hasLattice(name))
208 return _lattice_list.getLattice(name);
211 auto cloned_lattice = lattice.
clone();
216 std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> current_univ_map;
219 std::vector<std::reference_wrapper<const CSGUniverse>> current_univ_list;
220 for (
const auto & univ_ref : univ_list)
221 current_univ_list.push_back(addUniverseToList(univ_ref.get()));
222 current_univ_map.push_back(current_univ_list);
226 if (current_univ_map.size() > 0)
227 cloned_lattice->setUniverses(current_univ_map);
232 const auto & outer_univ_ref = addUniverseToList(lattice.
getOuterUniverse());
233 cloned_lattice->updateOuter(outer_univ_ref);
237 return addLattice(std::move(cloned_lattice));
243 if (!checkLatticeInBase(lattice))
246 " cannot be deleted as it is different from the lattice of the same name in the "
247 "CSGBase instance.");
250 for (
const auto & cell_ref : _cell_list.getAllCells())
252 const auto & cell = cell_ref.get();
253 if ((cell.getFillType() ==
"LATTICE") && (cell.getFillLattice() == lattice))
254 mooseError(
"Cannot delete lattice with name ",
256 " as it is used as the fill of cell with name ",
260 _lattice_list.getLatticeListMap().erase(lattice.
getName());
264CSGBase::createCell(
const std::string & name,
265 const std::string & mat_name,
269 checkRegionSurfaces(region);
270 auto & cell = _cell_list.addMaterialCell(name, mat_name, region);
272 addCellToUniverse(*add_to_univ, cell);
274 addCellToUniverse(getRootUniverse(), cell);
279CSGBase::createCell(
const std::string & name,
283 checkRegionSurfaces(region);
284 auto & cell = _cell_list.addVoidCell(name, region);
286 addCellToUniverse(*add_to_univ, cell);
288 addCellToUniverse(getRootUniverse(), cell);
293CSGBase::createCell(
const std::string & name,
298 checkRegionSurfaces(region);
299 if (add_to_univ && (&fill_univ == add_to_univ))
301 " cannot be filled with the same universe to which it is being added.");
303 auto & cell = _cell_list.addUniverseCell(name, fill_univ, region);
305 addCellToUniverse(*add_to_univ, cell);
307 addCellToUniverse(getRootUniverse(), cell);
312CSGBase::createCell(
const std::string & name,
317 checkRegionSurfaces(region);
322 for (
const auto & univ_ref : univ_list)
324 const CSGUniverse & univ_in_lattice = univ_ref.get();
325 if (&univ_in_lattice == add_to_univ)
327 " cannot be filled with a lattice containing the same universe to which it is "
331 auto & cell = _cell_list.addLatticeCell(name, fill_lattice, region);
333 addCellToUniverse(*add_to_univ, cell);
335 addCellToUniverse(getRootUniverse(), cell);
340CSGBase::prepareCellDeletion(
const CSGCell & cell)
342 for (
const auto & univ_ref : _universe_list.getAllUniverses())
344 const auto & univ = univ_ref.get();
345 for (
const auto & univ_cell : univ.getAllCells())
346 if (cell == univ_cell.get())
350 if (univ != getRootUniverse())
353 " from universe with name ",
355 " before cell deletion.");
356 _universe_list.getUniverse(univ.getName()).removeCell(cell.
getName());
364 if (!checkCellInBase(cell))
367 " cannot be deleted as it is different from the cell of the same name in the "
368 "CSGBase instance.");
370 prepareCellDeletion(cell);
371 if (
const auto * eng_unit = cellToEngUnit(cell))
372 _eng_unit_list.removeEngUnit(*eng_unit);
373 _cell_list.getCellListMap().erase(cell.
getName());
380 if (cellToEngUnit(cell))
382 "' because it is a CSGCellEngUnit.");
384 checkRegionSurfaces(region);
385 if (!checkCellInBase(cell))
387 " that is being updated is different " +
388 "from the cell of the same name in the CSGBase instance.");
389 auto & list_cell = _cell_list.getCell(cell.
getName());
390 list_cell.updateRegion(region);
397 if (cellToEngUnit(cell))
399 "' because it is a CSGCellEngUnit.");
401 if (!checkCellInBase(cell))
403 " that is being updated is different " +
404 "from the cell of the same name in the CSGBase instance.");
405 auto & list_cell = _cell_list.getCell(cell.
getName());
406 list_cell.resetCellFill();
410CSGBase::updateCellFill(
const CSGCell & cell,
const std::string & mat_name)
413 if (cellToEngUnit(cell))
415 "' because it is a CSGCellEngUnit.");
417 if (!checkCellInBase(cell))
419 " that is being updated is different " +
420 "from the cell of the same name in the CSGBase instance.");
421 auto & list_cell = _cell_list.getCell(cell.
getName());
422 list_cell.updateCellFill(mat_name);
429 if (cellToEngUnit(cell))
431 "' because it is a CSGCellEngUnit.");
433 if (!checkUniverseInBase(*univ))
436 " is being used as a cell fill that is different from the universe of the same name "
437 "in the CSGBase instance.");
438 if (!checkCellInBase(cell))
440 " that is being updated is different " +
441 "from the cell of the same name in the CSGBase instance.");
442 auto & list_cell = _cell_list.getCell(cell.
getName());
443 list_cell.updateCellFill(univ);
450 if (cellToEngUnit(cell))
452 "' because it is a CSGCellEngUnit.");
454 if (!checkLatticeInBase(*lattice))
457 " is being used as a cell fill that is different from the lattice of the same name "
458 "in the CSGBase instance.");
459 if (!checkCellInBase(cell))
461 " that is being updated is different " +
462 "from the cell of the same name in the CSGBase instance.");
463 auto & list_cell = _cell_list.getCell(cell.
getName());
464 list_cell.updateCellFill(lattice);
468CSGBase::createUniverse(
const std::string & name,
469 std::vector<std::reference_wrapper<const CSGCell>> & cells)
471 auto & univ = _universe_list.addUniverse(name);
472 addCellsToUniverse(univ, cells);
479 if (univ == getRootUniverse())
480 mooseError(
"Cannot delete root universe from CSGBase instance");
483 for (
const auto & lat : _lattice_list.getAllLattices())
485 for (
const auto & lat_univ : lat.get().getUniqueUniverses())
486 if (univ == lat_univ.get())
487 mooseError(
"Cannot delete universe with name ",
489 " as it is used in lattice with name ",
490 lat.get().getName());
491 if ((lat.get().getOuterType() ==
"UNIVERSE") && (lat.get().getOuterUniverse() == univ))
492 mooseError(
"Cannot delete universe with name ",
494 " as it is used as the outer universe of lattice with name ",
495 lat.get().getName());
499 for (
const auto & cell_ref : _cell_list.getAllCells())
501 const auto & cell = cell_ref.get();
502 if ((cell.getFillType() ==
"UNIVERSE") && (cell.getFillUniverse() == univ))
503 mooseError(
"Cannot delete universe with name ",
505 " as it is used as the fill of cell with name ",
513 if (!checkUniverseInBase(univ))
516 " cannot be deleted as it is different from the universe of the same name in the "
517 "CSGBase instance.");
519 prepareUniverseDeletion(univ);
520 if (
const auto * eng_unit = universeToEngUnit(univ))
521 _eng_unit_list.removeEngUnit(*eng_unit);
522 _universe_list.getUniverseListMap().erase(univ.
getName());
529 if (universeToEngUnit(universe))
531 "' cannot add cells because it is a CSGUniverseEngUnit.");
534 if (!checkCellInBase(cell))
537 " that is different from the cell of the same name in the CSGBase instance.");
539 if (!checkUniverseInBase(universe))
541 " that is different " +
542 "from the universe of the same name in the CSGBase instance.");
543 auto & univ = _universe_list.getUniverse(universe.
getName());
549 std::vector<std::reference_wrapper<const CSGCell>> & cells)
551 for (
auto & c : cells)
552 addCellToUniverse(universe, c);
559 if (!checkCellInBase(cell))
560 mooseError(
"A cell named " + cell.
getName() +
" is being removed from universe " +
562 " that is different from the cell of the same name in the CSGBase instance.");
564 if (!checkUniverseInBase(universe))
565 mooseError(
"Cells are being removed from a universe named " + universe.
getName() +
566 " that is different " +
567 "from the universe of the same name in the CSGBase instance.");
568 auto & univ = _universe_list.getUniverse(universe.
getName());
571 univ.removeCell(cell.
getName());
576 std::vector<std::reference_wrapper<const CSGCell>> & cells)
578 for (
auto & c : cells)
579 removeCellFromUniverse(universe, c);
583CSGBase::setLatticeOuter(
const CSGLattice & lattice,
const std::string & outer_name)
586 if (!checkLatticeInBase(lattice))
587 mooseError(
"Cannot set outer for lattice " + name +
588 ". Lattice is different from the lattice of the same name in the "
589 "CSGBase instance.");
590 _lattice_list.getLattice(name).updateOuter(outer_name);
597 if (!checkLatticeInBase(lattice))
598 mooseError(
"Cannot set outer universe for lattice " + name +
599 ". Lattice is different from the lattice of the same name in the "
600 "CSGBase instance.");
601 if (!checkUniverseInBase(outer_univ))
602 mooseError(
"Cannot set outer universe for lattice " + name +
". Outer universe " +
603 outer_univ.
getName() +
" is not in the CSGBase instance.");
604 _lattice_list.getLattice(name).updateOuter(outer_univ);
611 if (!checkLatticeInBase(lattice))
612 mooseError(
"Cannot reset outer for lattice " + name +
613 ". Lattice is different from the lattice of the same name in the "
614 "CSGBase instance.");
615 _lattice_list.getLattice(name).resetOuter();
619CSGBase::setUniverseAtLatticeIndex(
const CSGLattice & lattice,
621 std::pair<int, int> index)
624 if (!checkLatticeInBase(lattice))
625 mooseError(
"Cannot set universe at index for lattice " + name +
626 ". Lattice is different from the lattice of the same name in the "
627 "CSGBase instance.");
628 if (!checkUniverseInBase(universe))
630 ". Universe is not in the CSGBase instance.");
631 _lattice_list.getLattice(name).setUniverseAtIndex(universe, index);
635CSGBase::setLatticeUniverses(
637 std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> & universes)
640 if (!checkLatticeInBase(lattice))
641 mooseError(
"Cannot set universes for lattice " + name +
642 ". Lattice is different from the lattice of the same name in the "
643 "CSGBase instance.");
645 for (
auto univ_list : universes)
647 if (!checkUniverseInBase(univ))
648 mooseError(
"Cannot set universes for lattice " + name +
". Universe " + univ.getName() +
649 " is not in the CSGBase instance.");
650 _lattice_list.getLattice(name).setUniverses(universes);
656 const std::tuple<Real, Real, Real> &
values)
660 [&](
const auto & obj)
662 using T = std::decay_t<
decltype(obj.get())>;
666 if constexpr (std::is_same_v<T, CSGCell>)
668 const CSGCell & cell = obj.get();
669 if (!checkCellInBase(cell))
670 mooseError(
"Cannot apply transformation to cell ",
672 " that is not in this CSGBase instance.");
676 mooseAssert(mutable_cell == cell,
"Mutable cell does not match const cell passed in.");
679 else if constexpr (std::is_same_v<T, CSGSurface>)
682 if (!checkSurfaceInBase(surface))
683 mooseError(
"Cannot apply transformation to surface ",
685 " that is not in this CSGBase instance.");
689 mooseAssert(mutable_surface == surface,
690 "Mutable surface does not match const surface passed in.");
693 else if constexpr (std::is_same_v<T, CSGUniverse>)
696 if (!checkUniverseInBase(universe))
697 mooseError(
"Cannot apply transformation to universe ",
699 " that is not in this CSGBase instance.");
703 mooseAssert(mutable_universe == universe,
704 "Mutable universe does not match const universe passed in.");
707 else if constexpr (std::is_same_v<T, CSGLattice>)
710 if (!checkLatticeInBase(lattice))
711 mooseError(
"Cannot apply transformation to lattice ",
713 " that is not in this CSGBase instance.");
717 mooseAssert(mutable_lattice == lattice,
718 "Mutable lattice does not match const lattice passed in.");
721 else if constexpr (std::is_same_v<T, CSGRegion>)
728 if (!checkSurfaceInBase(surface))
729 mooseError(
"Cannot apply transformation to region with surface ",
731 " that is not in this CSGBase instance.");
732 addTransformation(surface, type,
values);
735 else if constexpr (std::is_same_v<T, CSGEngUnit>)
738 if (!checkEngUnitInBase(eng_unit))
739 mooseError(
"Cannot apply transformation to engineering unit ",
741 " that is not in this CSGBase instance.");
745 s->addTransformation(type,
values);
747 c->addTransformation(type,
values);
749 u->addTransformation(type,
values);
753 "' has an unrecognized type for transformation.");
756 mooseError(
"Transformation not implemented for this object type: ",
typeid(T).name());
773 case RotationAxisType::X:
776 case RotationAxisType::Y:
781 case RotationAxisType::Z:
785 mooseError(
"Invalid axis type provided for axis rotation.");
788 addTransformation(csg_object, TransformationType::ROTATION, std::make_tuple(phi, theta, psi));
792CSGBase::joinOtherBase(std::unique_ptr<CSGBase> base,
const bool ignore_identical_components)
796 if (ignore_identical_components)
797 updateIncomingCSGReferences(*base);
798 joinSurfaceList(base->getSurfaceList(), ignore_identical_components);
799 joinCellList(base->getCellList(), ignore_identical_components);
800 joinLatticeList(base->getLatticeList(), ignore_identical_components);
801 joinUniverseList(base->getUniverseList(), ignore_identical_components);
802 rebuildEngUnitList();
807CSGBase::joinOtherBase(std::unique_ptr<CSGBase> base,
808 const bool ignore_identical_components,
809 const std::string & new_root_name_join)
813 if (ignore_identical_components)
814 updateIncomingCSGReferences(*base);
815 joinSurfaceList(base->getSurfaceList(), ignore_identical_components);
816 joinCellList(base->getCellList(), ignore_identical_components);
817 joinLatticeList(base->getLatticeList(), ignore_identical_components);
818 joinUniverseList(base->getUniverseList(), ignore_identical_components, new_root_name_join);
819 rebuildEngUnitList();
824CSGBase::joinOtherBase(std::unique_ptr<CSGBase> base,
825 const bool ignore_identical_components,
826 const std::string & new_root_name_base,
827 const std::string & new_root_name_join)
831 if (ignore_identical_components)
832 updateIncomingCSGReferences(*base);
833 joinSurfaceList(base->getSurfaceList(), ignore_identical_components);
834 joinCellList(base->getCellList(), ignore_identical_components);
835 joinLatticeList(base->getLatticeList(), ignore_identical_components);
837 base->getUniverseList(), ignore_identical_components, new_root_name_base, new_root_name_join);
838 rebuildEngUnitList();
843CSGBase::updateIncomingCSGReferences(
CSGBase & incoming_base)
847 std::map<std::string, std::reference_wrapper<const CSGSurface>> identical_surface_refs;
849 for (
const auto & [surf_name, surf_ptr] : surf_list_map)
850 if (hasSurface(surf_name))
851 identical_surface_refs.insert({surf_name, getSurfaceByName(surf_name)});
855 std::map<std::string, std::reference_wrapper<const CSGCell>> identical_cell_refs;
856 auto & cell_list_map = incoming_base.getCellList().getCellListMap();
857 for (
const auto & [cell_name, cell_ptr] : cell_list_map)
858 if (hasCell(cell_name))
859 identical_cell_refs.insert({cell_name, getCellByName(cell_name)});
863 std::map<std::string, std::reference_wrapper<const CSGUniverse>> identical_universe_refs;
864 auto & universe_list_map = incoming_base.getUniverseList().getUniverseListMap();
865 for (
const auto & [univ_name, univ_ptr] : universe_list_map)
866 if (hasUniverse(univ_name))
867 identical_universe_refs.insert({univ_name, getUniverseByName(univ_name)});
871 std::map<std::string, std::reference_wrapper<const CSGLattice>> identical_lattice_refs;
872 auto & lattice_list_map = incoming_base.getLatticeList().getLatticeListMap();
873 for (
const auto & [lat_name, lat_ptr] : lattice_list_map)
874 if (hasLattice(lat_name))
875 identical_lattice_refs.insert({lat_name, getLatticeByName(lat_name)});
879 if (!identical_surface_refs.empty())
880 replaceSurfaceRefsByName(identical_surface_refs, incoming_base);
882 if (!identical_cell_refs.empty())
883 replaceCellRefsByName(identical_cell_refs, incoming_base);
885 if (!identical_universe_refs.empty())
886 replaceUniverseRefsByName(identical_universe_refs, incoming_base);
888 if (!identical_lattice_refs.empty())
889 replaceLatticeRefsByName(identical_lattice_refs, incoming_base);
893CSGBase::replaceSurfaceRefsByName(
894 std::map<std::string, std::reference_wrapper<const CSGSurface>> & identical_surface_refs,
899 cell_ptr->updateCellRegionSurfaces(identical_surface_refs);
903CSGBase::replaceCellRefsByName(
904 std::map<std::string, std::reference_wrapper<const CSGCell>> & identical_cell_refs,
909 for (
auto & [cell_name, cell_ref] : identical_cell_refs)
910 if (univ_ptr->hasCell(cell_name))
912 univ_ptr->removeCell(cell_name);
913 univ_ptr->addCell(cell_ref);
918CSGBase::replaceUniverseRefsByName(
919 std::map<std::string, std::reference_wrapper<const CSGUniverse>> & identical_universe_refs,
925 const auto fill_type = cell_ptr->getFillType();
926 const auto fill_name = cell_ptr->getFillName();
927 if ((fill_type ==
"UNIVERSE") &&
928 (identical_universe_refs.find(fill_name) != identical_universe_refs.end()))
930 const CSGUniverse * univ_ptr = &identical_universe_refs.at(fill_name).get();
931 cell_ptr->updateCellFill(univ_ptr);
937 for (
auto & [univ_name, univ_ref] : identical_universe_refs)
940 if (lat_ptr->hasUniverse(univ_name))
943 const auto univ_indices = lat_ptr->getUniverseIndices(univ_name);
944 for (
const auto & index : univ_indices)
945 lat_ptr->setUniverseAtIndex(univ_ref, index);
948 if ((lat_ptr->getOuterType() ==
"UNIVERSE") &&
949 (lat_ptr->getOuterUniverse().getName() == univ_name))
950 lat_ptr->updateOuter(univ_ref);
955CSGBase::replaceLatticeRefsByName(
956 std::map<std::string, std::reference_wrapper<const CSGLattice>> & identical_lattice_refs,
962 const auto fill_type = cell_ptr->getFillType();
963 const auto fill_name = cell_ptr->getFillName();
964 if ((fill_type ==
"LATTICE") &&
965 (identical_lattice_refs.find(fill_name) != identical_lattice_refs.end()))
967 const CSGLattice * lat_ptr = &identical_lattice_refs.at(fill_name).get();
968 cell_ptr->updateCellFill(lat_ptr);
974CSGBase::joinSurfaceList(
CSGSurfaceList & surf_list,
const bool ignore_identical_surfaces)
977 for (
auto & s : surf_list_map)
978 _surface_list.addSurface(std::move(s.second), ignore_identical_surfaces);
982CSGBase::joinCellList(
CSGCellList & cell_list,
const bool ignore_identical_cells)
985 for (
auto & c : cell_list_map)
986 _cell_list.addCell(std::move(c.second), ignore_identical_cells);
990CSGBase::joinLatticeList(
CSGLatticeList & lattice_list,
const bool ignore_identical_lattices)
993 for (
auto & lat : lat_list_map)
994 _lattice_list.addLattice(std::move(lat.second), ignore_identical_lattices);
998CSGBase::rebuildEngUnitList()
1004 for (
auto & [name, surf] : _surface_list.getSurfaceListMap())
1006 _eng_unit_list.addEngUnit(*eu);
1007 for (
auto & [name, cell] : _cell_list.getCellListMap())
1009 _eng_unit_list.addEngUnit(*eu);
1010 for (
auto & [name, univ] : _universe_list.getUniverseListMap())
1012 _eng_unit_list.addEngUnit(*eu);
1016CSGBase::joinUniverseList(
CSGUniverseList & univ_list,
const bool ignore_identical_universes)
1020 auto & root = getRootUniverse();
1021 for (
auto & u : univ_list_map)
1023 if (u.second->isRoot())
1026 auto all_cells = u.second->getAllCells();
1027 for (
auto & cell : all_cells)
1028 addCellToUniverse(root, cell);
1031 _universe_list.addUniverse(std::move(u.second), ignore_identical_universes);
1037 const bool ignore_identical_universes,
1038 const std::string & new_root_name_incoming)
1044 for (
auto & u : all_univs)
1046 if (u.second->isRoot())
1049 auto all_cells = u.second->getAllCells();
1050 createUniverse(new_root_name_incoming, all_cells);
1053 _universe_list.addUniverse(std::move(u.second), ignore_identical_universes);
1059 const bool ignore_identical_universes,
1060 const std::string & new_root_name_base,
1061 const std::string & new_root_name_incoming)
1066 auto & root = getRootUniverse();
1067 auto root_cells = root.getAllCells();
1068 createUniverse(new_root_name_base, root_cells);
1069 removeCellsFromUniverse(root, root_cells);
1073 for (
auto & u : all_univs)
1075 if (u.second->isRoot())
1078 auto all_cells = u.second->getAllCells();
1079 createUniverse(new_root_name_incoming, all_cells);
1082 _universe_list.addUniverse(std::move(u.second), ignore_identical_universes);
1092 if (!checkSurfaceInBase(s))
1093 mooseError(
"Region is being set with a surface named " + s.getName() +
1094 " that is different from the surface of the same name in the CSGBase instance.");
1101 auto name = surface.
getName();
1103 auto & list_surf = _surface_list.getSurface(name);
1105 return &surface == &list_surf;
1109CSGBase::checkCellInBase(
const CSGCell & cell)
const
1113 auto & list_cell = _cell_list.getCell(name);
1115 return &cell == &list_cell;
1121 auto name = universe.
getName();
1123 auto & list_univ = _universe_list.getUniverse(name);
1125 return &universe == &list_univ;
1131 auto name = lattice.
getName();
1133 auto & list_lattice = _lattice_list.getLattice(name);
1135 return &lattice == &list_lattice;
1141 const auto & name = unit.
getName();
1143 const auto & list_unit = _eng_unit_list.getEngUnit(name);
1145 return &unit == &list_unit;
1149CSGBase::renameEngUnit(
const CSGEngUnit & unit,
const std::string & name)
1155 renameSurface(*surf, name);
1156 else if (
const auto * cell =
dynamic_cast<const CSGCellEngUnit *
>(&unit))
1157 renameCell(*cell, name);
1159 renameUniverse(*univ, name);
1162 "Engineering unit '", unit.
getName(),
"' has an unrecognized type and cannot be renamed.");
1166CSGBase::renameSurface(
const CSGSurface & surface,
const std::string & name)
1170 if (surfaceToEngUnit(surface))
1171 if (_eng_unit_list.hasEngUnit(name))
1172 mooseError(
"Cannot rename surface " + surface.
getName() +
" to " + name +
". " +
1173 surface.
getName() +
" is an engineering unit and a unit with name " + name +
1174 " already exists.");
1176 _surface_list.renameSurface(surface, name);
1180CSGBase::renameCell(
const CSGCell & cell,
const std::string & name)
1184 if (cellToEngUnit(cell))
1185 if (_eng_unit_list.hasEngUnit(name))
1187 " is an engineering unit and a unit with name " + name +
" already exists.");
1189 _cell_list.renameCell(cell, name);
1193CSGBase::renameUniverse(
const CSGUniverse & universe,
const std::string & name)
1197 if (universeToEngUnit(universe))
1198 if (_eng_unit_list.hasEngUnit(name))
1199 mooseError(
"Cannot rename universe " + universe.
getName() +
" to " + name +
". " +
1200 universe.
getName() +
" is an engineering unit and a unit with name " + name +
1201 " already exists.");
1203 _universe_list.renameUniverse(universe, name);
1207CSGBase::checkUniverseLinking()
const
1209 std::set<std::string> linked_universe_names;
1210 std::set<std::string> linked_cell_names;
1211 std::set<std::string> linked_surf_names;
1214 getLinkedCSGObjects(
1215 getRootUniverse(), linked_universe_names, linked_cell_names, linked_surf_names);
1219 for (
const CSGUniverse & univ : getAllUniverses())
1220 if (linked_universe_names.find(univ.getName()) == linked_universe_names.end())
1221 mooseWarning(
"Universe with name ", univ.getName(),
" is not linked to root universe.");
1225 for (
const CSGCell & cell : getAllCells())
1226 if (linked_cell_names.find(cell.getName()) == linked_cell_names.end())
1227 mooseWarning(
"Cell with name ", cell.getName(),
" is not linked to root universe.");
1231 for (
const CSGSurface & surf : getAllSurfaces())
1232 if (linked_surf_names.find(surf.getName()) == linked_surf_names.end())
1233 mooseWarning(
"Surface with name ", surf.getName(),
" is not linked to root universe.");
1237CSGBase::checkCellUniverseMembership()
const
1241 std::map<std::string, std::set<std::string>> cell_to_universe_names;
1242 for (
const CSGUniverse & univ : getAllUniverses())
1243 for (
const CSGCell & cell : univ.getAllCells())
1244 cell_to_universe_names[cell.getName()].insert(univ.getName());
1246 for (
const auto & [cell_name, univ_names] : cell_to_universe_names)
1247 if (univ_names.size() > 1)
1250 " belongs to more than one universe (",
1251 MooseUtils::join(univ_names,
", "),
1252 "). Each cell must belong to exactly one universe.");
1256CSGBase::checkGeometry()
const
1259 checkUniverseLinking();
1261 checkCellUniverseMembership();
1265CSGBase::areCSGObjectsLinked()
const
1267 std::set<std::string> linked_univs, linked_cells, linked_surfs;
1268 getLinkedCSGObjects(getRootUniverse(), linked_univs, linked_cells, linked_surfs);
1270 for (
const CSGUniverse & univ : getAllUniverses())
1271 if (linked_univs.find(univ.getName()) == linked_univs.end())
1274 for (
const CSGCell & cell : getAllCells())
1275 if (linked_cells.find(cell.getName()) == linked_cells.end())
1278 for (
const CSGSurface & surf : getAllSurfaces())
1279 if (linked_surfs.find(surf.getName()) == linked_surfs.end())
1287 std::set<std::string> & linked_universe_names,
1288 std::set<std::string> & linked_cell_names,
1289 std::set<std::string> & linked_surface_names)
const
1292 if (!linked_universe_names.insert(univ.
getName()).second)
1294 linked_universe_names.insert(univ.
getName());
1296 for (
const CSGCell & cell : univ_cells)
1298 linked_cell_names.insert(cell.getName());
1299 for (
const CSGSurface & cell_surf : cell.getRegion().getSurfaces())
1300 linked_surface_names.insert(cell_surf.getName());
1302 if (cell.getFillType() ==
"UNIVERSE")
1303 getLinkedCSGObjects(
1304 cell.getFillUniverse(), linked_universe_names, linked_cell_names, linked_surface_names);
1305 else if (cell.getFillType() ==
"LATTICE")
1307 const auto & lattice = cell.getFillLattice();
1308 for (
const auto & univ_list : lattice.getUniverses())
1309 for (
const auto & univ_ref : univ_list)
1311 const CSGUniverse & lattice_univ = univ_ref.get();
1312 getLinkedCSGObjects(
1313 lattice_univ, linked_universe_names, linked_cell_names, linked_surface_names);
1316 if (lattice.getOuterType() ==
"UNIVERSE")
1318 const CSGUniverse & outer_univ = lattice.getOuterUniverse();
1319 getLinkedCSGObjects(
1320 outer_univ, linked_universe_names, linked_cell_names, linked_surface_names);
1329 if (!checkEngUnitInBase(unit))
1332 " cannot be deleted as it is different from the engineering unit of the same name "
1333 "in the CSGBase instance.");
1337 deleteSurface(cast_ref<const CSGSurface &>(*surf_unit));
1338 else if (
const auto * cell_unit =
dynamic_cast<const CSGCellEngUnit *
>(&unit))
1339 deleteCell(cast_ref<const CSGCell &>(*cell_unit));
1341 deleteUniverse(cast_ref<const CSGUniverse &>(*univ_unit));
1344 "Engineering unit '", unit.
getName(),
"' has an unrecognized type and cannot be deleted.");
1348CSGBase::expandAllEngUnits()
1350 std::set<std::set<std::string>> all_type_sets;
1351 expandAllEngUnitsCycle(all_type_sets);
1355CSGBase::expandAllEngUnitsCycle(std::set<std::set<std::string>> & all_type_sets)
1365 std::set<std::string> current_types;
1366 for (
const auto & u : getAllEngUnits())
1367 current_types.insert(u.get().getUnitType());
1369 if (all_type_sets.count(
1371 mooseError(
"Circular dependency detected in engineering unit expansion");
1373 all_type_sets.insert(current_types);
1377 std::vector<const CSGSurfaceEngUnit *> surfs;
1378 std::vector<const CSGCellEngUnit *> cells;
1379 std::vector<const CSGUniverseEngUnit *> univs;
1380 for (
const auto & u : getAllSurfaceEngUnits())
1381 surfs.push_back(&u.get());
1382 for (
const auto & u : getAllCellEngUnits())
1383 cells.push_back(&u.get());
1384 for (
const auto & u : getAllUniverseEngUnits())
1385 univs.push_back(&u.get());
1388 for (
const auto * s : surfs)
1390 for (
const auto * c : cells)
1392 for (
const auto * u : univs)
1397 if (!getAllEngUnits().empty())
1398 expandAllEngUnitsCycle(all_type_sets);
1407 auto & mutable_unit = cast_ref<CSGSurfaceEngUnit &>(_surface_list.getSurface(unit.
getName()));
1411 mutable_unit.expandUnit();
1415 auto unit_base = mutable_unit.getBase();
1416 if ((unit_base.getAllCells().size() > 0) || (unit_base.getAllUniverses().size() > 1))
1418 mutable_unit.getName(),
1420 mutable_unit.getUnitType(),
1421 " contains either cells or universes (beyond the root universe) after expansion, "
1422 "but should only contain surfaces.");
1425 joinOtherBase(mutable_unit.releaseBase(),
false);
1428 CSGRegion expanded_region = mutable_unit.getExpandedRegion();
1431 const auto & trans = cast_ref<const CSGSurface &>(mutable_unit).getTransformations();
1433 for (
const auto & surf_ref : expanded_region.
getSurfaces())
1435 CSGSurface & mutable_surf = _surface_list.getSurface(surf_ref.get().getName());
1436 for (
const auto & [trans_type,
values] : trans)
1441 replaceSurfaceRefsWithRegion(cast_ref<const CSGSurface &>(mutable_unit), expanded_region);
1445 deleteEngUnit(unit);
1446 return expanded_region;
1455 auto & mutable_unit = cast_ref<CSGCellEngUnit &>(_cell_list.getCell(unit.
getName()));
1459 mutable_unit.expandUnit();
1464 const CSGCell & expanded_cell = mutable_unit.getExpandedCell();
1467 joinOtherBase(mutable_unit.releaseBase(),
false);
1470 const auto & trans = cast_ref<const CSGCell &>(mutable_unit).getTransformations();
1473 CSGCell & mutable_cell = _cell_list.getCell(expanded_cell.
getName());
1474 for (
const auto & [trans_type,
values] : trans)
1480 if (getRootUniverse().hasCell(expanded_cell.
getName()))
1481 removeCellFromUniverse(getRootUniverse(), expanded_cell);
1484 replaceCellRefs(cast_ref<const CSGCell &>(mutable_unit), expanded_cell);
1487 deleteEngUnit(unit);
1488 return expanded_cell;
1494 auto unit_name = unit.
getName();
1499 auto & mutable_unit = cast_ref<CSGUniverseEngUnit &>(_universe_list.getUniverse(unit_name));
1503 mutable_unit.expandUnit();
1508 auto & pre_join_univ = mutable_unit.getExpandedUniverse();
1509 auto expanded_name = pre_join_univ.getName();
1518 auto unit_base = mutable_unit.releaseBase();
1519 if (expanded_name == getRootUniverse().getName())
1522 auto new_expanded_name = unit_name +
"_expanded_root";
1525 " has an expanded root universe named " + expanded_name +
1526 ", which is identical to the name of the current root universe. The expanded "
1527 "universe will be renamed " +
1528 new_expanded_name +
".");
1531 unit_base->renameRootUniverse(new_expanded_name);
1532 expanded_name = new_expanded_name;
1538 joinOtherBase(std::move(unit_base),
false, expanded_name);
1542 const CSGUniverse & expanded_univ = getUniverseByName(expanded_name);
1545 const auto & trans = cast_ref<const CSGUniverse &>(mutable_unit).getTransformations();
1549 for (
const auto & [trans_type,
values] : trans)
1554 replaceUniverseRefs(cast_ref<const CSGUniverse &>(mutable_unit), expanded_univ);
1557 deleteEngUnit(unit);
1558 return expanded_univ;
1565 for (
const auto & cell_ref : getAllCells())
1567 const CSGCell & cell = cell_ref.get();
1569 updateCellFill(cell, &new_univ);
1573 for (
const auto & lat_ref : getAllLattices())
1577 setLatticeOuter(lat, new_univ);
1580 for (std::size_t row = 0; row < lat_map.size(); ++row)
1581 for (std::size_t col = 0; col < lat_map[row].size(); ++col)
1582 if (lat_map[row][col].get() == old_univ)
1583 setUniverseAtLatticeIndex(lat, new_univ, {
static_cast<int>(row),
static_cast<int>(col)});
1587 if (getRootUniverse() == old_univ)
1588 _universe_list._root_universe = &new_univ;
1594 for (
const auto & univ_ref : getAllUniverses())
1598 if (&cell_ref.get() == &old_cell)
1600 removeCellFromUniverse(univ, old_cell);
1601 addCellToUniverse(univ, new_cell);
1609 for (
const auto & cell_ref : getAllCells())
1611 const CSGCell & cell = cell_ref.get();
1613 if (new_region.
getRegionType() == CSGRegion::RegionType::EMPTY)
1617 updateCellRegion(cell, new_region);
1622CSGBase::generateOutput()
const
1626 nlohmann::json csg_json;
1628 csg_json[
"surfaces"] = {};
1629 csg_json[
"cells"] = {};
1630 csg_json[
"universes"] = {};
1633 auto all_surfs = getAllSurfaces();
1636 if (surfaceToEngUnit(s))
1638 const auto & surf_name = s.getName();
1639 const auto & coeffs = s.getCoeffs();
1640 csg_json[
"surfaces"][surf_name] = {{
"type", s.getSurfaceType()}, {
"coefficients", {}}};
1641 for (
const auto & c : coeffs)
1642 csg_json[
"surfaces"][surf_name][
"coefficients"][c.first] = c.second;
1644 if (s.getTransformations().size() > 0)
1645 csg_json[
"surfaces"][surf_name][
"transformations"] = s.getTransformationsAsStrings();
1650 if (csg_json[
"surfaces"].empty())
1651 csg_json.erase(
"surfaces");
1654 auto all_cells = getAllCells();
1655 for (
const CSGCell & c : all_cells)
1657 if (cellToEngUnit(c))
1659 const auto & cell_name = c.getName();
1660 const auto & cell_region_infix = c.getRegion().toInfixJSON();
1661 const auto & cell_region_postfix = c.getRegion().toPostfixStringList();
1662 const auto & cell_filltype = c.getFillType();
1663 const auto & fill_name = c.getFillName();
1664 csg_json[
"cells"][cell_name][
"filltype"] = cell_filltype;
1665 csg_json[
"cells"][cell_name][
"region_infix"] = cell_region_infix;
1666 csg_json[
"cells"][cell_name][
"region_postfix"] = cell_region_postfix;
1667 csg_json[
"cells"][cell_name][
"fill"] = fill_name;
1669 if (c.getTransformations().size())
1670 csg_json[
"cells"][cell_name][
"transformations"] = c.getTransformationsAsStrings();
1675 if (csg_json[
"cells"].empty())
1676 csg_json.erase(
"cells");
1679 auto all_univs = getAllUniverses();
1682 if (universeToEngUnit(u))
1684 const auto & univ_name = u.getName();
1685 const auto & univ_cells = u.getAllCells();
1686 csg_json[
"universes"][univ_name][
"cells"] = {};
1687 for (
const CSGCell & c : univ_cells)
1688 csg_json[
"universes"][univ_name][
"cells"].push_back(c.getName());
1690 csg_json[
"universes"][univ_name][
"root"] = u.isRoot();
1692 if (u.getTransformations().size())
1693 csg_json[
"universes"][univ_name][
"transformations"] = u.getTransformationsAsStrings();
1697 auto all_lats = getAllLattices();
1698 if (all_lats.size())
1700 csg_json[
"lattices"] = {};
1703 const auto & lat_name = lat.getName();
1704 csg_json[
"lattices"][lat_name] = {};
1705 csg_json[
"lattices"][lat_name][
"type"] = lat.getType();
1706 const auto & outer_type = lat.getOuterType();
1707 csg_json[
"lattices"][lat_name][
"outertype"] = outer_type;
1708 if (outer_type ==
"UNIVERSE")
1709 csg_json[
"lattices"][lat_name][
"outer"] = lat.getOuterUniverse().getName();
1710 else if (outer_type ==
"CSG_MATERIAL")
1711 csg_json[
"lattices"][lat_name][
"outer"] = lat.getOuterMaterial();
1713 csg_json[
"lattices"][lat_name][
"attributes"] = {};
1714 const auto & lat_attrs = lat.getAttributes();
1715 for (
const auto & attr : lat_attrs)
1716 csg_json[
"lattices"][lat_name][
"attributes"][attr.first] = attr.second;
1718 csg_json[
"lattices"][lat_name][
"universes"] = lat.getUniverseNameMap();
1720 if (lat.getTransformations().size())
1721 csg_json[
"lattices"][lat_name][
"transformations"] = lat.getTransformationsAsStrings();
1726 auto all_units = getAllEngUnits();
1727 if (all_units.size())
1729 csg_json[
"units"] = {};
1732 const auto & unit_name = unit.getName();
1733 csg_json[
"units"][unit_name] = {};
1735 csg_json[
"units"][unit_name][
"unit_type"] = unit.getUnitType();
1736 csg_json[
"units"][unit_name][
"behavior"] = unit.getBehavior();
1738 csg_json[
"units"][unit_name][
"attributes"] = {};
1739 const auto & unit_attrs = unit.getAttributes();
1740 for (
const auto & attr : unit_attrs)
1741 csg_json[
"units"][unit_name][
"attributes"][attr.first] = attr.second;
1742 if (unit.getTransformations().size())
1743 csg_json[
"units"][unit_name][
"transformations"] = unit.getTransformationsAsStrings();
1753 const auto & surf_list = this->getSurfaceList();
1755 const auto & cell_list = this->getCellList();
1756 const auto & other_cell_list = other.
getCellList();
1757 const auto & univ_list = this->getUniverseList();
1759 const auto & lat_list = this->getLatticeList();
1761 const auto & eng_unit_list = this->getEngUnitList();
1763 return (surf_list == other_surf_list) && (cell_list == other_cell_list) &&
1764 (univ_list == other_univ_list) && (lat_list == other_lat_list) &&
1765 (eng_unit_list == other_eng_unit_list);
1771 return !(*
this == other);
void mooseInfoRepeated(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
std::array< Real, 2 > values
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model.
const CSGSurfaceList & getSurfaceList() const
Get a const reference to the CSGSurfaceList object.
const CSGCell & addCellToList(const CSGCell &cell)
Add a new cell to the cell list based on a cell reference.
const CSGCellList & getCellList() const
Get a const reference to the CSGCellList object.
CSGCellList _cell_list
List of cells associated with CSG object.
std::unique_ptr< CSGBase > clone() const
Create a deep copy of this CSGBase instance.
const CSGLattice & addLatticeToList(const CSGLattice &lattice)
Add a new lattice to the lattice list based on a lattice reference.
const CSGUniverse & addUniverseToList(const CSGUniverse &univ)
Add a new universe to the universe list based on a universe reference.
std::vector< std::reference_wrapper< const CSGUniverseEngUnit > > getAllUniverseEngUnits() const
Get all universe-like engineering units.
const CSGUniverseList & getUniverseList() const
Get a const reference to the CSGUniverseList object.
void rebuildEngUnitList()
rebuilds the list of raw pointers to engineering units by iterating through the surface,...
const CSGLatticeList & getLatticeList() const
Get a const reference to the CSGLatticeList object.
const CSGEngUnitList & getEngUnitList() const
Get a const reference to the CSGEngUnitList object.
const CSGUniverse & getRootUniverse() const
Get the Root Universe object.
const CSGUniverseEngUnit * universeToEngUnit(const CSGUniverse &univ) const
Returns the CSGUniverseEngUnit pointer if univ is an eng unit, nullptr otherwise.
std::vector< std::reference_wrapper< const CSGCellEngUnit > > getAllCellEngUnits() const
Get all cell-like engineering units in CSGBase.
void addCellToUniverse(const CSGUniverse &universe, const CSGCell &cell)
Add a cell to an existing universe.
const T & addEngUnit(std::unique_ptr< T > unit, const CSGUniverse *add_to_univ=nullptr)
Add an engineering unit (surface-, cell-, or universe-like object) to this CSGBase.
CSGBase()
Default constructor.
const CSGCellEngUnit * cellToEngUnit(const CSGCell &cell) const
Returns the CSGCellEngUnit pointer if cell is an eng unit, nullptr otherwise.
CSGCellEngUnit is an abstract base class for "engineering units" that are cell-like.
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGCell::getName())
CSGCellList creates a container for CSGCell objects to pass to CSGBase object.
std::unordered_map< std::string, std::unique_ptr< CSGCell > > & getCellListMap()
Get non-const map of all names to cells in cell list.
CSGCell & getCell(const std::string &name) const
Get the CSGCell by name.
CSGCell & addCell(std::unique_ptr< CSGCell > cell, const bool ignore_identical_cell=false)
add a cell to the CellList.
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell,...
const CSGRegion & getRegion() const
Get the cell region.
const std::string & getName() const
Get the cell name.
const CSGLattice & getFillLattice() const
Get the cell fill if fill type is LATTICE.
const std::string getFillType() const
Get the type of fill for the cell.
const CSGUniverse & getFillUniverse() const
Get the cell fill if fill type is UNIVERSE.
const std::string & getFillMaterial() const
Get the cell fill material name if fill fype is CSG_MATERIAL.
CSGEngUnitList is a non-owning index of CSGEngUnit objects stored in the type lists (CSGSurfaceList,...
CSGEngUnit is the abstract base class for all "engineering unit" types in the CSG system.
virtual const std::string & getName() const =0
Get the unique instance name of this engineering unit.
CSGLatticeList creates a container for CSGLattice objects to pass to CSGBase.
std::unordered_map< std::string, std::unique_ptr< CSGLattice > > & getLatticeListMap()
Get map of all names to lattices in lattice list.
CSGLattice is the abstract class for defining lattices.
std::vector< std::vector< std::reference_wrapper< const CSGUniverse > > > getUniverses() const
Get the arrangement of CSGUniverses in the lattice.
virtual std::unique_ptr< CSGLattice > clone() const =0
const std::string & getName() const
Get the name of lattice.
const std::string getOuterType() const
Get the type of outer that fills the space around the lattice elements.
const CSGUniverse & getOuterUniverse() const
Get the outer universe if outer type is UNIVERSE.
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection,...
RegionType getRegionType() const
Get the region type.
void replaceWithSubRegion(const CSGSurface &old_surf, const CSGRegion &sub_region)
Replace all occurrences of old_surf in this region's postfix token stream with the tokens of sub_regi...
std::vector< std::reference_wrapper< const CSGSurface > > getSurfaces() const
Get the list of surfaces associated with the region.
CSGSurfaceEngUnit is an abstract base class for "engineering units" that can be used as surfaces in c...
const std::string & getName() const override
Satisfy CSGEngUnit::getName() – resolved via CSGSurface::getName()
CSGSurfaceList is a container for storing CSGSurface objects in the CSGBase object.
std::unordered_map< std::string, std::unique_ptr< CSGSurface > > & getSurfaceListMap()
Get non-const map of all names to surfaces in surface list.
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface,...
const std::string & getName() const
Get the name of surface.
CSGUniverseEngUnit is an abstract base class for "engineering units" that are universe-like.
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGUniverse::getName())
CSGUniverseList creates a container for CSGUniverse objects to pass to CSGBase.
std::unordered_map< std::string, std::unique_ptr< CSGUniverse > > & getUniverseListMap()
Get non-const map of all names to universes in universe list.
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe,...
const std::string & getName() const
Get the name of the universe.
const std::vector< std::reference_wrapper< const CSGCell > > & getAllCells() const
Get list of the all cells in the universe.
std::variant< std::reference_wrapper< const CSGSurface >, std::reference_wrapper< const CSGCell >, std::reference_wrapper< const CSGUniverse >, std::reference_wrapper< const CSGRegion >, std::reference_wrapper< const CSGLattice >, std::reference_wrapper< const CSGEngUnit > > CSGObjectVariant
Define a variant type that can hold references to different CSG object types.
TransformationType
Enumeration of transformation types that can be applied to CSG objects.
RotationAxisType
Enumeration of axis types for rotations.