Commit c91d299d by Jigyasa Watwani

class name change

parent a6e9def7
Showing with 6 additions and 6 deletions
......@@ -5,7 +5,7 @@ import progressbar
df.set_log_level(df.LogLevel.ERROR)
df.parameters['form_compiler']['optimize'] = True
class Growth(object):
class FixedBoundaries(object):
def __init__(self, parameters):
# read in parameters
for key in parameters:
......@@ -122,16 +122,16 @@ if __name__ == '__main__':
with open('growth_parameters.json') as jsonFile:
params = json.load(jsonFile)
g = Growth(params)
fb = FixedBoundaries(params)
u0 = df.Expression('sin(x[0])', degree=1)
rho0 = df.Expression('rho0 + 0.1 * (cos(x[0])+cos(x[0]/2))', rho0 =g.average_rho, degree=1)
rho0 = df.Expression('rho0 + 0.1 * (cos(x[0])+cos(x[0]/2))', rho0 =fb.average_rho, degree=1)
(u, v, rho) = g.solve(u0, rho0)
(u, v, rho) = fb.solve(u0, rho0)
x = g.mesh.coordinates()
times = np.arange(0, g.maxtime, g.timestep)
x = fb.mesh.coordinates()
times = np.arange(0, fb.maxtime, fb.timestep)
fig, (axu, axv, axrho) = plt.subplots(3,1, sharex=True, figsize=(8,6))
axu.set_xlabel(r'$x$')
axu.set_ylabel(r'$u(x,t)$')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment