Skip to content
Snippets Groups Projects
Commit 367f3769 authored by Stephen Liu's avatar Stephen Liu
Browse files

Assert warning and skip output check if refinements are present

parent f5bb8515
No related branches found
No related tags found
No related merge requests found
Pipeline #10189 passed
......@@ -399,7 +399,8 @@ class ValidateSession:
f.get_expansions(geometry_file)
return True
#TODO Refactor, quite ugly atm
def check_consistent_output_shape(self,geometry_file:str,output_file:str,solver:SolverType) -> bool:
with NekSessionFile(self.file_path) as f:
composite_id_to_expansion: dict[int,list[ExpansionDefinition]] = f.get_expansions(geometry_file)
......@@ -408,7 +409,6 @@ class ValidateSession:
is_movement_exist: bool = f.is_movement()
homogeneous_property: str = f.get_homogeneous_property()
hom_y_modes,hom_z_modes = f.get_homogeneous_modes()
print(homogeneous_property)
homogeneous_coeffs_multiplier: int = 1
#different flavours of the same thing, as specified in nektar/FieldUtils/Fields
if (homogeneous_property == "1D" or homogeneous_property == "HOMOGENEOUS1D"
......@@ -419,8 +419,11 @@ class ValidateSession:
or homogeneous_property == "Homogeneous2D" or homogeneous_property == "Homo2D"):
homogeneous_coeffs_multiplier *= (hom_z_modes * hom_y_modes)
dim = 3#recast as quasi-3D
print(homogeneous_coeffs_multiplier)
if f.get_refinements():
warn_with_logging((f"You have refinements in this file. Skipping output shape check as this "
"has not yet been implemented. "))
return True
with NekGeometryFile(geometry_file) as f:
composite_list: dict[int,CompositeDefinition] = f.get_composite_info()
......@@ -446,7 +449,6 @@ class ValidateSession:
if is_movement_exist:
num_fields += len(["gridVx","gridVy","gridVz"])
num_unkown_coefficients += max_num_coeffs * composite.count * num_fields * homogeneous_coeffs_multiplier
print(max_num_coeffs,composite.count,num_fields,num_unkown_coefficients,homogeneous_coeffs_multiplier)
with NekOutputFile(output_file) as f:
total_coeffs:int = f.get_total_coefficients() #this should be 1D
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment