Beispiel #1
0
# ---- Cube ----
Cube_vertex_list = [[-0.25, -0.25, -0.25], [-0.25, -0.25, 0.25],
                    [-0.25, 0.25, -0.25], [-0.25, 0.25, 0.25],
                    [0.25, -0.25, -0.25], [0.25, -0.25, 0.25],
                    [0.25, 0.25, -0.25], [0.25, 0.25,
                                          0.25]]  # Cube_vertex_list

Cube_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                  [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                  [6, 4, 0], [3, 1, 5]]  # Cube_wall_list

Cube_left_side_wall_indices = [3, 9]  #Cube_left_side_wall_indices

Cube_left_side = m.SurfaceRegion(name='left_side',
                                 wall_indices=Cube_left_side_wall_indices,
                                 initial_color=color_green)

Cube_right_side_wall_indices = [1, 7]  #Cube_right_side_wall_indices

Cube_right_side = m.SurfaceRegion(name='right_side',
                                  wall_indices=Cube_right_side_wall_indices,
                                  initial_color=color_red)

Cube = m.GeometryObject(name='Cube',
                        vertex_list=Cube_vertex_list,
                        wall_list=Cube_wall_list,
                        surface_regions=[Cube_left_side, Cube_right_side],
                        initial_color=color_default)
# ^^^^ Cube ^^^^
Beispiel #2
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import mcell as m

# ---- Cube ----
Cube_vertex_list = [[-0.05, -0.05, -0.05], [-0.05, -0.05, 0.05],
                    [-0.05, 0.05, -0.05], [-0.05, 0.05, 0.05],
                    [0.05, -0.05, -0.05], [0.05, -0.05, 0.05],
                    [0.05, 0.05, -0.05], [0.05, 0.05,
                                          0.05]]  # Cube_vertex_list

Cube_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                  [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                  [6, 4, 0], [3, 1, 5]]  # Cube_wall_list

Cube_membrane_wall_indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
                              11]  #Cube_membrane_wall_indices

Cube_membrane = m.SurfaceRegion(name='membrane',
                                wall_indices=Cube_membrane_wall_indices)

Cube = m.GeometryObject(name='Cube',
                        vertex_list=Cube_vertex_list,
                        wall_list=Cube_wall_list,
                        surface_regions=[Cube_membrane])
# ^^^^ Cube ^^^^
Beispiel #3
0
import mcell as m

# ---- Cube1 ----
Cube1_vertex_list = [[-0.1, -0.1, -0.1], [-0.1, -0.1, 0.1], [-0.1, 0.1, -0.1],
                     [-0.1, 0.1, 0.1], [0.1, -0.1, -0.1], [0.1, -0.1, 0.1],
                     [0.1, 0.1, -0.1], [0.1, 0.1, 0.1]]  # Cube1_vertex_list

Cube1_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                   [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                   [6, 4, 0], [3, 1, 5]]  # Cube1_wall_list

Cube1 = m.GeometryObject(name='Cube1',
                         vertex_list=Cube1_vertex_list,
                         wall_list=Cube1_wall_list,
                         surface_regions=[])
# ^^^^ Cube1 ^^^^

# ---- Cube2 ----
Cube2_vertex_list = [[-0.2, -0.2, -0.2], [-0.2, -0.2, 0.2], [-0.2, 0.2, -0.2],
                     [-0.2, 0.2, 0.2], [0.2, -0.2, -0.2], [0.2, -0.2, 0.2],
                     [0.2, 0.2, -0.2], [0.2, 0.2, 0.2]]  # Cube2_vertex_list

Cube2_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                   [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                   [6, 4, 0], [3, 1, 5]]  # Cube2_wall_list

Cube2 = m.GeometryObject(name='Cube2',
                         vertex_list=Cube2_vertex_list,
                         wall_list=Cube2_wall_list,
                         surface_regions=[])
# ^^^^ Cube2 ^^^^
Beispiel #4
0
import os

MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
    sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
    print(
        "Error: variable MCELL_PATH that is used to find the mcell library was not set."
    )
    sys.exit(1)

import mcell as m

model = m.Model()

a = m.Species('a', diffusion_constant_3d=1e-6)

rs = m.ReleaseSite('rel_a', a, location=(0, 0, 0), number_to_release=1)
model.add_release_site(rs)
s1 = model.find_release_site('rel_a')
assert s1 is not None and s1.name == 'rel_a'
s2 = model.find_release_site('rel_b')
assert s2 is None

g = m.GeometryObject('g', [[0, 0, 0], [1, 1, 1], [0, 0, 1]], [[0, 1, 2]])
model.add_geometry_object(g)
g1 = model.find_geometry_object('g')
assert g1 is not None and g1.name == 'g'
g2 = model.find_geometry_object('qx')
assert g2 is None
Beispiel #5
0
import mcell as m

# ---- Compartment ----
Compartment_vertex_list = [[0, 0, 0.02], [0.02, 0,
                                          -0.01], [-0.01, 0.02, -0.01],
                           [-0.01, -0.02, -0.01]]  # Compartment_vertex_list

