FELiCS.Parameters.config#
Module Contents#
Classes#
Attributes#
- FELiCS.Parameters.config.logger#
- class FELiCS.Parameters.config.dotdict#
Bases:
dictAdds possibility to use dot notation to access entries of dictionary dict also works for nested dictionaries
- Parameters:
dict (
dictionary) – the dictionary which is going to become a dot-dictionary
- class FELiCS.Parameters.config.config#
Bases:
abc.ABCAbstract 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
- Parameters:
None
- getAllSettingsDict()#
Return the settings dictionary for the config object.
- Returns:
Dictionary of input parameters structured in subcategories.
- Return type:
dict
- parse_complex_list(data)#
Convert a list of mixed strings and floats into complex numbers.
- Parameters:
data (
list) – List containing strings, ints, or floats representing complex numbers.- Returns:
List of complex numbers.
- Return type:
listofcomplex
- calculate_parameters()#
Calculate and set derived parameters based on current configuration.
- check_for_mandatory_files(config_dict, mandatory_files)#
Check that all mandatory files exist in the configuration.
- Parameters:
config_dict (
dict) – Configuration dictionary.mandatory_files (
listofstr) – List of required file keys in the format ‘Category_Field’.
- Raises:
Exception – If any mandatory file is missing.
- 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().
- Parameters:
configFilePath (
str) – Path to the .json file containing parameters.
- 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.
- Parameters:
h5FileName (
str) – Path to the HDF5 file containing parameters.- Return type:
Noneorupdates internal configuration attributes.
- export(filestring)#
Export the current configuration parameters to a file.
- Parameters:
filestring (
str) – Path of the parameter file to export to. Supports .h5 and text files.
Notes
This function is currently not fully working for all export types.
- readDomainData(MeshFile, gDim, ExtendedTransportedQuantityList, coordinateSystem, m)#
Read all domain data from the mesh file and update mesh-related attributes.
- Parameters:
MeshFile (
str) – Path to the mesh file.gDim (
int) – Geometric dimension of the mesh.ExtendedTransportedQuantityList (
list) – List of transported quantities including velocity components.coordinateSystem (
str) – Coordinate system type (e.g., ‘Cartesian’, ‘Cylindrical’).m (
int) – Azimuthal wavenumber or mode.
- getMesh()#
Return the mesh object associated with the configuration.
- Returns:
The mesh object.
- Return type:
FELiCSMesh
- getInternalVelocityComponents()#
Get a list of velocity components directed within the mesh dimensions.
- Returns:
List of internal velocity component labels (e.g., [‘x’, ‘y’, ‘z’]).
- Return type:
listofstr
- getExternalVelocityComponents()#
Get a list of velocity components directed outside the mesh dimensions.
- Returns:
List of external velocity component labels (e.g., [‘z’], [‘t’], or []).
- Return type:
listofstr
- getVelocityComponents()#
Get a list of all velocity components, both internal and external.
- Returns:
List of all velocity component labels.
- Return type:
listofstr
- getTransportedQuantityList()#
Get a list of all transported quantities for the current case settings.
- Returns:
List of transported quantity variable names.
- Return type:
listofstr
- getEquationList()#
Get the list of equations with both defined equation and variable.
- Returns:
List of (equation_name, equation_dict) tuples for active equations.
- Return type:
listoftuple
- getStateVectorVariables(EquationList)#
Get the list of state vector variables and their components.
- Parameters:
EquationList (
list) – List of (equation_name, equation_dict) tuples.- Returns:
List of (variable, components) tuples.
- Return type:
listoftuple
- getExtendedTransportedQuantityList()#
Get a list of all transported quantities, including all velocity components.
- Returns:
List of transported quantities with velocity components expanded.
- Return type:
listofstr
- getMeanFlowFieldNames()#
Get the list of mean flow field names required for input.
- Returns:
List of mean field variable names to be read from file.
- Return type:
listofstr
- getNVelocityComponents()#
Get the number of velocity components for the current configuration.
- Returns:
Number of velocity components.
- Return type:
int