{"action":"created","comment":{"url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/comments/43243753","id":43243753,"diff_hunk":"@@ -487,3 +500,197 @@ def __idiv__(self, expr):\n             assemble_expressions.IDiv(self, expr))\n \n         return self\n+\n+    @utils.cached_property\n+    def ctypes(self):\n+        # Retrieve data from Python object\n+        function_space = self.function_space()\n+        mesh = function_space.mesh()\n+        coordinates = mesh.coordinates\n+        coordinates_space = coordinates.function_space()\n+\n+        # Store data into ``C struct''\n+        c_function = _CFunction()\n+        c_function.n_cols = mesh.num_cells()\n+        if hasattr(mesh, '_layers'):\n+            c_function.n_layers = mesh.layers - 1\n+        else:\n+            c_function.n_layers = 1\n+        c_function.coords = coordinates.dat.data.ctypes.data_as(POINTER(c_double))\n+        c_function.coords_map = coordinates_space.cell_node_list.ctypes.data_as(POINTER(c_int))\n+        c_function.f = self.dat.data.ctypes.data_as(POINTER(c_double))\n+        c_function.f_map = function_space.cell_node_list.ctypes.data_as(POINTER(c_int))\n+        c_function.sidx = mesh.spatial_index and mesh.spatial_index.ctypes\n+\n+        # Return pointer\n+        return ctypes.pointer(c_function)\n+\n+    @utils.cached_property\n+    def _c_evaluate(self):\n+        result = make_c_evaluate(self)\n+        result.restype = int\n+        return result\n+\n+    def evaluate(self, coord, mapping, component, index_values):\n+        # Called by UFL when evaluating expressions at coordinates\n+        return self.at(coord)","path":"firedrake/function.py","position":73,"original_position":73,"commit_id":"88ab9f58178e14bb2c2312dbcfab99ba322b4f4e","original_commit_id":"88ab9f58178e14bb2c2312dbcfab99ba322b4f4e","user":{"login":"wence-","id":1126981,"avatar_url":"https://avatars.githubusercontent.com/u/1126981?v=3","gravatar_id":"","url":"https://api.github.com/users/wence-","html_url":"https://github.com/wence-","followers_url":"https://api.github.com/users/wence-/followers","following_url":"https://api.github.com/users/wence-/following{/other_user}","gists_url":"https://api.github.com/users/wence-/gists{/gist_id}","starred_url":"https://api.github.com/users/wence-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wence-/subscriptions","organizations_url":"https://api.github.com/users/wence-/orgs","repos_url":"https://api.github.com/users/wence-/repos","events_url":"https://api.github.com/users/wence-/events{/privacy}","received_events_url":"https://api.github.com/users/wence-/received_events","type":"User","site_admin":false},"body":"Ignoring component means that `f(pt, component=1)` returns the full vector for vector-valued things.  Raise NotImplementedError if component is not `()` or `None`?","created_at":"2015-10-28T11:32:55Z","updated_at":"2015-10-28T11:32:55Z","html_url":"https://github.com/firedrakeproject/firedrake/pull/612#discussion_r43243753","pull_request_url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612","_links":{"self":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/comments/43243753"},"html":{"href":"https://github.com/firedrakeproject/firedrake/pull/612#discussion_r43243753"},"pull_request":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612"}}},"pull_request":{"url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612","id":47929831,"html_url":"https://github.com/firedrakeproject/firedrake/pull/612","diff_url":"https://github.com/firedrakeproject/firedrake/pull/612.diff","patch_url":"https://github.com/firedrakeproject/firedrake/pull/612.patch","issue_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues/612","number":612,"state":"open","locked":false,"title":"Point evaluations","user":{"login":"miklos1","id":4210841,"avatar_url":"https://avatars.githubusercontent.com/u/4210841?v=3","gravatar_id":"","url":"https://api.github.com/users/miklos1","html_url":"https://github.com/miklos1","followers_url":"https://api.github.com/users/miklos1/followers","following_url":"https://api.github.com/users/miklos1/following{/other_user}","gists_url":"https://api.github.com/users/miklos1/gists{/gist_id}","starred_url":"https://api.github.com/users/miklos1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miklos1/subscriptions","organizations_url":"https://api.github.com/users/miklos1/orgs","repos_url":"https://api.github.com/users/miklos1/repos","events_url":"https://api.github.com/users/miklos1/events{/privacy}","received_events_url":"https://api.github.com/users/miklos1/received_events","type":"User","site_admin":false},"body":"What is still missing:\r\n * **Immersed manifolds:** While much of the infrastructure already supports evaluating points on immersed manifolds, ~~finding the point on the manifold *may* or *may not* succeed.~~ this feature is disabled for now.\r\n\r\nLimited support:\r\n * **Distributed mesh support:** Works, but parallel efficiency (to be honest: any efficiency) is not a concern at this stage. Point evaluation is a *collective* operation, and the same set of points are expected to be supplied on each process, and each process will have the values for each point.\r\n\r\nUsage:\r\n * `f.at(points)` with all kinds of fancy syntax, e.g. `f.at(1.2, 4.5)` (one point), `f.at([0.5, -2.1], [-2.6, 3.4])` (multiple points) or `f.at(np.array([[0.5, -2.1], [-2.6, 3.4]]))` (array of points). An exception is thrown if any point is outside the domain, unless `f.at(points, dont_raise=True)` is used, in which case the the values for points outside the domain will be filled with `None`s.\r\n * UFL allows the evaluation of any expression at a single point with the function call syntax. For example, `(f*sin(f))([0.3, 0.8])`.\r\n\r\nThis depends on OP2/PyOP2#472 and on https://bitbucket.org/mapdes/ffc/pull-requests/86.","created_at":"2015-10-16T16:12:07Z","updated_at":"2015-10-28T11:32:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b35ae62af7c36c3f5def4fbc695926b938a6089","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612/commits","review_comments_url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612/comments","review_comment_url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues/612/comments","statuses_url":"https://api.github.com/repos/firedrakeproject/firedrake/statuses/88ab9f58178e14bb2c2312dbcfab99ba322b4f4e","head":{"label":"firedrakeproject:point-evaluation-serial","ref":"point-evaluation-serial","sha":"88ab9f58178e14bb2c2312dbcfab99ba322b4f4e","user":{"login":"firedrakeproject","id":5558005,"avatar_url":"https://avatars.githubusercontent.com/u/5558005?v=3","gravatar_id":"","url":"https://api.github.com/users/firedrakeproject","html_url":"https://github.com/firedrakeproject","followers_url":"https://api.github.com/users/firedrakeproject/followers","following_url":"https://api.github.com/users/firedrakeproject/following{/other_user}","gists_url":"https://api.github.com/users/firedrakeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/firedrakeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firedrakeproject/subscriptions","organizations_url":"https://api.github.com/users/firedrakeproject/orgs","repos_url":"https://api.github.com/users/firedrakeproject/repos","events_url":"https://api.github.com/users/firedrakeproject/events{/privacy}","received_events_url":"https://api.github.com/users/firedrakeproject/received_events","type":"Organization","site_admin":false},"repo":{"id":13384052,"name":"firedrake","full_name":"firedrakeproject/firedrake","owner":{"login":"firedrakeproject","id":5558005,"avatar_url":"https://avatars.githubusercontent.com/u/5558005?v=3","gravatar_id":"","url":"https://api.github.com/users/firedrakeproject","html_url":"https://github.com/firedrakeproject","followers_url":"https://api.github.com/users/firedrakeproject/followers","following_url":"https://api.github.com/users/firedrakeproject/following{/other_user}","gists_url":"https://api.github.com/users/firedrakeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/firedrakeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firedrakeproject/subscriptions","organizations_url":"https://api.github.com/users/firedrakeproject/orgs","repos_url":"https://api.github.com/users/firedrakeproject/repos","events_url":"https://api.github.com/users/firedrakeproject/events{/privacy}","received_events_url":"https://api.github.com/users/firedrakeproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firedrakeproject/firedrake","description":"Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)","fork":false,"url":"https://api.github.com/repos/firedrakeproject/firedrake","forks_url":"https://api.github.com/repos/firedrakeproject/firedrake/forks","keys_url":"https://api.github.com/repos/firedrakeproject/firedrake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firedrakeproject/firedrake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firedrakeproject/firedrake/teams","hooks_url":"https://api.github.com/repos/firedrakeproject/firedrake/hooks","issue_events_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues/events{/number}","events_url":"https://api.github.com/repos/firedrakeproject/firedrake/events","assignees_url":"https://api.github.com/repos/firedrakeproject/firedrake/assignees{/user}","branches_url":"https://api.github.com/repos/firedrakeproject/firedrake/branches{/branch}","tags_url":"https://api.github.com/repos/firedrakeproject/firedrake/tags","blobs_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/refs{/sha}","trees_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firedrakeproject/firedrake/statuses/{sha}","languages_url":"https://api.github.com/repos/firedrakeproject/firedrake/languages","stargazers_url":"https://api.github.com/repos/firedrakeproject/firedrake/stargazers","contributors_url":"https://api.github.com/repos/firedrakeproject/firedrake/contributors","subscribers_url":"https://api.github.com/repos/firedrakeproject/firedrake/subscribers","subscription_url":"https://api.github.com/repos/firedrakeproject/firedrake/subscription","commits_url":"https://api.github.com/repos/firedrakeproject/firedrake/commits{/sha}","git_commits_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/commits{/sha}","comments_url":"https://api.github.com/repos/firedrakeproject/firedrake/comments{/number}","issue_comment_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues/comments{/number}","contents_url":"https://api.github.com/repos/firedrakeproject/firedrake/contents/{+path}","compare_url":"https://api.github.com/repos/firedrakeproject/firedrake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firedrakeproject/firedrake/merges","archive_url":"https://api.github.com/repos/firedrakeproject/firedrake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firedrakeproject/firedrake/downloads","issues_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues{/number}","pulls_url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls{/number}","milestones_url":"https://api.github.com/repos/firedrakeproject/firedrake/milestones{/number}","notifications_url":"https://api.github.com/repos/firedrakeproject/firedrake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firedrakeproject/firedrake/labels{/name}","releases_url":"https://api.github.com/repos/firedrakeproject/firedrake/releases{/id}","created_at":"2013-10-07T13:07:44Z","updated_at":"2015-10-23T16:06:10Z","pushed_at":"2015-10-28T10:25:27Z","git_url":"git://github.com/firedrakeproject/firedrake.git","ssh_url":"git@github.com:firedrakeproject/firedrake.git","clone_url":"https://github.com/firedrakeproject/firedrake.git","svn_url":"https://github.com/firedrakeproject/firedrake","homepage":"http://firedrakeproject.org","size":18889,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":68,"forks":12,"open_issues":68,"watchers":21,"default_branch":"master"}},"base":{"label":"firedrakeproject:master","ref":"master","sha":"627b528debe9de363eba8a749ee655cb8ba9f626","user":{"login":"firedrakeproject","id":5558005,"avatar_url":"https://avatars.githubusercontent.com/u/5558005?v=3","gravatar_id":"","url":"https://api.github.com/users/firedrakeproject","html_url":"https://github.com/firedrakeproject","followers_url":"https://api.github.com/users/firedrakeproject/followers","following_url":"https://api.github.com/users/firedrakeproject/following{/other_user}","gists_url":"https://api.github.com/users/firedrakeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/firedrakeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firedrakeproject/subscriptions","organizations_url":"https://api.github.com/users/firedrakeproject/orgs","repos_url":"https://api.github.com/users/firedrakeproject/repos","events_url":"https://api.github.com/users/firedrakeproject/events{/privacy}","received_events_url":"https://api.github.com/users/firedrakeproject/received_events","type":"Organization","site_admin":false},"repo":{"id":13384052,"name":"firedrake","full_name":"firedrakeproject/firedrake","owner":{"login":"firedrakeproject","id":5558005,"avatar_url":"https://avatars.githubusercontent.com/u/5558005?v=3","gravatar_id":"","url":"https://api.github.com/users/firedrakeproject","html_url":"https://github.com/firedrakeproject","followers_url":"https://api.github.com/users/firedrakeproject/followers","following_url":"https://api.github.com/users/firedrakeproject/following{/other_user}","gists_url":"https://api.github.com/users/firedrakeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/firedrakeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firedrakeproject/subscriptions","organizations_url":"https://api.github.com/users/firedrakeproject/orgs","repos_url":"https://api.github.com/users/firedrakeproject/repos","events_url":"https://api.github.com/users/firedrakeproject/events{/privacy}","received_events_url":"https://api.github.com/users/firedrakeproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firedrakeproject/firedrake","description":"Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)","fork":false,"url":"https://api.github.com/repos/firedrakeproject/firedrake","forks_url":"https://api.github.com/repos/firedrakeproject/firedrake/forks","keys_url":"https://api.github.com/repos/firedrakeproject/firedrake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firedrakeproject/firedrake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firedrakeproject/firedrake/teams","hooks_url":"https://api.github.com/repos/firedrakeproject/firedrake/hooks","issue_events_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues/events{/number}","events_url":"https://api.github.com/repos/firedrakeproject/firedrake/events","assignees_url":"https://api.github.com/repos/firedrakeproject/firedrake/assignees{/user}","branches_url":"https://api.github.com/repos/firedrakeproject/firedrake/branches{/branch}","tags_url":"https://api.github.com/repos/firedrakeproject/firedrake/tags","blobs_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/refs{/sha}","trees_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firedrakeproject/firedrake/statuses/{sha}","languages_url":"https://api.github.com/repos/firedrakeproject/firedrake/languages","stargazers_url":"https://api.github.com/repos/firedrakeproject/firedrake/stargazers","contributors_url":"https://api.github.com/repos/firedrakeproject/firedrake/contributors","subscribers_url":"https://api.github.com/repos/firedrakeproject/firedrake/subscribers","subscription_url":"https://api.github.com/repos/firedrakeproject/firedrake/subscription","commits_url":"https://api.github.com/repos/firedrakeproject/firedrake/commits{/sha}","git_commits_url":"https://api.github.com/repos/firedrakeproject/firedrake/git/commits{/sha}","comments_url":"https://api.github.com/repos/firedrakeproject/firedrake/comments{/number}","issue_comment_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues/comments{/number}","contents_url":"https://api.github.com/repos/firedrakeproject/firedrake/contents/{+path}","compare_url":"https://api.github.com/repos/firedrakeproject/firedrake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firedrakeproject/firedrake/merges","archive_url":"https://api.github.com/repos/firedrakeproject/firedrake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firedrakeproject/firedrake/downloads","issues_url":"https://api.github.com/repos/firedrakeproject/firedrake/issues{/number}","pulls_url":"https://api.github.com/repos/firedrakeproject/firedrake/pulls{/number}","milestones_url":"https://api.github.com/repos/firedrakeproject/firedrake/milestones{/number}","notifications_url":"https://api.github.com/repos/firedrakeproject/firedrake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firedrakeproject/firedrake/labels{/name}","releases_url":"https://api.github.com/repos/firedrakeproject/firedrake/releases{/id}","created_at":"2013-10-07T13:07:44Z","updated_at":"2015-10-23T16:06:10Z","pushed_at":"2015-10-28T10:25:27Z","git_url":"git://github.com/firedrakeproject/firedrake.git","ssh_url":"git@github.com:firedrakeproject/firedrake.git","clone_url":"https://github.com/firedrakeproject/firedrake.git","svn_url":"https://github.com/firedrakeproject/firedrake","homepage":"http://firedrakeproject.org","size":18889,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":68,"forks":12,"open_issues":68,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612"},"html":{"href":"https://github.com/firedrakeproject/firedrake/pull/612"},"issue":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/issues/612"},"comments":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/issues/612/comments"},"review_comments":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612/comments"},"review_comment":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/pulls/612/commits"},"statuses":{"href":"https://api.github.com/repos/firedrakeproject/firedrake/statuses/88ab9f58178e14bb2c2312dbcfab99ba322b4f4e"}}}}