source: XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_mask_connector.hpp @ 1943

Last change on this file since 1943 was 1943, checked in by ymipsl, 4 years ago

Solve issues for grid mask on server side.

YM

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#ifndef __GRID_MASK_CONNECTOR_HPP__
2#define __GRID_MASK_CONNECTOR_HPP__
3
4#include "xios_spl.hpp"
5#include "array_new.hpp"
6#include "local_view.hpp"
7#include "distributed_view.hpp"
8
9namespace xios
10{
11 
12  class CGridMaskConnector
13  {
14
15    public:
16
17      CGridMaskConnector(vector<CLocalView*>& views) : views_(views) {}
18      void computeConnector(CArray<bool,1>& mask) ;
19     
20      CArray<bool,1>& getElementMask(int pos) { return elementsMask_[pos] ;} 
21      vector<CArray<bool,1>>& getElementsMask(void) ;
22   
23    private:
24      vector<CLocalView*> views_ ;
25      vector<CArray<bool,1>> elementsMask_ ; 
26
27      vector<int> size_ ;
28      vector<int> index_ ;
29      int nViews_ ;
30   
31    private:
32 
33    void recursiveInternal(int level, bool*& mask)
34    {
35      if (level==0)
36      {
37        for(int i=0; i < size_[level] ; i++)
38        {
39          for(int j=0 ; j<nViews_ ; j++) elementsMask_[j](index_[j]) |= *mask ;
40          index_[level]++ ;
41          mask++ ;
42        }
43        index_[level] = 0 ;
44      }
45      else
46      { 
47        for(int i=0; i<size_[level] ; i++) recursiveInternal(level-1, mask) ;
48        index_[level] = 0 ;
49      }
50    }
51
52  } ;
53
54}
55
56#endif
Note: See TracBrowser for help on using the repository browser.