Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to wrap input in period #115

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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