Fixed bugs. Bois model limit works correctly

parent df925e32
Showing with 28 additions and 5 deletions
{
"morphogen" : true,
"resolution" : 64,
"system_size_by_2PI" : 1 ,
"elasticity" : 0.0,
"viscosity" : 1.0,
"friction" : 1.0,
"lamda": 1.75,
"diffusion_rho" : 1.0,
"turnover_rho" : 0.0,
"average_rho" : 1.0,
"saturation_rho" : 1.0,
"diffusion_c" : 1.0,
"turnover_c" : 0.0,
"average_c" : 1.0,
"noise_level": 0.1,
"timestep" : 0.05,
"maxtime" : 200.0
}
...@@ -51,14 +51,14 @@ class FixedBoundaries(object): ...@@ -51,14 +51,14 @@ class FixedBoundaries(object):
def reaction_rho(self, rho, trho): def reaction_rho(self, rho, trho):
return self.turnover_rho * df.inner(rho - self.average_rho, trho) return self.turnover_rho * df.inner(rho - self.average_rho, trho)
def reaction_rho(self, c, tc): def reaction_c(self, c, tc):
return self.turnover_c * df.inner(c - self.average_c, tc) return self.turnover_c * df.inner(c - self.average_c, tc)
def diffusion_reaction_rho(self, rho, trho): def diffusion_reaction_rho(self, rho, trho):
return (self.diffusion_rho * df.inner(rho.dx(0), trho.dx(0)) + self.reaction_rho(rho, trho)) return (self.diffusion_rho * df.inner(rho.dx(0), trho.dx(0)) + self.reaction_rho(rho, trho))
def diffusion_reaction_c(self, c, tc): def diffusion_reaction_c(self, c, tc):
return (self.diffusion_c * df.inner(c.dx(0), tc.dx(0)) + self.reaction_rho(c, tc)) return (self.diffusion_c * df.inner(c.dx(0), tc.dx(0)) + self.reaction_c(c, tc))
def setup_initial_conditions(self, u0=None, rho0=None, c0=None): def setup_initial_conditions(self, u0=None, rho0=None, c0=None):
if u0==None and rho0==None and c0==None: if u0==None and rho0==None and c0==None:
...@@ -168,7 +168,6 @@ class FixedBoundaries(object): ...@@ -168,7 +168,6 @@ class FixedBoundaries(object):
# parse data # parse data
data = np.array(data) data = np.array(data)
print(data.shape)
if self.morphogen: if self.morphogen:
# u, v, rho, c # u, v, rho, c
return np.split(data, 4, axis=2) return np.split(data, 4, axis=2)
...@@ -192,8 +191,6 @@ if __name__ == '__main__': ...@@ -192,8 +191,6 @@ if __name__ == '__main__':
u, v, rho, c = Z u, v, rho, c = Z
else: else:
u, v, rho = Z u, v, rho = Z
print(u.shape, v.shape, rho.shape)
x = fb.mesh.coordinates() x = fb.mesh.coordinates()
......
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