kim-api-v2  2.0.0+912e79a.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
ex_test_Ar_fcc_cluster.c
Go to the documentation of this file.
1 /*
2  *
3  * CDDL HEADER START
4  *
5  * The contents of this file are subject to the terms of the Common Development
6  * and Distribution License Version 1.0 (the "License").
7  *
8  * You can obtain a copy of the license at
9  * http://www.opensource.org/licenses/CDDL-1.0. See the License for the
10  * specific language governing permissions and limitations under the License.
11  *
12  * When distributing Covered Code, include this CDDL HEADER in each file and
13  * include the License file in a prominent location with the name LICENSE.CDDL.
14  * If applicable, add the following below this CDDL HEADER, with the fields
15  * enclosed by brackets "[]" replaced with your own identifying information:
16  *
17  * Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
18  *
19  * CDDL HEADER END
20  *
21 
22  *
23  * Copyright (c) 2013--2019, Regents of the University of Minnesota.
24  * All rights reserved.
25  *
26  * Contributors:
27  * Ryan S. Elliott
28  * Stephen M. Whalen
29  *
30  */
31 
32 
33 #include "KIM_SimulatorHeaders.h"
34 #include <math.h>
35 #include <stdio.h>
36 #include <stdlib.h>
37 
38 #define TRUE 1
39 #define FALSE 0
40 
41 #define NAMESTRLEN 128
42 
43 #define FCCSPACING 5.260
44 #define DIM 3
45 #define NCELLSPERSIDE 2
46 #define NCLUSTERPARTS \
47  (4 * (NCELLSPERSIDE * NCELLSPERSIDE * NCELLSPERSIDE) \
48  + 6 * (NCELLSPERSIDE * NCELLSPERSIDE) + 3 * (NCELLSPERSIDE) + 1)
49 
50 
51 #define MY_ERROR(message) \
52  { \
53  printf("* Error : \"%s\" %d:%s\n", message, __LINE__, __FILE__); \
54  exit(1); \
55  }
56 
57 #define MY_WARNING(message) \
58  { \
59  printf("* WARNING : \"%s\" %d:%s\n", message, __LINE__, __FILE__); \
60  }
61 
62 /* Define neighborlist structure */
63 typedef struct
64 {
65  double cutoff;
67  int * NNeighbors;
68  int * neighborList;
69 } NeighList;
70 
71 /* Define prototypes */
72 void fcc_cluster_neighborlist(int half,
74  double * coords,
75  double cutoff,
76  NeighList * nl);
77 
78 int get_cluster_neigh(void * const dataObject,
79  int const numberOfNeighborLists,
80  double const * const cutoffs,
81  int const neighborListIndex,
82  int const particleNumber,
83  int * const numberOfNeighbors,
84  int const ** const neighborsOfParticle);
85 
86 void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double * coords);
87 
88 
89 /* Main program */
90 int main()
91 {
92  /* Local variable declarations */
93  double const MinSpacing = 0.8 * FCCSPACING;
94  double const MaxSpacing = 1.2 * FCCSPACING;
95  double const SpacingIncr = 0.025 * FCCSPACING;
96  double CurrentSpacing;
97  double cutpad = 0.75; /* Angstroms */
98  double force_norm;
99  int i;
100  int error;
101 
102 
103  /* KIM variable declarations */
104  KIM_Model * model;
105  /* model inputs */
106  int numberOfParticles_cluster = NCLUSTERPARTS;
107  int speciesIsSupported;
108  int particleSpecies_cluster_model[NCLUSTERPARTS];
109  int particleContributing_cluster_model[NCLUSTERPARTS];
110  double coords_cluster[NCLUSTERPARTS][DIM];
111  NeighList nl_cluster_model;
112  /* model outputs */
113  int number_of_neighbor_lists_cluster_model;
114  double influence_distance_cluster_model;
115  double const * cutoff_cluster_model;
116  double energy_cluster_model = 0.0;
117  double forces_cluster[NCLUSTERPARTS * DIM];
118 
119  char modelname[NAMESTRLEN];
120  int requestedUnitsAccepted;
121  int numberOfModelRoutineNames;
122  KIM_ModelRoutineName modelRoutineName;
123  int present;
124  int required;
125  int modelArCode;
126  int numberOfComputeArgumentNames;
127  KIM_ComputeArguments * computeArguments;
128  KIM_ComputeArgumentName computeArgumentName;
129  KIM_SupportStatus supportStatus;
130  int numberOfComputeCallbackNames;
131  KIM_ComputeCallbackName computeCallbackName;
132 
133  /* Get KIM Model names */
134  printf("Please enter valid KIM Model name: \n");
135  error = scanf("%s", modelname);
136  if (1 != error) { MY_ERROR("Unable to read model name"); }
137 
138  /* initialize the model */
145  modelname,
146  &requestedUnitsAccepted,
147  &model);
148  if (error) MY_ERROR("KIM_create_model_interface()");
149 
150  /* Check for compatibility with the model */
151  if (!requestedUnitsAccepted) MY_ERROR("Must adapt to model units");
152 
153  /* Check that we know about all required routines */
155  &numberOfModelRoutineNames);
156  for (i = 0; i < numberOfModelRoutineNames; ++i)
157  {
158  KIM_MODEL_ROUTINE_NAME_GetModelRoutineName(i, &modelRoutineName);
159 
161  model, modelRoutineName, &present, &required);
162  if (error) { MY_ERROR("Unable to get ModelRoutineName."); }
163 
164  if ((present == TRUE) && (required == TRUE))
165  {
166  if (!(KIM_ModelRoutineName_Equal(modelRoutineName,
170  || KIM_ModelRoutineName_Equal(modelRoutineName,
172  || KIM_ModelRoutineName_Equal(modelRoutineName,
175  modelRoutineName,
177  || KIM_ModelRoutineName_Equal(modelRoutineName,
179  { MY_ERROR("Unknown required ModelRoutineName found."); }
180  }
181  }
182 
183  /* check species */
185  model, KIM_SPECIES_NAME_Ar, &speciesIsSupported, &modelArCode);
186  if ((error) || (!speciesIsSupported))
187  { MY_ERROR("Species Ar not supported"); }
188 
189  error = KIM_Model_ComputeArgumentsCreate(model, &computeArguments);
190  if (error) { MY_ERROR("KIM_Model_ComputeArgumentsCreate"); }
191 
192  /* check arguments */
194  &numberOfComputeArgumentNames);
195  for (i = 0; i < numberOfComputeArgumentNames; ++i)
196  {
198  i, &computeArgumentName);
199  if (error) MY_ERROR("can't get argument name");
201  computeArguments, computeArgumentName, &supportStatus);
202  if (error) MY_ERROR("can't get argument supportStatus");
203 
204  /* can only handle energy and force as a required arg */
206  {
208  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialEnergy))
210  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)))
211  { MY_ERROR("unsupported required argument"); }
212  }
213 
214  /* must have energy and forces */
215  if ((KIM_ComputeArgumentName_Equal(computeArgumentName,
218  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)))
219  {
220  if (!((KIM_SupportStatus_Equal(supportStatus,
222  || (KIM_SupportStatus_Equal(supportStatus,
224  { MY_ERROR("energy or forces not available"); }
225  }
226  }
227 
228  /* check call backs */
230  &numberOfComputeCallbackNames);
231  for (i = 0; i < numberOfComputeCallbackNames; ++i)
232  {
234  i, &computeCallbackName);
235  if (error) MY_ERROR("can't get call back name");
237  computeArguments, computeCallbackName, &supportStatus);
238  if (error) MY_ERROR("can't get call back supportStatus");
239 
240  /* cannot handle any "required" call backs */
242  { MY_ERROR("unsupported required call back"); }
243  }
244 
245  /* We're compatible with the model. Let's do it. */
246 
248  computeArguments,
250  &numberOfParticles_cluster)
252  computeArguments,
254  particleSpecies_cluster_model)
256  computeArguments,
258  particleContributing_cluster_model)
260  computeArguments,
262  (double *) &coords_cluster)
264  computeArguments,
266  &energy_cluster_model)
268  computeArguments,
270  (double *) &forces_cluster);
271  if (error) MY_ERROR("KIM_setm_data");
273  computeArguments,
277  &nl_cluster_model);
278 
279  KIM_Model_GetInfluenceDistance(model, &influence_distance_cluster_model);
281  &number_of_neighbor_lists_cluster_model,
282  &cutoff_cluster_model,
283  NULL); /* ignoring hint */
284  if (number_of_neighbor_lists_cluster_model != 1)
285  MY_ERROR("too many neighbor lists");
286 
287  /* setup particleSpecies */
288  error
291  &speciesIsSupported,
292  &(particleSpecies_cluster_model[0]));
293  if (error) MY_ERROR("KIM_get_species_code");
294  for (i = 1; i < NCLUSTERPARTS; ++i)
295  particleSpecies_cluster_model[i] = particleSpecies_cluster_model[0];
296 
297  /* setup particleContributing */
298  for (i = 0; i < NCLUSTERPARTS; ++i)
299  {
300  particleContributing_cluster_model[i] = 1; /* all particles contribute */
301  }
302 
303  /* setup neighbor lists */
304  /* allocate memory for list */
305  nl_cluster_model.numberOfParticles = NCLUSTERPARTS;
306  nl_cluster_model.NNeighbors = (int *) malloc(NCLUSTERPARTS * sizeof(int));
307  if (NULL == nl_cluster_model.NNeighbors) MY_ERROR("malloc unsuccessful");
308 
309  nl_cluster_model.neighborList
310  = (int *) malloc(NCLUSTERPARTS * NCLUSTERPARTS * sizeof(int));
311  if (NULL == nl_cluster_model.neighborList) MY_ERROR("malloc unsuccessful");
312 
313  /* ready to compute */
314  printf("This is Test : ex_test_Ar_fcc_cluster\n");
315  printf("---------------------------------------------------------------------"
316  "-----------\n");
317  printf("Results for KIM Model : %s\n", modelname);
318 
319  printf("%20s, %20s, %20s\n", "Energy", "Force Norm", "Lattice Spacing");
320  for (CurrentSpacing = MinSpacing; CurrentSpacing < MaxSpacing;
321  CurrentSpacing += SpacingIncr)
322  {
323  /* update coordinates for cluster */
324  create_FCC_cluster(CurrentSpacing, NCELLSPERSIDE, &(coords_cluster[0][0]));
325  /* compute neighbor lists */
327  NCLUSTERPARTS,
328  &(coords_cluster[0][0]),
329  (*cutoff_cluster_model + cutpad),
330  &nl_cluster_model);
331 
332  /* call compute functions */
333  error = KIM_Model_Compute(model, computeArguments);
334  if (error) MY_ERROR("KIM_model_compute");
335 
336  /* compute force norm */
337  force_norm = 0.0;
338  for (i = 0; i < DIM * numberOfParticles_cluster; ++i)
339  { force_norm += forces_cluster[i] * forces_cluster[i]; }
340  force_norm = sqrt(force_norm);
341 
342  /* print the results */
343  printf("%20.10e, %20.10e, %20.10e\n",
344  energy_cluster_model,
345  force_norm,
346  CurrentSpacing);
347  }
348 
349  error = KIM_Model_ComputeArgumentsDestroy(model, &computeArguments);
350  if (error) { MY_ERROR("Unable to destroy compute arguments"); }
351 
352  /* free memory of neighbor lists */
353  free(nl_cluster_model.NNeighbors);
354  free(nl_cluster_model.neighborList);
355 
356  /* free pkim objects */
357  KIM_Model_Destroy(&model);
358 
359  /* everything is great */
360  return 0;
361 }
362 
363 void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double * coords)
364 {
365  /* local variables */
366  double FCCshifts[4][DIM];
367  double latVec[DIM];
368  int a;
369  int i;
370  int j;
371  int k;
372  int m;
373  int n;
374 
375  /* create a cubic FCC cluster of parts */
376  FCCshifts[0][0] = 0.0;
377  FCCshifts[0][1] = 0.0;
378  FCCshifts[0][2] = 0.0;
379  FCCshifts[1][0] = 0.5 * FCCspacing;
380  FCCshifts[1][1] = 0.5 * FCCspacing;
381  FCCshifts[1][2] = 0.0;
382  FCCshifts[2][0] = 0.5 * FCCspacing;
383  FCCshifts[2][1] = 0.0;
384  FCCshifts[2][2] = 0.5 * FCCspacing;
385  FCCshifts[3][0] = 0.0;
386  FCCshifts[3][1] = 0.5 * FCCspacing;
387  FCCshifts[3][2] = 0.5 * FCCspacing;
388 
389  a = 0;
390  for (i = 0; i < nCellsPerSide; ++i)
391  {
392  latVec[0] = ((double) i) * FCCspacing;
393  for (j = 0; j < nCellsPerSide; ++j)
394  {
395  latVec[1] = ((double) j) * FCCspacing;
396  for (k = 0; k < nCellsPerSide; ++k)
397  {
398  latVec[2] = ((double) k) * FCCspacing;
399  for (m = 0; m < 4; ++m)
400  {
401  for (n = 0; n < DIM; ++n)
402  { coords[a * DIM + n] = latVec[n] + FCCshifts[m][n]; }
403  a++;
404  }
405  }
406  /* add in the remaining three faces */
407  /* pos-x face */
408  latVec[0] = NCELLSPERSIDE * FCCspacing;
409  latVec[1] = ((double) i) * FCCspacing;
410  latVec[2] = ((double) j) * FCCspacing;
411  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
412  a++;
413  for (n = 0; n < DIM; ++n)
414  { coords[a * DIM + n] = latVec[n] + FCCshifts[3][n]; }
415  a++;
416  /* pos-y face */
417  latVec[0] = ((double) i) * FCCspacing;
418  latVec[1] = NCELLSPERSIDE * FCCspacing;
419  latVec[2] = ((double) j) * FCCspacing;
420  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
421  a++;
422  for (n = 0; n < DIM; ++n)
423  { coords[a * DIM + n] = latVec[n] + FCCshifts[2][n]; }
424  a++;
425  /* pos-z face */
426  latVec[0] = ((double) i) * FCCspacing;
427  latVec[1] = ((double) j) * FCCspacing;
428  latVec[2] = NCELLSPERSIDE * FCCspacing;
429  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
430  a++;
431  for (n = 0; n < DIM; ++n)
432  { coords[a * DIM + n] = latVec[n] + FCCshifts[1][n]; }
433  a++;
434  }
435  /* add in the remaining three edges */
436  latVec[0] = ((double) i) * FCCspacing;
437  latVec[1] = NCELLSPERSIDE * FCCspacing;
438  latVec[2] = NCELLSPERSIDE * FCCspacing;
439  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
440  a++;
441  latVec[0] = NCELLSPERSIDE * FCCspacing;
442  latVec[1] = ((double) i) * FCCspacing;
443  latVec[2] = NCELLSPERSIDE * FCCspacing;
444  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
445  a++;
446  latVec[0] = NCELLSPERSIDE * FCCspacing;
447  latVec[1] = NCELLSPERSIDE * FCCspacing;
448  latVec[2] = ((double) i) * FCCspacing;
449  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
450  a++;
451  }
452  /* add in the remaining corner */
453  for (n = 0; n < DIM; ++n)
454  { coords[a * DIM + n] = NCELLSPERSIDE * FCCspacing; }
455  a++;
456 
457  return;
458 }
459 
460 
462  int numberOfParticles,
463  double * coords,
464  double cutoff,
465  NeighList * nl)
466 {
467  /* local variables */
468  int i;
469  int j;
470  int k;
471  int a;
472 
473  double dx[DIM];
474  double r2;
475  double cutoff2;
476 
477  nl->cutoff = cutoff;
478 
479  cutoff2 = cutoff * cutoff;
480 
481  for (i = 0; i < numberOfParticles; ++i)
482  {
483  a = 0;
484  for (j = 0; j < numberOfParticles; ++j)
485  {
486  r2 = 0.0;
487  for (k = 0; k < DIM; ++k)
488  {
489  dx[k] = coords[j * DIM + k] - coords[i * DIM + k];
490  r2 += dx[k] * dx[k];
491  }
492 
493  if (r2 < cutoff2)
494  {
495  if ((half && i < j) || (!half && i != j))
496  {
497  /* part j is a neighbor of part i */
498  (*nl).neighborList[i * NCLUSTERPARTS + a] = j;
499  a++;
500  }
501  }
502  }
503  /* part i has `a' neighbors */
504  (*nl).NNeighbors[i] = a;
505  }
506 
507  return;
508 }
509 
510 int get_cluster_neigh(void * const dataObject,
511  int const numberOfNeighborLists,
512  double const * const cutoffs,
513  int const neighborListIndex,
514  int const particleNumber,
515  int * const numberOfNeighbors,
516  int const ** const neighborsOfParticle)
517 {
518  /* local variables */
519  int error = TRUE;
520  NeighList * nl = (NeighList *) dataObject;
522 
523  if ((numberOfNeighborLists != 1) || (cutoffs[0] > nl->cutoff)) return error;
524 
525  if (neighborListIndex != 0) return error;
526 
527  /* initialize numNeigh */
528  *numberOfNeighbors = 0;
529 
530  if ((particleNumber >= numberOfParticles)
531  || (particleNumber < 0)) /* invalid id */
532  {
533  MY_WARNING("Invalid part ID in get_cluster_neigh");
534  return TRUE;
535  }
536 
537  /* set the returned number of neighbors for the returned part */
538  *numberOfNeighbors = (*nl).NNeighbors[particleNumber];
539 
540  /* set the location for the returned neighbor list */
541  *neighborsOfParticle
542  = &((*nl).neighborList[(particleNumber) *numberOfParticles]);
543 
544  return FALSE;
545 }
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Destroy
The standard Destroy routine.
int KIM_Model_Create(KIM_Numbering const numbering, KIM_LengthUnit const requestedLengthUnit, KIM_EnergyUnit const requestedEnergyUnit, KIM_ChargeUnit const requestedChargeUnit, KIM_TemperatureUnit const requestedTemperatureUnit, KIM_TimeUnit const requestedTimeUnit, char const *const modelName, int *const requestedUnitsAccepted, KIM_Model **const model)
Create a new KIM API Model object.
int KIM_MODEL_ROUTINE_NAME_GetModelRoutineName(int const index, KIM_ModelRoutineName *const modelRoutineName)
Get the identity of each defined standard ModelRoutineName.
int KIM_Model_IsRoutinePresent(KIM_Model const *const model, KIM_ModelRoutineName const modelRoutineName, int *const present, int *const required)
Determine presence and required status of the given ModelRoutineName.
KIM_ChargeUnit const KIM_CHARGE_UNIT_e
The standard electron unit of charge.
int get_cluster_neigh(void *const dataObject, int const numberOfNeighborLists, double const *const cutoffs, int const neighborListIndex, int const particleNumber, int *const numberOfNeighbors, int const **const neighborsOfParticle)
int KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName(int const index, KIM_ComputeArgumentName *const computeArgumentName)
Get the identity of each defined standard ComputeArgumentName.
#define NAMESTRLEN
void KIM_MODEL_ROUTINE_NAME_GetNumberOfModelRoutineNames(int *const numberOfModelRoutineNames)
Get the number of standard ModelRoutineName&#39;s defined by the KIM API.
void KIM_Model_Destroy(KIM_Model **const model)
Destroy a previously Model::Create&#39;d object.
int KIM_ComputeArguments_GetArgumentSupportStatus(KIM_ComputeArguments const *const computeArguments, KIM_ComputeArgumentName const computeArgumentName, KIM_SupportStatus *const supportStatus)
Get the SupportStatus of a ComputeArgumentName.
An Extensible Enumeration for the ModelRoutineName&#39;s supported by the KIM API.
#define FCCSPACING
KIM_TemperatureUnit const KIM_TEMPERATURE_UNIT_K
The standard Kelvin unit of temperature.
KIM_SupportStatus const KIM_SUPPORT_STATUS_required
The standard required status.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Create
The standard Create routine.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_partialForces
The standard partialForces argument.
int KIM_ComputeArguments_SetArgumentPointerDouble(KIM_ComputeArguments *const computeArguments, KIM_ComputeArgumentName const computeArgumentName, double const *const ptr)
Set the data pointer for a ComputeArgumentName.
void KIM_Model_GetInfluenceDistance(KIM_Model const *const model, double *const influenceDistance)
Get the Model&#39;s influence distance.
#define NCLUSTERPARTS
int KIM_Model_ComputeArgumentsCreate(KIM_Model const *const model, KIM_ComputeArguments **const computeArguments)
Create a new ComputeArguments object for the Model object.
int KIM_ComputeArguments_SetCallbackPointer(KIM_ComputeArguments *const computeArguments, KIM_ComputeCallbackName const computeCallbackName, KIM_LanguageName const languageName, KIM_Function *const fptr, void *const dataObject)
Set the function pointer for a ComputeCallbackName.
int KIM_SupportStatus_Equal(KIM_SupportStatus const lhs, KIM_SupportStatus const rhs)
Compares SupportStatus objects for equality.
KIM_LengthUnit const KIM_LENGTH_UNIT_A
The standard angstrom unit of length.
KIM_TimeUnit const KIM_TIME_UNIT_ps
The standard picosecond unit of time.
int KIM_ComputeArgumentName_NotEqual(KIM_ComputeArgumentName const lhs, KIM_ComputeArgumentName const rhs)
Compares ComputeArgumentName objects for inequality.
int KIM_ComputeArgumentName_Equal(KIM_ComputeArgumentName const lhs, KIM_ComputeArgumentName const rhs)
Compares ComputeArgumentName objects for equality.
#define TRUE
void() KIM_Function(void)
Generic function type.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_ComputeArgumentsCreate
The standard ComputeArgumentsCreate routine.
int KIM_Model_GetSpeciesSupportAndCode(KIM_Model const *const model, KIM_SpeciesName const speciesName, int *const speciesIsSupported, int *const code)
Get the Model&#39;s support and code for the requested SpeciesName.
#define MY_WARNING(message)
struct KIM_ComputeArguments KIM_ComputeArguments
Provides the primary interface to a KIM API ComputeArguments object and is meant to be used by simula...
LengthUnit const m
The standard meter unit of length.
struct KIM_Model KIM_Model
Provides the primary interface to a KIM API Model object and is meant to be used by simulators...
Definition: KIM_Model.h:160
void KIM_COMPUTE_CALLBACK_NAME_GetNumberOfComputeCallbackNames(int *const numberOfComputeCallbackNames)
KIM_LanguageName const KIM_LANGUAGE_NAME_c
The standard c language.
An Extensible Enumeration for the ComputeCallbackName&#39;s supported by the KIM API. ...
KIM_SupportStatus const KIM_SUPPORT_STATUS_optional
The standard optional status.
#define NCELLSPERSIDE
An Extensible Enumeration for the ComputeArgumentName&#39;s supported by the KIM API. ...
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_partialEnergy
The standard partialEnergy argument.
int KIM_ComputeArguments_GetCallbackSupportStatus(KIM_ComputeArguments const *const computeArguments, KIM_ComputeCallbackName const computeCallbackName, KIM_SupportStatus *const supportStatus)
Get the SupportStatus of a ComputeCallbackName.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_particleContributing
The standard particleContributing argument.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Refresh
The standard Refresh routine.
int main()
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_coordinates
The standard coordinates argument.
An Extensible Enumeration for the SupportStatus&#39;s supported by the KIM API.
void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double *coords)
KIM_Numbering const KIM_NUMBERING_zeroBased
The standard zeroBased numbering.
#define MY_ERROR(message)
ComputeArgumentName const numberOfParticles
The standard numberOfParticles argument.
int KIM_ComputeArguments_SetArgumentPointerInteger(KIM_ComputeArguments *const computeArguments, KIM_ComputeArgumentName const computeArgumentName, int const *const ptr)
Set the data pointer for a ComputeArgumentName.
#define FALSE
SupportStatus const required
The standard required status.
int KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName(int const index, KIM_ComputeCallbackName *const computeCallbackName)
Get the identity of each defined standard ComputeCallbackName.
void KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames(int *const numberOfComputeArgumentNames)
Get the number of standard ComputeArgumentName&#39;s defined by the KIM API.
void KIM_Model_GetNeighborListPointers(KIM_Model const *const model, int *const numberOfNeighborLists, double const **const cutoffs, int const **const modelWillNotRequestNeighborsOfNoncontributingParticles)
Get the Model&#39;s neighbor list information.
int KIM_Model_ComputeArgumentsDestroy(KIM_Model const *const model, KIM_ComputeArguments **const computeArguments)
Destroy a previously Model::ComputeArgumentsCreate&#39;d object.
KIM_ComputeCallbackName const KIM_COMPUTE_CALLBACK_NAME_GetNeighborList
The standard GetNeighborList callback.
LogVerbosity const error
The standard error verbosity.
void fcc_cluster_neighborlist(int half, int numberOfParticles, double *coords, double cutoff, NeighList *nl)
int KIM_Model_Compute(KIM_Model const *const model, KIM_ComputeArguments const *const computeArguments)
Call the Model&#39;s MODEL_ROUTINE_NAME::Compute routine.
KIM_EnergyUnit const KIM_ENERGY_UNIT_eV
The standard electronvolt unit of energy.
KIM_SpeciesName const KIM_SPECIES_NAME_Ar
The standard Argon species.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_particleSpeciesCodes
The standard particleSpeciesCodes argument.
#define DIM
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles
The standard numberOfParticles argument.
int KIM_ModelRoutineName_Equal(KIM_ModelRoutineName const lhs, KIM_ModelRoutineName const rhs)
Compares ModelRoutineName objects for equality.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_ComputeArgumentsDestroy
The standard ComputeArgumentsDestroy routine.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Compute
The standard Compute routine.