Commit 26b780e9 authored by Silvia Chiacchiera's avatar Silvia Chiacchiera
Browse files

Merge branch 'adjustments'

parents e70decf3 dd90c41c
Pipeline #266 passed with stages
in 28 seconds
DL_MESO charged harmonic dimers with dpd repulsion
volume 64.0
temperature 1.0
cutoff 1.0
timestep 0.01
steps 70000
equilibration steps 20000
traj 20000 100
stats every 100
stack size 100
print every 100
job time 7200.0
close time 100.0
ensemble nvt mdvv
ewald sum 1.0 5 5 5
bjerrum 42.0
smear gauss equal
finish
DL_MESO charged harmonic dimers with dpd repulsion
SPECIES 2
solp 1.0 0.46 0
solm 1.0 -0.46 0
MOLECULES 1
DIMER
nummols 96
beads 2
solp 0.0 0.0 0.0
solm 0.1 0.0 0.0
bonds 1
harm 1 2 5.0 0.0
finish
INTERACTIONS 3
solp solp dpd 25.0 1.0 4.5
solm solm dpd 25.0 1.0 4.5
solp solm dpd 25.0 1.0 4.5
CLOSE
PROGRAM gen_dipole
!***********************************************************************************
! module to analyze charge dipole moments in DL_MESO
!
! authors: m. a. seaton and s. chiacchiera, February 2017
!**********************************************************************************
PROGRAM gen_dipole
IMPLICIT none
IMPLICIT none
INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND (15, 307)
INTEGER, PARAMETER :: ntraj=10
REAL(KIND=dp), PARAMETER :: pi=3.141592653589793_dp
......@@ -500,6 +500,11 @@ IMPLICIT none
CONTAINS
SUBROUTINE check_molecules
!*************************************************************************************
! subroutine to check molecular content and labelling
!
! authors: s. chiacchiera, February 2017
!*************************************************************************************
IMPLICIT NONE
INTEGER i, j, k, tm, tp, imol, im, ibd
INTEGER mxmolsize
......@@ -546,10 +551,16 @@ IMPLICIT none
END SUBROUTINE check_molecules
SUBROUTINE compute_charge_dipoles (dipx_box, dipy_box, dipz_box, dip2_box)
!input: xxx, yyy, zzz (at a given time step) and chg
!input: visit and from (obtained using connect)
!output: the x,y,z components of the total dipole, sum p_i^2/N_mol
!for each molecule type (at a given time step)
!*************************************************************************************
! subroutine to compute charge dipole moments
!
! authors: m. a. seaton and s. chiacchiera, February 2017
!
! input: xxx, yyy, zzz (at a given time step) and chg
! input: visit and from (obtained using connect)
! output: the x,y,z components of the total dipole, sum p_i^2/N_mol for each molecule
! type (at a given time step)
!*************************************************************************************
IMPLICIT NONE
INTEGER i, j, k, tm, tp, imol, im, ibd, count, ipr
REAL(KIND=dp), DIMENSION(nmoldef) :: dipx_box, dipy_box, dipz_box
......@@ -644,8 +655,9 @@ SUBROUTINE compute_charge_dipoles (dipx_box, dipy_box, dipz_box, dip2_box)
END SUBROUTINE compute_charge_dipoles
End PROGRAM gen_dipole
SUBROUTINE connect (nbeads, nbonds, bndtbl, visit, from)
!**********************************************************************
! Analyze all the bonds (bndtbl) to obtain a schedule (visit, from)
! Analyzes all the bonds (bndtbl) to obtain a schedule (visit, from)
! to visit the beads so that each cluster is visited along a connected
! path. "visit" gives the order to include beads, "from" gives the bead
! to attach them to.
......@@ -654,8 +666,7 @@ End PROGRAM gen_dipole
!
! author: s. chiacchiera, February 2017
!**********************************************************************
SUBROUTINE connect (nbeads, nbonds, bndtbl, visit, from)
IMPLICIT none
IMPLICIT none
INTEGER, INTENT (IN) :: bndtbl (nbonds,2)
INTEGER, INTENT (IN) :: nbeads, nbonds
INTEGER :: ic, i, j, k, nn, nclu, nper, lab, ref, count
......@@ -757,6 +768,7 @@ SUBROUTINE connect (nbeads, nbonds, bndtbl, visit, from)
!-----------------------------------------------------------------------
CONTAINS
!-----------------------------------------------------------------------
SUBROUTINE organize (N, NL, labnn, firstnn, lastnn, deg)
!**********************************************************************
! Analyzes the bonds (bndtbl) to obtain the degree (=number of bonds)
! of each bead, and the nearest neighbours list.
......@@ -764,8 +776,7 @@ SUBROUTINE connect (nbeads, nbonds, bndtbl, visit, from)
!
! author: s. chiacchiera, February 2017
!**********************************************************************
SUBROUTINE organize (N, NL, labnn, firstnn, lastnn, deg)
IMPLICIT none
IMPLICIT none
INTEGER, INTENT(IN) :: N, NL
INTEGER :: i,l,count_lab, i1,i2
INTEGER, DIMENSION (N), INTENT(OUT) :: deg
......
Number of nodes used in calculations ?
nchist: 0 96 0 0 0 0 0 0 0 0
Charges for SPECIES type solp :
Charges for SPECIES type solm :
chg= 0.4600 -0.4600
Number of snapshots: 501
<P_x>, <P_y>, <P_z>:
-3.627184E-02 -1.790324E-01 5.466988E-02
error:
9.792086E-02 1.066997E-01 9.685359E-02
<P^2>/V:
2.381825E-01
error:
8.641061E-03
<p^2>:
1.419998E-01
error:
4.556992E-04
kirkwood factor:
1.118229E+00
error:
4.415698E-02
Bjerrum length?
epsilon_r:
4.290325E+01
error:
1.520215E+00
......@@ -90,7 +90,15 @@ analyzed. The user is asked to provide the number of nodes used to run the
simulation, the electric charges for all the types of beads
and the Bjerrum length.
As a test, we suggest two examples involving two (toy) molecular species: a
To input the user-defined parameters one can enter them from the keyboard or write them into a text file (say, input.txt), one per line
(in the right order) and run the program in this way:
``gen_dipoleaf.exe < input.txt``
We propose two tests to familiarize with the utility and a third one on a
physically relevant system.
The first two tests involve two (toy) molecular species: a
branched one (four beads, T-shaped) and a simple dimer. All the beads carry charges.
In the first case 10 molecules of each type are present and are followed for a few time steps.
In the second case it is suggested to analyze a single snapshot with just two
......@@ -177,6 +185,45 @@ and the `dipole_BRANCH` one is
The results of this test do not depend on the number of nodes used to run the simulation.
**Third test: water in oil**
Here we suggest to consider a fluid made of harmonically bonded dimers
:math:`(+q,-q)`. Fixing appropriately the partial charge :math:`q`
and the Bjerrum length :math:`l_B` this system
mimics water in an oil background, as long as the dielectric properties
are concerned. For more details about this model, please see the page :ref:`dimers`.
Run DL_MESO_DPD using for the CONTROL file
.. literalinclude:: ./CONTROL-3
and for the FIELD file
.. literalinclude:: ./FIELD-3
Analyzing the HISTORY file with `gen_dipole.exe`, this output is printed on
the standard output
.. literalinclude:: ./out-3
In particular, we see that:
- :math:`\vec{P}=(0.0 \pm 0.1, 0.2 \pm 0.1, 0.1 \pm 0.1)`
- :math:`\epsilon_r= 43 \pm 2`
- :math:`g_k = 1.12 \pm 0.04`
Please notice that the error estimates are done assuming all the samples are
independent. From the results obtained in the testing case of the
module `gen_dipoleaf.f90`, one sees that the auto-correlation time of
:math:`\vec{P}` in this system is about 1-2 DPD time units, so the sampling choice
done here (trajectories are written every 100 time steps, i.e., every 1 DPD
time units) seems reasonable, even if a bit optimistic.
To confirm the reliability of the error estimate one can do
another run with a different random number sequence (see the directive `seed` of
DL_MESO) and see if the two results are compatible within error bars.
Source Code
___________
.. literalinclude:: ./gen_dipole.f90
......@@ -184,7 +231,7 @@ ___________
:linenos:
.. Here are the URL references used
.. _DL_MESO: http://www.scd.stfc.ac.uk/SCD/support/40694.aspx
.. _DL_MESO: http://www.ccp5.ac.uk/DL_MESO
.. _ReST: http://docutils.sourceforge.net/docs/user/rst/quickref.html
.. [1] Disambiguation on the concept of molecule. In DL\_MESO a *defined molecule*
is a set of beads, which can be bonded or not.
......@@ -193,5 +240,3 @@ ___________
In fact, this, together with the reasonable assumption that each stretching
bond cannot be stretched to more than half the system linear size, allows
to univocally define the charge dipole moment of each molecule.
.. www.ccp5.ac.uk/DL_MESO
......@@ -32,7 +32,7 @@ utility for DL_MESO_DPD, the Dissipative Particle Dynamics (DPD) code from the D
It converts the trajectory (HISTORY) files from *unformatted* to a
human readable form, (optionally) including explicative comments about all the
quantities. This module is mainly for learning/checking purpouses.
quantities. This module is mainly for learning/checking purposes.
The first aim is to help the user to check that the
system was prepared as intended (e.g., showing all the bead properties and
initial positions, all the bonds etc).
......@@ -89,6 +89,6 @@ ___________
:linenos:
.. Here are the URL references used
.. _DL_MESO: http://www.scd.stfc.ac.uk/SCD/support/40694.aspx
.. _DL_MESO: http://www.ccp5.ac.uk/DL_MESO
.. _ReST: http://docutils.sourceforge.net/docs/user/rst/quickref.html
.. www.ccp5.ac.uk/DL_MESO
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