5 # KIM-API: An API for interatomic models
6 # Copyright (c) 2013--2022, Regents of the University of Minnesota.
13 # SPDX-License-Identifier: LGPL-2.1-or-later
15 # This library is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU Lesser General Public
17 # License as published by the Free Software Foundation; either
18 # version 2.1 of the License, or (at your option) any later version.
20 # This library is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 # Lesser General Public License for more details.
25 # You should have received a copy of the GNU Lesser General Public License
26 # along with this library; if not, write to the Free Software Foundation,
27 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 flName=LennardJones612ImplementationComputeDispatch.cpp
33 printf "switch (GetComputeIndex(isComputeProcess_dEdr,\n" > $flName
34 printf " isComputeProcess_d2Edr2,\n" >> $flName
35 printf " isComputeEnergy,\n" >> $flName
36 printf " isComputeForces,\n" >> $flName
37 printf " isComputeParticleEnergy,\n" >> $flName
38 printf " isComputeVirial,\n" >> $flName
39 printf " isComputeParticleVirial,\n" >> $flName
40 printf " isShift))\n" >> $flName
41 printf "{\n" >> $flName
44 for processdE in false true; do
45 for processd2E in false true; do
46 for energy in false true; do
47 for force in false true; do
48 for particleEnergy in false true; do
49 for virial in false true; do
50 for particleVirial in false true; do
51 for sshift in false true; do
52 printf " case $i:\n" >> $flName
53 printf " ier = Compute<$processdE, $processd2E, " >> $flName
54 printf "$energy, $force, " >> $flName
55 printf "$particleEnergy, $virial, " >> $flName
56 printf "$particleVirial, $sshift>(\n" >> $flName
57 printf " modelCompute,\n" >> $flName
58 printf " modelComputeArguments,\n" >> $flName
59 printf " particleSpeciesCodes,\n" >> $flName
60 printf " particleContributing,\n" >> $flName
61 printf " coordinates,\n" >> $flName
62 printf " energy,\n" >> $flName
63 printf " forces,\n" >> $flName
64 printf " particleEnergy,\n" >> $flName
65 printf " *virial,\n" >> $flName
66 printf " particleVirial);\n" >> $flName
67 printf " break;\n" >> $flName
78 printf " default:\n" >> $flName
79 printf " std::cout << \"Unknown compute function index\" << std::endl;\n" >> $flName
80 printf " ier = true;\n" >> $flName
81 printf " break;\n" >> $flName
82 printf "}\n" >> $flName