NekUpload.validate.files module
- class NekUpload.validate.files.NekGeometryFile(geometry_path: str)[source]
Bases:
object- get_composite_edge_info() dict[int, CompositeDefinition][source]
Get dictionary of composite information, mapping composite id to its string definition, as per Nektar++ definition. Only returns edge information.
- Returns:
COMPOSITE ID -> DEFINITION OF COMPOSITE (ONLY EDGES)
- Return type:
dict[int,CompositeDefinition]
- get_composite_face_info() dict[int, CompositeDefinition][source]
Get dictionary of composite information, mapping composite id to its string definition, as per Nektar++ definition. Only returns face information.
- Returns:
COMPOSITE ID -> DEFINITION OF COMPOSITE (ONLY FACES)
- Return type:
dict[int,CompositeDefinition]
- get_composite_info() dict[int, CompositeDefinition][source]
Get dictionary of composite information, mapping composite id to its string definition, as per Nektar++ definition
- Returns:
COMPOSITE ID -> DEFINITION OF COMPOSITE
- Return type:
dict[int,CompositeDefinition]
- class NekUpload.validate.files.NekSessionFile(session_path: str)[source]
Bases:
object- BASIS_TYPE = {'Chebyshev': BasisType.CHEBYSHEV, 'Fourier': BasisType.FOURIER, 'Fourier_Half_Mode_Im': BasisType.FOURIER_HALF_MODE_IM, 'Fourier_Half_Mode_Re': BasisType.FOURIER_HALF_MODE_RE, 'Fourier_Single_Mode': BasisType.FOURIER_SINGLE_MODE, 'GLL_Lagrange': BasisType.GLL_LAGRANGE, 'Gauss_Lagrange': BasisType.GAUSS_LAGRANGE, 'Legendre': BasisType.LEGENDRE, 'Modified_A': BasisType.MODIFIED_A, 'Modified_B': BasisType.MODIFIED_B, 'Modified_C': BasisType.MODIFIED_C, 'Modified_Pyr_C': BasisType.MODIFIED_PYR_C, 'Monomial': BasisType.MONONMIAL, 'Ortho_A': BasisType.ORTHO_A, 'Ortho_B': BasisType.ORTHO_B, 'Ortho_C': BasisType.ORTHO_C, 'Ortho_Pyr_C': BasisType.ORTHO_PYR_C}
- INTEGRATION_POINTS_TYPE = {'BoundaryLayerPoints': IntegrationPoint.BOUNDARY_LAYER_POINTS, 'BoundaryLayerPointsRev': IntegrationPoint.BOUNDARY_LAYER_POINTS_REV, 'FourierEvenlySpaced': IntegrationPoint.FOURIER_EVENLY_SPACED, 'FourierSingleModeSpaced': IntegrationPoint.FOURIER_SINGLE_MODE_SPACED, 'GaussGaussChebyshev': IntegrationPoint.GAUSS_GAUSS_CHEBYSHEV, 'GaussGaussLegendre': IntegrationPoint.GAUSS_GAUSS_LEGENDRE, 'GaussKronrodLegendre': IntegrationPoint.GAUSS_KRONROD_LEGENDRE, 'GaussLobattoChebyshev': IntegrationPoint.GAUSS_LOBATTO_CHEBYSHEV, 'GaussLobattoKronrodLegendre': IntegrationPoint.GAUSS_LOBATTO_KRONROD_LEGENDRE, 'GaussLobattoLegendre': IntegrationPoint.GAUSS_LOBATTO_LEGENDRE, 'GaussRadauKronrodMAlpha1Beta0': IntegrationPoint.GAUSS_RADAU_KRONROD_M_ALPHA1_BETA0, 'GaussRadauKronrodMLegendre': IntegrationPoint.GAUSS_RADAU_KRONROD_M_LEGENDRE, 'GaussRadauMAlpha0Beta1': IntegrationPoint.GAUSS_RADAU_M_ALPHA0_BETA1, 'GaussRadauMAlpha0Beta2': IntegrationPoint.GAUSS_RADAU_M_ALPHA0_BETA2, 'GaussRadauMAlpha1Beta0': IntegrationPoint.GAUSS_RADAU_M_ALPHA1_BETA0, 'GaussRadauMAlpha2Beta0': IntegrationPoint.GAUSS_RADAU_M_ALPHA2_BETA0, 'GaussRadauMChebyshev': IntegrationPoint.GAUSS_RADAU_M_CHEBYSHEV, 'GaussRadauMLegendre': IntegrationPoint.GAUSS_RADAU_M_LEGENDRE, 'GaussRadauPChebyshev': IntegrationPoint.GAUSS_RADAU_P_CHEBYSHEV, 'GaussRadauPLegendre': IntegrationPoint.GAUSS_RADAU_P_LEGENDRE, 'NodalHexElec': IntegrationPoint.NODAL_HEX_ELEC, 'NodalPrismElec': IntegrationPoint.NODAL_PRISM_ELEC, 'NodalPrismEvenlySpaced': IntegrationPoint.NODAL_PRISM_EVENLY_SPACED, 'NodalPrismSPI': IntegrationPoint.NODAL_PRISM_SPI, 'NodalQuadElec': IntegrationPoint.NODAL_QUAD_ELEC, 'NodalTetElec': IntegrationPoint.NODAL_TET_ELEC, 'NodalTetEvenlySpaced': IntegrationPoint.NODAL_TET_EVENLY_SPACED, 'NodalTetSPI': IntegrationPoint.NODAL_TET_SPI, 'NodalTriElec': IntegrationPoint.NODAL_TRI_ELEC, 'NodalTriEvenlySpaced': IntegrationPoint.NODAL_TRI_EVENLY_SPACED, 'NodalTriFekete': IntegrationPoint.NODAL_TRI_FEKETE, 'NodalTriSPI': IntegrationPoint.NODAL_TRI_SPI, 'PolyEvenlySpaced': IntegrationPoint.POLY_EVENLY_SPACED, 'SizePointsType': IntegrationPoint.SIZE_POINTS_TYPE}
- get_all_boundary_condition_files() list[str][source]
Get all filenames referenced by the BOUNDARYCONDITIONS
- Returns:
List of file names
- Return type:
list[str]
- get_all_defined_boundary_regions() dict[int, CompositeDefinition][source]
Gets all the defined boundary regions defined in session file. If these boundary regions are not defined in boundary conditions, raise an error. Otherwise, return a mapping from the session region reference id -> composite definition.
- Raises:
SessionFileException – Regions are referenced, but no boundary condition is imposed
- Returns:
REGION REFERENCE ID -> COMPOSITE IDS
- Return type:
dict[int,CompositeDefinition]
- get_all_function_files() list[str][source]
Get all filenames referenced by all stated CONDITIONS/FUNCTION
- Returns:
List of file names
- Return type:
list[str]
- get_expansions(geometry_file: str) dict[int, list[ExpansionDefinition]][source]
Get expansion list from expansion definitions. Extracts composite info from geometry file, and uses it to generate expansion informaiton.
- Parameters:
geometry_file (str) – Geometry nekg HDF5 file
- Returns:
Mapping of composite ID -> list of expansion definitions with this id
- Return type:
dict[int,list[nd_exp.ExpansionDefinition]]
- get_filters(filter_type: str = None, exclude_chkpoints: bool = False) list[NekFilter][source]
Get list of available filters from file. Note that currently supports only AEROFORCE and CHECKPOINT and History. Ignores all other filters. #TODO Implement all other filters.
- Params:
filter_type(str): Optional, if only want a specific filter type #TODO could make this an enum exclude_chkpoints(bool): If True, excludes checkpoint files from list of filters
- Returns:
List of available filters
- Return type:
list[NekFilter]
- get_geometry_info() tuple[int, int, str][source]
Return all info in the GEOMETRY tag of the session file
- Returns:
Max dimension of elements, max dimension of the space, hdf5 geometry file name to be used
- Return type:
tuple[int,int,str]
- get_homogeneous_modes() tuple[int, int][source]
Get number of homogenous modes. If none exist, returns unity. Else, returns modes in y direction, and modes in z direction
- Returns:
_description_
- Return type:
tuple[int,int]
- get_homogeneous_property() str | None[source]
Get HOMOGENEOUS property. If not specified, return None.
- Returns:
_description_
- Return type:
str | None
- get_parameters() dict[str, int | float][source]
Parse and evaluate all <P> param = value </P> found under NEKTAR/CONDITIONS/PARAMETERS
- Returns:
Parameter name -> numeric value
- Return type:
dict[str,int|float]
- get_refinements() dict[int, Refinements][source]
- get_solver() SolverType | None[source]
- NekUpload.validate.files.ensure_composite_format(text: str) str[source]
Ensure any […] are converted to C[…]. This is to accouint for the fact that in BOUNDARYREGIONS in session file, both […] and C[…] and be used to define composite ids
- Parameters:
text (str) – _description_
- Returns:
_description_
- Return type:
str