{"action":"created","comment":{"url":"https://api.github.com/repos/simpeg/simpeg/pulls/comments/51920722","id":51920722,"diff_hunk":"@@ -0,0 +1,265 @@\n+from SimPEG.EM.Utils import omega\n+from SimPEG import mkvc\n+from scipy.constants import mu_0\n+from SimPEG.MT.BaseMT import BaseMTProblem\n+from SimPEG.MT.SurveyMT import Survey, Data\n+from SimPEG.MT.FieldsMT import Fields1D_e\n+from SimPEG.MT.Utils.MT1Danalytic import getEHfields\n+import numpy as np\n+import multiprocessing, sys, time\n+\n+\n+class eForm_psField(BaseMTProblem):\n+    \"\"\"\n+    A MT problem soving a e formulation and primary/secondary fields decomposion.\n+\n+    By eliminating the magnetic flux density using\n+\n+        .. math ::\n+\n+            \\mathbf{b} = \\\\frac{1}{i \\omega}\\\\left(-\\mathbf{C} \\mathbf{e} \\\\right)\n+\n+\n+    we can write Maxwell's equations as a second order system in \\\\\\(\\\\\\mathbf{e}\\\\\\) only:\n+\n+    .. math ::\n+        \\\\left(\\mathbf{C}^T \\mathbf{M^f_{\\mu^{-1}}} \\mathbf{C} + i \\omega \\mathbf{M^e_\\sigma}] \\mathbf{e}_{s} =& i \\omega \\mathbf{M^e_{\\delta \\sigma}} \\mathbf{e}_{p}\n+    which we solve for \\\\\\(\\\\\\mathbf{e_s}\\\\\\). The total field \\\\\\mathbf{e}\\\\ = \\\\\\mathbf{e_p}\\\\ + \\\\\\mathbf{e_s}\\\\.\n+\n+    The primary field is estimated from a background model (commonly half space ).\n+\n+\n+    \"\"\"\n+    # From FDEMproblem: Used to project the fields. Currently not used for MTproblem.\n+    _fieldType = 'e_1d'\n+    _eqLocs    = 'EF'\n+    _sigmaPrimary = None\n+\n+\n+    def __init__(self, mesh, **kwargs):\n+        BaseMTProblem.__init__(self, mesh, **kwargs)\n+        self.fieldsPair = Fields1D_e\n+        # self._sigmaPrimary = sigmaPrimary\n+\n+    @property\n+    def sigmaPrimary(self):\n+        \"\"\"\n+        A background model, use for the calculation of the primary fields.\n+\n+        \"\"\"\n+        return self._sigmaPrimary\n+    @sigmaPrimary.setter\n+    def sigmaPrimary(self, val):\n+        # Note: TODO add logic for val, make sure it is the correct size.\n+        self._sigmaPrimary = val\n+\n+    def getA(self, freq):\n+        \"\"\"\n+            Function to get the A matrix.\n+\n+            :param float freq: Frequency\n+            :rtype: scipy.sparse.csr_matrix\n+            :return: A\n+        \"\"\"\n+\n+        Mmui = self.mesh.getEdgeInnerProduct(1.0/mu_0)","path":"SimPEG/MT/Problem1D/Probs.py","position":65,"original_position":65,"commit_id":"b8bd011662e31d6e773f8b49306354add908816c","original_commit_id":"b8bd011662e31d6e773f8b49306354add908816c","user":{"login":"lheagy","id":6361812,"avatar_url":"https://avatars.githubusercontent.com/u/6361812?v=3","gravatar_id":"","url":"https://api.github.com/users/lheagy","html_url":"https://github.com/lheagy","followers_url":"https://api.github.com/users/lheagy/followers","following_url":"https://api.github.com/users/lheagy/following{/other_user}","gists_url":"https://api.github.com/users/lheagy/gists{/gist_id}","starred_url":"https://api.github.com/users/lheagy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lheagy/subscriptions","organizations_url":"https://api.github.com/users/lheagy/orgs","repos_url":"https://api.github.com/users/lheagy/repos","events_url":"https://api.github.com/users/lheagy/events{/privacy}","received_events_url":"https://api.github.com/users/lheagy/received_events","type":"User","site_admin":false},"body":"I would re-name this MeMui (lives on edges) and similarly for below, MfSigma (lives on faces) to be explicit ","created_at":"2016-02-04T19:05:08Z","updated_at":"2016-02-04T19:05:08Z","html_url":"https://github.com/simpeg/simpeg/pull/211#discussion_r51920722","pull_request_url":"https://api.github.com/repos/simpeg/simpeg/pulls/211","_links":{"self":{"href":"https://api.github.com/repos/simpeg/simpeg/pulls/comments/51920722"},"html":{"href":"https://github.com/simpeg/simpeg/pull/211#discussion_r51920722"},"pull_request":{"href":"https://api.github.com/repos/simpeg/simpeg/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/simpeg/simpeg/pulls/211","id":57553951,"html_url":"https://github.com/simpeg/simpeg/pull/211","diff_url":"https://github.com/simpeg/simpeg/pull/211.diff","patch_url":"https://github.com/simpeg/simpeg/pull/211.patch","issue_url":"https://api.github.com/repos/simpeg/simpeg/issues/211","number":211,"state":"open","locked":false,"title":"Merge MT into dev","user":{"login":"rowanc1","id":913249,"avatar_url":"https://avatars.githubusercontent.com/u/913249?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanc1","html_url":"https://github.com/rowanc1","followers_url":"https://api.github.com/users/rowanc1/followers","following_url":"https://api.github.com/users/rowanc1/following{/other_user}","gists_url":"https://api.github.com/users/rowanc1/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanc1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanc1/subscriptions","organizations_url":"https://api.github.com/users/rowanc1/orgs","repos_url":"https://api.github.com/users/rowanc1/repos","events_url":"https://api.github.com/users/rowanc1/events{/privacy}","received_events_url":"https://api.github.com/users/rowanc1/received_events","type":"User","site_admin":false},"body":"- [ ] Get example of 1D forward\r\n- [ ] Get (small) example of 3D forward\r\n- [ ] Document the major pieces (classes etc.)\r\n- [ ] Document the equations used\r\n- [ ] Celebrate\r\n","created_at":"2016-01-28T19:39:25Z","updated_at":"2016-02-04T19:05:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9453b39c49dcf77d217af67c136fdbec5a8813f","assignee":{"login":"grosenkj","id":6052367,"avatar_url":"https://avatars.githubusercontent.com/u/6052367?v=3","gravatar_id":"","url":"https://api.github.com/users/grosenkj","html_url":"https://github.com/grosenkj","followers_url":"https://api.github.com/users/grosenkj/followers","following_url":"https://api.github.com/users/grosenkj/following{/other_user}","gists_url":"https://api.github.com/users/grosenkj/gists{/gist_id}","starred_url":"https://api.github.com/users/grosenkj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosenkj/subscriptions","organizations_url":"https://api.github.com/users/grosenkj/orgs","repos_url":"https://api.github.com/users/grosenkj/repos","events_url":"https://api.github.com/users/grosenkj/events{/privacy}","received_events_url":"https://api.github.com/users/grosenkj/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/simpeg/simpeg/pulls/211/commits","review_comments_url":"https://api.github.com/repos/simpeg/simpeg/pulls/211/comments","review_comment_url":"https://api.github.com/repos/simpeg/simpeg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simpeg/simpeg/issues/211/comments","statuses_url":"https://api.github.com/repos/simpeg/simpeg/statuses/b8bd011662e31d6e773f8b49306354add908816c","head":{"label":"simpeg:mt/dev","ref":"mt/dev","sha":"b8bd011662e31d6e773f8b49306354add908816c","user":{"login":"simpeg","id":6043842,"avatar_url":"https://avatars.githubusercontent.com/u/6043842?v=3","gravatar_id":"","url":"https://api.github.com/users/simpeg","html_url":"https://github.com/simpeg","followers_url":"https://api.github.com/users/simpeg/followers","following_url":"https://api.github.com/users/simpeg/following{/other_user}","gists_url":"https://api.github.com/users/simpeg/gists{/gist_id}","starred_url":"https://api.github.com/users/simpeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simpeg/subscriptions","organizations_url":"https://api.github.com/users/simpeg/orgs","repos_url":"https://api.github.com/users/simpeg/repos","events_url":"https://api.github.com/users/simpeg/events{/privacy}","received_events_url":"https://api.github.com/users/simpeg/received_events","type":"Organization","site_admin":false},"repo":{"id":14727320,"name":"simpeg","full_name":"simpeg/simpeg","owner":{"login":"simpeg","id":6043842,"avatar_url":"https://avatars.githubusercontent.com/u/6043842?v=3","gravatar_id":"","url":"https://api.github.com/users/simpeg","html_url":"https://github.com/simpeg","followers_url":"https://api.github.com/users/simpeg/followers","following_url":"https://api.github.com/users/simpeg/following{/other_user}","gists_url":"https://api.github.com/users/simpeg/gists{/gist_id}","starred_url":"https://api.github.com/users/simpeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simpeg/subscriptions","organizations_url":"https://api.github.com/users/simpeg/orgs","repos_url":"https://api.github.com/users/simpeg/repos","events_url":"https://api.github.com/users/simpeg/events{/privacy}","received_events_url":"https://api.github.com/users/simpeg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simpeg/simpeg","description":"Simulation and Parameter Estimation in Geophysics  -  A python package for simulation and gradient based parameter estimation in the context of geophysical applications.","fork":false,"url":"https://api.github.com/repos/simpeg/simpeg","forks_url":"https://api.github.com/repos/simpeg/simpeg/forks","keys_url":"https://api.github.com/repos/simpeg/simpeg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simpeg/simpeg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simpeg/simpeg/teams","hooks_url":"https://api.github.com/repos/simpeg/simpeg/hooks","issue_events_url":"https://api.github.com/repos/simpeg/simpeg/issues/events{/number}","events_url":"https://api.github.com/repos/simpeg/simpeg/events","assignees_url":"https://api.github.com/repos/simpeg/simpeg/assignees{/user}","branches_url":"https://api.github.com/repos/simpeg/simpeg/branches{/branch}","tags_url":"https://api.github.com/repos/simpeg/simpeg/tags","blobs_url":"https://api.github.com/repos/simpeg/simpeg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simpeg/simpeg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simpeg/simpeg/git/refs{/sha}","trees_url":"https://api.github.com/repos/simpeg/simpeg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simpeg/simpeg/statuses/{sha}","languages_url":"https://api.github.com/repos/simpeg/simpeg/languages","stargazers_url":"https://api.github.com/repos/simpeg/simpeg/stargazers","contributors_url":"https://api.github.com/repos/simpeg/simpeg/contributors","subscribers_url":"https://api.github.com/repos/simpeg/simpeg/subscribers","subscription_url":"https://api.github.com/repos/simpeg/simpeg/subscription","commits_url":"https://api.github.com/repos/simpeg/simpeg/commits{/sha}","git_commits_url":"https://api.github.com/repos/simpeg/simpeg/git/commits{/sha}","comments_url":"https://api.github.com/repos/simpeg/simpeg/comments{/number}","issue_comment_url":"https://api.github.com/repos/simpeg/simpeg/issues/comments{/number}","contents_url":"https://api.github.com/repos/simpeg/simpeg/contents/{+path}","compare_url":"https://api.github.com/repos/simpeg/simpeg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simpeg/simpeg/merges","archive_url":"https://api.github.com/repos/simpeg/simpeg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simpeg/simpeg/downloads","issues_url":"https://api.github.com/repos/simpeg/simpeg/issues{/number}","pulls_url":"https://api.github.com/repos/simpeg/simpeg/pulls{/number}","milestones_url":"https://api.github.com/repos/simpeg/simpeg/milestones{/number}","notifications_url":"https://api.github.com/repos/simpeg/simpeg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simpeg/simpeg/labels{/name}","releases_url":"https://api.github.com/repos/simpeg/simpeg/releases{/id}","deployments_url":"https://api.github.com/repos/simpeg/simpeg/deployments","created_at":"2013-11-26T19:46:36Z","updated_at":"2016-01-27T23:32:06Z","pushed_at":"2016-02-04T17:25:20Z","git_url":"git://github.com/simpeg/simpeg.git","ssh_url":"git@github.com:simpeg/simpeg.git","clone_url":"https://github.com/simpeg/simpeg.git","svn_url":"https://github.com/simpeg/simpeg","homepage":null,"size":8464,"stargazers_count":26,"watchers_count":26,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":41,"forks":4,"open_issues":41,"watchers":26,"default_branch":"master"}},"base":{"label":"simpeg:dev","ref":"dev","sha":"5dab7ac1a86ba3cb1892142237707e4efd8879c0","user":{"login":"simpeg","id":6043842,"avatar_url":"https://avatars.githubusercontent.com/u/6043842?v=3","gravatar_id":"","url":"https://api.github.com/users/simpeg","html_url":"https://github.com/simpeg","followers_url":"https://api.github.com/users/simpeg/followers","following_url":"https://api.github.com/users/simpeg/following{/other_user}","gists_url":"https://api.github.com/users/simpeg/gists{/gist_id}","starred_url":"https://api.github.com/users/simpeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simpeg/subscriptions","organizations_url":"https://api.github.com/users/simpeg/orgs","repos_url":"https://api.github.com/users/simpeg/repos","events_url":"https://api.github.com/users/simpeg/events{/privacy}","received_events_url":"https://api.github.com/users/simpeg/received_events","type":"Organization","site_admin":false},"repo":{"id":14727320,"name":"simpeg","full_name":"simpeg/simpeg","owner":{"login":"simpeg","id":6043842,"avatar_url":"https://avatars.githubusercontent.com/u/6043842?v=3","gravatar_id":"","url":"https://api.github.com/users/simpeg","html_url":"https://github.com/simpeg","followers_url":"https://api.github.com/users/simpeg/followers","following_url":"https://api.github.com/users/simpeg/following{/other_user}","gists_url":"https://api.github.com/users/simpeg/gists{/gist_id}","starred_url":"https://api.github.com/users/simpeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simpeg/subscriptions","organizations_url":"https://api.github.com/users/simpeg/orgs","repos_url":"https://api.github.com/users/simpeg/repos","events_url":"https://api.github.com/users/simpeg/events{/privacy}","received_events_url":"https://api.github.com/users/simpeg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simpeg/simpeg","description":"Simulation and Parameter Estimation in Geophysics  -  A python package for simulation and gradient based parameter estimation in the context of geophysical applications.","fork":false,"url":"https://api.github.com/repos/simpeg/simpeg","forks_url":"https://api.github.com/repos/simpeg/simpeg/forks","keys_url":"https://api.github.com/repos/simpeg/simpeg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simpeg/simpeg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simpeg/simpeg/teams","hooks_url":"https://api.github.com/repos/simpeg/simpeg/hooks","issue_events_url":"https://api.github.com/repos/simpeg/simpeg/issues/events{/number}","events_url":"https://api.github.com/repos/simpeg/simpeg/events","assignees_url":"https://api.github.com/repos/simpeg/simpeg/assignees{/user}","branches_url":"https://api.github.com/repos/simpeg/simpeg/branches{/branch}","tags_url":"https://api.github.com/repos/simpeg/simpeg/tags","blobs_url":"https://api.github.com/repos/simpeg/simpeg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simpeg/simpeg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simpeg/simpeg/git/refs{/sha}","trees_url":"https://api.github.com/repos/simpeg/simpeg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simpeg/simpeg/statuses/{sha}","languages_url":"https://api.github.com/repos/simpeg/simpeg/languages","stargazers_url":"https://api.github.com/repos/simpeg/simpeg/stargazers","contributors_url":"https://api.github.com/repos/simpeg/simpeg/contributors","subscribers_url":"https://api.github.com/repos/simpeg/simpeg/subscribers","subscription_url":"https://api.github.com/repos/simpeg/simpeg/subscription","commits_url":"https://api.github.com/repos/simpeg/simpeg/commits{/sha}","git_commits_url":"https://api.github.com/repos/simpeg/simpeg/git/commits{/sha}","comments_url":"https://api.github.com/repos/simpeg/simpeg/comments{/number}","issue_comment_url":"https://api.github.com/repos/simpeg/simpeg/issues/comments{/number}","contents_url":"https://api.github.com/repos/simpeg/simpeg/contents/{+path}","compare_url":"https://api.github.com/repos/simpeg/simpeg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simpeg/simpeg/merges","archive_url":"https://api.github.com/repos/simpeg/simpeg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simpeg/simpeg/downloads","issues_url":"https://api.github.com/repos/simpeg/simpeg/issues{/number}","pulls_url":"https://api.github.com/repos/simpeg/simpeg/pulls{/number}","milestones_url":"https://api.github.com/repos/simpeg/simpeg/milestones{/number}","notifications_url":"https://api.github.com/repos/simpeg/simpeg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simpeg/simpeg/labels{/name}","releases_url":"https://api.github.com/repos/simpeg/simpeg/releases{/id}","deployments_url":"https://api.github.com/repos/simpeg/simpeg/deployments","created_at":"2013-11-26T19:46:36Z","updated_at":"2016-01-27T23:32:06Z","pushed_at":"2016-02-04T17:25:20Z","git_url":"git://github.com/simpeg/simpeg.git","ssh_url":"git@github.com:simpeg/simpeg.git","clone_url":"https://github.com/simpeg/simpeg.git","svn_url":"https://github.com/simpeg/simpeg","homepage":null,"size":8464,"stargazers_count":26,"watchers_count":26,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":41,"forks":4,"open_issues":41,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simpeg/simpeg/pulls/211"},"html":{"href":"https://github.com/simpeg/simpeg/pull/211"},"issue":{"href":"https://api.github.com/repos/simpeg/simpeg/issues/211"},"comments":{"href":"https://api.github.com/repos/simpeg/simpeg/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/simpeg/simpeg/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/simpeg/simpeg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simpeg/simpeg/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/simpeg/simpeg/statuses/b8bd011662e31d6e773f8b49306354add908816c"}}}}