Skip to content

Commit

Permalink
Fix loading flux
Browse files Browse the repository at this point in the history
  • Loading branch information
schmoelder committed Mar 29, 2024
1 parent ad7e130 commit ba630e0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
11 changes: 10 additions & 1 deletion cadet/cadet_dll.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,16 @@ def _process_data(
# Example: Outlet [nTime, nPort, nComp]
# Bulk [nTime, nAxialCells, nRadialCells, nComp] if 2D model
# Bulk [nTime, nAxialCells, nComp] if 1D model
dimensions = ['nTime', 'nPort', 'nAxialCells', 'nRadialCells', 'nParShells', 'nComp', 'nBound']
dimensions = [
'nTime',
'nPort',
'nAxialCells',
'nRadialCells',
'nParTypes',
'nParShells',
'nComp',
'nBound',
]
for dim in dimensions:
if dim in call_outputs and call_outputs[dim].value:
shape.append(call_outputs[dim].value)
Expand Down
32 changes: 16 additions & 16 deletions tests/test_dll.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,13 @@ def __repr__(self):
'last_state_y': (404,),
'last_state_ydot': (404,),
'soldot_bulk': (1501, 10, 4),
'soldot_flux': (1501, 1, 10, 4),
'soldot_flux': (1501, 10, 1, 4),
'soldot_inlet': (1501, 4),
'soldot_outlet': (1501, 4),
'soldot_particle': (1501, 10, 4, 4),
'soldot_solid': (1501, 10, 4, 4),
'solution_bulk': (1501, 10, 4),
'solution_flux': (1501, 1, 10, 4),
'solution_flux': (1501, 10, 1, 4),
'solution_inlet': (1501, 4),
'solution_outlet': (1501, 4),
'solution_particle': (1501, 10, 4, 4),
Expand Down Expand Up @@ -402,7 +402,7 @@ def __repr__(self):
'last_state_y': (404,),
'last_state_ydot': (404,),
'soldot_bulk': (1501, 10, 4),
'soldot_flux': (1501, 1, 10, 4),
'soldot_flux': (1501, 10, 1, 4),
'soldot_inlet_port_000_comp_000': (1501,),
'soldot_inlet_port_000_comp_001': (1501,),
'soldot_inlet_port_000_comp_002': (1501,),
Expand All @@ -414,7 +414,7 @@ def __repr__(self):
'soldot_particle': (1501, 10, 4, 4),
'soldot_solid': (1501, 10, 4, 4),
'solution_bulk': (1501, 10, 4),
'solution_flux': (1501, 1, 10, 4),
'solution_flux': (1501, 10, 1, 4),
'solution_inlet_port_000_comp_000': (1501,),
'solution_inlet_port_000_comp_001': (1501,),
'solution_inlet_port_000_comp_002': (1501,),
Expand Down Expand Up @@ -466,13 +466,13 @@ def __repr__(self):
'last_state_y': (404,),
'last_state_ydot': (404,),
'soldot_bulk': (1501, 10, 4),
'soldot_flux': (1501, 1, 10, 4),
'soldot_flux': (1501, 10, 1, 4),
'soldot_inlet': (1501, 4),
'soldot_outlet': (1501, 4),
'soldot_particle': (1501, 10, 4, 4),
'soldot_solid': (1501, 10, 4, 4),
'solution_bulk': (1501, 10, 4),
'solution_flux': (1501, 1, 10, 4),
'solution_flux': (1501, 10, 1, 4),
'solution_inlet': (1501, 4),
'solution_outlet': (1501, 4),
'solution_particle': (1501, 10, 4, 4),
Expand All @@ -488,13 +488,13 @@ def __repr__(self):
},
'sens_param_000_unit_000': {
'sensdot_bulk': (1501, 10, 4),
'sensdot_flux': (1501, 1, 10, 4),
'sensdot_flux': (1501, 10, 1, 4),
'sensdot_inlet': (1501, 4),
'sensdot_outlet': (1501, 4),
'sensdot_particle': (1501, 10, 4, 4),
'sensdot_solid': (1501, 10, 4, 4),
'sens_bulk': (1501, 10, 4),
'sens_flux': (1501, 1, 10, 4),
'sens_flux': (1501, 10, 1, 4),
'sens_inlet': (1501, 4),
'sens_outlet': (1501, 4),
'sens_particle': (1501, 10, 4, 4),
Expand Down Expand Up @@ -527,15 +527,15 @@ def __repr__(self):
'last_state_y': (764,),
'last_state_ydot': (764,),
'soldot_bulk': (1501, 10, 4),
'soldot_flux': (1501, 2, 10, 4),
'soldot_flux': (1501, 10, 2, 4),
'soldot_inlet': (1501, 4),
'soldot_outlet': (1501, 4),
'soldot_particle_partype_000': (1501, 10, 4, 4),
'soldot_particle_partype_001': (1501, 10, 4, 4),
'soldot_solid_partype_000': (1501, 10, 4, 4),
'soldot_solid_partype_001': (1501, 10, 4, 4),
'solution_bulk': (1501, 10, 4),
'solution_flux': (1501, 2, 10, 4),
'solution_flux': (1501, 10, 2, 4),
'solution_inlet': (1501, 4),
'solution_outlet': (1501, 4),
'solution_particle_partype_000': (1501, 10, 4, 4),
Expand Down Expand Up @@ -571,13 +571,13 @@ def __repr__(self):
'last_state_y': (1212,),
'last_state_ydot': (1212,),
'soldot_bulk': (1501, 10, 3, 4),
'soldot_flux': (1501, 1, 10, 3, 4),
'soldot_flux': (1501, 10, 3, 1, 4),
'soldot_inlet': (1501, 3, 4),
'soldot_outlet': (1501, 3, 4),
'soldot_particle': (1501, 10, 3, 4, 4),
'soldot_solid': (1501, 10, 3, 4, 4),
'solution_bulk': (1501, 10, 3, 4),
'solution_flux': (1501, 1, 10, 3, 4),
'solution_flux': (1501, 10, 3, 1, 4),
'solution_inlet': (1501, 3, 4),
'solution_outlet': (1501, 3, 4),
'solution_particle': (1501, 10, 3, 4, 4),
Expand Down Expand Up @@ -612,7 +612,7 @@ def __repr__(self):
'last_state_y': (1212,),
'last_state_ydot': (1212,),
'soldot_bulk': (1501, 10, 3, 4),
'soldot_flux': (1501, 1, 10, 3, 4),
'soldot_flux': (1501, 10, 3, 1, 4),
'soldot_inlet_port_000': (1501, 4),
'soldot_inlet_port_001': (1501, 4),
'soldot_inlet_port_002': (1501, 4),
Expand All @@ -622,7 +622,7 @@ def __repr__(self):
'soldot_particle': (1501, 10, 3, 4, 4),
'soldot_solid': (1501, 10, 3, 4, 4),
'solution_bulk': (1501, 10, 3, 4),
'solution_flux': (1501, 1, 10, 3, 4),
'solution_flux': (1501, 10, 3, 1, 4),
'solution_inlet_port_000': (1501, 4),
'solution_inlet_port_001': (1501, 4),
'solution_inlet_port_002': (1501, 4),
Expand Down Expand Up @@ -661,7 +661,7 @@ def __repr__(self):
'last_state_y': (1212,),
'last_state_ydot': (1212,),
'soldot_bulk': (1501, 10, 3, 4),
'soldot_flux': (1501, 1, 10, 3, 4),
'soldot_flux': (1501, 10, 3, 1, 4),
'soldot_inlet_port_000_comp_000': (1501,),
'soldot_inlet_port_000_comp_001': (1501,),
'soldot_inlet_port_000_comp_002': (1501,),
Expand Down Expand Up @@ -689,7 +689,7 @@ def __repr__(self):
'soldot_particle': (1501, 10, 3, 4, 4),
'soldot_solid': (1501, 10, 3, 4, 4),
'solution_bulk': (1501, 10, 3, 4),
'solution_flux': (1501, 1, 10, 3, 4),
'solution_flux': (1501, 10, 3, 1, 4),
'solution_inlet_port_000_comp_000': (1501,),
'solution_inlet_port_000_comp_001': (1501,),
'solution_inlet_port_000_comp_002': (1501,),
Expand Down

0 comments on commit ba630e0

Please sign in to comment.