# WARNING: This is an automatically generated file and will be overwritten # by CellBlender on the next model export. import os import mcell as m MODEL_PATH = os.path.dirname(os.path.abspath(__file__)) from parameters import * from subsystem import * from geometry import * # ---- observables ---- viz_output = m.VizOutput(mode=m.VizMode.ASCII, output_files_prefix='./viz_data/seed_' + str(SEED).zfill(5) + '/Scene', every_n_timesteps=1) count_a = m.Count(expression=m.CountTerm(species_pattern=m.Complex('a')), file_name='./react_data/seed_' + str(SEED).zfill(5) + '/a.dat') # ---- create observables object and add components ---- observables = m.Observables() observables.add_count(count_a) observables.add_viz_output(viz_output)
# WARNING: This is an automatically generated file and will be overwritten # by CellBlender on the next model export. import os import shared import mcell as m from parameters import * from subsystem import * from geometry import * MODEL_PATH = os.path.dirname(os.path.abspath(__file__)) # ---- observables ---- viz_output = m.VizOutput(mode=m.VizMode.CELLBLENDER, output_files_prefix='./viz_data/seed_' + str(SEED).zfill(5) + '/Scene', every_n_timesteps=SAMPLING_PERIODICITY) # ---- create observables object and add components ---- observables = m.Observables() observables.load_bngl_observables( os.path.join(MODEL_PATH, 'model.bngl'), './react_data/seed_' + str(SEED).zfill(5) + '/') #observables.add_viz_output(viz_output) for count in observables.counts: count.every_n_timesteps = SAMPLING_PERIODICITY
except EOFError: mol_file.close() break return mol_dict # create main model object (empty) model = m.Model() model.load_bngl('model.bngl') SEED = 0 prefix = './viz_data/seed_' + str(SEED).zfill(5) + '/Scene' viz_output = m.VizOutput(mode=m.VizMode.CELLBLENDER, output_files_prefix=prefix) model.add_viz_output(viz_output) model.config.total_iterations = 1 # ---- initialization and execution ---- model.initialize() model.run_iterations(1) model.end_simulation() # read cellbnder viz output mol_dict = read_cellblender_viz_output(prefix + '.cellbin.1.dat') def assert_eq(a, b):
#0000-2) MCELL_PATH = os.environ.get('MCELL_PATH', '') if MCELL_PATH: lib_path = os.path.join(MCELL_PATH, 'lib') sys.path.append(lib_path) else: print("Error: system variable MCELL_PATH that is used to find the mcell " "library was not set.") sys.exit(1) #0000-3) import mcell as m #0000-6) viz_output = m.VizOutput(output_files_prefix='./viz_data/seed_00001/Scene', ) #0030-1) o1v = m.geometry_utils.create_icosphere(name='O1V', radius=0.3, subdivisions=4) #0030-2) o1v.translate((0, -0.2, 0)) #0040-1) cyt = m.geometry_utils.create_icosphere(name='CYT', radius=0.6, subdivisions=4) """ 0060-1) We will add a second organelle and move it a bit to the right. """ o2v = m.geometry_utils.create_icosphere(name='O2V', radius=0.2, subdivisions=4) o2v.translate((0, 0.35, 0))