| 308 | //---------------------------------------------------------------------------- |
| 309 | template <typename T> |
| 310 | SuperLUDistSolver<T>::SuperLUDistSolver( |
| 311 | std::shared_ptr<const SuperLUDistMatrix<T>> A) |
| 312 | : _superlu_matA(std::move(A)), |
| 313 | _options( |
| 314 | [] |
| 315 | { |
| 316 | auto o = std::make_unique< |
| 317 | SuperLUDistStructs::superlu_dist_options_t>(); |
| 318 | set_default_options_dist(o.get()); |
| 319 | o->PrintStat = NO; |
| 320 | return o; |
| 321 | }()), |
| 322 | _gridinfo( |
| 323 | [comm = _superlu_matA->comm()] |
| 324 | { |
| 325 | int nprow = dolfinx::MPI::size(comm); |
| 326 | int npcol = 1; |
| 327 | std::unique_ptr<SuperLUDistStructs::gridinfo_t, GridInfoDeleter> p( |
| 328 | new SuperLUDistStructs::gridinfo_t, GridInfoDeleter{}); |
| 329 | superlu_gridinit(comm, nprow, npcol, p.get()); |
| 330 | return p; |
| 331 | }()), |
| 332 | _scalepermstruct( |
| 333 | [m = _superlu_matA->supermatrix()->nrow] |
| 334 | { |
| 335 | std::unique_ptr<typename map_t<T>::ScalePermstruct_t, |
| 336 | ScalePermStructDeleter> |
| 337 | s(new map_t<T>::ScalePermstruct_t, ScalePermStructDeleter{}); |
| 338 | |
| 339 | if constexpr (std::is_same_v<T, double>) |
| 340 | { |
| 341 | dScalePermstructInit(m, m, s.get()); |
| 342 | } |
| 343 | else if constexpr (std::is_same_v<T, float>) |
| 344 | { |
| 345 | sScalePermstructInit(m, m, s.get()); |
| 346 | } |
| 347 | else if constexpr (std::is_same_v<T, std::complex<double>>) |
| 348 | { |
| 349 | zScalePermstructInit(m, m, s.get()); |
| 350 | } |
| 351 | else |
| 352 | static_assert(always_false_v<T>, "Invalid scalar type"); |
| 353 | return s; |
| 354 | }()), |
| 355 | _lustruct( |
| 356 | [m = _superlu_matA->supermatrix()->nrow] |
| 357 | { |
| 358 | std::unique_ptr<typename map_t<T>::LUstruct_t, LUStructDeleter> l( |
| 359 | new map_t<T>::LUstruct_t, LUStructDeleter{}); |
| 360 | |
| 361 | if constexpr (std::is_same_v<T, double>) |
| 362 | { |
| 363 | dLUstructInit(m, l.get()); |
| 364 | } |
| 365 | else if constexpr (std::is_same_v<T, float>) |
| 366 | { |
| 367 | sLUstructInit(m, l.get()); |
nothing calls this directly
no test coverage detected