@@ -57,7 +57,7 @@ elasticity_trilinos::problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh,
5757
5858 // Define boundary condition
5959 auto u0 = std::make_shared<dolfinx::fem::Function<T>>(V);
60- std::ranges::fill (u0->x ()->array (), 0.0 );
60+ std::ranges::fill (u0->x ()->array (), 0.0 );
6161
6262 const int tdim = mesh->topology ()->dim ();
6363
@@ -193,7 +193,7 @@ elasticity_trilinos::problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh,
193193 new Tpetra::CrsMatrix<T, std::int32_t , std::int64_t >(crs_graph));
194194
195195 // Insert block
196- auto tpetra_insert_block = [&A_Tpetra, &bs, & num_local, &global_indices](
196+ auto tpetra_insert_block = [&A_Tpetra, &num_local, &global_indices](
197197 const std::span<const std::int32_t >& rows,
198198 const std::span<const std::int32_t >& cols,
199199 const std::span<const T>& data)
@@ -212,8 +212,8 @@ elasticity_trilinos::problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh,
212212 {
213213 Teuchos::ArrayView<const double > data_view (
214214 data.data () + (i * bs + j) * nc * bs, nc * bs);
215- std::size_t nvalid = A_Tpetra->sumIntoLocalValues (rows[i] * bs + j, col_view,
216- data_view);
215+ std::size_t nvalid = A_Tpetra->sumIntoLocalValues (
216+ rows[i] * bs + j, col_view, data_view);
217217 if (nvalid != nc * bs)
218218 throw std::runtime_error (" L Inserted " + std::to_string (nvalid)
219219 + " /" + std::to_string (nc)
@@ -230,7 +230,7 @@ elasticity_trilinos::problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh,
230230 {
231231 Teuchos::ArrayView<const double > data_view (
232232 data.data () + (i * bs + j) * nc * bs, nc * bs);
233- std::size_t nvalid = A_Tpetra->sumIntoGlobalValues (
233+ std::size_t nvalid = A_Tpetra->sumIntoGlobalValues (
234234 global_indices[rows[i]] * bs + j, global_col_view, data_view);
235235 if (nvalid != nc * bs)
236236 throw std::runtime_error (" G Inserted " + std::to_string (nvalid)
@@ -242,47 +242,7 @@ elasticity_trilinos::problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh,
242242 return 0 ;
243243 };
244244
245- // Insert individual values (for diagonal)
246- std::function<int (std::int32_t , const std::int32_t *, std::int32_t ,
247- const std::int32_t *, const T*)>
248- tpetra_insert
249- = [&A_Tpetra, &bs, &num_local, &global_index_view](
250- std::int32_t nr, const std::int32_t * rows, const std::int32_t nc,
251- const std::int32_t * cols, const T* data)
252- {
253- std::vector<std::int32_t > col_view (cols, cols + nc);
254- for (int i = 0 ; i < nr; ++i)
255- {
256- Teuchos::ArrayView<const double > data_view (data + i * nc, nc);
257- if ((std::size_t )rows[i] < num_local * bs)
258- {
259-
260- int nvalid = A_Tpetra->sumIntoLocalValues (rows[i], col_view, data_view);
261-
262- if (nvalid != nc)
263- throw std::runtime_error (" LD Inserted " + std::to_string (nvalid) + " /"
264- + std::to_string (nc)
265- + " on row:" + std::to_string (rows[i]));
266- }
267- else
268- {
269- std::vector<std::int64_t > global_col_view (nc);
270- for (int j = 0 ; j < nc; ++j)
271- global_col_view[j] = global_index_view[cols[j]];
272- int nvalid = A_Tpetra->sumIntoGlobalValues (global_index_view[rows[i]],
273- global_col_view, data_view);
274-
275- if (nvalid != nc)
276- throw std::runtime_error (" GD Inserted " + std::to_string (nvalid) + " /"
277- + std::to_string (nc)
278- + " on row:" + std::to_string (rows[i]));
279- }
280- }
281-
282- return 0 ;
283- };
284-
285- auto tpetra_set = [&A_Tpetra, &global_indices, &bs,
245+ auto tpetra_set = [&A_Tpetra, &global_indices,
286246 &num_local](const std::span<const std::int32_t >& rows,
287247 const std::span<const std::int32_t >& cols,
288248 const std::span<const T>& data)
@@ -296,7 +256,8 @@ elasticity_trilinos::problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh,
296256 + std::to_string (num_local));
297257 Teuchos::ArrayView<const int > col_view (cols.data (), 1 );
298258 Teuchos::ArrayView<const double > data_view (data.data (), 1 );
299- std::size_t nvalid = A_Tpetra->replaceLocalValues (rows[0 ], col_view, data_view);
259+ std::size_t nvalid
260+ = A_Tpetra->replaceLocalValues (rows[0 ], col_view, data_view);
300261 if (nvalid != nc)
301262 throw std::runtime_error (" Inserted " + std::to_string (nvalid) + " /"
302263 + std::to_string (nc) + " on row:"
0 commit comments