-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdata.hpp
More file actions
157 lines (103 loc) · 6.79 KB
/
data.hpp
File metadata and controls
157 lines (103 loc) · 6.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/***********************************************************************
MrHyDE - a framework for solving Multi-resolution Hybridized
Differential Equations and enabling beyond forward simulation for
large-scale multiphysics and multiscale systems.
Questions? Contact Tim Wildey (tmwilde@sandia.gov)
************************************************************************/
#ifndef MRHYDE_DATA_H
#define MRHYDE_DATA_H
#include "trilinos.hpp"
#include <iostream>
#include <iterator>
#include "interfaces/CompadreInterface.hpp"
namespace MrHyDE {
class Data {
public:
// ========================================================================================
// ========================================================================================
Data() {} ;
// ========================================================================================
// ========================================================================================
~Data() {} ;
/////////////////////////////////////////////////////////////////////////////
// Various constructors depending on the characteristics of the data (spatial,
// transient, stochastic, etc.)
/////////////////////////////////////////////////////////////////////////////
Data(const std::string & name_, const ScalarT & val);
/////////////////////////////////////////////////////////////////////////////
Data(const std::string & name_, const std::string & datafile);
/////////////////////////////////////////////////////////////////////////////
Data(const std::string & name_, const int & spaceDim_, const std::string & ptsfile);
/////////////////////////////////////////////////////////////////////////////
Data(const std::string & name_, const int & spaceDim_, const std::string & ptsfile,
const std::string & sensorprefix);
/////////////////////////////////////////////////////////////////////////////
Data(const std::string & name_, const int & spaceDim_, const std::string & ptsfile,
const std::string & sensorprefix, const bool & separate_files);
/////////////////////////////////////////////////////////////////////////////
Data(const std::string & name_, const int & spaceDim_, const std::string & ptsfile,
const std::string & sensorprefix, const bool & separate_files,
const int & Nx, const int & Ny, const int & Nz);
/////////////////////////////////////////////////////////////////////////////
Data(const std::string & name_, const int & spaceDim_, const std::string & ptsfile,
const int & Nsens, const std::string & sensorprefix);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void importPoints(const std::string & ptsfile, const int & spaceDim);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void importGridPoints(const std::string & ptsfile, const int & spaceDim,
const int & Nx, const int & Ny, const int & Nz);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void importDataOneFile(const std::string & datafile);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void importData(const std::string & datafile);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
ScalarT getValue(const ScalarT & x, const ScalarT & y, const ScalarT & z,
const ScalarT & time, const string & label) const;
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void findClosestPoint(const Kokkos::View<ScalarT**, AssemblyDevice> &testpts,
Kokkos::View<int*, CompadreDevice> &closestpts) const;
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
void findClosestPoint(const Kokkos::View<ScalarT**, AssemblyDevice> &testpts,
Kokkos::View<int*, CompadreDevice> &closestpts,
Kokkos::View<ScalarT*, AssemblyDevice> &distance) const;
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
int findClosestGridPoint(const ScalarT & x, const ScalarT & y,
const ScalarT & z, ScalarT & distance) const;
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
std::string getName();
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
std::vector<Kokkos::View<ScalarT**,HostDevice> > getData();
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
Kokkos::View<ScalarT**,HostDevice> getData(const int & sensnum);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
Kokkos::View<ScalarT**,HostDevice> getPoints();
private:
bool is_spatialdep;
bool is_timedep;
bool is_stochastic;
int spaceDim;
std::string name;
Kokkos::View<ScalarT**,HostDevice> points;
std::vector<Kokkos::View<ScalarT**,HostDevice> > data;
std::vector<std::vector<string> > labels;
Kokkos::View<ScalarT*,HostDevice> grid_x, grid_y, grid_z;
// Profile timers
Teuchos::RCP<Teuchos::Time> dataImportTimer = Teuchos::TimeMonitor::getNewCounter("MrHyDE::data - import data");
Teuchos::RCP<Teuchos::Time> pointImportTimer = Teuchos::TimeMonitor::getNewCounter("MrHyDE::data - import points");
Teuchos::RCP<Teuchos::Time> dataClosestTimer = Teuchos::TimeMonitor::getNewCounter("MrHyDE::data::findClosestNode()");
Teuchos::RCP<Teuchos::Time> dataValueTimer = Teuchos::TimeMonitor::getNewCounter("MrHyDE::data::getValue()");
};
}
#endif