Skip to content
Snippets Groups Projects
Select Git revision
  • fb8866f92f0a03983f584a0f383d571cec9939c6
  • 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

IMesh.cpp

Blame
    • Stéphane Del Pino's avatar
      fb8866f9
      Add DiamondDualConnectivityManager and DiamondDualMeshManager · fb8866f9
      Stéphane Del Pino authored
      These mechanisms are designed to manage diamond meshes/connectivities
      
      The main idea is that the diamond mesh is stored as long as its
      primary mesh lives, and can be retrieved easily.
      
      The same mechanism is defined for diamond mesh connectivities. Thus in
      a moving grid context, the only required calculations will be the
      definition of the diamond mesh's vertices coordinates.
      
      Recall that diamond meshes are just meshes so all meshes'
      functionality apply to them.
      fb8866f9
      History
      Add DiamondDualConnectivityManager and DiamondDualMeshManager
      Stéphane Del Pino authored
      These mechanisms are designed to manage diamond meshes/connectivities
      
      The main idea is that the diamond mesh is stored as long as its
      primary mesh lives, and can be retrieved easily.
      
      The same mechanism is defined for diamond mesh connectivities. Thus in
      a moving grid context, the only required calculations will be the
      definition of the diamond mesh's vertices coordinates.
      
      Recall that diamond meshes are just meshes so all meshes'
      functionality apply to them.
    Messenger.hpp 1.63 KiB
    #ifndef MESSENGER_HPP
    #define MESSENGER_HPP
    
    #include <PastisMacros.hpp>
    #include <PastisAssert.hpp>
    
    #include <Array.hpp>
    
    class Messenger
    {
     private:
      static Messenger* m_instance;
      Messenger(int& argc, char* argv[]);
    
      int m_rank{0};
      int m_size{1};
    
      Array<int> _broadcast(Array<int>& array, int root_rank) const;
    
     public:
      static void create(int& argc, char* argv[]);
      static void destroy();
    
      PASTIS_INLINE
      static Messenger& getInstance()
      {
        Assert(m_instance != nullptr);
        return *m_instance;
      }
    
      PASTIS_INLINE
      const int& rank() const
      {
        return m_rank;
      }
    
      PASTIS_INLINE
      const int& size() const
      {
        return m_size;
      }
    
      void barrier() const;
    
      template <typename DataType>
      PASTIS_INLINE
      Array<DataType> broadcast(const Array<DataType>& array, int root_rank) const
      {
        if constexpr(std::is_same<DataType, int>()) {
          Array<int> int_array = array;
          return _broadcast(int_array, root_rank);
        } else {
          static_assert(std::is_same<DataType, int>(), "unexpected type of data");
        }
      }
    
      Messenger(const Messenger&) = delete;
      ~Messenger();
    };
    
    PASTIS_INLINE
    const Messenger& messenger()
    {
      return Messenger::getInstance();
    }
    
    [[deprecated("use better name")]]
    PASTIS_INLINE
    const int& commRank()
    {
      return messenger().rank();
    }
    
    [[deprecated("use better name")]]
    PASTIS_INLINE
    const int& commSize()
    {
      return messenger().size();
    }
    
    PASTIS_INLINE
    void barrier()
    {
      return messenger().barrier();
    }
    
    template <typename DataType>
    PASTIS_INLINE
    Array<DataType> broadcast(const Array<DataType>& array, int root_rank)
    {
      return messenger().broadcast(array, root_rank);
    }
    
    #endif // MESSENGER_HPP