Skip to content

Commit

Permalink
fixing bugs with the simulation class
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavakula01 committed Dec 22, 2024
1 parent 832b2b9 commit 40a85e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions lib/para.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self):
self.right = 1 # x_max
self.bottom = 0 # y_min
self.top = 1 # y_max
self.calculate_spacing

@property
def calculate_spacing(self):
Expand Down
9 changes: 6 additions & 3 deletions lib/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ def get_phi_value(self):

# --- Vectorized implementation
jj, ii = np.meshgrid(np.arange(1, n + 2), np.arange(1, m + 2))
print("jj is: ", jj)
print("ii is: ", ii)
print(left + (ii - 1) * dx)
# print("jj is: ", jj)
# print("ii is: ", ii)
# print("Left is: ", left)
# print("bottom is: ", bottom)
# print("dx is: ", dx)
# print("dy is: ", dy)
phi_vec = self.z_func_test(left + (ii - 1) * dx, bottom + (jj - 1) * dy)
return phi_vec
except Exception as e:
Expand Down
10 changes: 4 additions & 6 deletions tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,19 @@ def initializing_simulation():

def test_get_phi_value():
"""
This function will test calculation of phi value
This function will test calculation of phi value. This test also goes through testing the z_func
"""
#initializing simulation object
test_sim_object = initializing_simulation()

#getting the phi value
test_sim_object.get_phi_value()
phi_vec = test_sim_object.get_phi_value()
print("The phi vector is: ", phi_vec)

pass

def test_z_func_calculation():
pass

def test_initialize_concentration():

pass

def test_compute_viscosity():
Expand Down

0 comments on commit 40a85e0

Please sign in to comment.