{"action":"created","comment":{"url":"https://api.github.com/repos/idaholab/moose/pulls/comments/32636089","id":32636089,"diff_hunk":"@@ -13,54 +13,97 @@ InputParameters validParams<CHInterface>()\n   params.addClassDescription(\"Gradient energy Cahn-Hilliard Kernel\");\n   params.addRequiredParam<std::string>(\"kappa_name\", \"The kappa used with the kernel\");\n   params.addRequiredParam<std::string>(\"mob_name\", \"The mobility used with the kernel\");\n-  params.addParam<std::string>(\"Dmob_name\", \"DM\", \"The D mobility used with the kernel\");\n-  params.addRequiredParam<std::string>(\"grad_mob_name\", \"The gradient of the mobility used with the kernel\");\n-  params.addParam<bool>(\"has_MJac\", false, \"Jacobian information for the mobility is defined\");\n+  params.addCoupledVar(\"args\", \"Vector of arguments to mobility\");\n \n   return params;\n }\n \n CHInterface::CHInterface(const std::string & name, InputParameters parameters) :\n-    Kernel(name, parameters),\n+    DerivativeMaterialInterface<JvarMapInterface<Kernel> >(name, parameters),\n     _kappa_name(getParam<std::string>(\"kappa_name\")),\n     _mob_name(getParam<std::string>(\"mob_name\")),\n-    _Dmob_name(getParam<std::string>(\"Dmob_name\")),\n-    _grad_mob_name(getParam<std::string>(\"grad_mob_name\")),\n     _kappa(getMaterialProperty<Real>(_kappa_name)),\n     _M(getMaterialProperty<Real>(_mob_name)),\n-    _has_MJac(getParam<bool>(\"has_MJac\")),\n-    _DM(_has_MJac ? &getMaterialProperty<Real>(_Dmob_name) : NULL),\n-    _grad_M(getMaterialProperty<RealGradient>(_grad_mob_name)),\n-    _Dgrad_Mnp(_has_MJac ? &getMaterialProperty<RealGradient>(\"Dgrad_Mnp\") : NULL),\n-    _Dgrad_Mngp(_has_MJac ? &getMaterialProperty<Real>(\"Dgrad_Mngp\") : NULL),\n+    _dMdc(getMaterialPropertyDerivative<Real>(_mob_name, _var.name())),\n+    _d2Mdc2(getMaterialPropertyDerivative<Real>(_mob_name, _var.name(), _var.name())),\n     _second_u(second()),\n     _second_test(secondTest()),\n-    _second_phi(secondPhi())\n+    _second_phi(secondPhi()),\n+    _nvar(_coupled_moose_vars.size()),\n+    _dMdarg(_nvar),\n+    _d2Mdcdarg(_nvar),\n+    _d2Mdargdarg(_nvar),\n+    _coupled_grad_vars(_nvar)\n {\n+  // Iterate over all coupled variables\n+  for (unsigned int i = 0; i < _nvar; ++i)\n+  {\n+    //Set material property values\n+    _dMdarg[i] = &getMaterialPropertyDerivative<Real>(_mob_name, _coupled_moose_vars[i]->name());\n+    _d2Mdcdarg[i] = &getMaterialPropertyDerivative<Real>(_mob_name, _var.name(), _coupled_moose_vars[i]->name());\n+    _d2Mdargdarg[i].resize(_nvar);\n+    for (unsigned int j = 0; j < _nvar; ++j)\n+      _d2Mdargdarg[i][j] = &getMaterialPropertyDerivative<Real>(_mob_name, _coupled_moose_vars[i]->name(), _coupled_moose_vars[j]->name());\n+\n+    //Set coupled variable gradients\n+    _coupled_grad_vars[i] = &coupledGradient(\"args\", i);\n+  }\n }\n \n Real\n CHInterface::computeQpResidual()\n {\n-  return _kappa[_qp] * _second_u[_qp].tr() * (_M[_qp] * _second_test[_i][_qp].tr() + _grad_M[_qp] * _grad_test[_i][_qp]);\n+  RealGradient grad_M = _dMdc[_qp]*_grad_u[_qp];","path":"modules/phase_field/src/kernels/CHInterface.C","position":57,"original_position":57,"commit_id":"8de156cb046c39b6c023974743319a547912fbbf","original_commit_id":"8de156cb046c39b6c023974743319a547912fbbf","user":{"login":"tonkmr","id":6609220,"avatar_url":"https://avatars.githubusercontent.com/u/6609220?v=3","gravatar_id":"","url":"https://api.github.com/users/tonkmr","html_url":"https://github.com/tonkmr","followers_url":"https://api.github.com/users/tonkmr/followers","following_url":"https://api.github.com/users/tonkmr/following{/other_user}","gists_url":"https://api.github.com/users/tonkmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonkmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonkmr/subscriptions","organizations_url":"https://api.github.com/users/tonkmr/orgs","repos_url":"https://api.github.com/users/tonkmr/repos","events_url":"https://api.github.com/users/tonkmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonkmr/received_events","type":"User","site_admin":false},"body":"If the standard is to always leave a space around the operators, that is OK. But I much prefer it the way that I described above.","created_at":"2015-06-17T15:02:49Z","updated_at":"2015-06-17T15:02:49Z","html_url":"https://github.com/idaholab/moose/pull/5247#discussion_r32636089","pull_request_url":"https://api.github.com/repos/idaholab/moose/pulls/5247","_links":{"self":{"href":"https://api.github.com/repos/idaholab/moose/pulls/comments/32636089"},"html":{"href":"https://github.com/idaholab/moose/pull/5247#discussion_r32636089"},"pull_request":{"href":"https://api.github.com/repos/idaholab/moose/pulls/5247"}}},"pull_request":{"url":"https://api.github.com/repos/idaholab/moose/pulls/5247","id":37730138,"html_url":"https://github.com/idaholab/moose/pull/5247","diff_url":"https://github.com/idaholab/moose/pull/5247.diff","patch_url":"https://github.com/idaholab/moose/pull/5247.patch","issue_url":"https://api.github.com/repos/idaholab/moose/issues/5247","number":5247,"state":"closed","locked":false,"title":"Used mobility derivative in CHBulk and CHInterface ","user":{"login":"tonkmr","id":6609220,"avatar_url":"https://avatars.githubusercontent.com/u/6609220?v=3","gravatar_id":"","url":"https://api.github.com/users/tonkmr","html_url":"https://github.com/tonkmr","followers_url":"https://api.github.com/users/tonkmr/followers","following_url":"https://api.github.com/users/tonkmr/following{/other_user}","gists_url":"https://api.github.com/users/tonkmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonkmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonkmr/subscriptions","organizations_url":"https://api.github.com/users/tonkmr/orgs","repos_url":"https://api.github.com/users/tonkmr/repos","events_url":"https://api.github.com/users/tonkmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonkmr/received_events","type":"User","site_admin":false},"body":"I have now added the mobility derivatives to CHBulk and CHInterface. This work addresses #5167","created_at":"2015-06-15T20:09:41Z","updated_at":"2015-06-17T15:02:49Z","closed_at":"2015-06-17T14:50:06Z","merged_at":"2015-06-17T14:50:06Z","merge_commit_sha":"8299a6b3a2f22140b02e9cc4868f2a2c22d45167","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/idaholab/moose/pulls/5247/commits","review_comments_url":"https://api.github.com/repos/idaholab/moose/pulls/5247/comments","review_comment_url":"https://api.github.com/repos/idaholab/moose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/idaholab/moose/issues/5247/comments","statuses_url":"https://api.github.com/repos/idaholab/moose/statuses/8de156cb046c39b6c023974743319a547912fbbf","head":{"label":"tonkmr:mobility_deriv_5167","ref":"mobility_deriv_5167","sha":"8de156cb046c39b6c023974743319a547912fbbf","user":{"login":"tonkmr","id":6609220,"avatar_url":"https://avatars.githubusercontent.com/u/6609220?v=3","gravatar_id":"","url":"https://api.github.com/users/tonkmr","html_url":"https://github.com/tonkmr","followers_url":"https://api.github.com/users/tonkmr/followers","following_url":"https://api.github.com/users/tonkmr/following{/other_user}","gists_url":"https://api.github.com/users/tonkmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonkmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonkmr/subscriptions","organizations_url":"https://api.github.com/users/tonkmr/orgs","repos_url":"https://api.github.com/users/tonkmr/repos","events_url":"https://api.github.com/users/tonkmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonkmr/received_events","type":"User","site_admin":false},"repo":{"id":17871479,"name":"moose","full_name":"tonkmr/moose","owner":{"login":"tonkmr","id":6609220,"avatar_url":"https://avatars.githubusercontent.com/u/6609220?v=3","gravatar_id":"","url":"https://api.github.com/users/tonkmr","html_url":"https://github.com/tonkmr","followers_url":"https://api.github.com/users/tonkmr/followers","following_url":"https://api.github.com/users/tonkmr/following{/other_user}","gists_url":"https://api.github.com/users/tonkmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonkmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonkmr/subscriptions","organizations_url":"https://api.github.com/users/tonkmr/orgs","repos_url":"https://api.github.com/users/tonkmr/repos","events_url":"https://api.github.com/users/tonkmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonkmr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tonkmr/moose","description":"Multiphysics Object Oriented Simulation Environment","fork":true,"url":"https://api.github.com/repos/tonkmr/moose","forks_url":"https://api.github.com/repos/tonkmr/moose/forks","keys_url":"https://api.github.com/repos/tonkmr/moose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tonkmr/moose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tonkmr/moose/teams","hooks_url":"https://api.github.com/repos/tonkmr/moose/hooks","issue_events_url":"https://api.github.com/repos/tonkmr/moose/issues/events{/number}","events_url":"https://api.github.com/repos/tonkmr/moose/events","assignees_url":"https://api.github.com/repos/tonkmr/moose/assignees{/user}","branches_url":"https://api.github.com/repos/tonkmr/moose/branches{/branch}","tags_url":"https://api.github.com/repos/tonkmr/moose/tags","blobs_url":"https://api.github.com/repos/tonkmr/moose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tonkmr/moose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tonkmr/moose/git/refs{/sha}","trees_url":"https://api.github.com/repos/tonkmr/moose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tonkmr/moose/statuses/{sha}","languages_url":"https://api.github.com/repos/tonkmr/moose/languages","stargazers_url":"https://api.github.com/repos/tonkmr/moose/stargazers","contributors_url":"https://api.github.com/repos/tonkmr/moose/contributors","subscribers_url":"https://api.github.com/repos/tonkmr/moose/subscribers","subscription_url":"https://api.github.com/repos/tonkmr/moose/subscription","commits_url":"https://api.github.com/repos/tonkmr/moose/commits{/sha}","git_commits_url":"https://api.github.com/repos/tonkmr/moose/git/commits{/sha}","comments_url":"https://api.github.com/repos/tonkmr/moose/comments{/number}","issue_comment_url":"https://api.github.com/repos/tonkmr/moose/issues/comments{/number}","contents_url":"https://api.github.com/repos/tonkmr/moose/contents/{+path}","compare_url":"https://api.github.com/repos/tonkmr/moose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tonkmr/moose/merges","archive_url":"https://api.github.com/repos/tonkmr/moose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tonkmr/moose/downloads","issues_url":"https://api.github.com/repos/tonkmr/moose/issues{/number}","pulls_url":"https://api.github.com/repos/tonkmr/moose/pulls{/number}","milestones_url":"https://api.github.com/repos/tonkmr/moose/milestones{/number}","notifications_url":"https://api.github.com/repos/tonkmr/moose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tonkmr/moose/labels{/name}","releases_url":"https://api.github.com/repos/tonkmr/moose/releases{/id}","created_at":"2014-03-18T15:41:12Z","updated_at":"2014-07-08T15:24:07Z","pushed_at":"2015-06-16T15:22:31Z","git_url":"git://github.com/tonkmr/moose.git","ssh_url":"git@github.com:tonkmr/moose.git","clone_url":"https://github.com/tonkmr/moose.git","svn_url":"https://github.com/tonkmr/moose","homepage":null,"size":105846,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"idaholab:devel","ref":"devel","sha":"b109b94a2b4198ae43262bb9488ea87d52027c54","user":{"login":"idaholab","id":3855370,"avatar_url":"https://avatars.githubusercontent.com/u/3855370?v=3","gravatar_id":"","url":"https://api.github.com/users/idaholab","html_url":"https://github.com/idaholab","followers_url":"https://api.github.com/users/idaholab/followers","following_url":"https://api.github.com/users/idaholab/following{/other_user}","gists_url":"https://api.github.com/users/idaholab/gists{/gist_id}","starred_url":"https://api.github.com/users/idaholab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idaholab/subscriptions","organizations_url":"https://api.github.com/users/idaholab/orgs","repos_url":"https://api.github.com/users/idaholab/repos","events_url":"https://api.github.com/users/idaholab/events{/privacy}","received_events_url":"https://api.github.com/users/idaholab/received_events","type":"Organization","site_admin":false},"repo":{"id":16851223,"name":"moose","full_name":"idaholab/moose","owner":{"login":"idaholab","id":3855370,"avatar_url":"https://avatars.githubusercontent.com/u/3855370?v=3","gravatar_id":"","url":"https://api.github.com/users/idaholab","html_url":"https://github.com/idaholab","followers_url":"https://api.github.com/users/idaholab/followers","following_url":"https://api.github.com/users/idaholab/following{/other_user}","gists_url":"https://api.github.com/users/idaholab/gists{/gist_id}","starred_url":"https://api.github.com/users/idaholab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idaholab/subscriptions","organizations_url":"https://api.github.com/users/idaholab/orgs","repos_url":"https://api.github.com/users/idaholab/repos","events_url":"https://api.github.com/users/idaholab/events{/privacy}","received_events_url":"https://api.github.com/users/idaholab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/idaholab/moose","description":"Multiphysics Object Oriented Simulation Environment","fork":false,"url":"https://api.github.com/repos/idaholab/moose","forks_url":"https://api.github.com/repos/idaholab/moose/forks","keys_url":"https://api.github.com/repos/idaholab/moose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/idaholab/moose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/idaholab/moose/teams","hooks_url":"https://api.github.com/repos/idaholab/moose/hooks","issue_events_url":"https://api.github.com/repos/idaholab/moose/issues/events{/number}","events_url":"https://api.github.com/repos/idaholab/moose/events","assignees_url":"https://api.github.com/repos/idaholab/moose/assignees{/user}","branches_url":"https://api.github.com/repos/idaholab/moose/branches{/branch}","tags_url":"https://api.github.com/repos/idaholab/moose/tags","blobs_url":"https://api.github.com/repos/idaholab/moose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/idaholab/moose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/idaholab/moose/git/refs{/sha}","trees_url":"https://api.github.com/repos/idaholab/moose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/idaholab/moose/statuses/{sha}","languages_url":"https://api.github.com/repos/idaholab/moose/languages","stargazers_url":"https://api.github.com/repos/idaholab/moose/stargazers","contributors_url":"https://api.github.com/repos/idaholab/moose/contributors","subscribers_url":"https://api.github.com/repos/idaholab/moose/subscribers","subscription_url":"https://api.github.com/repos/idaholab/moose/subscription","commits_url":"https://api.github.com/repos/idaholab/moose/commits{/sha}","git_commits_url":"https://api.github.com/repos/idaholab/moose/git/commits{/sha}","comments_url":"https://api.github.com/repos/idaholab/moose/comments{/number}","issue_comment_url":"https://api.github.com/repos/idaholab/moose/issues/comments{/number}","contents_url":"https://api.github.com/repos/idaholab/moose/contents/{+path}","compare_url":"https://api.github.com/repos/idaholab/moose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/idaholab/moose/merges","archive_url":"https://api.github.com/repos/idaholab/moose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/idaholab/moose/downloads","issues_url":"https://api.github.com/repos/idaholab/moose/issues{/number}","pulls_url":"https://api.github.com/repos/idaholab/moose/pulls{/number}","milestones_url":"https://api.github.com/repos/idaholab/moose/milestones{/number}","notifications_url":"https://api.github.com/repos/idaholab/moose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/idaholab/moose/labels{/name}","releases_url":"https://api.github.com/repos/idaholab/moose/releases{/id}","created_at":"2014-02-14T22:26:15Z","updated_at":"2015-06-09T05:07:23Z","pushed_at":"2015-06-17T15:01:11Z","git_url":"git://github.com/idaholab/moose.git","ssh_url":"git@github.com:idaholab/moose.git","clone_url":"https://github.com/idaholab/moose.git","svn_url":"https://github.com/idaholab/moose","homepage":"http://www.mooseframework.org","size":126888,"stargazers_count":83,"watchers_count":83,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":136,"mirror_url":null,"open_issues_count":467,"forks":136,"open_issues":467,"watchers":83,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/idaholab/moose/pulls/5247"},"html":{"href":"https://github.com/idaholab/moose/pull/5247"},"issue":{"href":"https://api.github.com/repos/idaholab/moose/issues/5247"},"comments":{"href":"https://api.github.com/repos/idaholab/moose/issues/5247/comments"},"review_comments":{"href":"https://api.github.com/repos/idaholab/moose/pulls/5247/comments"},"review_comment":{"href":"https://api.github.com/repos/idaholab/moose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/idaholab/moose/pulls/5247/commits"},"statuses":{"href":"https://api.github.com/repos/idaholab/moose/statuses/8de156cb046c39b6c023974743319a547912fbbf"}}}}