pytim
pytim copied to clipboard
willard_chandler.py
From Line 210:
ngrid, spacing = utilities.compute_compatible_mesh_params(
self.mesh, box)
self.spacing, self.ngrid = spacing, ngrid
#print ("spacing: ", self.spacing)
#print ("grid: ", self.ngrid)
#print ("mesh: ", self.mesh)
grid = utilities.generate_grid_in_box(box, ngrid, order='xyz')
kernel, _ = utilities.density_map(pos, grid, self.alpha, box)
#print ("kernel: ", kernel.__dict__)
#print ("position: ", pos)
#print ("position shape: ", np.array(pos).shape)
kernel.pos = pos.copy()
self.density_field = kernel.evaluate_pbc_fast(grid)
# Thomas Lewiner, Helio Lopes, Antonio Wilson Vieira and Geovan
# Tavares. Efficient implementation of Marching Cubes’ cases with
# topological guarantees. Journal of Graphics Tools 8(2) pp. 1-15
# (december 2003). DOI: 10.1080/10867651.2003.10487582
volume = self.density_field.reshape(
tuple(np.array(ngrid[::-1]).astype(int)))
#verts, faces, normals, values = marching_cubes(
# volume, None, spacing=tuple(spacing))
volume_cut = volume.max() - 0.9*volume.ptp()
verts, faces, normals, values = marching_cubes(
volume, volume_cut, spacing=tuple(spacing))
# note that len(normals) == len(verts): they are normals
# at the vertices, and not normals of the faces
self.triangulated_surface = [verts, faces, normals]
self.surface_area = measure.mesh_surface_area(verts, faces)
#verts += spacing[::-1] / 2.
Hi,
I don't understand what you would like to merge. You should branch off the master branch, make your changes and then set up a pull request from your branch into the master branch here.
I went through your branches, could it be what you want to merge is https://github.com/Zhu-Liu/pytim/tree/patch-1 ?
If you have some trouble, you can have a look at https://opensource.com/article/19/7/create-pull-request-github or just contact me back.
[cid:e00e058b-47b6-4ebb-b372-09964471878c]
Hi Dr. Sega,
I am really sorry that I forgot to answer your email. I attached a code difference comparison, where the right side is the version directly downloaded from your GitHub and left is my slightly modified version.
Basically, there are two differences:
- right Line 225 ---> left Line 323: I put a volume threshold value as the Gaussian density cutoff, which is cutting the Gaussian density around 90%. For this part, you told me in the last emails that Pytim has already included this feature. Thus this may be necessary anymore.
- right Line 231 ---> left Line 330: I comment out the vertices transfer. This will cause the off of the instantaneous interface location. (At least in all my testing, for example, it will move the willard-chandler interface close to the central water phase.)
I also want to mention the x,z coordinates switching, which refers to right Line 213 and the function "generate_grid_in_box" from the "utilities_mesh" module. I have no idea why the "generate_grid_in_box" function is written in that way (line 27--30, see below). In my testing, this will result in the willard-chandler interface from the original xy-plane (along the z-axis) to the yz-plane (along the x-axis).
Best, Zhu
[cid:83e51ac1-2faf-44f9-9e23-d7f4a2150cd8]
Dr. Zhu Liu
Postdoctoral Research Associate,
Department of Chemistry,
Washington State University
Tel. +1 509 592-1561
Email: [email protected]
https://aclark.chem.wsu.edu/
From: Marcello Sega [email protected] Sent: Saturday, April 25, 2020 1:59 AM To: Marcello-Sega/pytim [email protected] Cc: Liu, Zhu [email protected]; Author [email protected] Subject: Re: [Marcello-Sega/pytim] willard_chandler.py (#332)
Hi,
I don't understand what you would like to merge. You should branch off the master branch, make your changes and then set up a pull request from your branch into the master branch here.
I went through your branches, could it be what you want to merge is https://github.com/Zhu-Liu/pytim/tree/patch-1https://urldefense.com/v3/__https://github.com/Zhu-Liu/pytim/tree/patch-1__;!!JmPEgBY0HMszNaDT!4fMwHJS7AM9VGvjgqrs0SoBhXNEbuEf90c3vEC017SpnfWEjs3EQF8k-BdCPi3E$ ?
If you have some trouble, you can have a look at https://opensource.com/article/19/7/create-pull-request-githubhttps://urldefense.com/v3/__https://opensource.com/article/19/7/create-pull-request-github__;!!JmPEgBY0HMszNaDT!4fMwHJS7AM9VGvjgqrs0SoBhXNEbuEf90c3vEC017SpnfWEjs3EQF8k-8lRatns$ or just contact me back.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/Marcello-Sega/pytim/pull/332*issuecomment-619346518__;Iw!!JmPEgBY0HMszNaDT!4fMwHJS7AM9VGvjgqrs0SoBhXNEbuEf90c3vEC017SpnfWEjs3EQF8k-ekCA3GM$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AE5OTV4E3KQBPWKGPQ3NLQ3ROKQ7ZANCNFSM4MHIDOBQ__;!!JmPEgBY0HMszNaDT!4fMwHJS7AM9VGvjgqrs0SoBhXNEbuEf90c3vEC017SpnfWEjs3EQF8k-Qvo0JsM$.