{"action":"opened","issue":{"url":"https://api.github.com/repos/dealii/dealii/issues/2649","repository_url":"https://api.github.com/repos/dealii/dealii","labels_url":"https://api.github.com/repos/dealii/dealii/issues/2649/labels{/name}","comments_url":"https://api.github.com/repos/dealii/dealii/issues/2649/comments","events_url":"https://api.github.com/repos/dealii/dealii/issues/2649/events","html_url":"https://github.com/dealii/dealii/issues/2649","id":157401082,"number":2649,"title":"Access issue with rank 4 symmetric tensors","user":{"login":"drwells","id":3917035,"avatar_url":"https://avatars.githubusercontent.com/u/3917035?v=3","gravatar_id":"","url":"https://api.github.com/users/drwells","html_url":"https://github.com/drwells","followers_url":"https://api.github.com/users/drwells/followers","following_url":"https://api.github.com/users/drwells/following{/other_user}","gists_url":"https://api.github.com/users/drwells/gists{/gist_id}","starred_url":"https://api.github.com/users/drwells/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drwells/subscriptions","organizations_url":"https://api.github.com/users/drwells/orgs","repos_url":"https://api.github.com/users/drwells/repos","events_url":"https://api.github.com/users/drwells/events{/privacy}","received_events_url":"https://api.github.com/users/drwells/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-29T19:21:35Z","updated_at":"2016-05-29T19:21:35Z","closed_at":null,"body":"The following won't compile:\r\n\r\n```cpp\r\n#include <deal.II/base/symmetric_tensor.h>\r\n#include <deal.II/base/table_indices.h>\r\n\r\nint main()\r\n{\r\n  using namespace dealii;\r\n\r\n  static const int rank = 4;\r\n\r\n  TableIndices<rank> indices;\r\n\r\n  SymmetricTensor<rank, 3, double> tensor;\r\n\r\n  tensor[indices];\r\n}\r\n```\r\n\r\nThe error is (edited slightly for clarity)\r\n```\r\nIn file included from /home/drwells/Documents/Code/CPP/dealii-symmetric-tensor-constructor/symmetric.cc:1:0:\r\n/home/drwells/Applications/dealii-dev/include/deal.II/base/symmetric_tensor.h:\r\nIn instantiation of 'Number& SymmetricTensor<rank, dim, Number>::operator[](const TableIndices<N>&)\r\n[with int rank = 4; int dim = 3; Number = double]':\r\n/home/drwells/Documents/Code/CPP/dealii-symmetric-tensor-constructor/symmetric.cc:14:17:\r\nrequired from here\r\n/home/drwells/Applications/dealii-dev/include/deal.II/base/symmetric_tensor.h:1664:51:\r\nerror: invalid initialization of reference of type 'double&' from expression of\r\ntype 'dealii::Tensor<2, 6, double>::value_type {aka dealii::Tensor<1, 6, double>}'\r\nreturn data[component_to_unrolled_index(indices)];\r\n```\r\n\r\nbut this does work if `rank = 2`."}}
{"actor":{"display_login":"drwells"}}