ASL  0.1.7
Advanced Simulation Library
aslDataResampling.h
Go to the documentation of this file.
1 /*
2  * Advanced Simulation Library <http://asl.org.il>
3  *
4  * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5  *
6  *
7  * This file is part of Advanced Simulation Library (ASL).
8  *
9  * ASL is free software: you can redistribute it and/or modify it
10  * under the terms of the GNU Affero General Public License as
11  * published by the Free Software Foundation, version 3 of the License.
12  *
13  * ASL is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #ifndef ASLDATARESAMPLING_H
25 #define ASLDATARESAMPLING_H
26 
27 #include "aslSingleKernelNM.h"
28 #include "math/aslVectors.h"
29 //#include <CL/cl.hpp>
30 // Supply "cl.hpp" with ASL, since it is not present in OpenCL 2.0
31 // Remove the file after switching to OpenCL 2.1
32 #include "acl/cl.hpp"
33 
34 namespace acl
35 {
36  class VectorOfElementsData;
37 }
38 
39 namespace asl
40 {
41  class VectorTemplate;
42  template <typename V> class DataWithGhostNodes;
43  typedef DataWithGhostNodes<acl::VectorOfElementsData> DataWithGhostNodesACLData;
44  typedef std::shared_ptr<DataWithGhostNodesACLData> SPDataWithGhostNodesACLData;
45  class AbstractDataWithGhostNodes;
46  typedef std::shared_ptr<AbstractDataWithGhostNodes> SPAbstractDataWithGhostNodes;
47 
49 
55  {
56  public:
58 
59  private:
60  Data dataIn;
61  Data dataOut;
62  const VectorTemplate* vectorTemplate;
63 
64  virtual void init0();
65  public:
68  inline Data getDataOut();
69  };
70 
71  typedef std::shared_ptr<DataCoarser> SPDataCoarser;
72 
75 
77 
83  {
84  public:
86 
87  private:
88  Data dataIn;
89  Data dataOut;
90  AVec<int> a0;
91  AVec<int> aE;
92 
93  virtual void init0();
94  public:
97  inline Data getDataOut();
98  };
99 
100  typedef std::shared_ptr<DataClipper> SPDataClipper;
101 
104  AVec<int> a0,
105  AVec<int> aE);
106 
107 //----------------------------- Implementation -----------------------
108 
110  {
111  return dataOut;
112  }
113 
115  {
116  return dataOut;
117  }
118 
120  {
121  DataCoarser dc(d);
122  dc.init();
123  dc.execute();
124  return dc.getDataOut();
125 
126  }
127 
129  AVec<int> a0,
130  AVec<int> aE)
131  {
132  asl::DataClipper dcl(d, a0,aE);
133  dcl.init();
134  dcl.execute();
135  return dcl.getDataOut();
136  }
137 
138 
139 } // asl
140 #endif // ASLDATARESAMPLING_H
Algorithm for generation of coarsed dataset.
DataClipper(Data dIn, AVec< int > a0, AVec< int > aE)
SPDataWithGhostNodesACLData Data
Algorithm for generation of coarsed dataset.
DataCoarser(Data dIn)
SPDataWithGhostNodesACLData Data
virtual void execute()
Executes the numerical procedure.
virtual void init()
Builds the necesery internal data and kernels.
Defines set of vectros with several properties.
Definition: aslTemplates.h:88
SPDataWithGhostNodesACLData coarseData(SPDataWithGhostNodesACLData d)
SPDataWithGhostNodesACLData clipData(SPDataWithGhostNodesACLData d, AVec< int > a0, AVec< int > aE)
Advanced Computational Language.
Definition: acl.h:41
Advanced Simulation Library.
Definition: aslDataInc.h:31
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
Definition: aslGenerators.h:45
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
Definition: aslGenerators.h:50
std::shared_ptr< DataClipper > SPDataClipper
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
Definition: aslGenerators.h:47
std::shared_ptr< DataCoarser > SPDataCoarser