Skip to content
Snippets Groups Projects
Select Git revision
  • d4a4334f57d72a4c7f8f20ca9b9c8fd186165dbc
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

gmsh.html

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    • Christophe Geuzaine's avatar
      d4a4334f
      · d4a4334f
      Christophe Geuzaine authored
      remove link to quicktime movie: this eats a lot of bandwidth for nothing.
      d4a4334f
      History
      Christophe Geuzaine authored
      remove link to quicktime movie: this eats a lot of bandwidth for nothing.
    DistributedField.h 3.10 KiB
    // GmshFEM - Copyright (C) 2023, B. Martin, C. Geuzaine, Université de Liège
    //
    // See the LICENSE.txt file for license information. Please report all
    // issues on https://gitlab.onelab.info/gmsh/fem/issues
    
    #ifndef H_GMSHFEM_DISTRIBUTED_FIELD
    #define H_GMSHFEM_DISTRIBUTED_FIELD
    
    #include "Field.h"
    
    #include <set>
    #include <unordered_set>
    #include <map>
    #include <unordered_map>
    #include <optional>
    
    namespace gmshfem::field
    {
    
    
      template< class T_Scalar, field::Form T_Form >
      class DistributedField : public Field< T_Scalar, T_Form >
      {
    
        private:
        using DofGlobalIndex = std::pair<int, std::size_t>; // Key without tag information (modulo FIELD_OFFSET)
        using DofIndex = std::pair<unsigned long long, unsigned long long>; // Includes tag information
    
    
        struct HashBySecond {
          size_t operator()(const DofGlobalIndex &p) const
          {
            return std::hash<  std::size_t >()(p.second); // Hash based on the entity ID
          }
          size_t operator()(const DofIndex &p) const
          {
            return std::hash<  std::size_t >()(p.second); // Hash based on the entity ID
          }
        };
    
       public:
            domain::Domain _innerDomain, _overlapDomain;
    
    
        std::unordered_set< dofs::Dof * > _sharedDofs; // DOFs having non-zero support on the overlap
        std::unordered_set< dofs::Dof * > _subdomainInterfaceDofs; // Intersection of _sharedDofs and _innerDofs
        std::unordered_set<dofs::Dof *> _ownedDofs; // Strict interior + interface dofs owned
    
        std::unordered_set< dofs::Dof * > _toSend; // List of DOFs objects whose ID should be broadcasted by
        std::unordered_set< dofs::Dof * > _toRead;
    
        std::unordered_map<DofIndex, dofs::Dof*, HashBySecond> _indexToDof;
        std::unordered_map<unsigned long long, unsigned long long> _localToGlobal; //numDof()
    
       private:
        void _computeDofsSubsets(); // Computes the sets above, assuming this->_values is filled.    
        void _synchronizeInterfaceOwnership(const std::optional<std::vector<int>>&  neighboringRanks);
        void _computeToSend(const std::optional<std::vector<int>>&  neighboringRanks);
    
      public:
        virtual void preProMPI(const std::optional<std::vector<int>>&  neighboringRanks = std::nullopt) override;
        virtual std::unordered_set<dofs::Dof*> getAllOwnedDofs() override;
        virtual std::unordered_set<dofs::Dof*> getNonOwnedDofs() override;
        virtual void syncGlobalDofs(std::vector<unsigned long long>& localToGlobal, std::vector<unsigned long long>& readIDs) override;
        void dumpOwnedKeys();
    
       public:
        DistributedField();
        DistributedField(const std::string &name, const domain::Domain &innerdomain, const domain::Domain &outerdomain, const field::FunctionSpaceOfForm< T_Form > &type, const unsigned int order = 0, const std::string &model = "");
        DistributedField(const std::string &name, const domain::Domain &innerdomain, const domain::Domain &outerdomain, const FunctionSpace< scalar::Precision< T_Scalar >, T_Form > &functionSpace, const std::string &model = "");
        DistributedField(const DistributedField< T_Scalar, T_Form > &other);
        virtual ~DistributedField();
      };
    
    
    } // namespace gmshfem::field
    
    
    #endif // H_GMSHFEM_DISTRIBUTED_FIELD