2#include "util/cuda_launch.hpp"
3#include "Grid/grid_dist_id.hpp"
4#include "data_type/aggregate.hpp"
78constexpr int U_next = 2;
79constexpr int V_next = 3;
87 for (
int i = 0 ; i < 10 ; i++)
92 auto it =
grid.getGridIterator();
97 auto key = it.get_dist();
100 grid.template insert<U>(key) = 1.0;
106 std::cout <<
"Time populate: " << t.
getwct() << std::endl;
113 auto it2 =
grid.getGridIterator();
118 auto key = it2.get_dist();
121 grid.template insert<U>(key) = 5.0;
127 std::cout <<
"Time populate: " <<
t2.getwct() << std::endl;
133int main(
int argc,
char* argv[])
135 openfpm_init(&argc,&argv);
141 size_t sz[3] = {256,256,256};
150 double deltaT = 0.25;
160 size_t timeSteps = 200;
162 size_t timeSteps = 5000;
176 double spacing[3] = {
grid.spacing(0),
grid.spacing(1),
grid.spacing(2)};
182 grid.template ghost_get<U,V>();
186 double uFactor = deltaT * du/(spacing[x]*spacing[x]);
187 double vFactor = deltaT * dv/(spacing[x]*spacing[x]);
192 auto & v_cl = create_vcluster();
195 std::cout <<
"Total simulation: " << tot_sim.
getwct() << std::endl;
This class represent an N-dimensional box.
This is a distributed grid.
Class for cpu time benchmarking.
void stop()
Stop the timer.
void start()
Start the timer.
double getwct()
Return the elapsed real time.
OutputIteratorT OffsetT ReductionOpT OuputT init
< [in] The initial value of the reduction
[v_transform metafunction]
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
It model an expression expr1 * expr2.