{"action":"created","issue":{"url":"https://api.github.com/repos/mcellteam/mcell/issues/21","labels_url":"https://api.github.com/repos/mcellteam/mcell/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/mcellteam/mcell/issues/21/comments","events_url":"https://api.github.com/repos/mcellteam/mcell/issues/21/events","html_url":"https://github.com/mcellteam/mcell/issues/21","id":111213815,"number":21,"title":"Overlapping/coplanar faces can cause leaks","user":{"login":"jczech","id":5074309,"avatar_url":"https://avatars.githubusercontent.com/u/5074309?v=3","gravatar_id":"","url":"https://api.github.com/users/jczech","html_url":"https://github.com/jczech","followers_url":"https://api.github.com/users/jczech/followers","following_url":"https://api.github.com/users/jczech/following{/other_user}","gists_url":"https://api.github.com/users/jczech/gists{/gist_id}","starred_url":"https://api.github.com/users/jczech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jczech/subscriptions","organizations_url":"https://api.github.com/users/jczech/orgs","repos_url":"https://api.github.com/users/jczech/repos","events_url":"https://api.github.com/users/jczech/events{/privacy}","received_events_url":"https://api.github.com/users/jczech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-13T16:08:42Z","updated_at":"2015-10-14T14:56:56Z","closed_at":null,"body":"This issue is being created because of a problem that Bob reported while creating a tutorial for Fick's Law. I've simplified his original MDL considerably and am including it here. The root of the problem is the fact that some faces in his model are overlapping/coplanar, which results in molecules leaking out. If two faces are identical, MCell will report an error as long as the ``with_checks`` flag isn't disabled. We've known that coplanar faces can cause problems in the past and even warn against it in the QRG (http://mcell.org/documentation/qrg/mcell3_qrg.html#avoid-coincident-meshes), but we've never taken any steps to resolve it afaik, aside from the special case where they are completely overlapping (i.e. identical).\r\n\r\n    ITERATIONS = 500\r\n    TIME_STEP = 1e-06\r\n\r\n    DEFINE_MOLECULES {\r\n      vm { DIFFUSION_CONSTANT_3D = 1e-05 }\r\n    }\r\n\r\n    box BOX {\r\n      CORNERS = [0.01,-0.3,-0.3],[0.09,0.3,0.3]\r\n    }\r\n\r\n    plane POLYGON_LIST {\r\n      VERTEX_LIST\r\n      {\r\n        // The directions (e.g. bottom, top) used below were chosen somewhat\r\n        // arbitrarily by looking along the X-axis (from negative to positive) with\r\n        // the Z-axis pointing up in Blender. \r\n        //\r\n        // This probably won't look right if you don't use a monospaced font\r\n        /*\r\n           2     3\r\n            -----\r\n            |\\  |\r\n            | \\ |\r\n            |__\\|\r\n           1     0\r\n        */\r\n        [0.01,-0.3,-0.3]  // bottom right\r\n        [0.01,0.3,-0.3]   // bottom left\r\n        [0.01,0.3,0.3]    // top left\r\n        [0.01,-0.3,0.3]   // top right\r\n      }\r\n      ELEMENT_CONNECTIONS\r\n      {\r\n        // The faces and vertices directly overlap. Mcell will catch this as long\r\n        // as the \"with_checks\" flag isn't set to \"no\".\r\n        /*[1, 2, 3]*/\r\n        /*[3, 0, 1]*/\r\n        // The vertices directly overlap, but not the faces. Mcell will not catch\r\n        // this.\r\n        [0, 1, 2]\r\n        [2, 3, 0]\r\n      }\r\n    }\r\n\r\n    INSTANTIATE world OBJECT\r\n    {\r\n      box OBJECT box {}\r\n      box_rel RELEASE_SITE\r\n      {\r\n        SHAPE = world.box\r\n        MOLECULE = vm\r\n        NUMBER_TO_RELEASE = 250\r\n      }\r\n      plane OBJECT plane {}\r\n    }\r\n\r\n    VIZ_OUTPUT\r\n    {\r\n      MODE = CELLBLENDER\r\n      FILENAME = \"./viz_data/fick\"\r\n      MOLECULES\r\n      {\r\n        NAME_LIST {ALL_MOLECULES}\r\n        ITERATION_NUMBERS {ALL_DATA @ ALL_ITERATIONS}\r\n      }\r\n    }"},"comment":{"url":"https://api.github.com/repos/mcellteam/mcell/issues/comments/148075980","html_url":"https://github.com/mcellteam/mcell/issues/21#issuecomment-148075980","issue_url":"https://api.github.com/repos/mcellteam/mcell/issues/21","id":148075980,"user":{"login":"jczech","id":5074309,"avatar_url":"https://avatars.githubusercontent.com/u/5074309?v=3","gravatar_id":"","url":"https://api.github.com/users/jczech","html_url":"https://github.com/jczech","followers_url":"https://api.github.com/users/jczech/followers","following_url":"https://api.github.com/users/jczech/following{/other_user}","gists_url":"https://api.github.com/users/jczech/gists{/gist_id}","starred_url":"https://api.github.com/users/jczech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jczech/subscriptions","organizations_url":"https://api.github.com/users/jczech/orgs","repos_url":"https://api.github.com/users/jczech/repos","events_url":"https://api.github.com/users/jczech/events{/privacy}","received_events_url":"https://api.github.com/users/jczech/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T14:56:56Z","updated_at":"2015-10-14T14:56:56Z","body":"Here's an example where MCell catches the coplanar faces (and issues an error) even though the vertices aren't coincident at all:\r\n\r\n    ITERATIONS = 1000\r\n    TIME_STEP = 1e-6\r\n\r\n    DEFINE_MOLECULES\r\n    {\r\n      sm { DIFFUSION_CONSTANT_2D = 1e-06 }\r\n    }\r\n\r\n    Triangle POLYGON_LIST\r\n    {\r\n      VERTEX_LIST\r\n      {\r\n        [ -1, -1, 0 ]\r\n        [ 1, -1, 0 ]\r\n        [ -1, 1, 0 ]\r\n      }\r\n      ELEMENT_CONNECTIONS\r\n      {\r\n        [ 0, 1, 2 ]\r\n      }\r\n    }\r\n\r\n    INSTANTIATE Scene OBJECT\r\n    {\r\n      Triangle OBJECT Triangle{}\r\n      Triangle2 OBJECT Triangle{ SCALE = [1.5, 1.5, 1.5] TRANSLATE = [0.2, 0.2, 0.0]}\r\n      // This version of Triangle2 will work since it's slightly offset along the\r\n      // z-axis\r\n      /*Triangle2 OBJECT Triangle{ SCALE = [1.5, 1.5, 1.5] TRANSLATE = [0.2, 0.2, 0.05]}*/\r\n      rel RELEASE_SITE\r\n      {\r\n        SHAPE = Scene.Triangle\r\n        MOLECULE = sm'\r\n        NUMBER_TO_RELEASE = 1000\r\n      }\r\n    }"}}