Skip to content

Commit

Permalink
MRA: Randomize Gaussian function
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Sep 9, 2024
1 parent 25bb6f8 commit bbe6cfb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/madness/mra-device/mrattg-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,22 @@ void test(std::size_t K) {
mra::Domain<NDIM> D;
D.set_cube(-6.0,6.0);

srand48(5551212); // for reproducible results
//for (auto i : range(10000)) drand48(); // warmup generator

ttg::Edge<mra::Key<NDIM>, void> project_control;
ttg::Edge<mra::Key<NDIM>, mra::FunctionReconstructedNode<T, NDIM>> project_result, reconstruct_result;
ttg::Edge<mra::Key<NDIM>, mra::FunctionCompressedNode<T, NDIM>> compress_result;

// define a Gaussian
auto gaussian = mra::Gaussian<T, NDIM>(D, T(3.0), {T(0.0),T(0.0),T(0.0)});
//auto gaussian = mra::Gaussian<T, NDIM>(D, T(3.0), {T(0.0),T(0.0),T(0.0)});
T expnt = 30000.0;
mra::Coordinate<T,NDIM> r;
for (size_t d=0; d<NDIM; d++) {
r[d] = T(-6.0) + T(12.0)*drand48();
}
auto gaussian = mra::Gaussian<T,NDIM>(D, expnt, r);

// put it into a buffer
auto gauss_buffer = ttg::Buffer<mra::Gaussian<T, NDIM>>(&gaussian);
auto start = make_start(project_control);
Expand Down

0 comments on commit bbe6cfb

Please sign in to comment.