DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
BenchmarkFiniteVolume.cpp
Go to the documentation of this file.
2#include <vector>
3#define DNDS_NDEBUG
5
6namespace DNDS::CFV
7{
8 static const DeviceBackend B = DeviceBackend::Host;
9
10 template <>
15 int nIter,
16 const t_jsonconfig &settings)
17 {
18 int nVars = u.father.MatRowSize();
19 for (int i = 0; i < nIter; i++)
20#pragma omp parallel for
21 for (index iCell = 0; iCell < fv.mesh.NumCell(); iCell++)
22 {
23 std::vector<real> b(nVars * 3);
24 finiteVolumeCellOpTest(fv, u, u_grad, iCell, b.data());
25 };
26 }
27
28 /*************************************************************/
29
30 /*************************************************************/
31
32 /*************************************************************/
33
34 /*************************************************************/
35
36 template <int nVarsFixed>
37 void finiteVolumeCellOpTest_Fixed_entry<B, nVarsFixed>::run(
39 typename tUDof<nVarsFixed>::template t_deviceView<B> &u,
40 typename tUGrad<nVarsFixed, 3>::template t_deviceView<B> &u_grad,
41 int nIter,
42 const t_jsonconfig &settings)
43 {
44 int nVars = u.father.MatRowSize();
45 for (int i = 0; i < nIter; i++)
46#pragma omp parallel for
47 for (index iCell = 0; iCell < fv.mesh.NumCell(); iCell++)
48 {
49 finiteVolumeCellOpTest_Fixed<B, nVarsFixed>(fv, u, u_grad, iCell);
50 };
51 }
52
53 template void finiteVolumeCellOpTest_Fixed_entry<B, 1>::run(
55 typename tUDof<1>::template t_deviceView<B> &u,
56 typename tUGrad<1, 3>::template t_deviceView<B> &u_grad,
57 int nIter,
58 const t_jsonconfig &settings);
59
60 template void finiteVolumeCellOpTest_Fixed_entry<B, 5>::run(
62 typename tUDof<5>::template t_deviceView<B> &u,
63 typename tUGrad<5, 3>::template t_deviceView<B> &u_grad,
64 int nIter,
65 const t_jsonconfig &settings);
66
67 /*************************************************************/
68
69 /*************************************************************/
70
71 /*************************************************************/
72
73 /*************************************************************/
74
75 template <int nVarsFixed>
76 void finiteVolumeCellOpTest_SOA_ver0_entry<B, nVarsFixed>::run(
78 std::array<tUDof<1>::t_deviceView<B>, nVarsFixed> &u,
79 std::array<tUGrad<1, 3>::t_deviceView<B>, nVarsFixed> &u_grad,
80 int nIter,
81 const t_jsonconfig &settings)
82 {
83 int nVars = nVarsFixed;
84 for (int i = 0; i < nIter; i++)
85#pragma omp parallel for
86 for (index iCell = 0; iCell < fv.mesh.NumCell(); iCell++)
87 {
88 finiteVolumeCellOpTest_SOA_ver0<B, nVarsFixed>(fv, u, u_grad, iCell);
89 };
90 }
91
92 template void finiteVolumeCellOpTest_SOA_ver0_entry<B, 1>::run(
94 std::array<tUDof<1>::t_deviceView<B>, 1> &u,
95 std::array<tUGrad<1, 3>::t_deviceView<B>, 1> &u_grad,
96 int nIter,
97 const t_jsonconfig &settings);
98
99 template void finiteVolumeCellOpTest_SOA_ver0_entry<B, 5>::run(
101 std::array<tUDof<1>::t_deviceView<B>, 5> &u,
102 std::array<tUGrad<1, 3>::t_deviceView<B>, 5> &u_grad,
103 int nIter,
104 const t_jsonconfig &settings);
105}
Primary solver state container: an ArrayEigenMatrix pair with MPI-collective vector-space operations.
Definition ArrayDOF.hpp:172
ArrayDofDeviceView< B, n_m, n_n > t_deviceView
Mutable device view alias.
Definition ArrayDOF.hpp:179
Geom::UnstructuredMeshDeviceView< B > mesh
FiniteVolumeDeviceView< B > t_deviceView
DNDS_DEVICE_CALLABLE void finiteVolumeCellOpTest(FiniteVolume::t_deviceView< B > &fv, tUDof< DynamicSize >::t_deviceView< B > &u, tUGrad< DynamicSize, 3 >::t_deviceView< B > &u_grad, index iCell, real *local_buf, int iVar=UnInitRowsize)
void finiteVolumeCellOpTest_run< B >(FiniteVolume::t_deviceView< B > &fv, tUDof< DynamicSize >::t_deviceView< B > &u, tUGrad< DynamicSize, 3 >::t_deviceView< B > &u_grad, int nIter, const t_jsonconfig &settings)
DeviceBackend
Enumerates the backends a DeviceStorage / Array can live on.
@ Host
Plain CPU memory.
int64_t index
Global row / DOF index type (signed 64-bit; handles multi-billion-cell meshes).
Definition Defines.hpp:107
nlohmann::ordered_json t_jsonconfig
Project-wide JSON type alias: nlohmann/json with ordered keys.
Definition JsonUtil.hpp:19
ssp< TArray > father
Owned-side array (must be resized before ghost setup).
tVec b(NCells)