Unverified Commit 87227a22 authored by Christoph Junghans's avatar Christoph Junghans Committed by GitHub

Merge branch 'master' into lammps_y_scale

parents 0b3601f0 2d57ba8d
Pipeline #86640136 passed with stages
in 221 minutes and 3 seconds
......@@ -446,7 +446,7 @@ inline Residue *Topology::CreateResidue(std::string name, int id) {
}
inline Residue *Topology::CreateResidue(std::string name) {
Residue *res = new Residue(this, _molecules.size(), name);
Residue *res = new Residue(this, _residues.size(), name);
_residues.push_back(res);
return res;
}
......
......@@ -4,7 +4,6 @@ add_custom_target(help2t2t_build DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/help2t2t)
add_custom_command(OUTPUT help2t2t ALL COMMAND ${CMAKE_COMMAND}
-DINPUT="help2t2t.out" -DOUTPUT="help2t2t"
-DGIT_EXECUTABLE="${GIT_EXECUTABLE}"
-DMERCURIAL_EXECUTABLE="${MERCURIAL_EXECUTABLE}"
-DTOP_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -P ${CMAKE_MODULE_PATH}/gitscript.cmake)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES help2t2t)
......@@ -14,7 +13,6 @@ foreach(SCRIPT csg_call csg_inverse)
add_custom_command(OUTPUT ${SCRIPT} COMMAND ${CMAKE_COMMAND}
-DINPUT="${SCRIPT}.out" -DOUTPUT="${SCRIPT}"
-DGIT_EXECUTABLE="${GIT_EXECUTABLE}"
-DMERCURIAL_EXECUTABLE="${MERCURIAL_EXECUTABLE}"
-DTOP_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -P ${CMAKE_MODULE_PATH}/gitscript.cmake)
if(ENABLE_TESTING OR BUILD_CSG_MANUAL)
add_custom_command(TARGET ${SCRIPT}_build POST_BUILD COMMAND chmod +x ${SCRIPT})
......
......@@ -3149,7 +3149,7 @@ class CMAEvolutionStrategy(OOOptimizer):
pass
if self.countiter == 0:
self.tic = time.clock() # backward compatible
self.tic = time.process_time() # backward compatible
self.elapsed_time = ElapsedTime()
sigma = sigma_fac * self.sigma
......@@ -7334,15 +7334,15 @@ class ElapsedTime(object):
"""
def __init__(self):
self.tic0 = time.clock()
self.tic0 = time.process_time()
self.tic = self.tic0
self.lasttoc = time.clock()
self.lastdiff = time.clock() - self.lasttoc
self.lasttoc = time.process_time()
self.lastdiff = time.process_time() - self.lasttoc
self.time_to_add = 0
self.messages = 0
reset = __init__
def __call__(self):
toc = time.clock()
toc = time.process_time()
if toc - self.tic >= self.lasttoc - self.tic:
self.lastdiff = toc - self.lasttoc
self.lasttoc = toc
......
......@@ -39,7 +39,7 @@ for group in $imc_groups; do
reg="$(csg_get_property cg.inverse.imc.${group}.reg ${default_reg})" #filter me away
is_num "${reg}" || die "${0##*/}: value of cg.inverse.imc.${group}.reg should be a number"
msg "solving linear equations for imc group '$group' (regularization ${reg})"
critical csg_imc_solve --imcfile "${group}.imc" --gmcfile "${group}.gmc" --idxfile "${group}.idx" --regularization "${reg}" --outputfile "${group}.sol"
critical csg_imc_solve --imcfile "${group}.imc" --gmcfile "${group}.gmc" --idxfile "${group}.idx" --regularization "${reg}"
done
for_all "non-bonded bonded" do_external imc purify
......@@ -60,6 +60,24 @@ bool PDBReader::FirstFrame(Topology &top) {
}
bool PDBReader::NextFrame(Topology &top) {
cout << "The VOTCA pdb reader attempts to follow the official format: "
<< endl;
cout << "http://www.wwpdb.org/documentation/file-format" << endl;
cout << endl;
cout << "NOTE the element symbol is important for associating a mass with "
<< endl;
cout << "each atom, if no element symbol is specified the atom name will be"
<< endl;
cout << "used and assumed to be an element symbol." << endl;
cout << "The pdb file format does not support pseudo atoms such as a CH3 "
<< endl;
cout << "and thus VOTCA cannot read such atoms in when using a .pdb file."
<< endl;
cout << "If you need to use pseudo atoms consider using a different file "
<< endl;
cout << "format such as the lammps data format." << endl;
string line;
tools::Elements elements;
// Two column vector for storing all bonds
......@@ -173,7 +191,7 @@ bool PDBReader::NextFrame(Topology &top) {
// according to PDB format
string x, y, z, resNum, resName, atName;
string charge;
string charge, elem_sym;
// string atNum;
try {
/* Some pdb don't include all this, read only what we really need*/
......@@ -208,19 +226,20 @@ bool PDBReader::NextFrame(Topology &top) {
// str , Segment identifier
// string segID (line,(73-1),4);
// str , Element symbol
// elem_sym = string(line,(77-1),2);
elem_sym = string(line, (77 - 1), 2);
// str , Charge on the atom
charge = string(line, (79 - 1), 2);
} catch (std::out_of_range &) {
string err_msg = "Misformated pdb file in atom line # " +
boost::lexical_cast<string>(bead_count) +
"\n the correct pdb file format requires 80 "
"characters in width. Furthermore, " +
"characters in width (spaces matter). Furthermore, " +
"\n to read the topology in from a .pdb file the "
"following attributes must be " +
"\n specified: "
" " +
"\n Atom Name, Residue Name, Residue Number, x, y, z, "
"element symbol"
"charge (optional) \n";
throw std::runtime_error(err_msg);
}
......@@ -230,6 +249,7 @@ bool PDBReader::NextFrame(Topology &top) {
boost::algorithm::trim(x);
boost::algorithm::trim(y);
boost::algorithm::trim(z);
boost::algorithm::trim(elem_sym);
boost::algorithm::trim(charge);
bead_count++;
......@@ -245,6 +265,13 @@ bool PDBReader::NextFrame(Topology &top) {
"Cannot convert resNum='" + resNum +
"' to int, that usallly means: misformated pdb file");
}
if (resName == "") {
cout << "WARNING no resname specified, assigning name to: UNK"
<< endl;
resName = "UNK";
}
if (resnr < 1)
throw std::runtime_error("Misformated pdb file, resnr has to be > 0");
// TODO: fix the case that resnr is not in ascending order
......@@ -254,9 +281,10 @@ bool PDBReader::NextFrame(Topology &top) {
// sloppy files
// create dummy residue, hopefully it will never show
top.CreateResidue("DUMMY");
cout << "Warning: residue numbers not continous, create DUMMY "
"residue with nr "
top.CreateResidue(resName);
cout << "Warning: residue numbers not continuous, create dummy "
"residue with residue number "
<< top.ResidueCount() << endl;
}
top.CreateResidue(resName);
......@@ -271,7 +299,25 @@ bool PDBReader::NextFrame(Topology &top) {
double ch = 0;
if (charge != "") {
ch = stod(charge);
} else {
cout << "WARNING no charge was specified for " << endl;
cout << line << endl;
cout << "Assuming a charge of 0" << endl;
}
if (elem_sym == "") {
cout << "WARNING no element was specified, assuming atom name is "
<< endl;
cout << "an element symbol: " << atName << endl;
if (elements.isElement(atName)) {
elem_sym = atName;
} else {
throw std::runtime_error(
"Atom name is not an element symbol, so substitution fails, "
"the element is needed in order to resolve the mass.");
}
}
// CreateBead takes 6 parameters in the following order
// 1 - symmetry of the bead (1-indicates sphere, 3-indicates
// ellipsoidal)
......@@ -283,7 +329,7 @@ bool PDBReader::NextFrame(Topology &top) {
//
// res -1 as internal number starts with 0
b = top.CreateBead(1, atName, atName, resnr - 1,
elements.getMass(atName), ch);
elements.getMass(elem_sym), ch);
} else {
b = top.getBead(bead_count - 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment