kim-api  2.1.4-git+v2.1.3-git-1-g7847914a.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
CreateDispatch.sh
Go to the documentation of this file.
1 #!/bin/sh
2 #
3 
4 #
5 # CDDL HEADER START
6 #
7 # The contents of this file are subject to the terms of the Common Development
8 # and Distribution License Version 1.0 (the "License").
9 #
10 # You can obtain a copy of the license at
11 # http://www.opensource.org/licenses/CDDL-1.0. See the License for the
12 # specific language governing permissions and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each file and
15 # include the License file in a prominent location with the name LICENSE.CDDL.
16 # If applicable, add the following below this CDDL HEADER, with the fields
17 # enclosed by brackets "[]" replaced with your own identifying information:
18 #
19 # Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
20 #
21 # CDDL HEADER END
22 #
23 
24 #
25 # Copyright (c) 2013--2015, Regents of the University of Minnesota.
26 # All rights reserved.
27 #
28 # Contributors:
29 # Ryan S. Elliott
30 # Stephen M. Whalen
31 #
32 
33 
34 flName=LennardJones612ImplementationComputeDispatch.cpp
35 
36 printf "switch (GetComputeIndex(isComputeProcess_dEdr,\n" > $flName
37 printf " isComputeProcess_d2Edr2,\n" >> $flName
38 printf " isComputeEnergy,\n" >> $flName
39 printf " isComputeForces,\n" >> $flName
40 printf " isComputeParticleEnergy,\n" >> $flName
41 printf " isComputeVirial,\n" >> $flName
42 printf " isComputeParticleVirial,\n" >> $flName
43 printf " isShift))\n" >> $flName
44 printf "{\n" >> $flName
45 
46 i=0
47 for processdE in false true; do
48  for processd2E in false true; do
49  for energy in false true; do
50  for force in false true; do
51  for particleEnergy in false true; do
52  for virial in false true; do
53  for particleVirial in false true; do
54  for sshift in false true; do
55  printf " case $i:\n" >> $flName
56  printf " ier = Compute<$processdE, $processd2E, " >> $flName
57  printf "$energy, $force, " >> $flName
58  printf "$particleEnergy, $virial, " >> $flName
59  printf "$particleVirial, $sshift>(\n" >> $flName
60  printf " modelCompute,\n" >> $flName
61  printf " modelComputeArguments,\n" >> $flName
62  printf " particleSpeciesCodes,\n" >> $flName
63  printf " particleContributing,\n" >> $flName
64  printf " coordinates,\n" >> $flName
65  printf " energy,\n" >> $flName
66  printf " forces,\n" >> $flName
67  printf " particleEnergy,\n" >> $flName
68  printf " *virial,\n" >> $flName
69  printf " particleVirial);\n" >> $flName
70  printf " break;\n" >> $flName
71  i=`expr $i + 1`
72  done # sshift
73  done # particleVirial
74  done # virial
75  done # particleEnergy
76  done # force
77  done # energy
78  done # processd2E
79 done # processdE
80 
81 printf " default:\n" >> $flName
82 printf " std::cout << \"Unknown compute function index\" << std::endl;\n" >> $flName
83 printf " ier = true;\n" >> $flName
84 printf " break;\n" >> $flName
85 printf "}\n" >> $flName