Consistency check of input files in DL_MESO_DPD¶
Purpose of Module¶
This module, check_config.f90
, is a pre-processing
utility for DL_MESO_DPD, the Dissipative Particle Dynamics (DPD) code from the DL_MESO package.
It checks that the content of the optional configuration (CONFIG) file is consistent with that
of the necessary input files (CONTROL and FIELD). In particular, it checks: the system
dimensions, its composition and the bead content of all the molecules.
In addition, in case hard walls are present, it checks that none of the
stretching bonds between beads crosses a hard wall.
Background Information¶
The base code for this module is DL_MESO_DPD, the Dissipative Particle Dynamics code from the mesoscopic simulation package DL_MESO, developed by M. Seaton at Daresbury Laboratory. This open source code is available from STFC under both academic (free) and commercial (paid) licenses. The module can be used with DL_MESO from version 2.6 (dated November 2015) onwards, including its currently released version, version 2.7 (dating December 2018).
Testing¶
The present module, check_config.f90
, is compiled with the available
Fortran90 compiler [1], e.g.:
gfortran -o check_config.exe check_config.f90
and the executable must be in the same directory of the three files to be analyzed (i.e., CONTROL, FIELD and CONFIG).
When running check_config.f90
, the outcome of the different checks is
sent to the standard output. The most important messages are: warnings,
error messages and hints to fix them. For completeness, some information
about the system size and composition is printed too.
We suggest as a test a very small system with three species of beads (A, B, C) and a total population of 24 beads. Of these, 6 are unbonded, while the others are grouped into 7 molecules of two types. In the first test, consistent input is given. In the following ones, small changes rising warnings and errors are analyzed, to demonstrate the behaviour of the module.
Test 1
Use for the CONTROL
file
Simple test
temperature 1.0
cutoff 1.0
timestep 0.01
steps 1100
equilibration steps 100
trajectory 100 100 0
stats every 100
stack size 100
print every 100
job time 100.0
close time 10.0
ensemble nvt mdvv
nfold 1 1 1
#vol 1.0
conf zero
#surface hard z
finish
for the FIELD
file
Simple test
SPECIES 3
A 1.0 0.0 0
B 1.0 0.0 6
C 1.0 0.0 0
MOLECULES 2
ACB
nummols 4
beads 3
A 0.0 0.5 0.0
C 0.0 0.0 0.0
B 0.5 0.0 0.0
bonds 2
harm 1 2 10.0 0.0
harm 2 3 10.0 0.0
finish
BC
nummols 3
beads 2
B 0.0 0.0 0.0
C 0.5 0.0 0.0
bonds 1
harm 1 2 10.0 0.0
finish
INTERACTIONS 3
A A dpd 25.0 1.0 4.0
B B dpd 25.0 1.0 4.0
C C dpd 25.0 1.0 4.0
CLOSE
and for the CONFIG
file this (correct labelling) one, where
the beads are randomly located in the cubic box
Simple test
0 1
1.0000000000 0.0000000000 0.0000000000
0.0000000000 1.0000000000 0.0000000000
0.0000000000 0.0000000000 1.0000000000
B 1
0.4577200045 0.9001190080 0.3001750172
B 2
0.0415166244 0.7699064654 0.8179705041
B 3
0.6302680192 0.9146029274 0.7314079348
B 4
0.7731659040 0.5993543351 0.3483148324
B 5
0.1273913826 0.0669681234 0.5332509871
B 6
0.3493437595 0.4205682036 0.4898004159
A 7
0.0755944215 0.5154423406 0.0394230825
C 8
0.5837477096 0.0477604149 0.7092934456
B 9
0.0949452841 0.7453901460 0.7721903180
A 10
0.2026802865 0.4475765512 0.4191000671
C 11
0.8148312410 0.8686744347 0.8112311619
B 12
0.3621449634 0.5704018599 0.7440643976
A 13
0.4903370300 0.0944675650 0.7163648810
C 14
0.9445609725 0.2362723351 0.0291370763
B 15
0.7068423470 0.8993323711 0.0791676911
A 16
0.5713842548 0.2551756180 0.7366135404
C 17
0.2637800160 0.3507307479 0.7316829655
B 18
0.3956074216 0.9739386044 0.9861309514
B 19
0.9029085375 0.1837974484 0.0837168293
C 20
0.0287508243 0.2151038377 0.2502012593
B 21
0.1325665768 0.0464577116 0.8147593457
C 22
0.6603299794 0.1659685862 0.4340299834
B 23
0.7419336708 0.6792113832 0.5057230908
C 24
0.6879917453 0.0772687141 0.6552782347
Running the utility check_config.f90
, this output is printed on the
standard output
unit cell sizes = 1.0000000000 1.0000000000 1.0000000000
nfoldx, nfoldy, nfoldz = 1 1 1
system sizes = 1.0000000000 1.0000000000 1.0000000000
imcon = 1
levcfg = 0
lconfzero = T
srftype = 0
nspe = 3
nmoldef = 2
mxmolsize = 3
mxbonds = 2
nspec = 0 6 0
nspecmol = 4 7 7
numbond = 11
for molecule ACB :
mlstrtspe = 1 3 2
for molecule BC :
mlstrtspe = 2 3 0
OK: CONFIG file is consistent with FIELD file
(composition and bead content of molecules)
Test 2
Instead, altering just two particle species in the CONFIG file given above:
- “B 3” changes into “A 3”
- “C 20” changes into “B 20”
an error message is given
error: problem with unbonded beads of species A : 1 instead of 0
error: problem with unbonded beads of species B : 5 instead of 6
error: problem with molecular beads of species B : 8 instead of 7
error: problem with molecular beads of species C : 6 instead of 7
error: problem with the molecular content of BC : 2 -th bead is B instead of C (bead label = 20 )
error: CONFIG file is not consistent with FIELD file
Test 3
If instead these two lines of the CONFIG file are altered
- “A 10” into “C 10”
- “C 11” into “A 11”
the error message is
error: problem with the molecular content of ACB : 1 -th bead is C instead of A (bead label = 10 )
error: problem with the molecular content of ACB : 2 -th bead is A instead of C (bead label = 11 )
error: CONFIG file is not consistent with FIELD file
Test 4
Here instead we propose to add a hard wall orthogonal to the z axis: this
is done by uncommenting the surface hard z
line in the CONTROL file.
Running the utility, one obtains
srftype = 1
srfx, srfy, srfz = 0 0 1
(composition and bead content of molecules)
error: bond between beads 7 and 8 crosses hard wall perp. to z
error: bond between beads 13 and 14 crosses hard wall perp. to z
Source Code¶
To download the source code for check_config.f90
, click here
.
[1] | Compilation has been tested with the GNU compiler GCC, version 10.2.0. |