Skip to content

Commit cc5efaa

Browse files
committed
Add FQ section in input
1 parent 477afe0 commit cc5efaa

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

tests/input/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ file(
1111
COPY
1212
cpcm.inp
1313
diffuse.inp
14+
fq.inp
1415
multipoles.inp
1516
restart.inp
1617
sharp.inp
@@ -138,3 +139,18 @@ add_Catch_test(
138139
DEPENDS
139140
parser_script-sharp
140141
)
142+
143+
add_test(
144+
NAME
145+
parser_script-fq
146+
COMMAND
147+
${PYTHON_EXECUTABLE} "-c" "from pcmsolver import parse_pcm_input; \
148+
parsed = parse_pcm_input('fq.inp', write_out=True)"
149+
WORKING_DIRECTORY
150+
${CMAKE_CURRENT_BINARY_DIR}
151+
)
152+
set_tests_properties(parser_script-fq
153+
PROPERTIES
154+
LABELS "parser;parser_script"
155+
ENVIRONMENT PYTHONPATH=${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/${PYMOD_INSTALL_LIBDIR}:$ENV{PYTHONPATH}
156+
)

tests/input/fq.inp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
UNITS = AU
2+
CAVITY
3+
{
4+
TYPE = GEPOL
5+
MODE = ATOMS
6+
ATOMS = [1]
7+
RADII = [1.2]
8+
}
9+
10+
MEDIUM
11+
{
12+
SOLVENT = WATER
13+
}
14+
15+
FQ
16+
{
17+
# X, Y, Z, CHI, ETA
18+
FRAGMENTS = [0.0, 0.0, 0.0, 1.0, 2.0,
19+
0.0, 0.0, 0.0, 1.0, 2.0]
20+
}
21+

tools/pcmparser.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,17 @@ def setup_keywords():
358358
charge_distribution.add_kw('DIPOLES', 'DBL_ARRAY')
359359
top.add_sect(charge_distribution)
360360

361-
return top
361+
# FQ section
362+
# Set a classical fluctuating charge force field
363+
# No additional spheres will be generated.
364+
fq = getkw.Section('FQ', callback = verify_fq)
365+
# FQ force field
366+
# Valid values: array of doubles in format [x, y, z, chi, eta]
367+
fq.add_kw('FRAGMENTS', 'DBL_ARRAY')
368+
# TODO: smearing parameters
369+
top.add_sect(fq)
362370

371+
return top
363372

364373
def verify_top(section):
365374
global isAngstrom, CODATAyear

0 commit comments

Comments
 (0)