@@ -358,7 +374,12 @@ class CP2KImplementation(object):
returnresult
else:
logger.debug("Looking for forces in separate force file.")
forces=self.csvengine.parse(self.parser.get_file_handle("forces"),columns=(-3,-2,-1),comments=("#","ATOMIC","SUM"),separator=r"\ ATOMIC FORCES in \[a\.u\.\]")
iterator=self.csvengine.iread(self.parser.get_file_handle("forces"),columns=(-3,-2,-1),comments=("#","SUM"),separator=r"\ ATOMIC FORCES in \[a\.u\.\]")
forces=[]
forconfigurationiniterator:
forces.append(configuration)
forces=np.array(forces)
ifforcesisNone:
msg="No force configurations were found when searching an external XYZ force file."
logger.warning(msg)
...
...
@@ -366,7 +387,8 @@ class CP2KImplementation(object):
result.code=ResultCode.fail
returnresult
else:
result.value=forces
iflen(forces)!=0:
result.value=forces
returnresult
def_Q_particle_number(self):
...
...
@@ -395,7 +417,7 @@ class CP2KImplementation(object):
coords.strip()
n_particles=coords.count("\n")
result.value=factor*n_particles
elifcoord_formatin["CP2K","G96","XTL"]:
elifcoord_formatin["CP2K","G96","XTL","CRD"]:
msg="Tried to read the number of atoms from the initial configuration, but the parser does not yet support the '{}' format that is used by file '{}'.".format(coord_format,self.parser.file_ids["initial_coordinates"])
logger.warning(msg)
result.error_message=msg
...
...
@@ -404,15 +426,34 @@ class CP2KImplementation(object):