mcellteam / mcell

MCell Monte Carlo Simulator of Cellular Microphysiology
Other
33 stars 11 forks source link

ABSORPTIVE = ALL_MOLECULES #24

Open jczech opened 8 years ago

jczech commented 8 years ago

A strange bug can be triggered when creating a surface class where all molecules should be absorbed (i.e. ABSORPTIVE = ALL_MOLECULES). The problem is that volume molecules are not absorbed after the first time step. This seems to require a fairly specific set of conditions to trigger. The following conditions are sufficient (and possibly necessary):

If you make any of the following changes, the bug will not happen:

Here is an example of a test that triggers the bug:

ITERATIONS = 1000
TIME_STEP = 1e-06

DEFINE_MOLECULES
{
  vm { DIFFUSION_CONSTANT_3D = 1e-06 }
  sm { DIFFUSION_CONSTANT_2D = 1e-05 }
}

DEFINE_SURFACE_CLASSES
{
  sc
  {
    /*ABSORPTIVE = ALL_VOLUME_MOLECULES;*/
    /*ABSORPTIVE = ALL_SURFACE_MOLECULES;*/
    ABSORPTIVE = ALL_MOLECULES;
  }
}

Cube POLYGON_LIST
{
  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 ]
  }
  ELEMENT_CONNECTIONS
  {
    [ 0, 1, 2 ]
    [ 4, 7, 5 ]
    [ 0, 4, 1 ]
    [ 1, 5, 2 ]
    [ 2, 6, 7 ]
    [ 4, 0, 7 ]
    [ 3, 0, 2 ]
    [ 4, 5, 1 ]
    [ 0, 3, 7 ]
    [ 7, 6, 5 ]
    [ 3, 2, 7 ]
    [ 5, 6, 2 ]
  }
  DEFINE_SURFACE_REGIONS
  {
    sr
    {
      INCLUDE_ELEMENTS = [4, 10]
    }
  }
}

MODIFY_SURFACE_REGIONS
{
  /*Cube[sr]*/
  Cube[ALL]
  {
    SURFACE_CLASS = sc
  }
}

INSTANTIATE Scene OBJECT
{
  Cube OBJECT Cube {}
  rel_vm RELEASE_SITE
  {
   SHAPE = Scene.Cube
   MOLECULE = vm
   NUMBER_TO_RELEASE = 1000
  }
  rel_sm RELEASE_SITE
  {
   SHAPE = Scene.Cube
   MOLECULE = sm'
   NUMBER_TO_RELEASE = 1000
  }
}

/*VIZ_OUTPUT*/
/*{*/
/*  MODE = CELLBLENDER*/
/*  FILENAME = "./viz_data/Scene"*/
/*  MOLECULES*/
/*  {*/
/*    NAME_LIST {ALL_MOLECULES}*/
/*    ITERATION_NUMBERS {ALL_DATA @ ALL_ITERATIONS}*/
/*  }*/
/*}*/

REACTION_DATA_OUTPUT
{
  STEP=1e-06
  {COUNT[sm,WORLD]}=> "./react_data/sm.World.dat"
  {COUNT[vm,WORLD]}=> "./react_data/vm.World.dat"
}