Beispiel #1
0
if args.dipolemoments:
    """ Compute dipole moment D, of molecules in system.
        Compute orientational order parameter; Tp = 1/2 < 3cos^2(theta) - 1>
        Compute angle theta; |D||n|cos(theta) = D dot n
        
        Restrictions:
        1) Molecule ID (mol) and atom ID's (id) must be present in lammpstrj file
        2) Positions of atoms must be present in lammpstrj file (x,y,z)
        3) Atom types (type) must be present in lammpstrj file
        4) The given atom types must belong to a molecule ID (mol)
        5) Geometrical center of molecules is used in stead of center of mass.
            Method is therefore approximate for molecules with charge =! 0.
    """

    obj = trj(args.inputfile[0])  # create LAMMPStrj object
    nframes = obj.nframes  # number of time frames in trajectory
    ## ----------------------------------------------------- ##
    ID = 'id'  # atom id
    MOL = 'mol'  # molecule id
    TYPE = 'type'  # atom type
    Q = 'q'  # charge
    X = 'x'  # unscaled atom position x
    Y = 'y'  # unscaled atom position y
    Z = 'z'  # unscaled atom position z
    Xs = 'xs'  # scaled atom position x # not supported
    Ys = 'ys'  # scaled atom position y # not supported
    Zs = 'zs'  # scaled atom position z # not supported
    ## ----------------------------------------------------- ##

    allpos = []  # bin1d bins
Beispiel #2
0
if args.dipolemoments:
    """ Compute dipole moment D, of molecules in system.
        Compute orientational order parameter; Tp = 1/2 < 3cos^2(theta) - 1>
        Compute angle theta; |D||n|cos(theta) = D dot n
        
        Restrictions:
        1) Molecule ID (mol) and atom ID's (id) must be present in lammpstrj file
        2) Positions of atoms must be present in lammpstrj file (x,y,z)
        3) Atom types (type) must be present in lammpstrj file
        4) The given atom types must belong to a molecule ID (mol)
        5) Geometrical center of molecules is used in stead of center of mass.
            Method is therefore approximate for molecules with charge =! 0.
    """
        
    obj = trj(args.inputfile[0]) # create LAMMPStrj object 
    nframes = obj.nframes        # number of time frames in trajectory    
    ## ----------------------------------------------------- ##
    ID='id'                      # atom id
    MOL='mol'                    # molecule id
    TYPE='type'                  # atom type
    Q='q'                        # charge
    X='x'                        # unscaled atom position x
    Y='y'                        # unscaled atom position y
    Z='z'                        # unscaled atom position z
    Xs='xs'                      # scaled atom position x # not supported
    Ys='ys'                      # scaled atom position y # not supported
    Zs='zs'                      # scaled atom position z # not supported
    ## ----------------------------------------------------- ##    
    
    allpos = []                  # bin1d bins