{"action":"created","issue":{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1018","labels_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1018/labels{/name}","comments_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1018/comments","events_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1018/events","html_url":"https://github.com/ComputationalRadiationPhysics/picongpu/pull/1018","id":99424386,"number":1018,"title":"Particle Manipulators: Init Multi Ion Species","user":{"login":"ax3l","id":1353258,"avatar_url":"https://avatars.githubusercontent.com/u/1353258?v=3","gravatar_id":"","url":"https://api.github.com/users/ax3l","html_url":"https://github.com/ax3l","followers_url":"https://api.github.com/users/ax3l/followers","following_url":"https://api.github.com/users/ax3l/following{/other_user}","gists_url":"https://api.github.com/users/ax3l/gists{/gist_id}","starred_url":"https://api.github.com/users/ax3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ax3l/subscriptions","organizations_url":"https://api.github.com/users/ax3l/orgs","repos_url":"https://api.github.com/users/ax3l/repos","events_url":"https://api.github.com/users/ax3l/events{/privacy}","received_events_url":"https://api.github.com/users/ax3l/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/labels/core","name":"core","color":"00589c"},{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/labels/feature","name":"feature","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"PrometheusPi","id":5121158,"avatar_url":"https://avatars.githubusercontent.com/u/5121158?v=3","gravatar_id":"","url":"https://api.github.com/users/PrometheusPi","html_url":"https://github.com/PrometheusPi","followers_url":"https://api.github.com/users/PrometheusPi/followers","following_url":"https://api.github.com/users/PrometheusPi/following{/other_user}","gists_url":"https://api.github.com/users/PrometheusPi/gists{/gist_id}","starred_url":"https://api.github.com/users/PrometheusPi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrometheusPi/subscriptions","organizations_url":"https://api.github.com/users/PrometheusPi/orgs","repos_url":"https://api.github.com/users/PrometheusPi/repos","events_url":"https://api.github.com/users/PrometheusPi/events{/privacy}","received_events_url":"https://api.github.com/users/PrometheusPi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/milestones/2","html_url":"https://github.com/ComputationalRadiationPhysics/picongpu/milestones/Open%20Beta","labels_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/milestones/2/labels","id":395839,"number":2,"title":"Open Beta","description":"Tasks to complete until the release of our open beta (version 0.1)\r\n\r\nThe [beta](https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta) release shall be useful for *physicist* that used a Particle-in-Cell code *before*. Experience with *compiling libraries from source* and a *good Linux knowledge* is required for the initial installation.\r\n","creator":{"login":"ax3l","id":1353258,"avatar_url":"https://avatars.githubusercontent.com/u/1353258?v=3","gravatar_id":"","url":"https://api.github.com/users/ax3l","html_url":"https://github.com/ax3l","followers_url":"https://api.github.com/users/ax3l/followers","following_url":"https://api.github.com/users/ax3l/following{/other_user}","gists_url":"https://api.github.com/users/ax3l/gists{/gist_id}","starred_url":"https://api.github.com/users/ax3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ax3l/subscriptions","organizations_url":"https://api.github.com/users/ax3l/orgs","repos_url":"https://api.github.com/users/ax3l/repos","events_url":"https://api.github.com/users/ax3l/events{/privacy}","received_events_url":"https://api.github.com/users/ax3l/received_events","type":"User","site_admin":false},"open_issues":143,"closed_issues":1035,"state":"open","created_at":"2013-08-06T16:38:57Z","updated_at":"2015-12-02T20:53:35Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-08-06T12:29:05Z","updated_at":"2015-12-03T09:56:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/pulls/1018","html_url":"https://github.com/ComputationalRadiationPhysics/picongpu/pull/1018","diff_url":"https://github.com/ComputationalRadiationPhysics/picongpu/pull/1018.diff","patch_url":"https://github.com/ComputationalRadiationPhysics/picongpu/pull/1018.patch"},"body":"This commit adds new manipulators that can be used during the species init-pipeline.\r\n\r\n- `RatioWeightingImpl`: Useful to clone one ion species from an other ion species by still satisfying the `densityRatio` of the new created species.\r\n\r\n- `ProtonTimesWeightingImpl`: Useful to clone electron species from an ion species for pre-ionized plasmas. The weighting of the electrons is simply multiplied by the proton number of the initial ion species.\r\n\r\n### Example Usage\r\n\r\nin `particleConfig.param`:\r\n```c++\r\nnamespace picongpu\r\n{\r\nnamespace particles\r\n{\r\n// [...]\r\nnamespace manipulators\r\n{\r\n    // [...]\r\n    typedef ProtonTimesWeightingImpl ProtonTimesWeighting;\r\n    typedef RatioWeightingImpl RatioWeighting;\r\n} /* namespace manipulators */\r\n// [...]\r\n} /* namespace particles */\r\n} /* namespace picongpu */\r\n```\r\n\r\nin `speciesInitialization.param`:\r\n```c++\r\nnamespace picongpu\r\n{\r\nnamespace particles\r\n{\r\n    // [...]\r\n    // Init-Pipeline for PMMA with Carbon, Oxygen, Proton and a general Electron species\r\n    // (4 species in total, need to be defined in `speciesDefinition.param`)\r\n    typedef mpl::vector<\r\n        /* at this point, the reference density is taken to calculate weightings */\r\n        CreateGas<gasProfiles::SphereFlanks, startPosition::Random, PIC_Proton>,\r\n        /* clone and weight additional ions according to their `densityRatio` */\r\n        ManipulateCloneSpecies<manipulators::RatioWeighting, PIC_Proton, PIC_Carbon>,\r\n        ManipulateCloneSpecies<manipulators::RatioWeighting, PIC_Proton, PIC_Oxygen>,\r\n        /* re-distribute new ion species in their cell */\r\n        Manipulate<manipulators::RandomPosition, PIC_Carbon>,\r\n        Manipulate<manipulators::RandomPosition, PIC_Oxygen>,\r\n        /* create electrons with numberOfProtons-higher weighting to emulate pre-ionization,\r\n         * additionally, the initial plasma distribution is now field-neutral */\r\n        ManipulateCloneSpecies<manipulators::ProtonTimesWeighting, PIC_Carbon, PIC_Electrons>,\r\n        ManipulateCloneSpecies<manipulators::ProtonTimesWeighting, PIC_Oxygen, PIC_Electrons>,\r\n        /* cloning from Hydrogen (Protons) is always easy: numberOfProtons == 1 */\r\n        CloneSpecies<PIC_Proton, PIC_Electrons>\r\n    > InitPipeline;\r\n} /* namespace particles */\r\n} /* namespace picongpu */\r\n```\r\n\r\n### Note\r\n\r\nI did only add the second part of the documentation for the new work-flow in `speciesInitialization.param` ([docs init pipeline](https://github.com/ComputationalRadiationPhysics/picongpu/blob/df8e8de789d564b707c6f6936bacb435f8428c11/src/picongpu/include/simulation_defines/param/speciesInitialization.param#L30-L79)) yet.\r\nMissing part: the `particleConfig.param` (will probably be renamed) does include and select (via `typedef`) the `particles/manipulators/` that are used in `speciesInitialization.param` and is not yet documented (will contain a list + short description of all manipulators before the next release, see #1020).\r\n\r\n### To do\r\n\r\n- [x] compile test: I changed the namings a bit for the functors from my local branch (which was runtime tested)\r\n- add example in follow-up PR? (which one?)\r\n- add according `.def` file to each manipulator's `.hpp` file -> follow-up PR?"},"comment":{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/comments/161573000","html_url":"https://github.com/ComputationalRadiationPhysics/picongpu/pull/1018#issuecomment-161573000","issue_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1018","id":161573000,"user":{"login":"PrometheusPi","id":5121158,"avatar_url":"https://avatars.githubusercontent.com/u/5121158?v=3","gravatar_id":"","url":"https://api.github.com/users/PrometheusPi","html_url":"https://github.com/PrometheusPi","followers_url":"https://api.github.com/users/PrometheusPi/followers","following_url":"https://api.github.com/users/PrometheusPi/following{/other_user}","gists_url":"https://api.github.com/users/PrometheusPi/gists{/gist_id}","starred_url":"https://api.github.com/users/PrometheusPi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrometheusPi/subscriptions","organizations_url":"https://api.github.com/users/PrometheusPi/orgs","repos_url":"https://api.github.com/users/PrometheusPi/repos","events_url":"https://api.github.com/users/PrometheusPi/events{/privacy}","received_events_url":"https://api.github.com/users/PrometheusPi/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T09:56:38Z","updated_at":"2015-12-03T09:56:38Z","body":"Great pull request :+1: \r\nJust some minor comments on names and one question on the definition of `densityRatio`.\r\n\r\n@ax3l have you decided what you will do with the following points:\r\n>\r\n- add example in follow-up PR? (which one?)\r\n- add according `.def` file to each manipulator's `.hpp` file -> follow-up PR?\r\n"}}