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
Take snapshots of molecule positions during GCMC and record adsorbate density grid #107
Conversation
…lows the user to take snapshots of the adsorbate atoms positions in the unit cell
… gcmc_result_savename to generate names for xyz files
…id density to Grid.jl
one more thing: if snapshots are being taken, can you printf "writing snapshots of adsorption positions every %d cycles (after burn cycles)\n" if density grid is being written, can you printf "adsorption spatial probability density grid written with spacing %.3f Angstrom every %d cycles (after burn cycles)" |
I went through all suggestions and implemented them. The branch passes all tests as well. This should be ready to merge, I am going to update the docs site so the new function appear there as well. |
|
|
I am wrapping up with these edits soon, but I was just thinking about changing the I think it is a good idea to do this, but we should release the next version as 1.0.0 since PorousMaterials.jl is no longer going through rapid development and the API won't be compatible with scripts written for older versions. |
I found an issue when writing a test for the |
…_period inside GCMC.jl added more tests
🎆 hooray for tests! Didn't think of that... |
I think we should leave renaming I agree that informative parameter names are important, but that small change breaks some backwards compatibility. We should leave it out for now, but we should go through and decide what 'stable' PorousMaterials.jl looks like. Then we can fix small errors like this without creating a chain of incompatible releases |
sure, that is fine with me! |
… for consistency. These will be changed at a later time
This should be good to go now! Take a look at the new xf_to_id. It checks to see if it is above and below because it has to treat them with different cases. |
…e with more than one atom through
…id modifying molecule coords
thanks @ahyork
do these changes look ok to you? |
Those changes look good to me, I am going to add these new functions to the docs and then merge unless there is anything else you think we should add? |
@ahyork
Looks great! Before merging this PR:
gcmc_simulation()
snapshots
to more informativewrite_adsorbate_snapshots
since now it is only writing them to file.xyz_snapshot_file = ""
is initialized as a string. Doesn't that introduce type instability? Doesxyz_snapshot_file = IOStream
work better, initializing an empty IOStream?comment=filename_comment * "adsorbate_positions"
switch order so comment is always at end.if (outer_cycle % snapshot_frequency == 0) && (outer_cycle > n_burn_cycles)
for speed is it better to reverse these? I imagine>
is faster than a%
?write_xyz_to_file
can you change towrite_xyz
to be consistent with the otherwrite_xyz
? i.e. overload it so one less function name to remember.snapshot_frequency=1
by default.snapshot::Bool
: Whether this is the name for a snapshot file" is a vestige of an old version ofgcmc_result_savename
?indices for storing that data inside a
Grid
object" to be more specific, change to: "returns the indices of the voxel in which it falls when a unit cube is partitioned into a regular grid ofn_pts[1]
byn_pts[2]
byn_pts[3]
voxels.write_xyz_to_file(molecules, xyz_file)
doc string does not match function. specify in doc string it is writing cartesian not fractionalatoms_in_molecules
is redundant given type assertion, how aboutn_atoms(molecules::Array{Molecules})
?update_density!
, the problem here is that for CO2, it would increment the voxel for both C and O then you'd get a density grid that is confusingly keeping track of C and O. I think we should put thespecies
granularity on the atom within the molecule (not the molecule itself), so e.g. the user would pass:C
to keep track of:C
within CO2. soif molecule.atoms.species[i] == species
I think should be the condition for writing