Compartment_wall_list = [[0, 1, 2], [0, 2, 3], [0, 3, 1],
                         [1, 3, 2]]  # Compartment_wall_list

Compartment = m.GeometryObject(name='Compartment',
                               vertex_list=Compartment_vertex_list,
                               wall_list=Compartment_wall_list,
                               surface_regions=[])
# ^^^^ Compartment ^^^^
Beispiel #6
0
    [-0.300000071525574, 0.100000023841858, -0.100000023841858],
    [-0.300000071525574, 0.100000023841858, 0.100000023841858],
    [0.300000071525574, -0.100000023841858, -0.100000023841858],
    [0.300000071525574, -0.100000023841858, 0.100000023841858],
    [0.300000071525574, 0.100000023841858, -0.100000023841858],
    [0.300000071525574, 0.100000023841858, 0.100000023841858]
]  # box1_vertex_list

box1_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                  [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                  [6, 4, 0], [3, 1, 5]]  # box1_wall_list

sr1 = m.SurfaceRegion(name='sr1', wall_indices=[0, 1, 2, 3])

box1 = m.GeometryObject(name='box1',
                        vertex_list=box1_vertex_list,
                        wall_list=box1_wall_list,
                        surface_regions=[sr1])
# ^^^^ box1 ^^^^

# ---- box2 ----
box2_vertex_list = [
    [-0.150000035762787, -0.150000035762787, -0.150000035762787],
    [-0.150000035762787, -0.150000035762787, 0.150000035762787],
    [-0.150000035762787, 0.150000035762787, -0.150000035762787],
    [-0.150000035762787, 0.150000035762787, 0.150000035762787],
    [0.150000035762787, -0.150000035762787, -0.150000035762787],
    [0.150000035762787, -0.150000035762787, 0.150000035762787],
    [0.150000035762787, 0.150000035762787, -0.150000035762787],
    [0.150000035762787, 0.150000035762787, 0.150000035762787]
]  # box2_vertex_list
Beispiel #7
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import mcell as m

# ---- box ----
box_vertex_list = [[-0.234999999403954, -0.234999999403954, -2.5],
                   [-0.234999999403954, -0.234999999403954, 2.5],
                   [-0.234999999403954, 0.234999999403954, -2.5],
                   [-0.234999999403954, 0.234999999403954, 2.5],
                   [0.234999999403954, -0.234999999403954, -2.5],
                   [0.234999999403954, -0.234999999403954, 2.5],
                   [0.234999999403954, 0.234999999403954, -2.5],
                   [0.234999999403954, 0.234999999403954,
                    2.5]]  # box_vertex_list

box_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                 [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                 [6, 4, 0], [3, 1, 5]]  # box_wall_list

box_bottom_wall_indices = [4, 10]  #box_bottom_wall_indices

box_bottom = m.SurfaceRegion(name='bottom',
                             wall_indices=box_bottom_wall_indices)

box = m.GeometryObject(name='box',
                       vertex_list=box_vertex_list,
                       wall_list=box_wall_list,
                       surface_regions=[box_bottom])
# ^^^^ box ^^^^
Beispiel #8
0
    [3, 6, 2], 
    [7, 4, 6], 
    [5, 0, 4], 
    [6, 0, 2], 
    [3, 5, 7], 
    [1, 3, 2], 
    [3, 7, 6], 
    [7, 5, 4], 
    [5, 1, 0], 
    [6, 4, 0], 
    [3, 1, 5]
] # up_wall_list

up = m.GeometryObject(
    name = 'up',
    vertex_list = up_vertex_list,
    wall_list = up_wall_list,
    surface_regions = []
)
# ^^^^ up ^^^^


# ---- bottom ----
bottom_vertex_list = [
    [-0.199999988079071, -0.199999988079071, -0.02], 
    [-0.199999988079071, -0.199999988079071, 0.018], # the gap is 2nm 
    [-0.199999988079071, 0.199999988079071, -0.02], 
    [-0.199999988079071, 0.199999988079071, 0.018], 
    [0.199999988079071, -0.199999988079071, -0.02], 
    [0.199999988079071, -0.199999988079071, 0.018], 
    [0.199999988079071, 0.199999988079071, -0.02], 
    [0.199999988079071, 0.199999988079071, 0.018]
Beispiel #9
0
import mcell as m

# ---- Cube ----
Cube_vertex_list = [[-0.25, -0.25, -0.25], [-0.25, -0.25, 0.25],
                    [-0.25, 0.25, -0.25], [-0.25, 0.25, 0.25],
                    [0.25, -0.25, -0.25], [0.25, -0.25, 0.25],
                    [0.25, 0.25, -0.25], [0.25, 0.25,
                                          0.25]]  # Cube_vertex_list

Cube_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                  [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                  [6, 4, 0], [3, 1, 5]]  # Cube_wall_list

Cube_left_side_wall_indices = [3, 9]  #Cube_left_side_wall_indices

Cube_left_side = m.SurfaceRegion(name='left_side',
                                 wall_indices=Cube_left_side_wall_indices)

Cube_right_side_wall_indices = [1, 7]  #Cube_right_side_wall_indices

Cube_right_side = m.SurfaceRegion(name='right_side',
                                  wall_indices=Cube_right_side_wall_indices)

Cube = m.GeometryObject(name='Cube',
                        vertex_list=Cube_vertex_list,
                        wall_list=Cube_wall_list,
                        surface_regions=[Cube_left_side, Cube_right_side])
# ^^^^ Cube ^^^^
Beispiel #10
0
    [6, 0, 2],
    [3, 5, 7],
    [1, 3, 2],
    [3, 7, 6],
    [7, 5, 4],
    [5, 1, 0],
    [6, 4, 0],
    [3, 1, 5]
]
"""
0010-3)
We use the previously defined list of vertices and walls 
to create an object of class GeometryObject.
"""
box = m.GeometryObject(name='box',
                       vertex_list=box_vertex_list,
                       wall_list=box_wall_list)

