Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: virtual_sites: Removed default argument from virtual function and non-functional virtual COM feature #3250

Merged
merged 4 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions doc/sphinx/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,6 @@ General features
- ``BOND_CONSTRAINT`` Turns on the RATTLE integrator which allows for fixed lengths bonds
between particles.

- ``VIRTUAL_SITES_COM`` Virtual sites are particles, the position and velocity of which is
not obtained by integrating equations of motion. Rather, they are
placed using the position (and orientation) of other particles. The
feature allows to place a virtual particle into the center of mass of
a set of other particles.

.. seealso:: :ref:`Virtual sites`

- ``VIRTUAL_SITES_RELATIVE`` Virtual sites are particles, the position and velocity of which is
not obtained by integrating equations of motion. Rather, they are
placed using the position (and orientation) of other particles. The
Expand Down
73 changes: 0 additions & 73 deletions doc/sphinx/particles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -436,79 +436,6 @@ For correct results, the LB thermostat has to be deactivated for virtual sites::
Please note that the velocity attribute of the virtual particles does not carry valid information for this virtual sites scheme.


..
.. _Virtual sites in the center of mass of a molecule:

Virtual sites in the center of mass of a molecule
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. todo:: This is not implemented in Python, yet

To activate this implementation, enable the feature ``VIRTUAL_SITES_COM`` in :file:`myconfig.hpp`. Virtual sites are then placed in the center of mass of
a set of particles (as defined below). Their velocity will also be that
of the center of mass. Forces accumulating on the virtual sites are
distributed back to the particles which form the molecule. To place a
virtual site at the center of a molecule, perform the following steps in
that order

#. Create a particle of the desired type for each molecule. It should be
placed at least roughly in the center of the molecule to make sure,
its on the same node as the other particles forming the molecule, in
a simulation with more than one CPU.

#. Make it a virtual site using

part virtual 1

#. Declare the list of molecules and the particles they consist of:

analyze set { ...} ...

The lists of particles in a molecule comprise the non-virtual
particles as well as the virtual site. The id of this molecule is its
index in this list. For example,

analyze set {0 1 2 3 4} {0 5 6 7 8} {1 9 10 11}

declares three molecules, of which the first two consist of three
particles and a virtual site each (particles 14 and 58,
respectively). The third molecule has type 1 and consists of two
particles and a virtual site. The virtual sites were determined
before by setting the flag. You can choose freely one out of each
molecule, for example particles 1, 5, and 9.

#. Assign to all particles that belong to the same molecule the
molecules id

part mol

The molid is the index of the particle in the above list, so you
would assign 0 to particles 1-4, 1 to particles 5-8 and 2 to
particles 9-11. Alternatively, you can call

analyze set topo_part_sync

to set the s from the molecule declarations.

#. Update the position of all virtual particles (optional)

integrate 0

The type of the molecule you can choose freely, it is only used in
certain analysis functions, namely ``energy_kinetic_mol``,
``pressure_mol`` and ``dipmom_mol``, which compute kinetic energy,
pressure and dipole moment per molecule type, respectively.

.. _Additional features:

Additional features
~~~~~~~~~~~~~~~~~~~

The behavior of virtual sites can be fine-tuned with the following
switches in :file:`myconfig.hpp`.

- ``THERMOSTAT_IGNORE_NON_VIRTUAL`` specifies that the thermostat does not act on non-virtual particles
jngrad marked this conversation as resolved.
Show resolved Hide resolved

.. _Particle number counting feature:

Particle number counting feature
Expand Down
3 changes: 1 addition & 2 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ set(EspressoCore_SRC
observables/LBVelocityProfile.cpp
virtual_sites/lb_inertialess_tracers.cpp
virtual_sites/lb_inertialess_tracers_cuda_interface.cpp
virtual_sites/virtual_sites_com.cpp
virtual_sites/VirtualSitesInertialessTracers.cpp
virtual_sites/VirtualSitesRelative.cpp
accumulators/TimeSeries.cpp
observables/PidObservable.cpp)
observables/PidObservable.cpp)

if(CUDA)
set(EspressoCuda_SRC
Expand Down
2 changes: 1 addition & 1 deletion src/core/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ void on_ghost_flags_change() {

void update_dependent_particles() {
#ifdef VIRTUAL_SITES
virtual_sites()->update();
virtual_sites()->update(true);
#endif
cells_update_ghosts();

Expand Down
4 changes: 2 additions & 2 deletions src/core/integrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void integrate_vv(int n_steps, int reuse_forces) {
lb_lbcoupling_deactivate();

#ifdef VIRTUAL_SITES
virtual_sites()->update();
virtual_sites()->update(true);
#endif

// Communication step: distribute ghost positions
Expand Down Expand Up @@ -248,7 +248,7 @@ void integrate_vv(int n_steps, int reuse_forces) {

// VIRTUAL_SITES pos (and vel for DPD) update for security reason !!!
#ifdef VIRTUAL_SITES
virtual_sites()->update();
virtual_sites()->update(true);
#endif

// Communication step: distribute ghost positions
Expand Down
2 changes: 1 addition & 1 deletion src/core/virtual_sites/VirtualSites.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class VirtualSites {
* Velocities are only updated if get_have_velocity() returns true.
* @param recalc_positions Skip the recalculation of positions if false.
*/
virtual void update(bool recalc_positions = true) const = 0;
virtual void update(bool recalc_positions) const = 0;
/** Back-transfer forces (and torques) to non-virtual particles. */
virtual void back_transfer_forces_and_torques() const = 0;
/** @brief Called after force calculation (and before rattle/shake) */
Expand Down
147 changes: 0 additions & 147 deletions src/core/virtual_sites/virtual_sites_com.cpp

This file was deleted.

46 changes: 0 additions & 46 deletions src/core/virtual_sites/virtual_sites_com.hpp

This file was deleted.