harishaseebat92 commited on
Commit
c68dfcb
·
1 Parent(s): 53d632d

Updated qlbm_embedded.py so get_initial_distribution_figure() now always adds a peach, semi-transparent Mesh3d unit cube

Browse files
Files changed (1) hide show
  1. qlbm_embedded.py +55 -6
qlbm_embedded.py CHANGED
@@ -450,6 +450,61 @@ def get_initial_distribution_figure(distribution_type, N, show_edges=False):
450
  caps=dict(x_show=False, y_show=False, z_show=False)
451
  )]
452
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  if show_edges:
454
  # Create grid lines
455
  Y_yz, Z_yz = np.meshgrid(y_indices, z_indices, indexing='ij')
@@ -1439,12 +1494,6 @@ def _build_control_panels(plotter):
1439
  color="primary",
1440
  classes="mb-2"
1441
  )
1442
- vuetify3.VCardSubtitle("Governing Equations", classes="text-caption font-weight-bold mt-2")
1443
- vuetify3.VListItemTitle("Laminar Navier-Stokes including energy", classes="text-caption")
1444
- vuetify3.VCardSubtitle("Inputs", classes="text-caption font-weight-bold mt-2")
1445
- vuetify3.VListItemTitle("Geometry, Boundary conditions - temperature and flow", classes="text-caption")
1446
- vuetify3.VCardSubtitle("Outputs", classes="text-caption font-weight-bold mt-2")
1447
- vuetify3.VListItemTitle("Surface plots on sections OR sampling through a line in 3D domain", classes="text-caption")
1448
 
1449
  # Geometry card
1450
  with vuetify3.VCard(classes="mb-2"):
 
450
  caps=dict(x_show=False, y_show=False, z_show=False)
451
  )]
452
 
453
+ # Add translucent peach unit cube to give spatial frame
454
+ cube_x = [0, 1, 1, 0, 0, 1, 1, 0]
455
+ cube_y = [0, 0, 1, 1, 0, 0, 1, 1]
456
+ cube_z = [0, 0, 0, 0, 1, 1, 1, 1]
457
+ cube_color = "rgba(255,218,185,0.25)" # Peach with transparency
458
+
459
+ data.append(go.Mesh3d(
460
+ x=cube_x,
461
+ y=cube_y,
462
+ z=cube_z,
463
+ i=[7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
464
+ j=[3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
465
+ k=[0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
466
+ opacity=0.18,
467
+ color=cube_color,
468
+ flatshading=True,
469
+ showscale=False,
470
+ name="Unit Cube"
471
+ ))
472
+
473
+ cube_edge_x = [
474
+ 0, 1, 1, 0, 0, None,
475
+ 0, 1, 1, 0, 0, None,
476
+ 0, 0, None,
477
+ 1, 1, None,
478
+ 1, 1, None,
479
+ 0, 0
480
+ ]
481
+ cube_edge_y = [
482
+ 0, 0, 1, 1, 0, None,
483
+ 0, 0, 1, 1, 0, None,
484
+ 0, 0, None,
485
+ 0, 0, None,
486
+ 1, 1, None,
487
+ 1, 1
488
+ ]
489
+ cube_edge_z = [
490
+ 0, 0, 0, 0, 0, None,
491
+ 1, 1, 1, 1, 1, None,
492
+ 0, 1, None,
493
+ 0, 1, None,
494
+ 0, 1, None,
495
+ 0, 1
496
+ ]
497
+
498
+ data.append(go.Scatter3d(
499
+ x=cube_edge_x,
500
+ y=cube_edge_y,
501
+ z=cube_edge_z,
502
+ mode='lines',
503
+ line=dict(color='#E3A079', width=3),
504
+ opacity=0.9,
505
+ name='Unit Cube Frame'
506
+ ))
507
+
508
  if show_edges:
509
  # Create grid lines
510
  Y_yz, Z_yz = np.meshgrid(y_indices, z_indices, indexing='ij')
 
1494
  color="primary",
1495
  classes="mb-2"
1496
  )
 
 
 
 
 
 
1497
 
1498
  # Geometry card
1499
  with vuetify3.VCard(classes="mb-2"):