Hey,
Maybe not most elegant way, but the following should help you to get started.
> I'm writing a C++ program using Votca to calculate the sum of the
> interactions (L.J. + coulomb) between the atoms composing two beads, reading
> a Gromacs trajectory. Since I'm not so skilled in C++ I can't figure out two
> basic things:
>
> 1) How do I get an iterator over the atoms of a given bead?
in a cg app, you have a coarse-grained and atomistic topology. To get
atom indices of a coarse-grained bead use
cg_bead->ParentBeads() which returns a std::vector<int>
vector<int> &atoms=cg_beads->ParentBeads();
for(vector<int>::iterator iatom=atoms.begin(); iatom!=atoms.end(); ++iatom)
Bead *atom = top_atomistic->Beads()[iatom]
...
I don't remember why we've chosen to store integer instead of
pointers. Never was an excessively used feature so far...
> 2) Can I get Lennard Jones and charge parameters from the .tpr file or shall
> I give them explicitly adding an option in the mapping.xml file?
Unfortunately we do not reat that in from tpr file yet. Either adjust
the TopologyReader or the simplest solution is as you suggested, add
it to xml file.
If you add xml to a cg bead, e.g.
<cg_bead>
....
<atom_eps>1. 1. 3. 4.</atom_eps>
You can access this part of information with
bead->Options().get("atom_eps") as a string. You can use
votca::tools::Tokenizer to convert this to a std::vector<float>
(votca/csg/src/libcsg/map.cc:58, tok_weights...). You would need to
add this for each bead...
Hope that helps, let me know if you need more informaion.
Victor
>
> Thanks
>
> Emiliano
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "votca" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/votca?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"votca" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/votca?hl=en.