pycfast.parsers.CFASTParser#
- class pycfast.parsers.CFASTParser[source]#
Parser for CFAST input files (.in format).
This class can read CFAST input files and convert them back to CFASTModel objects with all the component classes properly instantiated. The parser handles various CFAST namelist blocks including simulation environment, materials, compartments, vents, fires, and devices.
- Parameters:
simulation_environment (SimulationEnvironment) – object containing simulation settings.
material_properties (List[Material]) – List of Material objects.
compartments (List[Compartment]) – List of Compartment objects.
wall_vents (List[WallVent]) – List of WallVent objects.
ceiling_floor_vents (List[CeilingFloorVent]) – List of CeilingFloorVent objects.
mechanical_vents (List[MechanicalVent]) – List of MechanicalVent objects.
fires (List[Fire]) – List of Fire objects.
devices (List[Device]) – List of Device objects.
surface_connections (List[SurfaceConnection]) – List of SurfaceConnection objects.
- parse_file(file_path, output_path=None)[source]#
Parse a CFAST input file and return a CFASTModel object.
Reads and parses a CFAST input file (.in format), extracting all namelist blocks and converting them to appropriate PyCFAST component objects.
- Parameters:
- Returns:
CFASTModel object with all components parsed from the file, including: - Simulation environment settings - Material properties - Compartment definitions - Vent configurations - Fire definitions - Device specifications
- Return type:
- Raises:
FileNotFoundError: – If the input file doesn’t exist at the specified path.
ValueError: – If the file format is invalid or required parameters are missing.