trilinos / ForTrilinos

ForTrilinos provides portable object-oriented Fortran interfaces to Trilinos C++ packages.
https://trilinos.github.io/ForTrilinos
BSD 3-Clause "New" or "Revised" License
24 stars 12 forks source link

SWIG priorities #139

Open aprokop opened 6 years ago

aprokop commented 6 years ago

Ordered from high to low:

aprokop commented 6 years ago

@sethrj

sethrj commented 6 years ago

@aprokop To get the 2D array views, can you give me C++ code that gives

aprokop commented 6 years ago

@sethrj If you have a Tpetra::MultiVector<...>, the code you want is

  Tpetra::MultiVector<...> X;
   // The following returns multi-dimensional Kokkos::View
   // Right now, all the data is going to be on the host
   auto Xview = X->getLocalView();
   double* ptr = Xview.data();
   size_t dim_0 = Xview.extent(0);
   size_t dim_1 = Xview.extent(1);

This gives you the full 2D array data (not tested, though). The allocation should be contiguous (I don't think there is any padding). I'm not sure what you mean by the ranges of slices. We only need the full 2D array.

sethrj commented 6 years ago

I can get these last items done once #217 and #220 are merged.