#0000-7)
model = m.Model()
model.add_species(species_a)
model.add_release_site(release_site_a)
model.add_viz_output(viz_output)
"""
0010-4)
In addition to the previous components, we also add our box 
to the model.
"""
model.add_geometry_object(box)

#0000-8)
Beispiel #11
0
                                   [-0.0625, 0.0625, -0.0625],
                                   [-0.0625, 0.0625, 0.0625],
                                   [0.0625, -0.0625, -0.0625],
                                   [0.0625, -0.0625, 0.0625],
                                   [0.0625, 0.0625, -0.0625],
                                   [0.0625, 0.0625,
                                    0.0625]]  # default_compartment_vertex_list

default_compartment_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4],
                                 [6, 0, 2], [3, 5, 7], [1, 3, 2], [3, 7, 6],
                                 [7, 5, 4], [5, 1, 0], [6, 4, 0],
                                 [3, 1, 5]]  # default_compartment_wall_list

default_compartment = m.GeometryObject(
    name='DEFAULT',
    vertex_list=default_compartment_vertex_list,
    wall_list=default_compartment_wall_list,
    surface_regions=[])
# ^^^^ default_compartment ^^^^

# ---- EC ----
EC_vertex_list = [[-0.25, -0.25, -0.25], [-0.25, -0.25, 0.25],
                  [-0.25, 0.25, -0.25], [-0.25, 0.25, 0.25],
                  [0.25, -0.25, -0.25], [0.25, -0.25, 0.25],
                  [0.25, 0.25, -0.25], [0.25, 0.25, 0.25]]  # EC_vertex_list

EC_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0,
                                                             2], [3, 5, 7],
                [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0], [6, 4, 0],
                [3, 1, 5]]  # EC_wall_list
Beispiel #12
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import mcell as m

# ---- Plane ----
Plane_vertex_list = [[-1.10000002384186, -1.10000002384186, 0],
                     [1.10000002384186, -1.10000002384186, 0],
                     [-1.10000002384186, 1.10000002384186, 0],
                     [1.10000002384186, 1.10000002384186,
                      0]]  # Plane_vertex_list

Plane_wall_list = [[1, 2, 0], [1, 3, 2]]  # Plane_wall_list

Plane = m.GeometryObject(name='Plane',
                         vertex_list=Plane_vertex_list,
                         wall_list=Plane_wall_list,
                         surface_regions=[])
# ^^^^ Plane ^^^^

# ---- Cube ----
Cube_vertex_list = [[-1, -1, -1], [-1, -1, 1], [-1, 1, -1], [-1, 1, 1],
                    [1, -1, -1], [1, -1, 1], [1, 1, -1],
                    [1, 1, 1]]  # Cube_vertex_list

Cube_wall_list = [[1, 2, 0], [3, 6, 2], [7, 4, 6], [5, 0, 4], [6, 0, 2],
                  [3, 5, 7], [1, 3, 2], [3, 7, 6], [7, 5, 4], [5, 1, 0],
                  [6, 4, 0], [3, 1, 5]]  # Cube_wall_list

Cube = m.GeometryObject(name='Cube',
                        vertex_list=Cube_vertex_list,
                        wall_list=Cube_wall_list,
Beispiel #13
0
import mcell as m

# ---- Tetrahedron ----
Tetrahedron_vertex_list = [[0, 0, 0.02], [0.02, 0,
                                          -0.01], [-0.01, 0.02, -0.01],
                           [-0.01, -0.02, -0.01]]  # Tetrahedron_vertex_list

Tetrahedron_wall_list = [[0, 1, 2], [0, 2, 3], [0, 3, 1],
                         [1, 3, 2]]  # Tetrahedron_wall_list

Tetrahedron = m.GeometryObject(name='Tetrahedron',
                               vertex_list=Tetrahedron_vertex_list,
                               wall_list=Tetrahedron_wall_list,
                               surface_regions=[])
# ^^^^ Tetrahedron ^^^^