Skip to content
Snippets Groups Projects
Select Git revision
  • 71ed5abbd13e479ffb4e3ed4739e77622afb5835
  • develop default protected
  • feature/gmsh-reader
  • origin/stage/bouguettaia
  • feature/kinetic-schemes
  • feature/reconstruction
  • feature/local-dt-fsi
  • feature/composite-scheme-sources
  • feature/composite-scheme-other-fluxes
  • feature/serraille
  • feature/variational-hydro
  • feature/composite-scheme
  • hyperplastic
  • feature/polynomials
  • feature/gks
  • feature/implicit-solver-o2
  • feature/coupling_module
  • feature/implicit-solver
  • feature/merge-local-dt-fsi
  • master protected
  • feature/escobar-smoother
  • v0.5.0 protected
  • v0.4.1 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0 protected
  • Kidder
  • v0.0.4 protected
  • v0.0.3 protected
  • v0.0.2 protected
  • v0 protected
  • v0.0.1 protected
33 results

PugsAssert.hpp

Blame
    • Stéphane Del Pino's avatar
      71ed5abb
      Simplify Assert management · 71ed5abb
      Stéphane Del Pino authored
      Now `Assert(d)` or `Assert(d, "d is undefined")` work properly with
      `std::unique_ptr`. Does not require anymore to write
      `Assert(static_cast<bool>(d))` which is much more convenient.
      71ed5abb
      History
      Simplify Assert management
      Stéphane Del Pino authored
      Now `Assert(d)` or `Assert(d, "d is undefined")` work properly with
      `std::unique_ptr`. Does not require anymore to write
      `Assert(static_cast<bool>(d))` which is much more convenient.
    ConnectivityMatrix.hpp 2.13 KiB
    #ifndef CONNECTIVITY_MATRIX_HPP
    #define CONNECTIVITY_MATRIX_HPP
    
    #include <Kokkos_Core.hpp>
    #include <Kokkos_StaticCrsGraph.hpp>
    
    class ConnectivityMatrix
    {
     private:
      typedef Kokkos::StaticCrsGraph<unsigned int, Kokkos::HostSpace> HostMatrix;
      HostMatrix m_host_matrix;
    
     public:
      typedef HostMatrix::row_map_type HostRowType;
    
      const auto& entries() const
      {
        return m_host_matrix.entries;
      }
    
      const auto& rowsMap() const
      {
        return m_host_matrix.row_map;
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto numEntries() const
      {
        return m_host_matrix.entries.extent(0);
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto numRows() const
      {
        return m_host_matrix.numRows();
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto rowConst(const size_t& j) const
      {
        return m_host_matrix.rowConst(j);
      }
    
      KOKKOS_INLINE_FUNCTION
      const auto rowMap(const size_t& j) const
      {
        return m_host_matrix.row_map[j];
      }
    
      KOKKOS_INLINE_FUNCTION
      ConnectivityMatrix(const std::vector<std::vector<unsigned int>>& initializer)
          : m_host_matrix(Kokkos::create_staticcrsgraph<HostMatrix>("connecticity_matrix", initializer))
      {
        ;
      }
    
      KOKKOS_INLINE_FUNCTION
      ConnectivityMatrix(const ConnectivityMatrix& connecticity_matrix,std::vector<std::vector<unsigned int>>& initializer)
          : m_host_matrix(Kokkos::create_staticcrsgraph<HostMatrix>("connecticity_matrix", initializer))
      {
        ;
      }
    
      [[deprecated("Must only define connectivities so that only unsigned int should be treated")]]
      ConnectivityMatrix(const std::vector<std::vector<unsigned short>>& initializer)
      : m_host_matrix(Kokkos::create_staticcrsgraph<HostMatrix>("connecticity_matrix", initializer))
      {
        ;
      }
    
      ConnectivityMatrix& operator=(const ConnectivityMatrix&) = default;
      ConnectivityMatrix& operator=(ConnectivityMatrix&&) = default;
    
      ConnectivityMatrix() = default;
      ConnectivityMatrix(const ConnectivityMatrix&) = default;
      ConnectivityMatrix(ConnectivityMatrix&&) = default;
      ~ConnectivityMatrix() = default;
    };
    
    #warning use right type (unsigned short) instead of a clone of ConnectivityMatrix
    using ConnectivityMatrixShort = ConnectivityMatrix;
    
    #endif // CONNECTIVITY_MATRIX_HPP