{"action":"created","comment":{"url":"https://api.github.com/repos/geodynamics/aspect/pulls/comments/69369194","id":69369194,"diff_hunk":"@@ -0,0 +1,157 @@\n+/*\n+  Copyright (C) 2015 - 2016 by the authors of the ASPECT code.\n+\n+  This file is part of ASPECT.\n+\n+  ASPECT is free software; you can redistribute it and/or modify\n+  it under the terms of the GNU General Public License as published by\n+  the Free Software Foundation; either version 2, or (at your option)\n+  any later version.\n+\n+  ASPECT is distributed in the hope that it will be useful,\n+  but WITHOUT ANY WARRANTY; without even the implied warranty of\n+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+  GNU General Public License for more details.\n+\n+  You should have received a copy of the GNU General Public License\n+  along with ASPECT; see the file doc/COPYING.  If not see\n+  <http://www.gnu.org/licenses/>.\n+*/\n+\n+\n+#include <aspect/heating_model/shear_heating_with_melt.h>\n+#include <aspect/melt.h>\n+#include <aspect/simulator.h>\n+#include <deal.II/numerics/fe_field_function.h>\n+\n+\n+namespace aspect\n+{\n+  namespace HeatingModel\n+  {\n+    template <int dim>\n+    void\n+    ShearHeatingMelt<dim>::\n+    evaluate (const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,\n+              const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs,\n+              HeatingModel::HeatingModelOutputs &heating_model_outputs) const\n+    {\n+      Assert(heating_model_outputs.heating_source_terms.size() == material_model_inputs.position.size(),\n+             ExcMessage (\"Heating outputs need to have the same number of entries as the material model inputs.\"));\n+\n+      Assert(heating_model_outputs.heating_source_terms.size() == material_model_inputs.strain_rate.size(),\n+             ExcMessage (\"The shear heating plugin needs the strain rate!\"));\n+\n+      Assert(this->introspection().compositional_name_exists(\"porosity\"),\n+             ExcMessage(\"Heating model shear heating with melt only works if there \"\n+                        \"is a compositional field called porosity.\"));\n+\n+      // get the melt velocity from the solution vector\n+      std::vector<Tensor<1,dim> > melt_velocity (material_model_inputs.position.size());\n+\n+      if (material_model_inputs.cell && this->get_timestep_number() > 0)\n+        {\n+          // we have to create a long vector, because that is the only way to extract the velocities\n+          // from the solution vector\n+          std::vector<std::vector<double> > melt_velocitiy_vector (dim, std::vector<double>(material_model_inputs.position.size()));\n+          // Prepare the field function\n+          Functions::FEFieldFunction<dim, DoFHandler<dim>, LinearAlgebra::BlockVector>\n+          fe_value(this->get_dof_handler(), this->get_solution(), this->get_mapping());\n+\n+          fe_value.set_active_cell(*material_model_inputs.cell);\n+\n+          for (unsigned int d=0; d<dim; ++d)\n+            fe_value.value_list(material_model_inputs.position,\n+                                melt_velocitiy_vector[d],\n+                                this->introspection().variable(\"fluid velocity\").first_component_index+d);\n+\n+          for (unsigned int i=0; i<material_model_inputs.position.size(); ++i)\n+            for (unsigned int d=0; d<dim; ++d)\n+              melt_velocity[i][d] = melt_velocitiy_vector[d][i];\n+        }\n+\n+      const MaterialModel::MeltOutputs<dim> *melt_outputs = material_model_outputs.template get_additional_output<MaterialModel::MeltOutputs<dim> >();\n+      Assert(melt_outputs != NULL, ExcMessage(\"Need MeltOutputs from the material model for shear heating with melt.\"));\n+\n+      for (unsigned int q=0; q<heating_model_outputs.heating_source_terms.size(); ++q)\n+        {\n+          const double porosity = material_model_inputs.composition[q][this->introspection().compositional_index_for_name(\"porosity\")];\n+\n+          heating_model_outputs.heating_source_terms[q] = melt_outputs->compaction_viscosities[q]\n+                                                          * pow(trace(material_model_inputs.strain_rate[q]),2)\n+                                                          +\n+                                                          (melt_outputs->permeabilities[q] > 0\n+                                                           ?\n+                                                           melt_outputs->fluid_viscosities[q] * porosity * porosity\n+                                                           / melt_outputs->permeabilities[q]\n+                                                           * (melt_velocity[q] - material_model_inputs.velocity[q])\n+                                                           * (melt_velocity[q] - material_model_inputs.velocity[q])\n+                                                           :\n+                                                           0.0);\n+\n+          heating_model_outputs.lhs_latent_heat_terms[q] = 0.0;\n+        }\n+    }\n+\n+    template <int dim>\n+    void\n+    ShearHeatingMelt<dim>::declare_parameters (ParameterHandler &prm)\n+    {\n+      prm.enter_subsection(\"Heating model\");\n+      {\n+        prm.enter_subsection(\"Shear heating with melt\");","path":"source/heating_model/shear_heating_with_melt.cc","position":102,"original_position":102,"commit_id":"8ec6435ea2ef7fcae497cbdec7cfeeb3b38f7441","original_commit_id":"8ec6435ea2ef7fcae497cbdec7cfeeb3b38f7441","user":{"login":"bangerth","id":7504421,"avatar_url":"https://avatars.githubusercontent.com/u/7504421?v=3","gravatar_id":"","url":"https://api.github.com/users/bangerth","html_url":"https://github.com/bangerth","followers_url":"https://api.github.com/users/bangerth/followers","following_url":"https://api.github.com/users/bangerth/following{/other_user}","gists_url":"https://api.github.com/users/bangerth/gists{/gist_id}","starred_url":"https://api.github.com/users/bangerth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bangerth/subscriptions","organizations_url":"https://api.github.com/users/bangerth/orgs","repos_url":"https://api.github.com/users/bangerth/repos","events_url":"https://api.github.com/users/bangerth/events{/privacy}","received_events_url":"https://api.github.com/users/bangerth/received_events","type":"User","site_admin":false},"body":"correct -- the whole function should go, as well as the parsing function","created_at":"2016-07-02T00:32:34Z","updated_at":"2016-07-02T00:32:34Z","html_url":"https://github.com/geodynamics/aspect/pull/1089#discussion_r69369194","pull_request_url":"https://api.github.com/repos/geodynamics/aspect/pulls/1089","_links":{"self":{"href":"https://api.github.com/repos/geodynamics/aspect/pulls/comments/69369194"},"html":{"href":"https://github.com/geodynamics/aspect/pull/1089#discussion_r69369194"},"pull_request":{"href":"https://api.github.com/repos/geodynamics/aspect/pulls/1089"}}},"pull_request":{"url":"https://api.github.com/repos/geodynamics/aspect/pulls/1089","id":76042342,"html_url":"https://github.com/geodynamics/aspect/pull/1089","diff_url":"https://github.com/geodynamics/aspect/pull/1089.diff","patch_url":"https://github.com/geodynamics/aspect/pull/1089.patch","issue_url":"https://api.github.com/repos/geodynamics/aspect/issues/1089","number":1089,"state":"open","locked":false,"title":"add melt heating plugins and tests","user":{"login":"jdannberg","id":7517347,"avatar_url":"https://avatars.githubusercontent.com/u/7517347?v=3","gravatar_id":"","url":"https://api.github.com/users/jdannberg","html_url":"https://github.com/jdannberg","followers_url":"https://api.github.com/users/jdannberg/followers","following_url":"https://api.github.com/users/jdannberg/following{/other_user}","gists_url":"https://api.github.com/users/jdannberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jdannberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdannberg/subscriptions","organizations_url":"https://api.github.com/users/jdannberg/orgs","repos_url":"https://api.github.com/users/jdannberg/repos","events_url":"https://api.github.com/users/jdannberg/events{/privacy}","received_events_url":"https://api.github.com/users/jdannberg/received_events","type":"User","site_admin":false},"body":"Add heating plugins for models with melt migration. This includes shear heating, adiabatic heating and latent heat of melting for models where the melt velocity is different than the solid velocity. ","created_at":"2016-07-01T22:06:06Z","updated_at":"2016-07-02T00:32:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a920e5e34348d5f8d461a9876b88e9671533883b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/geodynamics/aspect/pulls/1089/commits","review_comments_url":"https://api.github.com/repos/geodynamics/aspect/pulls/1089/comments","review_comment_url":"https://api.github.com/repos/geodynamics/aspect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geodynamics/aspect/issues/1089/comments","statuses_url":"https://api.github.com/repos/geodynamics/aspect/statuses/8ec6435ea2ef7fcae497cbdec7cfeeb3b38f7441","head":{"label":"jdannberg:melt_heating_models","ref":"melt_heating_models","sha":"8ec6435ea2ef7fcae497cbdec7cfeeb3b38f7441","user":{"login":"jdannberg","id":7517347,"avatar_url":"https://avatars.githubusercontent.com/u/7517347?v=3","gravatar_id":"","url":"https://api.github.com/users/jdannberg","html_url":"https://github.com/jdannberg","followers_url":"https://api.github.com/users/jdannberg/followers","following_url":"https://api.github.com/users/jdannberg/following{/other_user}","gists_url":"https://api.github.com/users/jdannberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jdannberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdannberg/subscriptions","organizations_url":"https://api.github.com/users/jdannberg/orgs","repos_url":"https://api.github.com/users/jdannberg/repos","events_url":"https://api.github.com/users/jdannberg/events{/privacy}","received_events_url":"https://api.github.com/users/jdannberg/received_events","type":"User","site_admin":false},"repo":{"id":19785028,"name":"aspect","full_name":"jdannberg/aspect","owner":{"login":"jdannberg","id":7517347,"avatar_url":"https://avatars.githubusercontent.com/u/7517347?v=3","gravatar_id":"","url":"https://api.github.com/users/jdannberg","html_url":"https://github.com/jdannberg","followers_url":"https://api.github.com/users/jdannberg/followers","following_url":"https://api.github.com/users/jdannberg/following{/other_user}","gists_url":"https://api.github.com/users/jdannberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jdannberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdannberg/subscriptions","organizations_url":"https://api.github.com/users/jdannberg/orgs","repos_url":"https://api.github.com/users/jdannberg/repos","events_url":"https://api.github.com/users/jdannberg/events{/privacy}","received_events_url":"https://api.github.com/users/jdannberg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdannberg/aspect","description":"Finite element parallel code to simulate problems in thermal convection in both 2D and 3D models.","fork":true,"url":"https://api.github.com/repos/jdannberg/aspect","forks_url":"https://api.github.com/repos/jdannberg/aspect/forks","keys_url":"https://api.github.com/repos/jdannberg/aspect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdannberg/aspect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdannberg/aspect/teams","hooks_url":"https://api.github.com/repos/jdannberg/aspect/hooks","issue_events_url":"https://api.github.com/repos/jdannberg/aspect/issues/events{/number}","events_url":"https://api.github.com/repos/jdannberg/aspect/events","assignees_url":"https://api.github.com/repos/jdannberg/aspect/assignees{/user}","branches_url":"https://api.github.com/repos/jdannberg/aspect/branches{/branch}","tags_url":"https://api.github.com/repos/jdannberg/aspect/tags","blobs_url":"https://api.github.com/repos/jdannberg/aspect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdannberg/aspect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdannberg/aspect/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdannberg/aspect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdannberg/aspect/statuses/{sha}","languages_url":"https://api.github.com/repos/jdannberg/aspect/languages","stargazers_url":"https://api.github.com/repos/jdannberg/aspect/stargazers","contributors_url":"https://api.github.com/repos/jdannberg/aspect/contributors","subscribers_url":"https://api.github.com/repos/jdannberg/aspect/subscribers","subscription_url":"https://api.github.com/repos/jdannberg/aspect/subscription","commits_url":"https://api.github.com/repos/jdannberg/aspect/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdannberg/aspect/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdannberg/aspect/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdannberg/aspect/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdannberg/aspect/contents/{+path}","compare_url":"https://api.github.com/repos/jdannberg/aspect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdannberg/aspect/merges","archive_url":"https://api.github.com/repos/jdannberg/aspect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdannberg/aspect/downloads","issues_url":"https://api.github.com/repos/jdannberg/aspect/issues{/number}","pulls_url":"https://api.github.com/repos/jdannberg/aspect/pulls{/number}","milestones_url":"https://api.github.com/repos/jdannberg/aspect/milestones{/number}","notifications_url":"https://api.github.com/repos/jdannberg/aspect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdannberg/aspect/labels{/name}","releases_url":"https://api.github.com/repos/jdannberg/aspect/releases{/id}","deployments_url":"https://api.github.com/repos/jdannberg/aspect/deployments","created_at":"2014-05-14T15:28:24Z","updated_at":"2015-09-22T19:25:32Z","pushed_at":"2016-07-01T22:04:36Z","git_url":"git://github.com/jdannberg/aspect.git","ssh_url":"git@github.com:jdannberg/aspect.git","clone_url":"https://github.com/jdannberg/aspect.git","svn_url":"https://github.com/jdannberg/aspect","homepage":null,"size":120912,"stargazers_count":0,"watchers_count":0,"language":"Gnuplot","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"geodynamics:master","ref":"master","sha":"b9ae012cfbcd362674400e1d6048e99db36955ae","user":{"login":"geodynamics","id":4052461,"avatar_url":"https://avatars.githubusercontent.com/u/4052461?v=3","gravatar_id":"","url":"https://api.github.com/users/geodynamics","html_url":"https://github.com/geodynamics","followers_url":"https://api.github.com/users/geodynamics/followers","following_url":"https://api.github.com/users/geodynamics/following{/other_user}","gists_url":"https://api.github.com/users/geodynamics/gists{/gist_id}","starred_url":"https://api.github.com/users/geodynamics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geodynamics/subscriptions","organizations_url":"https://api.github.com/users/geodynamics/orgs","repos_url":"https://api.github.com/users/geodynamics/repos","events_url":"https://api.github.com/users/geodynamics/events{/privacy}","received_events_url":"https://api.github.com/users/geodynamics/received_events","type":"Organization","site_admin":false},"repo":{"id":19502452,"name":"aspect","full_name":"geodynamics/aspect","owner":{"login":"geodynamics","id":4052461,"avatar_url":"https://avatars.githubusercontent.com/u/4052461?v=3","gravatar_id":"","url":"https://api.github.com/users/geodynamics","html_url":"https://github.com/geodynamics","followers_url":"https://api.github.com/users/geodynamics/followers","following_url":"https://api.github.com/users/geodynamics/following{/other_user}","gists_url":"https://api.github.com/users/geodynamics/gists{/gist_id}","starred_url":"https://api.github.com/users/geodynamics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geodynamics/subscriptions","organizations_url":"https://api.github.com/users/geodynamics/orgs","repos_url":"https://api.github.com/users/geodynamics/repos","events_url":"https://api.github.com/users/geodynamics/events{/privacy}","received_events_url":"https://api.github.com/users/geodynamics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geodynamics/aspect","description":"A parallel, extendible finite element code to simulate thermal convection in both 2D and 3D models.","fork":false,"url":"https://api.github.com/repos/geodynamics/aspect","forks_url":"https://api.github.com/repos/geodynamics/aspect/forks","keys_url":"https://api.github.com/repos/geodynamics/aspect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geodynamics/aspect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geodynamics/aspect/teams","hooks_url":"https://api.github.com/repos/geodynamics/aspect/hooks","issue_events_url":"https://api.github.com/repos/geodynamics/aspect/issues/events{/number}","events_url":"https://api.github.com/repos/geodynamics/aspect/events","assignees_url":"https://api.github.com/repos/geodynamics/aspect/assignees{/user}","branches_url":"https://api.github.com/repos/geodynamics/aspect/branches{/branch}","tags_url":"https://api.github.com/repos/geodynamics/aspect/tags","blobs_url":"https://api.github.com/repos/geodynamics/aspect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geodynamics/aspect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geodynamics/aspect/git/refs{/sha}","trees_url":"https://api.github.com/repos/geodynamics/aspect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geodynamics/aspect/statuses/{sha}","languages_url":"https://api.github.com/repos/geodynamics/aspect/languages","stargazers_url":"https://api.github.com/repos/geodynamics/aspect/stargazers","contributors_url":"https://api.github.com/repos/geodynamics/aspect/contributors","subscribers_url":"https://api.github.com/repos/geodynamics/aspect/subscribers","subscription_url":"https://api.github.com/repos/geodynamics/aspect/subscription","commits_url":"https://api.github.com/repos/geodynamics/aspect/commits{/sha}","git_commits_url":"https://api.github.com/repos/geodynamics/aspect/git/commits{/sha}","comments_url":"https://api.github.com/repos/geodynamics/aspect/comments{/number}","issue_comment_url":"https://api.github.com/repos/geodynamics/aspect/issues/comments{/number}","contents_url":"https://api.github.com/repos/geodynamics/aspect/contents/{+path}","compare_url":"https://api.github.com/repos/geodynamics/aspect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geodynamics/aspect/merges","archive_url":"https://api.github.com/repos/geodynamics/aspect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geodynamics/aspect/downloads","issues_url":"https://api.github.com/repos/geodynamics/aspect/issues{/number}","pulls_url":"https://api.github.com/repos/geodynamics/aspect/pulls{/number}","milestones_url":"https://api.github.com/repos/geodynamics/aspect/milestones{/number}","notifications_url":"https://api.github.com/repos/geodynamics/aspect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geodynamics/aspect/labels{/name}","releases_url":"https://api.github.com/repos/geodynamics/aspect/releases{/id}","deployments_url":"https://api.github.com/repos/geodynamics/aspect/deployments","created_at":"2014-05-06T16:47:18Z","updated_at":"2016-06-28T02:05:15Z","pushed_at":"2016-07-02T00:32:28Z","git_url":"git://github.com/geodynamics/aspect.git","ssh_url":"git@github.com:geodynamics/aspect.git","clone_url":"https://github.com/geodynamics/aspect.git","svn_url":"https://github.com/geodynamics/aspect","homepage":"http://aspect.dealii.org/","size":143064,"stargazers_count":27,"watchers_count":27,"language":"Gnuplot","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":147,"forks":57,"open_issues":147,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geodynamics/aspect/pulls/1089"},"html":{"href":"https://github.com/geodynamics/aspect/pull/1089"},"issue":{"href":"https://api.github.com/repos/geodynamics/aspect/issues/1089"},"comments":{"href":"https://api.github.com/repos/geodynamics/aspect/issues/1089/comments"},"review_comments":{"href":"https://api.github.com/repos/geodynamics/aspect/pulls/1089/comments"},"review_comment":{"href":"https://api.github.com/repos/geodynamics/aspect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geodynamics/aspect/pulls/1089/commits"},"statuses":{"href":"https://api.github.com/repos/geodynamics/aspect/statuses/8ec6435ea2ef7fcae497cbdec7cfeeb3b38f7441"}}}}
{"actor":{"display_login":"bangerth"}}