{"action":"created","issue":{"url":"https://api.github.com/repos/agnwinds/python/issues/164","labels_url":"https://api.github.com/repos/agnwinds/python/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/agnwinds/python/issues/164/comments","events_url":"https://api.github.com/repos/agnwinds/python/issues/164/events","html_url":"https://github.com/agnwinds/python/issues/164","id":100702379,"number":164,"title":"Domains","user":{"login":"kslong","id":2530901,"avatar_url":"https://avatars.githubusercontent.com/u/2530901?v=3","gravatar_id":"","url":"https://api.github.com/users/kslong","html_url":"https://github.com/kslong","followers_url":"https://api.github.com/users/kslong/followers","following_url":"https://api.github.com/users/kslong/following{/other_user}","gists_url":"https://api.github.com/users/kslong/gists{/gist_id}","starred_url":"https://api.github.com/users/kslong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kslong/subscriptions","organizations_url":"https://api.github.com/users/kslong/orgs","repos_url":"https://api.github.com/users/kslong/repos","events_url":"https://api.github.com/users/kslong/events{/privacy}","received_events_url":"https://api.github.com/users/kslong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-13T06:53:37Z","updated_at":"2015-08-13T08:32:19Z","closed_at":null,"body":"This is an area to discuss how we implement domains in Python.  My first efforts on this have not been entirely successful and I think it is a good idea to try to summarize what we want to do and what are the issues associated with this.\r\n\r\nWe currently store nearly all of the information about a model in python.h.  We have a single Wind structure, a single Plasma structure, and a geo structure.   Nominally.\r\n\r\ngeo includes most of what is read in from the command line, and lots of derived quantities such as luminosity and convergence results\r\n\r\nwind defines the grid, and contains velocities.  The grid covers the entire \"space\" in which the radiative transfer is calculated.  \r\n\r\nplasma defines the physical conditions in each grid cell that has volume in the actual wind.\r\n\r\nIn addiction, python.h contains many derived quantities to facilitate the calculation.  These include arrays which are used for identifying where a photon is in the wind.  It also contains all of the rest of the structures and a lot of \"control\" data for the program.\r\n\r\nNote that saving the wind, amounts to saving the geo, wind, and plasma structures.\r\n\r\nWith the addition of multiple components to the wind, e.g the disk layer, we are introducing the concept of a domain, which in terms of the \"architecture\" of the way we represent space, is at the top of the hierarchy.\r\n\r\nDomain --> Wind --> Plasma\r\n\r\nThere is nominally one element in the domain for each individual structure.  So a model consisting of and SV wind and a disk layer would have two Domain elements.  Each of those elements would have a set of associated Wind elements, which in turn would have Plams elements.\r\n\r\nDomains = 2\r\nWinds = 2 x the number of cells in each domain\r\nPlasma = 2 x the number of cells with volume in the domain\r\n\r\nOne of the issues is how geometry fits into this.  The proposed solution is to move those quantities which really describe the domains (e.g. the wind parameters) into the appropriate Domain, and leave those elements which are not domain specific in geo.  Some of the ancillary information also needs to be moved into the domains.\r\n\r\nThe issue of how to set these domains up and easily index into them is one of the main considerations.  We always need to be able to determine what wind cell (domain+windcell) that a \"photon is located in\".  There are times we would like to cycle through all of the cells in any of the regions.\r\n\r\nThere are times when we are concerned only with a single domain; there are other times we are concerned with all of the cells (usually those associated with Plasma), e.g for calculating the emission.\r\n\r\nThis suggests, we would like to have both a PlasmaMain which points to all of the plasma elements, and ways to map into just the elements for a particular domain.  Currently we create elements for each domain.  Probably, we can create a Ptr array which stores all of the elements.\r\n\r\nNote:  python.h is now very complicated, and over 1300 lines long.  I think it is time to split it into two files,  one with the stuff we want to save to the windfile, and one with everything else.\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/agnwinds/python/issues/comments/130574276","html_url":"https://github.com/agnwinds/python/issues/164#issuecomment-130574276","issue_url":"https://api.github.com/repos/agnwinds/python/issues/164","id":130574276,"user":{"login":"kslong","id":2530901,"avatar_url":"https://avatars.githubusercontent.com/u/2530901?v=3","gravatar_id":"","url":"https://api.github.com/users/kslong","html_url":"https://github.com/kslong","followers_url":"https://api.github.com/users/kslong/followers","following_url":"https://api.github.com/users/kslong/following{/other_user}","gists_url":"https://api.github.com/users/kslong/gists{/gist_id}","starred_url":"https://api.github.com/users/kslong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kslong/subscriptions","organizations_url":"https://api.github.com/users/kslong/orgs","repos_url":"https://api.github.com/users/kslong/repos","events_url":"https://api.github.com/users/kslong/events{/privacy}","received_events_url":"https://api.github.com/users/kslong/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T08:32:19Z","updated_at":"2015-08-13T08:32:19Z","body":"At present, wmain is created directly with a calloc statement.  As a result one can use staments like\r\nwmain[i].x\r\n\r\nIf we create individual wind arrays for each domain.  Then I don't think we can create a new array wmain that can be addressed similarly.  Even if we make wmain available without passing it directly, I think one would always have to say\r\nwmain[i]->x\r\n\r\nThis is because wmain[i] necessarily has to point to an address in a real structure.  "}}