ASL
0.1.7
Advanced Simulation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
src
data
aslProbe.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 ASLPROBE_H
25
#define ASLPROBE_H
26
27
#include <
acl/Kernels/aclKernel.h
>
28
#include <
math/aslVectors.h
>
29
#include <iostream>
30
#include <fstream>
31
32
33
34
using namespace
std
;
35
36
namespace
acl
37
{
38
class
VectorOfElementsData
;
39
typedef
std::shared_ptr<VectorOfElementsData>
SPVectorOfElementsData
;
40
41
}
42
namespace
asl
43
{
44
45
class
AbstractData
;
46
typedef
std::shared_ptr<AbstractData>
SPAbstractData
;
47
49
51
The class takes in
52
*/
53
class
Probe
54
{
55
protected
:
56
SPAbstractData
data
;
57
acl::Kernel
k
;
58
59
std::vector<int>
indices
;
60
acl::SPVectorOfElementsData
indicesACL
;
61
62
vector<vector<double>>
values
;
63
acl::SPVectorOfElementsData
valuesACL
;
64
65
void
loadIndicesToACL
();
66
void
loadValuesFromACL
();
67
68
public
:
69
Probe
(
SPAbstractData
d);
70
void
addPoint
(
AVec<int>
p);
72
void
init
();
74
void
update
();
75
const
unsigned
int
getNComponents
()
const
;
76
const
unsigned
int
getNDimensions
()
const
;
77
inline
vector<double> &
getComponent
(
unsigned
int
i);
78
inline
AVec<double>
getValue
(
unsigned
int
pointNumber);
79
};
80
82
84
*/
85
class
ProbeLI
86
{
87
protected
:
88
SPAbstractData
data
;
89
acl::Kernel
k
;
90
91
std::vector<AVec<>>
points
;
92
acl::SPVectorOfElementsData
pointsACL
;
93
94
vector<vector<double>>
values
;
95
acl::SPVectorOfElementsData
valuesACL
;
96
97
void
loadPointsToACL
();
98
void
loadValuesFromACL
();
99
100
public
:
101
ProbeLI
(
SPAbstractData
d);
102
void
addPoint
(
AVec<>
p);
104
void
init
();
106
void
update
();
107
const
unsigned
int
getNComponents
()
const
;
108
const
unsigned
int
getNDimensions
()
const
;
109
inline
vector<double> &
getComponent
(
unsigned
int
i);
110
inline
AVec<double>
getValue
(
unsigned
int
pointNumber);
111
};
112
113
114
// -------------------------- Implementation ------------------------------
115
116
inline
vector<double> &
Probe::getComponent
(
unsigned
int
i)
117
{
118
return
values
[i];
119
}
120
121
122
inline
AVec<double>
Probe::getValue
(
unsigned
int
pointNumber)
123
{
124
unsigned
int
nC(
getNComponents
());
125
AVec<double>
value(nC);
126
for
(
unsigned
int
i(0); i < nC; ++i)
127
value[i] =
values
[i][pointNumber];
128
129
return
value;
130
}
131
132
inline
vector<double> &
ProbeLI::getComponent
(
unsigned
int
i)
133
{
134
return
values
[i];
135
}
136
137
138
inline
AVec<double>
ProbeLI::getValue
(
unsigned
int
pointNumber)
139
{
140
unsigned
int
nC(
getNComponents
());
141
AVec<double>
value(nC);
142
for
(
unsigned
int
i(0); i < nC; ++i)
143
value[i] =
values
[i][pointNumber];
144
145
return
value;
146
}
147
148
}
149
150
#endif
151
aclKernel.h
aslVectors.h
definition of class АVec<T>
acl::Kernel
OpenCl Kernel generator.
Definition
aclKernel.h:49
acl::VectorOfElementsData
The class represents several ElementData.
Definition
aclVectorOfElementsDef.h:57
asl::AVec
Definition
aslVectorsDynamicLength.h:40
asl::AbstractData
Definition
aslDataWrapper.h:53
asl::Probe::getNDimensions
const unsigned int getNDimensions() const
asl::Probe::addPoint
void addPoint(AVec< int > p)
asl::Probe::loadIndicesToACL
void loadIndicesToACL()
asl::Probe::values
vector< vector< double > > values
Definition
aslProbe.h:62
asl::Probe::indicesACL
acl::SPVectorOfElementsData indicesACL
Definition
aslProbe.h:60
asl::Probe::update
void update()
Updates data in output.
asl::Probe::init
void init()
initialization of internal kernels and data
asl::Probe::data
SPAbstractData data
Definition
aslProbe.h:56
asl::Probe::k
acl::Kernel k
Definition
aslProbe.h:57
asl::Probe::getComponent
vector< double > & getComponent(unsigned int i)
Definition
aslProbe.h:116
asl::Probe::getValue
AVec< double > getValue(unsigned int pointNumber)
Definition
aslProbe.h:122
asl::Probe::indices
std::vector< int > indices
Definition
aslProbe.h:59
asl::Probe::valuesACL
acl::SPVectorOfElementsData valuesACL
Definition
aslProbe.h:63
asl::Probe::loadValuesFromACL
void loadValuesFromACL()
asl::Probe::Probe
Probe(SPAbstractData d)
asl::Probe::getNComponents
const unsigned int getNComponents() const
asl::ProbeLI::valuesACL
acl::SPVectorOfElementsData valuesACL
Definition
aslProbe.h:95
asl::ProbeLI::getValue
AVec< double > getValue(unsigned int pointNumber)
Definition
aslProbe.h:138
asl::ProbeLI::loadValuesFromACL
void loadValuesFromACL()
asl::ProbeLI::values
vector< vector< double > > values
Definition
aslProbe.h:94
asl::ProbeLI::points
std::vector< AVec<> > points
Definition
aslProbe.h:91
asl::ProbeLI::data
SPAbstractData data
Definition
aslProbe.h:88
asl::ProbeLI::loadPointsToACL
void loadPointsToACL()
asl::ProbeLI::addPoint
void addPoint(AVec<> p)
asl::ProbeLI::k
acl::Kernel k
Definition
aslProbe.h:89
asl::ProbeLI::getNDimensions
const unsigned int getNDimensions() const
asl::ProbeLI::init
void init()
initialization of internal kernels and data
asl::ProbeLI::getNComponents
const unsigned int getNComponents() const
asl::ProbeLI::ProbeLI
ProbeLI(SPAbstractData d)
asl::ProbeLI::getComponent
vector< double > & getComponent(unsigned int i)
Definition
aslProbe.h:132
asl::ProbeLI::update
void update()
Updates data in output.
asl::ProbeLI::pointsACL
acl::SPVectorOfElementsData pointsACL
Definition
aslProbe.h:92
acl
Advanced Computational Language.
Definition
acl.h:41
acl::SPVectorOfElementsData
shared_ptr< VectorOfElementsData > SPVectorOfElementsData
Definition
aclVectorOfElementsDef.h:105
asl
Advanced Simulation Library.
Definition
aslDataInc.h:31
asl::SPAbstractData
shared_ptr< AbstractData > SPAbstractData
Definition
aslDataWrapper.h:65
std
STL namespace.
Generated by
1.17.0