Exemplo n.º 1
0
import pymcell as m

# Make a world
world = m.make_mcell_world()

# Set timestep
world.dt = 0.1

###
# Box
###

# Create a box
box = m.create_simple_object(name="My box",
                             type="CUBE",
                             center=[0, 0, 0],
                             radius=[1, 1, 1])

# Add it to the mcell world
world.obj_list.append(box)

###
# Species
###

mol_A = m.create_species(name="A", dc=1)
world.species_list.append(mol_A)

mol_B = m.create_species(name="B", dc=1)
world.species_list.append(mol_B)
surf_class_a = m.create_surface_class(name="Absorptive",
                                      molecules=[mol_A],
                                      type="ABSORPTIVE")

# Create a clamp surface class
surf_class_c = m.create_surface_class(name="Clamp",
                                      molecules=[mol_A],
                                      type="CLAMP",
                                      clamp_value=1)

##########
# Transparency
##########

# Make a world
world_t = m.make_mcell_world()

# Set timestep
world_t.dt = 0.1

# Add the box to the world
world_t.obj_list.append(box)

# Add the surface classes to the world
world_t.reg_list.append(surf_reg_1)
world_t.reg_list.append(surf_reg_2)

# Add the molecule to the world
world_t.species_list.append(mol_A)

# Assign the surface class to the regions