Skip to content

Commit

Permalink
Document Observable_stat Coulomb/Dipole slots
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed May 21, 2020
1 parent c5a19f4 commit 072180f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
2 changes: 1 addition & 1 deletion doc/sphinx/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The direct analysis commands can be classified into two types:

- :ref:`Energies`
- :ref:`Pressure`
- :ref:`Pressure Tensor`
- :ref:`Momentum of the System`
- :ref:`Minimal distances between particles`
- :ref:`Particles in the neighborhood`
Expand All @@ -32,7 +33,6 @@ The direct analysis commands can be classified into two types:
- :ref:`Center of mass`
- :ref:`Moment of inertia matrix`
- :ref:`Gyration tensor`
- :ref:`Pressure Tensor`

.. _Energies:

Expand Down
11 changes: 9 additions & 2 deletions src/core/electrostatics_magnetostatics/coulomb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ struct Coulomb_parameters {
extern Coulomb_parameters coulomb;

namespace Coulomb {
/** Number of electrostatic contributions to the system pressure calculation. */
/** Number of electrostatic contributions to the system pressure calculation.
* - slot 0: pressure from particle pairs
* - slot 1: energies from electrostatics solvers
*/
inline size_t pressure_n() {
switch (coulomb.method) {
case COULOMB_NONE:
Expand All @@ -73,7 +76,11 @@ inline size_t pressure_n() {
}
}

/** Number of electrostatic contributions to the system energy calculation. */
/** Number of electrostatic contributions to the system energy calculation.
* - slot 0: energies from particle pairs
* - slot 1: energies from electrostatics solvers
* - slot 2: energy corrections
*/
inline size_t energy_n() {
switch (coulomb.method) {
case COULOMB_NONE:
Expand Down
6 changes: 5 additions & 1 deletion src/core/electrostatics_magnetostatics/dipole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ namespace Dipole {
/** Number of electrostatic contributions to the system pressure calculation. */
constexpr size_t pressure_n() { return 0; }

/** Number of electrostatic contributions to the system energy calculation. */
/** Number of electrostatic contributions to the system energy calculation.
* - slot 0: energies from particle pairs and magnetic field constraints
* - slot 1: energies from magnetostatics solvers
* - slot 2: energy corrections
*/
inline size_t energy_n() {
switch (dipole.method) {
case DIPOLAR_NONE:
Expand Down
28 changes: 21 additions & 7 deletions src/python/espressomd/analyze.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@ class Analysis:
* ``"nonbonded_intra", <type_i>, <type_j>``: nonbonded pressure between short ranged forces between type i and j and with the same mol_id
* ``"nonbonded_inter", <type_i>, <type_j>``: nonbonded pressure between short ranged forces between type i and j and different mol_ids
* ``"coulomb"``: Coulomb pressure, how it is calculated depends on the method. It is equivalent to 1/3 of the trace of the Coulomb pressure tensor.
For how the pressure tensor is calculated, see below. The averaged value in an isotropic NVT simulation is equivalent to the average of
For how the pressure tensor is calculated, see :ref:`Pressure Tensor`. The averaged value in an isotropic NVT simulation is equivalent to the average of
:math:`E^{coulomb}/(3V)`, see :cite:`brown95a`.
* ``"dipolar"``: TODO
* ``"coulomb", <i>``: Coulomb pressure from particle pairs (``i=0``), electrostatics solvers (``i=1``) and their corrections (``i=2``)
* ``"dipolar"``: not implemented
* ``"virtual_sites"``: Pressure contribution due to virtual sites
"""
Expand Down Expand Up @@ -308,10 +309,11 @@ class Analysis:
* ``"bonded", <bond_type>``: bonded pressure tensor which arises from the given bond_type
* ``"nonbonded"``: total nonbonded pressure tensor
* ``"nonbonded", <type_i>, <type_j>``: nonbonded pressure tensor which arises from the interactions between type_i and type_j
* ``"nonbonded_intra" <type_i>, <type_j>``: nonbonded pressure tensor between short ranged forces between type i and j and with the same mol_id
* ``"nonbonded_inter" <type_i>, <type_j>``: nonbonded pressure tensor between short ranged forces between type i and j and different mol_ids
* ``"nonbonded_intra", <type_i>, <type_j>``: nonbonded pressure tensor between short ranged forces between type i and j and with the same mol_id
* ``"nonbonded_inter", <type_i>, <type_j>``: nonbonded pressure tensor between short ranged forces between type i and j and different mol_ids
* ``"coulomb"``: Maxwell pressure tensor, how it is calculated depends on the method
* ``"dipolar"``: TODO
* ``"coulomb", <i>``: Maxwell pressure tensor from particle pairs (``i=0``), electrostatics solvers (``i=1``) and their corrections (``i=2``)
* ``"dipolar"``: not implemented
* ``"virtual_sites"``: pressure tensor contribution for virtual sites
"""
Expand Down Expand Up @@ -425,8 +427,20 @@ class Analysis:
Returns
-------
:obj:`dict`
A dictionary with keys ``total``, ``kinetic``, ``bonded``, ``nonbonded``,
``coulomb``, ``external_fields``.
A dictionary with the following keys:
* ``"total"``: total energy
* ``"kinetic"``: linear and rotational kinetic energy
* ``"bonded"``: total bonded energy
* ``"bonded", <bond_type>``: bonded energy which arises from the given bond_type
* ``"nonbonded"``: total nonbonded energy
* ``"nonbonded", <type_i>, <type_j>``: nonbonded energy which arises from the interactions between type_i and type_j
* ``"nonbonded_intra", <type_i>, <type_j>``: nonbonded energy between short ranged forces between type i and j and with the same mol_id
* ``"nonbonded_inter", <type_i>, <type_j>``: nonbonded energy between short ranged forces between type i and j and different mol_ids
* ``"coulomb"``: Coulomb energy, how it is calculated depends on the method
* ``"coulomb", <i>``: Coulomb energy from particle pairs (``i=0``), electrostatics solvers (``i=1``) and their corrections (``i=2``)
* ``"dipolar"``: dipolar energy
* ``"dipolar", <i>``: dipolar energy from particle pairs and magnetic field constraints (``i=0``), magnetostatics solvers (``i=1``) and their corrections (``i=2``)
Examples
Expand Down

0 comments on commit 072180f

Please sign in to comment.