Skip to content

Commit ba630e0

Browse files
committed
Fix loading flux
1 parent ad7e130 commit ba630e0

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

cadet/cadet_dll.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,16 @@ def _process_data(
233233
# Example: Outlet [nTime, nPort, nComp]
234234
# Bulk [nTime, nAxialCells, nRadialCells, nComp] if 2D model
235235
# Bulk [nTime, nAxialCells, nComp] if 1D model
236-
dimensions = ['nTime', 'nPort', 'nAxialCells', 'nRadialCells', 'nParShells', 'nComp', 'nBound']
236+
dimensions = [
237+
'nTime',
238+
'nPort',
239+
'nAxialCells',
240+
'nRadialCells',
241+
'nParTypes',
242+
'nParShells',
243+
'nComp',
244+
'nBound',
245+
]
237246
for dim in dimensions:
238247
if dim in call_outputs and call_outputs[dim].value:
239248
shape.append(call_outputs[dim].value)

tests/test_dll.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,13 @@ def __repr__(self):
362362
'last_state_y': (404,),
363363
'last_state_ydot': (404,),
364364
'soldot_bulk': (1501, 10, 4),
365-
'soldot_flux': (1501, 1, 10, 4),
365+
'soldot_flux': (1501, 10, 1, 4),
366366
'soldot_inlet': (1501, 4),
367367
'soldot_outlet': (1501, 4),
368368
'soldot_particle': (1501, 10, 4, 4),
369369
'soldot_solid': (1501, 10, 4, 4),
370370
'solution_bulk': (1501, 10, 4),
371-
'solution_flux': (1501, 1, 10, 4),
371+
'solution_flux': (1501, 10, 1, 4),
372372
'solution_inlet': (1501, 4),
373373
'solution_outlet': (1501, 4),
374374
'solution_particle': (1501, 10, 4, 4),
@@ -402,7 +402,7 @@ def __repr__(self):
402402
'last_state_y': (404,),
403403
'last_state_ydot': (404,),
404404
'soldot_bulk': (1501, 10, 4),
405-
'soldot_flux': (1501, 1, 10, 4),
405+
'soldot_flux': (1501, 10, 1, 4),
406406
'soldot_inlet_port_000_comp_000': (1501,),
407407
'soldot_inlet_port_000_comp_001': (1501,),
408408
'soldot_inlet_port_000_comp_002': (1501,),
@@ -414,7 +414,7 @@ def __repr__(self):
414414
'soldot_particle': (1501, 10, 4, 4),
415415
'soldot_solid': (1501, 10, 4, 4),
416416
'solution_bulk': (1501, 10, 4),
417-
'solution_flux': (1501, 1, 10, 4),
417+
'solution_flux': (1501, 10, 1, 4),
418418
'solution_inlet_port_000_comp_000': (1501,),
419419
'solution_inlet_port_000_comp_001': (1501,),
420420
'solution_inlet_port_000_comp_002': (1501,),
@@ -466,13 +466,13 @@ def __repr__(self):
466466
'last_state_y': (404,),
467467
'last_state_ydot': (404,),
468468
'soldot_bulk': (1501, 10, 4),
469-
'soldot_flux': (1501, 1, 10, 4),
469+
'soldot_flux': (1501, 10, 1, 4),
470470
'soldot_inlet': (1501, 4),
471471
'soldot_outlet': (1501, 4),
472472
'soldot_particle': (1501, 10, 4, 4),
473473
'soldot_solid': (1501, 10, 4, 4),
474474
'solution_bulk': (1501, 10, 4),
475-
'solution_flux': (1501, 1, 10, 4),
475+
'solution_flux': (1501, 10, 1, 4),
476476
'solution_inlet': (1501, 4),
477477
'solution_outlet': (1501, 4),
478478
'solution_particle': (1501, 10, 4, 4),
@@ -488,13 +488,13 @@ def __repr__(self):
488488
},
489489
'sens_param_000_unit_000': {
490490
'sensdot_bulk': (1501, 10, 4),
491-
'sensdot_flux': (1501, 1, 10, 4),
491+
'sensdot_flux': (1501, 10, 1, 4),
492492
'sensdot_inlet': (1501, 4),
493493
'sensdot_outlet': (1501, 4),
494494
'sensdot_particle': (1501, 10, 4, 4),
495495
'sensdot_solid': (1501, 10, 4, 4),
496496
'sens_bulk': (1501, 10, 4),
497-
'sens_flux': (1501, 1, 10, 4),
497+
'sens_flux': (1501, 10, 1, 4),
498498
'sens_inlet': (1501, 4),
499499
'sens_outlet': (1501, 4),
500500
'sens_particle': (1501, 10, 4, 4),
@@ -527,15 +527,15 @@ def __repr__(self):
527527
'last_state_y': (764,),
528528
'last_state_ydot': (764,),
529529
'soldot_bulk': (1501, 10, 4),
530-
'soldot_flux': (1501, 2, 10, 4),
530+
'soldot_flux': (1501, 10, 2, 4),
531531
'soldot_inlet': (1501, 4),
532532
'soldot_outlet': (1501, 4),
533533
'soldot_particle_partype_000': (1501, 10, 4, 4),
534534
'soldot_particle_partype_001': (1501, 10, 4, 4),
535535
'soldot_solid_partype_000': (1501, 10, 4, 4),
536536
'soldot_solid_partype_001': (1501, 10, 4, 4),
537537
'solution_bulk': (1501, 10, 4),
538-
'solution_flux': (1501, 2, 10, 4),
538+
'solution_flux': (1501, 10, 2, 4),
539539
'solution_inlet': (1501, 4),
540540
'solution_outlet': (1501, 4),
541541
'solution_particle_partype_000': (1501, 10, 4, 4),
@@ -571,13 +571,13 @@ def __repr__(self):
571571
'last_state_y': (1212,),
572572
'last_state_ydot': (1212,),
573573
'soldot_bulk': (1501, 10, 3, 4),
574-
'soldot_flux': (1501, 1, 10, 3, 4),
574+
'soldot_flux': (1501, 10, 3, 1, 4),
575575
'soldot_inlet': (1501, 3, 4),
576576
'soldot_outlet': (1501, 3, 4),
577577
'soldot_particle': (1501, 10, 3, 4, 4),
578578
'soldot_solid': (1501, 10, 3, 4, 4),
579579
'solution_bulk': (1501, 10, 3, 4),
580-
'solution_flux': (1501, 1, 10, 3, 4),
580+
'solution_flux': (1501, 10, 3, 1, 4),
581581
'solution_inlet': (1501, 3, 4),
582582
'solution_outlet': (1501, 3, 4),
583583
'solution_particle': (1501, 10, 3, 4, 4),
@@ -612,7 +612,7 @@ def __repr__(self):
612612
'last_state_y': (1212,),
613613
'last_state_ydot': (1212,),
614614
'soldot_bulk': (1501, 10, 3, 4),
615-
'soldot_flux': (1501, 1, 10, 3, 4),
615+
'soldot_flux': (1501, 10, 3, 1, 4),
616616
'soldot_inlet_port_000': (1501, 4),
617617
'soldot_inlet_port_001': (1501, 4),
618618
'soldot_inlet_port_002': (1501, 4),
@@ -622,7 +622,7 @@ def __repr__(self):
622622
'soldot_particle': (1501, 10, 3, 4, 4),
623623
'soldot_solid': (1501, 10, 3, 4, 4),
624624
'solution_bulk': (1501, 10, 3, 4),
625-
'solution_flux': (1501, 1, 10, 3, 4),
625+
'solution_flux': (1501, 10, 3, 1, 4),
626626
'solution_inlet_port_000': (1501, 4),
627627
'solution_inlet_port_001': (1501, 4),
628628
'solution_inlet_port_002': (1501, 4),
@@ -661,7 +661,7 @@ def __repr__(self):
661661
'last_state_y': (1212,),
662662
'last_state_ydot': (1212,),
663663
'soldot_bulk': (1501, 10, 3, 4),
664-
'soldot_flux': (1501, 1, 10, 3, 4),
664+
'soldot_flux': (1501, 10, 3, 1, 4),
665665
'soldot_inlet_port_000_comp_000': (1501,),
666666
'soldot_inlet_port_000_comp_001': (1501,),
667667
'soldot_inlet_port_000_comp_002': (1501,),
@@ -689,7 +689,7 @@ def __repr__(self):
689689
'soldot_particle': (1501, 10, 3, 4, 4),
690690
'soldot_solid': (1501, 10, 3, 4, 4),
691691
'solution_bulk': (1501, 10, 3, 4),
692-
'solution_flux': (1501, 1, 10, 3, 4),
692+
'solution_flux': (1501, 10, 3, 1, 4),
693693
'solution_inlet_port_000_comp_000': (1501,),
694694
'solution_inlet_port_000_comp_001': (1501,),
695695
'solution_inlet_port_000_comp_002': (1501,),

0 commit comments

Comments
 (0)