Closed greole closed 4 days ago
Is it more straight way in openFoam application? you can also do it with create
function from existing linop and comm pattern.
I'll add an extra constructor/create function. The reasoning is that we basically already local
and non_local data
and the communication pattern already in place from OpenFOAM.
I just realised that the following create method should be sufficient:
template <typename ValueType, typename LocalIndexType, typename GlobalIndexType>
std::unique_ptr<Matrix<ValueType, LocalIndexType, GlobalIndexType>>
Matrix<ValueType, LocalIndexType, GlobalIndexType>::create(
std::shared_ptr<const Executor> exec, mpi::communicator comm, dim<2> size,
std::shared_ptr<LinOp> local_linop, std::shared_ptr<LinOp> non_local_linop,
std::vector<comm_index_type> recv_sizes,
std::vector<comm_index_type> recv_offsets,
array<local_index_type> recv_gather_idxs)
@greole Agreed in general, though we should be using the abstractions from #1588 and #1589 once they are available, instead of raw vectors/arrays
This PR adds a version of read_distributed that works on existing local data and non_local_data and comm_pattern.