:py:mod:`FELiCS.Parameters.config` ================================== .. py:module:: FELiCS.Parameters.config Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: FELiCS.Parameters.config.dotdict FELiCS.Parameters.config.config Attributes ~~~~~~~~~~ .. autoapisummary:: FELiCS.Parameters.config.logger .. py:data:: logger .. py:class:: dotdict Bases: :py:obj:`dict` Adds possibility to use dot notation to access entries of dictionary dict also works for nested dictionaries :param dict: the dictionary which is going to become a dot-dictionary :type dict: :py:class:`dictionary` .. py:class:: config Bases: :py:obj:`abc.ABC` Abstract base class for FELiCS configuration management. Handles loading, parsing, and exporting simulation parameters from JSON and HDF5 files, manages default settings, and provides utility methods for parameter access and validation. **Initialize the config object** :param None: .. py:method:: getAllSettingsDict() Return the settings dictionary for the config object. :returns: Dictionary of input parameters structured in subcategories. :rtype: :py:class:`dict` .. py:method:: parse_complex_list(data) Convert a list of mixed strings and floats into complex numbers. :param data: List containing strings, ints, or floats representing complex numbers. :type data: :py:class:`list` :returns: List of complex numbers. :rtype: :py:class:`list` of :py:class:`complex` .. py:method:: calculate_parameters() Calculate and set derived parameters based on current configuration. .. py:method:: check_for_mandatory_files(config_dict, mandatory_files) Check that all mandatory files exist in the configuration. :param config_dict: Configuration dictionary. :type config_dict: :py:class:`dict` :param mandatory_files: List of required file keys in the format 'Category_Field'. :type mandatory_files: :py:class:`list` of :py:class:`str` :raises Exception: If any mandatory file is missing. .. py:method:: importFromFile(configFilePath) Import parameters from a .json file and update configuration. If a parameter is not found in the .json file, the default is used. This method also calls check_for_mandatory_files() and calculate_parameters(). :param configFilePath: Path to the .json file containing parameters. :type configFilePath: :py:class:`str` .. py:method:: importFromH5File(h5FileName) Import parameters from an HDF5 file. This function is not used in the current version of FELiCS. It used to be called when reading 'meanflow.h5' instead of a .fel file, in which case it would overwrite the parameters. :param h5FileName: Path to the HDF5 file containing parameters. :type h5FileName: :py:class:`str` :rtype: :py:obj:`None` or :py:class:`updates internal configuration attributes.` .. py:method:: export(filestring) Export the current configuration parameters to a file. :param filestring: Path of the parameter file to export to. Supports .h5 and text files. :type filestring: :py:class:`str` .. admonition:: Notes This function is currently not fully working for all export types. .. py:method:: readDomainData(MeshFile, gDim, ExtendedTransportedQuantityList, coordinateSystem, m) Read all domain data from the mesh file and update mesh-related attributes. :param MeshFile: Path to the mesh file. :type MeshFile: :py:class:`str` :param gDim: Geometric dimension of the mesh. :type gDim: :py:class:`int` :param ExtendedTransportedQuantityList: List of transported quantities including velocity components. :type ExtendedTransportedQuantityList: :py:class:`list` :param coordinateSystem: Coordinate system type (e.g., 'Cartesian', 'Cylindrical'). :type coordinateSystem: :py:class:`str` :param m: Azimuthal wavenumber or mode. :type m: :py:class:`int` .. py:method:: getMesh() Return the mesh object associated with the configuration. :returns: The mesh object. :rtype: :py:class:`FELiCSMesh` .. py:method:: getInternalVelocityComponents() Get a list of velocity components directed within the mesh dimensions. :returns: List of internal velocity component labels (e.g., ['x', 'y', 'z']). :rtype: :py:class:`list` of :py:class:`str` .. py:method:: getExternalVelocityComponents() Get a list of velocity components directed outside the mesh dimensions. :returns: List of external velocity component labels (e.g., ['z'], ['t'], or []). :rtype: :py:class:`list` of :py:class:`str` .. py:method:: getVelocityComponents() Get a list of all velocity components, both internal and external. :returns: List of all velocity component labels. :rtype: :py:class:`list` of :py:class:`str` .. py:method:: getTransportedQuantityList() Get a list of all transported quantities for the current case settings. :returns: List of transported quantity variable names. :rtype: :py:class:`list` of :py:class:`str` .. py:method:: getEquationList() Get the list of equations with both defined equation and variable. :returns: List of (equation_name, equation_dict) tuples for active equations. :rtype: :py:class:`list` of :py:class:`tuple` .. py:method:: getStateVectorVariables(EquationList) Get the list of state vector variables and their components. :param EquationList: List of (equation_name, equation_dict) tuples. :type EquationList: :py:class:`list` :returns: List of (variable, components) tuples. :rtype: :py:class:`list` of :py:class:`tuple` .. py:method:: getExtendedTransportedQuantityList() Get a list of all transported quantities, including all velocity components. :returns: List of transported quantities with velocity components expanded. :rtype: :py:class:`list` of :py:class:`str` .. py:method:: getMeanFlowFieldNames() Get the list of mean flow field names required for input. :returns: List of mean field variable names to be read from file. :rtype: :py:class:`list` of :py:class:`str` .. py:method:: getNVelocityComponents() Get the number of velocity components for the current configuration. :returns: Number of velocity components. :rtype: :py:class:`int`