make "coords" optional and infer natoms from "types" instead
This commit is contained in:
@ -814,7 +814,7 @@ for the "native" molecule file format.
|
|||||||
- overrides the auto-computed moments of inertia
|
- overrides the auto-computed moments of inertia
|
||||||
* - coords
|
* - coords
|
||||||
- a data block
|
- a data block
|
||||||
- yes
|
- no
|
||||||
- contains atom positions with the format "atom-id", "x", "y", "z" (same as Coords)
|
- contains atom positions with the format "atom-id", "x", "y", "z" (same as Coords)
|
||||||
* - types
|
* - types
|
||||||
- a data block
|
- a data block
|
||||||
|
|||||||
@ -280,8 +280,8 @@ void Molecule::from_json(const std::string &molid, const json &moldata)
|
|||||||
error->all(FLERR, Error::NOLASTLINE, "Found {} instead of {} data entries for '{}'", sizevar, \
|
error->all(FLERR, Error::NOLASTLINE, "Found {} instead of {} data entries for '{}'", sizevar, \
|
||||||
sizecheck, #field);
|
sizecheck, #field);
|
||||||
|
|
||||||
JSON_INIT_FIELD(coords, natoms, xflag, true, 0);
|
JSON_INIT_FIELD(types, natoms, typeflag, true, 0);
|
||||||
JSON_INIT_FIELD(types, dummyvar, typeflag, true, natoms);
|
JSON_INIT_FIELD(coords, dummyvar, xflag, false, natoms);
|
||||||
JSON_INIT_FIELD(molecules, dummyvar, moleculeflag, false, natoms);
|
JSON_INIT_FIELD(molecules, dummyvar, moleculeflag, false, natoms);
|
||||||
JSON_INIT_FIELD(fragments, nfragments, fragmentflag, false, 0);
|
JSON_INIT_FIELD(fragments, nfragments, fragmentflag, false, 0);
|
||||||
JSON_INIT_FIELD(charges, dummyvar, qflag, false, natoms);
|
JSON_INIT_FIELD(charges, dummyvar, qflag, false, natoms);
|
||||||
|
|||||||
@ -302,5 +302,5 @@
|
|||||||
"required": ["format", "data"]
|
"required": ["format", "data"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["application", "format", "revision", "coords", "types"]
|
"required": ["application", "format", "revision", "types"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user