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

Rings dev #8

Merged
merged 40 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
93203f8
primitiveRings: Shifted atomType assigning function for every ring ty…
amritagos Aug 31, 2022
09c683d
sOut: Added a new function for writing out the number of primitive ri…
amritagos Aug 31, 2022
35def58
topoBulk: Added a new function for counting the number of primitive r…
amritagos Aug 31, 2022
850c998
topoTwoDim: Shifted a more general function for assigning atom types …
amritagos Aug 31, 2022
f7250e2
main: Registers a new lua function for writing out the number of prim…
amritagos Aug 31, 2022
c3df05c
examples: Added an example for getting the number of primitive rings …
amritagos Aug 31, 2022
59f25c5
examples: Added trajectory file for a clathrate-THF system
amritagos Aug 31, 2022
6af3ef5
MAINT,DOC: Add debug instructions
amritagos Sep 2, 2022
8aa5ed2
selection: Init of functions to create and deal with selections accor…
amritagos Sep 3, 2022
c2587a6
cmake: Added new file for selection functions
amritagos Sep 3, 2022
7609bc8
main: Registers lua functions corresponding to creating PointCloud st…
amritagos Sep 3, 2022
dc32369
readme: TODO add more on debugging
amritagos Sep 3, 2022
bd9207b
DOC: Update
amritagos Sep 5, 2022
0d24d7d
MAINT: Add header print debugging
amritagos Sep 5, 2022
76fac59
TMP: Code for clean trajectory reads
amritagos Sep 5, 2022
33895fc
selection: Added function for setting inSlice to true for all atoms i…
amritagos Sep 6, 2022
0d84cd0
molSys: Added function for constructing a multimap with mol IDs as ke…
amritagos Sep 6, 2022
072504a
main: Registered function for selecting atoms within a region
amritagos Sep 6, 2022
af978e7
molSys: Declared function for generating a multimap for molecule IDs …
amritagos Sep 6, 2022
7a32add
neighbours: Minor edit to remove icecream macro
amritagos Sep 6, 2022
352830f
selection: Added option for clearing all previous slice information
amritagos Sep 6, 2022
ac4287e
selection: Functions added for selecting atoms and molecules which pa…
amritagos Sep 8, 2022
79b1bce
main: Registered lua functions for selection function for selecting e…
amritagos Sep 8, 2022
f6921fc
lua_input: Added functions for selection operations in the lua script.
amritagos Sep 8, 2022
122a6d2
selection: Prints out dump file with selected O atoms (TODO: fix to a…
amritagos Sep 9, 2022
08dc8c5
main: Registers lua function for C++ function for printing out slice …
amritagos Sep 9, 2022
cfded08
lua_inputs: One function now handles the selection operations
amritagos Sep 9, 2022
d6db396
selection: Writes out molecule IDs in the selection
amritagos Sep 11, 2022
792d1a4
examples: TODO fix examples for strict criterion
amritagos Sep 12, 2022
3c0b95e
example: Added example for selection of a clathrate unit cell in a sy…
amritagos Sep 12, 2022
8e4392e
selection: Bug fix in selecting atoms in the slice
amritagos Sep 13, 2022
b4abca8
selection: Many bugs; TODO
amritagos Sep 13, 2022
7fd69ee
rings_dev: Attempt to debug things
amritagos Sep 15, 2022
168451c
selection: Added a command for printing out OVITO stuff
amritagos Sep 16, 2022
0dee991
example: Added an example for a small system, illustrating how the se…
amritagos Sep 16, 2022
b6adeb9
examples: Fixed examples
amritagos Sep 16, 2022
c372fef
examples: Example files fixed for topoOneDim ice. TODO: check the oth…
amritagos Sep 16, 2022
f8a9e51
selection: Minor changes
amritagos Sep 19, 2022
15aa3f5
MAINT: Update license I
HaoZeke Mar 26, 2023
7c1c696
MAINT: Update license II
HaoZeke Mar 26, 2023
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
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ can be run with the `yodaStruct_test` binary, which will drop into the
```{bash}
# Just run this
./testBuild.sh
# At this point the binary and library are copied into the root
# One might, in a foolhardy attempt, use gdb at this point
# Here be dragons :)
# USE NIX
# Anyway
gdb --args ./yodaStruct -c lua_inputs/config.yml
# quit gdb with quit
# Go run the test binary
cd shellBuild
Expand Down Expand Up @@ -261,6 +267,35 @@ Note that we expect compliance with the `clang-format` as mentioned above, and t

This will ensure that new commits are in accordance to the `clang-format` file.

## Development Builds

The general idea is to drop into an interactive shell with the dependencies and then use `cmake` as usual.

```bash
nix-shell --pure --run bash --show-trace --verbose
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DNO_WARN=TRUE \
-DFIND_EIGEN=TRUE \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-G "Ninja"
ninja
# Test
cd ../
yodaStruct -c lua_inputs/config.yml
# Debug
gdb --args yodaStruct -c lua_inputs/config.yml
```
To load debugging symbols from the shared library, when you are inside `gdb` (from the top-level directory, for instance), use the following command:

```bash
add-symbol-file build/libyodaLib.so
```
Then you can set breakpoints in the C++ code; for instance:

```bash
b seams_input.cpp:408
```

# Acknowledgements

The following tools are used in this project:
Expand Down Expand Up @@ -290,3 +325,4 @@ The libraries used are:
- [Boost Math](https://www.boost.org/doc/libs/?view=category_math) for spherical harmonics
- [Blaze](https://bitbucket.org/blaze-lib/blaze/) for very fast modern linear algebra
- [nanoflann](https://github.com/jlblancoc/nanoflann) to calculate nearest neighbors
- [icecream-cpp](https://github.com/renatoGarcia/icecream-cpp) for pretty-printing and debugging
10 changes: 10 additions & 0 deletions example_lua/bulkPrimitiveRings/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
trajectory: "input/traj/clathrate-thf.lammpstrj"
variables: "lua_inputs/iceType/vars.lua"
bulk:
use: true
topologicalNetworkCriterion: false
bondOrderParameters: false
topoOneDim:
use: false
topoTwoDim:
use: false
10 changes: 10 additions & 0 deletions example_lua/bulkPrimitiveRings/iceType/functions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
print("\n Welcome to the manual lua function evaluation environment.\n");

for frame=targetFrame,finalFrame,frameGap do
resCloud=readFrameOnlyOne(trajectory,frame,resCloud,oxygenAtomType,isSlice,sliceLowerLimits,sliceUpperLimits) --- Get the frame
nList=neighborList(cutoffRadius, resCloud, oxygenAtomType); --- Calculate the neighborlist by ID
hbnList=getHbondNetwork(trajectory,resCloud,nList,frame,hydrogenAtomType) --- Get the hydrogen-bonded network for the current frame
hbnList=bondNetworkByIndex(resCloud,hbnList) --- Hydrogen-bonded network using indices not IDs
rings=getPrimitiveRings(hbnList,maxDepth); --- Gets every ring (non-primitives included)
bulkRingNumberAnalysis(outDir, rings, hbnList, resCloud, maxDepth, targetFrame); --- Writes out primitive rings for a bulk system
end
16 changes: 16 additions & 0 deletions example_lua/bulkPrimitiveRings/iceType/vars.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
print("\n Welcome to the Ice Type Determination Module\n");
cutoffRadius = 3.5; --- This is for H2O
oxygenAtomType = 1; --- This is assigned by LAMMPS
hydrogenAtomType = 2; --- Hydrogen atom type assigned
targetFrame=1; --- The first frame
finalFrame=1; --- This is inclusive
frameGap=1; --- The gap between frames
maxDepth = 6; --- The maximum depth upto which rings will be searched.
--- Slice Information
isSlice = true; --- This is true if the analysis is to be done only for a volume slice
sliceLowerLimits = {0,0,0}; --- Lower limit of the slice (for box dim, keep the values the same as 0)
sliceUpperLimits = {34.728,0,0}; --- Upper limit of the slice

--- Paths for the output directories and lua scipt
outDir="runOne/"; --- The subdirectory used;
functionScript="lua_inputs/iceType/functions.lua" --- This is relative to the binary location
4 changes: 2 additions & 2 deletions example_lua/iceNanotube/shapeMatching/iceType/vars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ print("\n Welcome to the Ice Type Determination Module\n");
cutoffRadius = 3.5; --- This is for H2O
oxygenAtomType = 2; --- This is assigned by LAMMPS
hydrogenAtomType = 1; --- Hydrogen atom type assigned
targetFrame=100; --- The first frame
finalFrame=100; --- This is inclusive
targetFrame=1; --- The first frame
finalFrame=1; --- This is inclusive
frameGap=1; --- The gap between frames
maxDepth = 6; --- The maximum depth upto which rings will be searched.
--- Slice Information
Expand Down
4 changes: 2 additions & 2 deletions example_lua/iceNanotube/strictCriterion/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
trajectory: "../input/traj/dump-240-square.lammpstrj"
variables: "../lua_inputs/iceType/vars.lua"
trajectory: "input/traj/exampleTraj.lammpstrj"
variables: "lua_inputs/iceType/vars.lua"
bulk:
use: false
topologicalNetworkCriterion: false
Expand Down
8 changes: 4 additions & 4 deletions example_lua/iceNanotube/strictCriterion/iceType/vars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ print("\n Welcome to the Ice Type Determination Module\n");
cutoffRadius = 3.5; --- This is for H2O
oxygenAtomType = 2; --- This is assigned by LAMMPS
hydrogenAtomType = 1; --- Hydrogen atom type assigned
targetFrame=100; --- The first frame
finalFrame=100; --- This is inclusive
targetFrame=1; --- The first frame
finalFrame=1; --- This is inclusive
frameGap=1; --- The gap between frames
maxDepth = 6; --- The maximum depth upto which rings will be searched.
--- Slice Information
Expand All @@ -12,5 +12,5 @@ sliceLowerLimits = {0,0,0}; --- Lower limit of the slice (for box dim, keep the
sliceUpperLimits = {0,0,0}; --- Upper limit of the slice

--- Paths for the output directories and lua scipt
outDir="../runOne/"; --- The subdirectory used;
functionScript="../lua_inputs/iceType/functions.lua" --- This is relative to the binary location
outDir="runOne/"; --- The subdirectory used;
functionScript="lua_inputs/iceType/functions.lua" --- This is relative to the binary location
10 changes: 10 additions & 0 deletions example_lua/selection/clathrate-system/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
trajectory: "input/traj/clathrate-thf.lammpstrj"
variables: "lua_inputs/iceType/vars.lua"
bulk:
use: true
topologicalNetworkCriterion: false
bondOrderParameters: false
topoOneDim:
use: false
topoTwoDim:
use: false
18 changes: 18 additions & 0 deletions example_lua/selection/clathrate-system/iceType/functions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
print("\n Welcome to the manual lua function evaluation environment.\n");

for frame=targetFrame,finalFrame,frameGap do
-- Read in all atom types without applying the slice
resCloud=readFrameOnlyOneAllAtoms(trajectory, frame,resCloud,false, {0,0,0}, {0,0,0});
-- Get just the O atoms from the PointCloud with all the atoms (including those not in the slice)
oCloud=getPointCloudAtomsOfOneAtomType(resCloud,oCloud,oxygenAtomType,false, {0,0,0}, {0,0,0});
-- Get the H atoms (including those not in the slice) for the entire system
hCloud=getPointCloudAtomsOfOneAtomType(resCloud,hCloud,hydrogenAtomType,false,{0,0,0}, {0,0,0});
nList=neighborList(cutoffRadius, oCloud, oxygenAtomType); --- Calculate the neighborlist by ID
hbnList=getHbondNetworkFromClouds(oCloud,hCloud,nList); --- Get the hydrogen-bonded network for the current frame
hbnList=bondNetworkByIndex(oCloud,hbnList); --- Hydrogen-bonded network using indices not IDs
rings=getPrimitiveRings(hbnList,maxDepth); --- Gets every ring (non-primitives included)
-- bulkRingNumberAnalysis(outDir, rings, hbnList, oCloud, maxDepth, targetFrame); --- Writes out primitive rings for a bulk system
-- All atoms within the slice will have an inSlice bool attribute of true. If a single atom of a molecule is in the
-- slice, then all atoms in the molecule will also be inside the slice. We will also select edge atoms in rings
selectAtomsInSliceWithRingEdgeAtoms(outDir,rings,oCloud,resCloud,sliceLowerLimits,sliceUpperLimits,false);
end
16 changes: 16 additions & 0 deletions example_lua/selection/clathrate-system/iceType/vars.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
print("\n Welcome to the Ice Type Determination Module\n");
cutoffRadius = 3.5; --- This is for H2O
oxygenAtomType = 1; --- This is assigned by LAMMPS
hydrogenAtomType = 2; --- Hydrogen atom type assigned
targetFrame=1; --- The first frame
finalFrame=1; --- This is inclusive
frameGap=1; --- The gap between frames
maxDepth = 6; --- The maximum depth upto which rings will be searched.
--- Slice Information
isSlice = true; --- This is true if the analysis is to be done only for a volume slice
sliceLowerLimits = {0,0,0}; --- Lower limit of the slice (for box dim, keep the values the same as 0)
sliceUpperLimits = {34.728,0,0}; --- Upper limit of the slice

--- Paths for the output directories and lua scipt
outDir="runOne/"; --- The subdirectory used;
functionScript="lua_inputs/iceType/functions.lua" --- This is relative to the binary location
10 changes: 10 additions & 0 deletions example_lua/selection/tiny-selection/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
trajectory: "input/traj/tiny-selectionTest.lammpstrj"
variables: "lua_inputs/iceType/vars.lua"
bulk:
use: true
topologicalNetworkCriterion: false
bondOrderParameters: false
topoOneDim:
use: false
topoTwoDim:
use: false
18 changes: 18 additions & 0 deletions example_lua/selection/tiny-selection/iceType/functions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
print("\n Welcome to the manual lua function evaluation environment.\n");

for frame=targetFrame,finalFrame,frameGap do
-- Read in all atom types without applying the slice
resCloud=readFrameOnlyOneAllAtoms(trajectory, frame,resCloud,false, {0,0,0}, {0,0,0});
-- Get just the O atoms from the PointCloud with all the atoms (including those not in the slice)
oCloud=getPointCloudAtomsOfOneAtomType(resCloud,oCloud,oxygenAtomType,false, {0,0,0}, {0,0,0});
-- Get the H atoms (including those not in the slice) for the entire system
hCloud=getPointCloudAtomsOfOneAtomType(resCloud,hCloud,hydrogenAtomType,false,{0,0,0}, {0,0,0});
nList=neighborList(cutoffRadius, oCloud, oxygenAtomType); --- Calculate the neighborlist by ID
hbnList=getHbondNetworkFromClouds(oCloud,hCloud,nList); --- Get the hydrogen-bonded network for the current frame
hbnList=bondNetworkByIndex(oCloud,hbnList); --- Hydrogen-bonded network using indices not IDs
rings=getPrimitiveRings(hbnList,maxDepth); --- Gets every ring (non-primitives included)
-- bulkRingNumberAnalysis(outDir, rings, hbnList, oCloud, maxDepth, targetFrame); --- Writes out primitive rings for a bulk system
-- All atoms within the slice will have an inSlice bool attribute of true. If a single atom of a molecule is in the
-- slice, then all atoms in the molecule will also be inside the slice. We will also select edge atoms in rings
selectAtomsInSliceWithRingEdgeAtoms(outDir,rings,oCloud,resCloud,sliceLowerLimits,sliceUpperLimits,false);
end
16 changes: 16 additions & 0 deletions example_lua/selection/tiny-selection/iceType/vars.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
print("\n Welcome to the Ice Type Determination Module\n");
cutoffRadius = 3.5; --- This is for H2O
oxygenAtomType = 1; --- This is assigned by LAMMPS
hydrogenAtomType = 2; --- Hydrogen atom type assigned
targetFrame=1; --- The first frame
finalFrame=1; --- This is inclusive
frameGap=1; --- The gap between frames
maxDepth = 6; --- The maximum depth upto which rings will be searched.
--- Slice Information
isSlice = true; --- This is true if the analysis is to be done only for a volume slice
sliceLowerLimits = {0,0,0}; --- Lower limit of the slice (for box dim, keep the values the same as 0)
sliceUpperLimits = {31.728,0,0}; --- Upper limit of the slice

--- Paths for the output directories and lua scipt
outDir="runOne/"; --- The subdirectory used;
functionScript="lua_inputs/iceType/functions.lua" --- This is relative to the binary location
Loading