@@ -425,24 +425,26 @@ CLSCell::CLSCell()
425425}
426426
427427CLSCell::CLSCell (pugi::xml_node cell_node)
428- : CSGCell(cell_node) // Initialize base Cell properties (id, material, etc.)
429- { geom_type () = GeometryType::CLS;
430- // --- Parse CLS-Specific Parameters ---
431- auto dispersion_node = cell_node. child ( " dispersion " );
432-
433- // Boolean flag to enable/disable CLS for this cell
434- bool is_dispersed = dispersion_node. attribute ( " enable" ). as_bool ( false );
435-
436- // Particle parameters (conditional parsing)
437- if (is_dispersed) {
438- particle_radius_ = dispersion_node. attribute ( " particle_radius " ). as_double ();
439- fill_ratio_ = dispersion_node.attribute (" fill_ratio " ).as_double ();
440-
441- validate_parameters (); // Ensure 0 < fill_ratio < 1 and radius > 0
442- }
428+ : CSGCell(cell_node) // Initialize base Cell properties (id, material, etc.)
429+ {
430+ geom_type () = GeometryType:: CLS;
431+ // --- Parse CLS-Specific Parameters ---
432+ auto dispersion_node = cell_node. child ( " dispersion " );
433+
434+ // Boolean flag to enable/disable CLS for this cell
435+ bool is_dispersed = dispersion_node. attribute ( " enable " ). as_bool ( false );
436+
437+ // Particle parameters (conditional parsing)
438+ if (is_dispersed) {
439+ particle_radius_ = dispersion_node.attribute (" particle_radius " ).as_double ();
440+ fill_ratio_ = dispersion_node. attribute ( " fill_ratio " ). as_double ();
441+
442+ validate_parameters (); // Ensure 0 < fill_ratio < 1 and radius > 0
443443 }
444+ }
444445
445- void CLSCell::validate_parameters () const {
446+ void CLSCell::validate_parameters () const
447+ {
446448 // Check that fill_ratio is between 0 and 1
447449 if (fill_ratio_ <= 0 || fill_ratio_ >= 1 ) {
448450 throw std::runtime_error (" CLSCell: fill_ratio must be beteween (0, 1)" );
@@ -452,20 +454,12 @@ void CLSCell::validate_parameters() const {
452454 throw std::runtime_error (" CLSCell: particle_radius must be positive" );
453455 }
454456 // Check that the cell is filled with a sphere universe
455- if (type_!= Fill::UNIVERSE){
456- throw std::runtime_error (" CLSCell: cell must be filled with a sphere universe" );
457+ if (type_ != Fill::UNIVERSE) {
458+ throw std::runtime_error (
459+ " CLSCell: cell must be filled with a sphere universe" );
457460 }
458461}
459462
460-
461-
462-
463-
464-
465-
466-
467-
468-
469463// ==============================================================================
470464// Region implementation
471465// ==============================================================================
@@ -1034,12 +1028,11 @@ void read_cells(pugi::xml_node node)
10341028 bool is_dispersed = dispersion_node;
10351029
10361030 if (is_dispersed) {
1037- auto cell= make_unique<CLSCell>(cell_node);
1031+ auto cell = make_unique<CLSCell>(cell_node);
10381032 model::cells.push_back (std::move (cell));
10391033 } else {
10401034 model::cells.push_back (make_unique<CSGCell>(cell_node));
10411035 }
1042-
10431036 }
10441037
10451038 // Fill the cell map.
0 commit comments