From: Matthias Maier Date: Wed, 21 Jun 2023 02:17:43 +0000 (-0500) Subject: Test symengine/symengine_tensor_operations_04: fix test compilation X-Git-Tag: v9.5.0-rc1~64^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15411%2Fhead;p=dealii.git Test symengine/symengine_tensor_operations_04: fix test compilation This partially reverts 7ad068984b29f5712dd2bed5742459a9e2030ac3 This part has been commited and merged accidentally (partly due to our CI not testing any symengine artifacts). Unfortunately, the anticipated replacement of `begin_raw()` by `unrolled_to_component_indices(i)` does not work as intended. It is neither implemented for Tensor of rank 0, nor for SymmetricTensor of rank 4. --- diff --git a/tests/symengine/symengine_tensor_operations_04.cc b/tests/symengine/symengine_tensor_operations_04.cc index 2a908985ee..767900b392 100644 --- a/tests/symengine/symengine_tensor_operations_04.cc +++ b/tests/symengine/symengine_tensor_operations_04.cc @@ -104,12 +104,10 @@ test_tensor() using Tensor_t = Tensor; Tensor_t t_a, t_b; - for (unsigned int i = 0; i < Tensor_t::n_independent_components; ++i) - { - const auto index = t_a.unrolled_to_component_index(i); - t_a[index] = 1.0; - t_b[index] = 2.0; - } + for (auto it = t_a.begin_raw(); it != t_a.end_raw(); ++it) + *it = 1.0; + for (auto it = t_b.begin_raw(); it != t_b.end_raw(); ++it) + *it = 2.0; const Tensor_SD_number_t symb_t_a = SD::make_tensor_of_symbols("a"); @@ -130,13 +128,10 @@ test_symmetric_tensor() using Tensor_t = SymmetricTensor; Tensor_t t_a, t_b; - for (unsigned int i = 0; i < Tensor_t::n_independent_components; ++i) - { - const auto index = t_a.unrolled_to_component_index(i); - t_a[index] = 1.0; - t_b[index] = 2.0; - } - + for (auto it = t_a.begin_raw(); it != t_a.end_raw(); ++it) + *it = 1.0; + for (auto it = t_b.begin_raw(); it != t_b.end_raw(); ++it) + *it = 2.0; const Tensor_SD_number_t symb_t_a = SD::make_symmetric_tensor_of_symbols("a");