Hi, I am trying to calculate (or predict) the volume of diffusion pathways in structure, but it seems pymatgen can not meet my requirement. Any quick suggestions a will help me a lot here.
This is kind of possible we have done something similar with when integrating charge in a tube between two sites, if you have the exact path you can also set up a grid and then move a sphere along the path slowly and get the integrated volume:
You can look at my code here for an example of how this can be done:
This file has been truncated.
def _get_chg_between_sites_tube(self, migration_hop, mask_file_seedname=None):
Calculate the amount of charge that a migrating ion has to move through in order to complete a hop
migration_hop: MigrationHop object that represents a given hop
mask_file_seedname(string): seedname for output of the migration path masks (for debugging and
visualization) (Default value = None)
float: The total charge density in a tube that connects two sites of a given edges of the graph
logger.warning("The radius of the tubes for charge analysis need to be defined first.")
ipos = migration_hop.isite.frac_coords
epos = migration_hop.esite.frac_coords
cart_ipos = np.dot(ipos, self.potential_field.structure.lattice.matrix)
cart_epos = np.dot(epos, self.potential_field.structure.lattice.matrix)
pbc_mask = np.zeros(self._uc_grid_shape, dtype=bool).flatten()