Skip to content

Commit

Permalink
Added the ability to wrap input in period (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelahi committed Jan 4, 2024
1 parent 01ad988 commit 9902dfb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/getting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ These can be passed to ``cmake``
| ``VR_ADIOS``: boolean on whether to include ADIOS support
| ``ADIOS_DIR``: specify a local directory containing ADIOS library.
* Enable variation in input
* to allow particles in input to be outside the periodic bounds
| ``VR_PARTICLES_OUTSIDE_PERIOD_LIMIT``: boolean to allow particles to be outside periodic limit and be wrapped into periodic volume. Enable this only if you are certain that particles can be outside volume. Otherwise, error report by VR might indicate incorrect reading of the input.
* To set directories of required libraries
* Set the directories of the following libraries
| ``GSL_DIR =``
Expand Down
6 changes: 6 additions & 0 deletions src/hdfio.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2997,6 +2997,9 @@ void ReadHDF(Options &opt, vector<Particle> &Part, const Int_t nbodies,Particle
}
LOG(debug) << "Now getting where the data should be sent";
for (unsigned long long nn=0;nn<nchunk;nn++) {
#ifdef PERIODWRAPINPUT
PeriodWrapInput<double>(hdf_header_info[i].BoxSize, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
#endif
ibuf=MPIGetParticlesProcessor(opt, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
ibufindex=ibuf*BufSize+Nbuf[ibuf];
//reset hydro quantities of buffer
Expand Down Expand Up @@ -3401,6 +3404,9 @@ void ReadHDF(Options &opt, vector<Particle> &Part, const Int_t nbodies,Particle
#endif
#endif
for (int nn=0;nn<nchunk;nn++) {
#ifdef PERIODWRAPINPUT
PeriodWrapInput<double>(hdf_header_info[i].BoxSize, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
#endif
ibuf=MPIGetParticlesProcessor(opt, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
ibufindex=ibuf*BufSize+Nbuf[ibuf];
//reset hydro quantities of buffer
Expand Down
6 changes: 6 additions & 0 deletions src/mpihdfio.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ void MPINumInDomainHDF(Options &opt)
//setup hyperslab so that it is loaded into the buffer
HDF5ReadHyperSlabReal(doublebuff,partsdataset[i*NHDFTYPE+k], partsdataspace[i*NHDFTYPE+k], 1, 3, nchunk, n, plist_id);
for (auto nn=0;nn<nchunk;nn++) {
#ifdef PERIODWRAPINPUT
PeriodWrapInput<double>(hdf_header_info[i].BoxSize, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
#endif
ibuf=MPIGetParticlesProcessor(opt, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
Nbuf[ibuf]++;
}
Expand All @@ -263,6 +266,9 @@ void MPINumInDomainHDF(Options &opt)
HDF5ReadHyperSlabReal(doublebuff, partsdataset[i*NHDFTYPE+k], partsdataspace[i*NHDFTYPE+k], 1, 3, nchunk, n, plist_id);

for (auto nn=0;nn<nchunk;nn++) {
#ifdef PERIODWRAPINPUT
PeriodWrapInput<double>(hdf_header_info[i].BoxSize, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
#endif
ibuf=MPIGetParticlesProcessor(opt, doublebuff[nn*3],doublebuff[nn*3+1],doublebuff[nn*3+2]);
Nbaryonbuf[ibuf]++;
}
Expand Down

0 comments on commit 9902dfb

Please sign in to comment.