// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2016 - 2024 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-2.1-or-later. Detailed license information // governing the source code and code contributions can be found in // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. // // ------------------------------------------------------------------------ #ifndef dealii_trilinos_epetra_communication_pattern_h #define dealii_trilinos_epetra_communication_pattern_h #include #ifdef DEAL_II_WITH_TRILINOS # include DEAL_II_DISABLE_EXTRA_DIAGNOSTICS # include DEAL_II_ENABLE_EXTRA_DIAGNOSTICS # include DEAL_II_NAMESPACE_OPEN namespace LinearAlgebra { namespace EpetraWrappers { /** * This class implements a wrapper to a Trilinos Epetra_Import object, * for use in places where a Utilities::MPI::CommunicationPatternBase object * is required. */ class CommunicationPattern : public Utilities::MPI::CommunicationPatternBase { public: /** * Initialize the communication pattern. * * @param[in] locally_owned_indices The set of indices of elements * in the array mentioned in the class documentation that are * stored on the current process. * @param[in] ghost_indices The set of indices of elements in the * array mentioned in the class documentation that the current * process will need to be able to import. * @param[in] communicator The MPI communicator used to describe the * entire set of processes that participate in the storage and * access to elements of the array. */ CommunicationPattern(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator); /** * Reinitialize the communication pattern. * * @param[in] locally_owned_indices The set of indices of elements * in the array mentioned in the class documentation that are * stored on the current process. * @param[in] ghost_indices The set of indices of elements in the * array mentioned in the class documentation that the current * process will need to be able to import. * @param[in] communicator The MPI communicator used to describe the * entire set of processes that participate in the storage and * access to elements of the array. */ virtual void reinit(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator) override; /** * Return the underlying MPI communicator. */ virtual MPI_Comm get_mpi_communicator() const override; /** * Return the underlying Epetra_Import object. */ const Epetra_Import & get_epetra_import() const; private: /** * Shared pointer to the MPI communicator used. */ std::shared_ptr comm; /** * Shared pointer to the Epetra_Import object used. */ std::unique_ptr importer; }; } // end of namespace EpetraWrappers } // end of namespace LinearAlgebra DEAL_II_NAMESPACE_CLOSE #else // Make sure the scripts that create the C++20 module input files have // something to latch on if the preprocessor #ifdef above would // otherwise lead to an empty content of the file. DEAL_II_NAMESPACE_OPEN DEAL_II_NAMESPACE_CLOSE #endif #endif