{"action":"created","comment":{"url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/comments/196642893","pull_request_review_id":130232032,"id":196642893,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjY0Mjg5Mw==","diff_hunk":"@@ -0,0 +1,89 @@\n+// Distributed under the MIT License.\n+// See LICENSE.txt for details.\n+\n+#include \"ControlSystem/ControllerPND.hpp\"\n+#include \"ErrorHandling/Error.hpp\"\n+#include \"Utilities/ConstantExpressions.hpp\"\n+\n+namespace Controllers {\n+\n+template <size_t deriv_order>\n+DataVector PND<deriv_order>::operator()(\n+    const DataVector& timescales,\n+    const std::array<DataVector, deriv_order + 1>& q_and_derivs,\n+    const double q_dt, const double deriv_dt) const noexcept {\n+  // helper lambda for computing the binomial coefficients\n+  auto binomial = [](size_t N, size_t k) {\n+    return falling_factorial(N, k) / factorial(k);\n+  };\n+\n+  // The coefficients a0_{k} are chosen such that the system is critically\n+  // damped, which are given by: a0_{k} = (N choose k) timescales^{k-N}\n+  std::array<DataVector, deriv_order> coefs0;\n+  const DataVector inv_timescales = 1.0 / timescales;\n+  DataVector tau = inv_timescales;\n+  for (size_t i = deriv_order; i-- > 0;) {\n+    gsl::at(coefs0, i) = binomial(deriv_order, i) * tau;\n+    // add another power of timescales\n+    tau = tau * inv_timescales;\n+  }\n+\n+  // If an averager is used for q_and_derivs, there is an induced time offset,","path":"src/ControlSystem/ControllerPND.cpp","position":31,"original_position":31,"commit_id":"bc1c42f2979eb87985dbbe724dd8c2b7809c5ac2","original_commit_id":"1334b571f8c770284a17c4bb4c19bd52fcaa196f","user":{"login":"gsb76","id":27026354,"node_id":"MDQ6VXNlcjI3MDI2MzU0","avatar_url":"https://avatars3.githubusercontent.com/u/27026354?v=4","gravatar_id":"","url":"https://api.github.com/users/gsb76","html_url":"https://github.com/gsb76","followers_url":"https://api.github.com/users/gsb76/followers","following_url":"https://api.github.com/users/gsb76/following{/other_user}","gists_url":"https://api.github.com/users/gsb76/gists{/gist_id}","starred_url":"https://api.github.com/users/gsb76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsb76/subscriptions","organizations_url":"https://api.github.com/users/gsb76/orgs","repos_url":"https://api.github.com/users/gsb76/repos","events_url":"https://api.github.com/users/gsb76/events{/privacy}","received_events_url":"https://api.github.com/users/gsb76/received_events","type":"User","site_admin":false},"body":"Will the averager(s) be future SpECTRE objects? It would be nice to give a concrete example of what might be used here.","created_at":"2018-06-20T04:07:30Z","updated_at":"2018-06-20T04:53:43Z","html_url":"https://github.com/sxs-collaboration/spectre/pull/774#discussion_r196642893","pull_request_url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/comments/196642893"},"html":{"href":"https://github.com/sxs-collaboration/spectre/pull/774#discussion_r196642893"},"pull_request":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774"}}},"pull_request":{"url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774","id":196012966,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MDEyOTY2","html_url":"https://github.com/sxs-collaboration/spectre/pull/774","diff_url":"https://github.com/sxs-collaboration/spectre/pull/774.diff","patch_url":"https://github.com/sxs-collaboration/spectre/pull/774.patch","issue_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/774","number":774,"state":"open","locked":false,"title":"Controller","user":{"login":"mgiesler","id":4701610,"node_id":"MDQ6VXNlcjQ3MDE2MTA=","avatar_url":"https://avatars1.githubusercontent.com/u/4701610?v=4","gravatar_id":"","url":"https://api.github.com/users/mgiesler","html_url":"https://github.com/mgiesler","followers_url":"https://api.github.com/users/mgiesler/followers","following_url":"https://api.github.com/users/mgiesler/following{/other_user}","gists_url":"https://api.github.com/users/mgiesler/gists{/gist_id}","starred_url":"https://api.github.com/users/mgiesler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgiesler/subscriptions","organizations_url":"https://api.github.com/users/mgiesler/orgs","repos_url":"https://api.github.com/users/mgiesler/repos","events_url":"https://api.github.com/users/mgiesler/events{/privacy}","received_events_url":"https://api.github.com/users/mgiesler/received_events","type":"User","site_admin":false},"body":"## Proposed changes\r\n\r\nAdd the controller base class for the control system and a PND controller (with tests).\r\n\r\n### Types of changes:\r\n\r\n- [ ] Bugfix\r\n- [x] New feature\r\n\r\n### Component:\r\n\r\n- [x] Code\r\n- [ ] Documentation\r\n- [ ] Build system\r\n- [ ] Continuous integration\r\n\r\n### Code review checklist\r\n\r\n- [ ] The PR passes all checks, including unit tests, `clang-tidy` and `IWYU`. For\r\n  instructions on how to perform the CI checks locally refer to the [Dev guide\r\n  on the Travis CI](https://spectre-code.org/travis_guide.html).\r\n- [ ] The code is documented and the documentation renders correctly. Run `make doc`\r\n  to generate the documentation locally into `BUILD_DIR/docs/html`. Then open\r\n  `index.html`.\r\n- [ ] The code follows the stylistic and code quality guidelines listed in the\r\n  [code review guide](https://spectre-code.org/code_review_guide.html).\r\n\r\n### Further comments\r\n\r\n<!--\r\nIf this is a relatively large or complex change, kick off the discussion by\r\nexplaining why you chose the solution you did and what alternatives you\r\nconsidered, etc...\r\n-->\r\n","created_at":"2018-06-20T03:29:20Z","updated_at":"2018-06-20T04:53:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05393a6599f66f5ef6a3e4793ea4abb32d545496","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774/commits","review_comments_url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774/comments","review_comment_url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/774/comments","statuses_url":"https://api.github.com/repos/sxs-collaboration/spectre/statuses/bc1c42f2979eb87985dbbe724dd8c2b7809c5ac2","head":{"label":"mgiesler:Controller","ref":"Controller","sha":"bc1c42f2979eb87985dbbe724dd8c2b7809c5ac2","user":{"login":"mgiesler","id":4701610,"node_id":"MDQ6VXNlcjQ3MDE2MTA=","avatar_url":"https://avatars1.githubusercontent.com/u/4701610?v=4","gravatar_id":"","url":"https://api.github.com/users/mgiesler","html_url":"https://github.com/mgiesler","followers_url":"https://api.github.com/users/mgiesler/followers","following_url":"https://api.github.com/users/mgiesler/following{/other_user}","gists_url":"https://api.github.com/users/mgiesler/gists{/gist_id}","starred_url":"https://api.github.com/users/mgiesler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgiesler/subscriptions","organizations_url":"https://api.github.com/users/mgiesler/orgs","repos_url":"https://api.github.com/users/mgiesler/repos","events_url":"https://api.github.com/users/mgiesler/events{/privacy}","received_events_url":"https://api.github.com/users/mgiesler/received_events","type":"User","site_admin":false},"repo":{"id":102661535,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI2NjE1MzU=","name":"spectre","full_name":"mgiesler/spectre","owner":{"login":"mgiesler","id":4701610,"node_id":"MDQ6VXNlcjQ3MDE2MTA=","avatar_url":"https://avatars1.githubusercontent.com/u/4701610?v=4","gravatar_id":"","url":"https://api.github.com/users/mgiesler","html_url":"https://github.com/mgiesler","followers_url":"https://api.github.com/users/mgiesler/followers","following_url":"https://api.github.com/users/mgiesler/following{/other_user}","gists_url":"https://api.github.com/users/mgiesler/gists{/gist_id}","starred_url":"https://api.github.com/users/mgiesler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgiesler/subscriptions","organizations_url":"https://api.github.com/users/mgiesler/orgs","repos_url":"https://api.github.com/users/mgiesler/repos","events_url":"https://api.github.com/users/mgiesler/events{/privacy}","received_events_url":"https://api.github.com/users/mgiesler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgiesler/spectre","description":null,"fork":true,"url":"https://api.github.com/repos/mgiesler/spectre","forks_url":"https://api.github.com/repos/mgiesler/spectre/forks","keys_url":"https://api.github.com/repos/mgiesler/spectre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgiesler/spectre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgiesler/spectre/teams","hooks_url":"https://api.github.com/repos/mgiesler/spectre/hooks","issue_events_url":"https://api.github.com/repos/mgiesler/spectre/issues/events{/number}","events_url":"https://api.github.com/repos/mgiesler/spectre/events","assignees_url":"https://api.github.com/repos/mgiesler/spectre/assignees{/user}","branches_url":"https://api.github.com/repos/mgiesler/spectre/branches{/branch}","tags_url":"https://api.github.com/repos/mgiesler/spectre/tags","blobs_url":"https://api.github.com/repos/mgiesler/spectre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgiesler/spectre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgiesler/spectre/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgiesler/spectre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgiesler/spectre/statuses/{sha}","languages_url":"https://api.github.com/repos/mgiesler/spectre/languages","stargazers_url":"https://api.github.com/repos/mgiesler/spectre/stargazers","contributors_url":"https://api.github.com/repos/mgiesler/spectre/contributors","subscribers_url":"https://api.github.com/repos/mgiesler/spectre/subscribers","subscription_url":"https://api.github.com/repos/mgiesler/spectre/subscription","commits_url":"https://api.github.com/repos/mgiesler/spectre/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgiesler/spectre/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgiesler/spectre/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgiesler/spectre/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgiesler/spectre/contents/{+path}","compare_url":"https://api.github.com/repos/mgiesler/spectre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgiesler/spectre/merges","archive_url":"https://api.github.com/repos/mgiesler/spectre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgiesler/spectre/downloads","issues_url":"https://api.github.com/repos/mgiesler/spectre/issues{/number}","pulls_url":"https://api.github.com/repos/mgiesler/spectre/pulls{/number}","milestones_url":"https://api.github.com/repos/mgiesler/spectre/milestones{/number}","notifications_url":"https://api.github.com/repos/mgiesler/spectre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgiesler/spectre/labels{/name}","releases_url":"https://api.github.com/repos/mgiesler/spectre/releases{/id}","deployments_url":"https://api.github.com/repos/mgiesler/spectre/deployments","created_at":"2017-09-06T21:48:07Z","updated_at":"2018-06-19T19:59:07Z","pushed_at":"2018-06-20T03:27:07Z","git_url":"git://github.com/mgiesler/spectre.git","ssh_url":"git@github.com:mgiesler/spectre.git","clone_url":"https://github.com/mgiesler/spectre.git","svn_url":"https://github.com/mgiesler/spectre","homepage":null,"size":37732,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"sxs-collaboration:develop","ref":"develop","sha":"0c7ba9055dbd0880d82efe8a33c2a7e318f57150","user":{"login":"sxs-collaboration","id":26882595,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODgyNTk1","avatar_url":"https://avatars2.githubusercontent.com/u/26882595?v=4","gravatar_id":"","url":"https://api.github.com/users/sxs-collaboration","html_url":"https://github.com/sxs-collaboration","followers_url":"https://api.github.com/users/sxs-collaboration/followers","following_url":"https://api.github.com/users/sxs-collaboration/following{/other_user}","gists_url":"https://api.github.com/users/sxs-collaboration/gists{/gist_id}","starred_url":"https://api.github.com/users/sxs-collaboration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sxs-collaboration/subscriptions","organizations_url":"https://api.github.com/users/sxs-collaboration/orgs","repos_url":"https://api.github.com/users/sxs-collaboration/repos","events_url":"https://api.github.com/users/sxs-collaboration/events{/privacy}","received_events_url":"https://api.github.com/users/sxs-collaboration/received_events","type":"Organization","site_admin":false},"repo":{"id":87570510,"node_id":"MDEwOlJlcG9zaXRvcnk4NzU3MDUxMA==","name":"spectre","full_name":"sxs-collaboration/spectre","owner":{"login":"sxs-collaboration","id":26882595,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODgyNTk1","avatar_url":"https://avatars2.githubusercontent.com/u/26882595?v=4","gravatar_id":"","url":"https://api.github.com/users/sxs-collaboration","html_url":"https://github.com/sxs-collaboration","followers_url":"https://api.github.com/users/sxs-collaboration/followers","following_url":"https://api.github.com/users/sxs-collaboration/following{/other_user}","gists_url":"https://api.github.com/users/sxs-collaboration/gists{/gist_id}","starred_url":"https://api.github.com/users/sxs-collaboration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sxs-collaboration/subscriptions","organizations_url":"https://api.github.com/users/sxs-collaboration/orgs","repos_url":"https://api.github.com/users/sxs-collaboration/repos","events_url":"https://api.github.com/users/sxs-collaboration/events{/privacy}","received_events_url":"https://api.github.com/users/sxs-collaboration/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sxs-collaboration/spectre","description":"SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.","fork":false,"url":"https://api.github.com/repos/sxs-collaboration/spectre","forks_url":"https://api.github.com/repos/sxs-collaboration/spectre/forks","keys_url":"https://api.github.com/repos/sxs-collaboration/spectre/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sxs-collaboration/spectre/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sxs-collaboration/spectre/teams","hooks_url":"https://api.github.com/repos/sxs-collaboration/spectre/hooks","issue_events_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/events{/number}","events_url":"https://api.github.com/repos/sxs-collaboration/spectre/events","assignees_url":"https://api.github.com/repos/sxs-collaboration/spectre/assignees{/user}","branches_url":"https://api.github.com/repos/sxs-collaboration/spectre/branches{/branch}","tags_url":"https://api.github.com/repos/sxs-collaboration/spectre/tags","blobs_url":"https://api.github.com/repos/sxs-collaboration/spectre/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sxs-collaboration/spectre/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sxs-collaboration/spectre/git/refs{/sha}","trees_url":"https://api.github.com/repos/sxs-collaboration/spectre/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sxs-collaboration/spectre/statuses/{sha}","languages_url":"https://api.github.com/repos/sxs-collaboration/spectre/languages","stargazers_url":"https://api.github.com/repos/sxs-collaboration/spectre/stargazers","contributors_url":"https://api.github.com/repos/sxs-collaboration/spectre/contributors","subscribers_url":"https://api.github.com/repos/sxs-collaboration/spectre/subscribers","subscription_url":"https://api.github.com/repos/sxs-collaboration/spectre/subscription","commits_url":"https://api.github.com/repos/sxs-collaboration/spectre/commits{/sha}","git_commits_url":"https://api.github.com/repos/sxs-collaboration/spectre/git/commits{/sha}","comments_url":"https://api.github.com/repos/sxs-collaboration/spectre/comments{/number}","issue_comment_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues/comments{/number}","contents_url":"https://api.github.com/repos/sxs-collaboration/spectre/contents/{+path}","compare_url":"https://api.github.com/repos/sxs-collaboration/spectre/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sxs-collaboration/spectre/merges","archive_url":"https://api.github.com/repos/sxs-collaboration/spectre/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sxs-collaboration/spectre/downloads","issues_url":"https://api.github.com/repos/sxs-collaboration/spectre/issues{/number}","pulls_url":"https://api.github.com/repos/sxs-collaboration/spectre/pulls{/number}","milestones_url":"https://api.github.com/repos/sxs-collaboration/spectre/milestones{/number}","notifications_url":"https://api.github.com/repos/sxs-collaboration/spectre/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sxs-collaboration/spectre/labels{/name}","releases_url":"https://api.github.com/repos/sxs-collaboration/spectre/releases{/id}","deployments_url":"https://api.github.com/repos/sxs-collaboration/spectre/deployments","created_at":"2017-04-07T17:28:20Z","updated_at":"2018-06-20T01:31:53Z","pushed_at":"2018-06-20T03:29:20Z","git_url":"git://github.com/sxs-collaboration/spectre.git","ssh_url":"git@github.com:sxs-collaboration/spectre.git","clone_url":"https://github.com/sxs-collaboration/spectre.git","svn_url":"https://github.com/sxs-collaboration/spectre","homepage":"","size":10927,"stargazers_count":26,"watchers_count":26,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":95,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":22,"open_issues":95,"watchers":26,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774"},"html":{"href":"https://github.com/sxs-collaboration/spectre/pull/774"},"issue":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/issues/774"},"comments":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/issues/774/comments"},"review_comments":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774/comments"},"review_comment":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/pulls/774/commits"},"statuses":{"href":"https://api.github.com/repos/sxs-collaboration/spectre/statuses/bc1c42f2979eb87985dbbe724dd8c2b7809c5ac2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gsb76"}}