Exemplo n.º 1
0
                        + w0[n]
                    ),
                )
        return np.array(ww)
    else:
        print("We can't indentify the mode")
        sys.exit()


# -----END of some functions-----------------

# -----READ---------------------------------
print("\nWe are ready to start. Reading {} ... (This can take a while)".format(inputt))

simulation = Simulation.load_from_xml(
    inputt, custom_verbosity="quiet", request_banner=False, read_only=True
)
# xmlrestart = xml_parse_file(open(inputt))
# input_simulation = isimulation.InputSimulation()
# input_simulation.parse(xmlrestart.fields[0][1])
# simulation = input_simulation.fetch()
# simulation.bind(read_only=True)


beads = simulation.syslist[0].motion.beads.copy()
m = simulation.syslist[0].motion.beads.m.copy()
nbeads = simulation.syslist[0].motion.beads.nbeads
natoms = simulation.syslist[0].motion.beads.natoms

if case == "reactant":
    if nbeadsR == 0:
                ret = read_file("xyz", ipos)
                pos.append(ret["atoms"])
                cell = ret["cell"]
                nbeads += 1
            except EOFError:  # finished reading files
                break
        ipos.close()

        natoms = pos[0].natoms
        atom = pos[0]
        # Compose the half ring polymer.
        q = np.vstack([i.q for i in pos])
    else:
        from ipi.engine.simulation import Simulation
        if (os.path.exists(chk)):
            simulation = Simulation.load_from_xml(chk, custom_verbosity='low', request_banner=False)
        else:
            print "We can't find %s " % chk
            sys.exit()
        cell = simulation.syslist[0].cell
        beads = simulation.syslist[0].motion.beads.copy()
        natoms = simulation.syslist[0].motion.beads.natoms
        nbeads = beads.nbeads
        q = beads.q
        atom = beads._blist[0]

    print ' '
    print 'We have a half ring polymer made of %i beads and %i atoms.' % (nbeads, natoms)
    print 'We will expand the ring polymer to get a half polymer of %i beads.' % nbeadsNew

    # Compose the full ring polymer.
Exemplo n.º 3
0
        return np.array(ww)
    else:
        print "We can't indentify the mode"
        sys.exit()


#-----END of some functions-----------------

#-----READ---------------------------------
print ''
print 'We are ready to start'
print 'Reading %s ...' % inputt
print '(This can take a while)'

simulation = Simulation.load_from_xml(inputt,
                                      custom_verbosity='low',
                                      request_banner=False)
beads = simulation.syslist[0].motion.beads.copy()
m = simulation.syslist[0].motion.beads.m.copy()
nbeads = simulation.syslist[0].motion.beads.nbeads
natoms = simulation.syslist[0].motion.beads.natoms

if case == 'reactant':
    if nbeadsR == 0:
        print 'We have to specify number of beads for computing the partition function in the reactant case'
        sys.exit()

if case != 'instanton' and nbeads > 1:
    print 'Incompatibility between case and nbeads in %s.' % (inputt)
    print 'case %s' % case
    print 'beads %i' % nbeads
Exemplo n.º 4
0
                cell = ret["cell"]
                nbeads += 1
            except EOFError:  # finished reading files
                break
        ipos.close()

        natoms = pos[0].natoms
        atom = pos[0]
        # Compose the half ring polymer.
        q = np.vstack([i.q for i in pos])
    else:
        from ipi.engine.simulation import Simulation

        if os.path.exists(chk):
            simulation = Simulation.load_from_xml(
                chk, custom_verbosity="low", request_banner=False, read_only=True
            )
        else:
            print("We can't find {}".format(chk))
            sys.exit()
        cell = simulation.syslist[0].cell
        beads = simulation.syslist[0].motion.beads.copy()
        natoms = simulation.syslist[0].motion.beads.natoms
        nbeads = beads.nbeads
        q = beads.q
        atom = beads._blist[0]

    print(" ")
    print(
        "We have a half ring polymer made of {} beads and {} atoms.".format(
            nbeads, natoms