kim-api  2.3.1-git+v2.3.0-git-2-g378406f9.GNU.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  * KIM-API: An API for interatomic models
3  * Copyright (c) 2013--2022, Regents of the University of Minnesota.
4  * All rights reserved.
5  *
6  * Contributors:
7  * Ryan S. Elliott
8  * Stephen M. Whalen
9  *
10  * SPDX-License-Identifier: LGPL-2.1-or-later
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this library; if not, write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  */
26 
27 
28 #include "KIM_SimulatorHeaders.h"
29 #include <math.h>
30 #include <stdio.h>
31 #include <stdlib.h>
32 
33 #define TRUE 1
34 #define FALSE 0
35 
36 #define NAMESTRLEN 128
37 #define NAMESTRFMT "%127s"
38 
39 #define FCCSPACING 5.260
40 #define DIM 3
41 #define NCELLSPERSIDE 2
42 #define NCLUSTERPARTS \
43  (4 * (NCELLSPERSIDE * NCELLSPERSIDE * NCELLSPERSIDE) \
44  + 6 * (NCELLSPERSIDE * NCELLSPERSIDE) + 3 * (NCELLSPERSIDE) + 1)
45 
46 
47 #define MY_ERROR(message) \
48  { \
49  printf("* Error : \"%s\" %d:%s\n", message, __LINE__, __FILE__); \
50  exit(1); \
51  }
52 
53 #define MY_WARNING(message) \
54  { \
55  printf("* WARNING : \"%s\" %d:%s\n", message, __LINE__, __FILE__); \
56  }
57 
58 /* Define neighborlist structure */
59 typedef struct
60 {
61  double cutoff;
63  int * NNeighbors;
64  int * neighborList;
65 } NeighList;
66 
67 /* Define prototypes */
68 void fcc_cluster_neighborlist(int half,
70  double * coords,
71  double cutoff,
72  NeighList * nl);
73 
74 int get_cluster_neigh(void * const dataObject,
75  int const numberOfNeighborLists,
76  double const * const cutoffs,
77  int const neighborListIndex,
78  int const particleNumber,
79  int * const numberOfNeighbors,
80  int const ** const neighborsOfParticle);
81 
82 void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double * coords);
83 
84 
85 /* Main program */
86 int main()
87 {
88  /* Local variable declarations */
89  double const MinSpacing = 0.8 * FCCSPACING;
90  double const MaxSpacing = 1.2 * FCCSPACING;
91  double const SpacingIncr = 0.025 * FCCSPACING;
92  double CurrentSpacing;
93  double cutpad = 0.75; /* Angstroms */
94  double force_norm;
95  int i;
96  int error;
97 
98 
99  /* KIM variable declarations */
100  KIM_Model * model;
101  /* model inputs */
102  int numberOfParticles_cluster = NCLUSTERPARTS;
103  int speciesIsSupported;
104  int particleSpecies_cluster_model[NCLUSTERPARTS];
105  int particleContributing_cluster_model[NCLUSTERPARTS];
106  double coords_cluster[NCLUSTERPARTS][DIM];
107  NeighList nl_cluster_model;
108  /* model outputs */
109  int number_of_neighbor_lists_cluster_model;
110  double influence_distance_cluster_model;
111  double const * cutoff_cluster_model;
112  double energy_cluster_model = 0.0;
113  double forces_cluster[NCLUSTERPARTS * DIM];
114 
115  char modelname[NAMESTRLEN];
116  int requestedUnitsAccepted;
117  int numberOfModelRoutineNames;
118  KIM_ModelRoutineName modelRoutineName;
119  int present;
120  int required;
121  int modelArCode;
122  int numberOfComputeArgumentNames;
123  KIM_ComputeArguments * computeArguments;
124  KIM_ComputeArgumentName computeArgumentName;
125  KIM_SupportStatus supportStatus;
126  int numberOfComputeCallbackNames;
127  KIM_ComputeCallbackName computeCallbackName;
128 
129  /* Get KIM Model names */
130  printf("Please enter valid KIM Model name: \n");
131  error = scanf(NAMESTRFMT, modelname);
132  if (1 != error) { MY_ERROR("Unable to read model name"); }
133 
134  /* initialize the model */
141  modelname,
142  &requestedUnitsAccepted,
143  &model);
144  if (error) MY_ERROR("KIM_create_model_interface()");
145 
146  /* Check for compatibility with the model */
147  if (!requestedUnitsAccepted) MY_ERROR("Must adapt to model units");
148 
149  /* Check that we know about all required routines */
151  &numberOfModelRoutineNames);
152  for (i = 0; i < numberOfModelRoutineNames; ++i)
153  {
154  KIM_MODEL_ROUTINE_NAME_GetModelRoutineName(i, &modelRoutineName);
155 
157  model, modelRoutineName, &present, &required);
158  if (error) { MY_ERROR("Unable to get ModelRoutineName."); }
159 
160  if ((present == TRUE) && (required == TRUE))
161  {
162  if (!(KIM_ModelRoutineName_Equal(modelRoutineName,
166  || KIM_ModelRoutineName_Equal(modelRoutineName,
168  || KIM_ModelRoutineName_Equal(modelRoutineName,
171  modelRoutineName,
173  || KIM_ModelRoutineName_Equal(modelRoutineName,
175  {
176  MY_ERROR("Unknown required ModelRoutineName found.");
177  }
178  }
179  }
180 
181  /* check species */
183  model, KIM_SPECIES_NAME_Ar, &speciesIsSupported, &modelArCode);
184  if ((error) || (!speciesIsSupported))
185  {
186  MY_ERROR("Species Ar not supported");
187  }
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  {
212  MY_ERROR("unsupported required argument");
213  }
214  }
215 
216  /* must have energy and forces */
217  if ((KIM_ComputeArgumentName_Equal(computeArgumentName,
220  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)))
221  {
222  if (!((KIM_SupportStatus_Equal(supportStatus,
224  || (KIM_SupportStatus_Equal(supportStatus,
226  {
227  MY_ERROR("energy or forces not available");
228  }
229  }
230  }
231 
232  /* check call backs */
234  &numberOfComputeCallbackNames);
235  for (i = 0; i < numberOfComputeCallbackNames; ++i)
236  {
238  i, &computeCallbackName);
239  if (error) MY_ERROR("can't get call back name");
241  computeArguments, computeCallbackName, &supportStatus);
242  if (error) MY_ERROR("can't get call back supportStatus");
243 
244  /* cannot handle any "required" call backs */
246  {
247  MY_ERROR("unsupported required call back");
248  }
249  }
250 
251  /* We're compatible with the model. Let's do it. */
252 
254  computeArguments,
256  &numberOfParticles_cluster)
258  computeArguments,
260  particleSpecies_cluster_model)
262  computeArguments,
264  particleContributing_cluster_model)
266  computeArguments,
268  (double *) &coords_cluster)
270  computeArguments,
272  &energy_cluster_model)
274  computeArguments,
276  (double *) &forces_cluster);
277  if (error) MY_ERROR("KIM_setm_data");
279  computeArguments,
283  &nl_cluster_model);
284 
285  KIM_Model_GetInfluenceDistance(model, &influence_distance_cluster_model);
287  &number_of_neighbor_lists_cluster_model,
288  &cutoff_cluster_model,
289  NULL); /* ignoring hint */
290  if (number_of_neighbor_lists_cluster_model != 1)
291  MY_ERROR("too many neighbor lists");
292 
293  /* setup particleSpecies */
294  error
297  &speciesIsSupported,
298  &(particleSpecies_cluster_model[0]));
299  if (error) MY_ERROR("KIM_get_species_code");
300  for (i = 1; i < NCLUSTERPARTS; ++i)
301  particleSpecies_cluster_model[i] = particleSpecies_cluster_model[0];
302 
303  /* setup particleContributing */
304  for (i = 0; i < NCLUSTERPARTS; ++i)
305  {
306  particleContributing_cluster_model[i] = 1; /* all particles contribute */
307  }
308 
309  /* setup neighbor lists */
310  /* allocate memory for list */
311  nl_cluster_model.numberOfParticles = NCLUSTERPARTS;
312  nl_cluster_model.NNeighbors = (int *) malloc(NCLUSTERPARTS * sizeof(int));
313  if (NULL == nl_cluster_model.NNeighbors) MY_ERROR("malloc unsuccessful");
314 
315  nl_cluster_model.neighborList
316  = (int *) malloc(NCLUSTERPARTS * NCLUSTERPARTS * sizeof(int));
317  if (NULL == nl_cluster_model.neighborList) MY_ERROR("malloc unsuccessful");
318 
319  /* ready to compute */
320  printf("This is Test : ex_test_Ar_fcc_cluster\n");
321  printf("---------------------------------------------------------------------"
322  "-----------\n");
323  printf("Results for KIM Model : %s\n", modelname);
324 
325  printf("%20s, %20s, %20s\n", "Energy", "Force Norm", "Lattice Spacing");
326  for (CurrentSpacing = MinSpacing; CurrentSpacing < MaxSpacing;
327  CurrentSpacing += SpacingIncr)
328  {
329  /* update coordinates for cluster */
330  create_FCC_cluster(CurrentSpacing, NCELLSPERSIDE, &(coords_cluster[0][0]));
331  /* compute neighbor lists */
333  NCLUSTERPARTS,
334  &(coords_cluster[0][0]),
335  (*cutoff_cluster_model + cutpad),
336  &nl_cluster_model);
337 
338  /* call compute functions */
339  error = KIM_Model_Compute(model, computeArguments);
340  if (error) MY_ERROR("KIM_model_compute");
341 
342  /* compute force norm */
343  force_norm = 0.0;
344  for (i = 0; i < DIM * numberOfParticles_cluster; ++i)
345  {
346  force_norm += forces_cluster[i] * forces_cluster[i];
347  }
348  force_norm = sqrt(force_norm);
349 
350  /* print the results */
351  printf("%20.10e, %20.10e, %20.10e\n",
352  energy_cluster_model,
353  force_norm,
354  CurrentSpacing);
355  }
356 
357  error = KIM_Model_ComputeArgumentsDestroy(model, &computeArguments);
358  if (error) { MY_ERROR("Unable to destroy compute arguments"); }
359 
360  /* free memory of neighbor lists */
361  free(nl_cluster_model.NNeighbors);
362  free(nl_cluster_model.neighborList);
363 
364  /* free pkim objects */
365  KIM_Model_Destroy(&model);
366 
367  /* everything is great */
368  return 0;
369 }
370 
371 void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double * coords)
372 {
373  /* local variables */
374  double FCCshifts[4][DIM];
375  double latVec[DIM];
376  int a;
377  int i;
378  int j;
379  int k;
380  int m;
381  int n;
382 
383  /* create a cubic FCC cluster of parts */
384  FCCshifts[0][0] = 0.0;
385  FCCshifts[0][1] = 0.0;
386  FCCshifts[0][2] = 0.0;
387  FCCshifts[1][0] = 0.5 * FCCspacing;
388  FCCshifts[1][1] = 0.5 * FCCspacing;
389  FCCshifts[1][2] = 0.0;
390  FCCshifts[2][0] = 0.5 * FCCspacing;
391  FCCshifts[2][1] = 0.0;
392  FCCshifts[2][2] = 0.5 * FCCspacing;
393  FCCshifts[3][0] = 0.0;
394  FCCshifts[3][1] = 0.5 * FCCspacing;
395  FCCshifts[3][2] = 0.5 * FCCspacing;
396 
397  a = 0;
398  for (i = 0; i < nCellsPerSide; ++i)
399  {
400  latVec[0] = ((double) i) * FCCspacing;
401  for (j = 0; j < nCellsPerSide; ++j)
402  {
403  latVec[1] = ((double) j) * FCCspacing;
404  for (k = 0; k < nCellsPerSide; ++k)
405  {
406  latVec[2] = ((double) k) * FCCspacing;
407  for (m = 0; m < 4; ++m)
408  {
409  for (n = 0; n < DIM; ++n)
410  {
411  coords[a * DIM + n] = latVec[n] + FCCshifts[m][n];
412  }
413  a++;
414  }
415  }
416  /* add in the remaining three faces */
417  /* pos-x face */
418  latVec[0] = NCELLSPERSIDE * FCCspacing;
419  latVec[1] = ((double) i) * FCCspacing;
420  latVec[2] = ((double) j) * FCCspacing;
421  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
422  a++;
423  for (n = 0; n < DIM; ++n)
424  {
425  coords[a * DIM + n] = latVec[n] + FCCshifts[3][n];
426  }
427  a++;
428  /* pos-y face */
429  latVec[0] = ((double) i) * FCCspacing;
430  latVec[1] = NCELLSPERSIDE * FCCspacing;
431  latVec[2] = ((double) j) * FCCspacing;
432  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
433  a++;
434  for (n = 0; n < DIM; ++n)
435  {
436  coords[a * DIM + n] = latVec[n] + FCCshifts[2][n];
437  }
438  a++;
439  /* pos-z face */
440  latVec[0] = ((double) i) * FCCspacing;
441  latVec[1] = ((double) j) * FCCspacing;
442  latVec[2] = NCELLSPERSIDE * FCCspacing;
443  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
444  a++;
445  for (n = 0; n < DIM; ++n)
446  {
447  coords[a * DIM + n] = latVec[n] + FCCshifts[1][n];
448  }
449  a++;
450  }
451  /* add in the remaining three edges */
452  latVec[0] = ((double) i) * FCCspacing;
453  latVec[1] = NCELLSPERSIDE * FCCspacing;
454  latVec[2] = NCELLSPERSIDE * FCCspacing;
455  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
456  a++;
457  latVec[0] = NCELLSPERSIDE * FCCspacing;
458  latVec[1] = ((double) i) * FCCspacing;
459  latVec[2] = NCELLSPERSIDE * FCCspacing;
460  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
461  a++;
462  latVec[0] = NCELLSPERSIDE * FCCspacing;
463  latVec[1] = NCELLSPERSIDE * FCCspacing;
464  latVec[2] = ((double) i) * FCCspacing;
465  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
466  a++;
467  }
468  /* add in the remaining corner */
469  for (n = 0; n < DIM; ++n)
470  {
471  coords[a * DIM + n] = NCELLSPERSIDE * FCCspacing;
472  }
473  a++;
474 
475  return;
476 }
477 
478 
480  int numberOfParticles,
481  double * coords,
482  double cutoff,
483  NeighList * nl)
484 {
485  /* local variables */
486  int i;
487  int j;
488  int k;
489  int a;
490 
491  double dx[DIM];
492  double r2;
493  double cutoff2;
494 
495  nl->cutoff = cutoff;
496 
497  cutoff2 = cutoff * cutoff;
498 
499  for (i = 0; i < numberOfParticles; ++i)
500  {
501  a = 0;
502  for (j = 0; j < numberOfParticles; ++j)
503  {
504  r2 = 0.0;
505  for (k = 0; k < DIM; ++k)
506  {
507  dx[k] = coords[j * DIM + k] - coords[i * DIM + k];
508  r2 += dx[k] * dx[k];
509  }
510 
511  if (r2 < cutoff2)
512  {
513  if ((half && i < j) || (!half && i != j))
514  {
515  /* part j is a neighbor of part i */
516  (*nl).neighborList[i * NCLUSTERPARTS + a] = j;
517  a++;
518  }
519  }
520  }
521  /* part i has `a' neighbors */
522  (*nl).NNeighbors[i] = a;
523  }
524 
525  return;
526 }
527 
528 int get_cluster_neigh(void * const dataObject,
529  int const numberOfNeighborLists,
530  double const * const cutoffs,
531  int const neighborListIndex,
532  int const particleNumber,
533  int * const numberOfNeighbors,
534  int const ** const neighborsOfParticle)
535 {
536  /* local variables */
537  int error = TRUE;
538  NeighList * nl = (NeighList *) dataObject;
540 
541  if ((numberOfNeighborLists != 1) || (cutoffs[0] > nl->cutoff)) return error;
542 
543  if (neighborListIndex != 0) return error;
544 
545  /* initialize numNeigh */
546  *numberOfNeighbors = 0;
547 
548  if ((particleNumber >= numberOfParticles)
549  || (particleNumber < 0)) /* invalid id */
550  {
551  MY_WARNING("Invalid part ID in get_cluster_neigh");
552  return TRUE;
553  }
554 
555  /* set the returned number of neighbors for the returned part */
556  *numberOfNeighbors = (*nl).NNeighbors[particleNumber];
557 
558  /* set the location for the returned neighbor list */
559  *neighborsOfParticle
560  = &((*nl).neighborList[(particleNumber) *numberOfParticles]);
561 
562  return FALSE;
563 }
struct KIM_ComputeArguments KIM_ComputeArguments
Provides the primary interface to a KIM API ComputeArguments object and is meant to be used by simula...
void KIM_Model_GetInfluenceDistance(KIM_Model const *const model, double *const influenceDistance)
Get the Model&#39;s influence distance.
int KIM_ComputeArgumentName_Equal(KIM_ComputeArgumentName const lhs, KIM_ComputeArgumentName const rhs)
Compares ComputeArgumentName objects for equality.
KIM_SupportStatus const KIM_SUPPORT_STATUS_optional
The standard optional status.
int KIM_ComputeArguments_GetCallbackSupportStatus(KIM_ComputeArguments const *const computeArguments, KIM_ComputeCallbackName const computeCallbackName, KIM_SupportStatus *const supportStatus)
Get the SupportStatus of a ComputeCallbackName.
void KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames(int *const numberOfComputeArgumentNames)
Get the number of standard ComputeArgumentName&#39;s defined by the KIM API.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_coordinates
The standard coordinates argument.
void KIM_COMPUTE_CALLBACK_NAME_GetNumberOfComputeCallbackNames(int *const numberOfComputeCallbackNames)
void KIM_MODEL_ROUTINE_NAME_GetNumberOfModelRoutineNames(int *const numberOfModelRoutineNames)
Get the number of standard ModelRoutineName&#39;s defined by the KIM API.
int main()
void() KIM_Function(void)
Generic function type.
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)
void KIM_Model_Destroy(KIM_Model **const model)
Destroy a previously Model::Create&#39;d object.
KIM_ChargeUnit const KIM_CHARGE_UNIT_e
The standard electron unit of charge.
void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double *coords)
An Extensible Enumeration for the ComputeArgumentName&#39;s supported by the KIM API. ...
KIM_LanguageName const KIM_LANGUAGE_NAME_c
The standard c language.
int KIM_ComputeArgumentName_NotEqual(KIM_ComputeArgumentName const lhs, KIM_ComputeArgumentName const rhs)
Compares ComputeArgumentName objects for inequality.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_partialForces
The standard partialForces argument.
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.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_ComputeArgumentsCreate
The standard ComputeArgumentsCreate routine.
int KIM_MODEL_ROUTINE_NAME_GetModelRoutineName(int const index, KIM_ModelRoutineName *const modelRoutineName)
Get the identity of each defined standard ModelRoutineName.
#define NAMESTRLEN
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_particleSpeciesCodes
The standard particleSpeciesCodes argument.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Compute
The standard Compute 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.
An Extensible Enumeration for the SupportStatus&#39;s supported by the KIM API.
#define FALSE
int KIM_ComputeArguments_SetArgumentPointerInteger(KIM_ComputeArguments *const computeArguments, KIM_ComputeArgumentName const computeArgumentName, int const *const ptr)
Set the data pointer for a ComputeArgumentName.
int KIM_ModelRoutineName_Equal(KIM_ModelRoutineName const lhs, KIM_ModelRoutineName const rhs)
Compares ModelRoutineName objects for equality.
KIM_SpeciesName const KIM_SPECIES_NAME_Ar
The standard Argon species.
#define NAMESTRFMT
SupportStatus const required
The standard required status.
#define TRUE
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_Model_ComputeArgumentsCreate(KIM_Model const *const model, KIM_ComputeArguments **const computeArguments)
Create a new ComputeArguments object for the Model object.
#define MY_WARNING(message)
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Destroy
The standard Destroy routine.
#define FCCSPACING
#define NCLUSTERPARTS
An Extensible Enumeration for the ModelRoutineName&#39;s supported by the KIM API.
LengthUnit const m
The standard meter unit of length.
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.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_numberOfParticles
The standard numberOfParticles argument.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Create
The standard Create routine.
void fcc_cluster_neighborlist(int half, int numberOfParticles, double *coords, double cutoff, NeighList *nl)
KIM_ComputeCallbackName const KIM_COMPUTE_CALLBACK_NAME_GetNeighborList
The standard GetNeighborList callback.
KIM_TimeUnit const KIM_TIME_UNIT_ps
The standard picosecond unit of time.
int KIM_ComputeArguments_SetArgumentPointerDouble(KIM_ComputeArguments *const computeArguments, KIM_ComputeArgumentName const computeArgumentName, double const *const ptr)
Set the data pointer for a ComputeArgumentName.
#define DIM
int KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName(int const index, KIM_ComputeCallbackName *const computeCallbackName)
Get the identity of each defined standard ComputeCallbackName.
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_ComputeArgumentsDestroy
The standard ComputeArgumentsDestroy routine.
An Extensible Enumeration for the ComputeCallbackName&#39;s supported by the KIM API. ...
int KIM_Model_ComputeArgumentsDestroy(KIM_Model const *const model, KIM_ComputeArguments **const computeArguments)
Destroy a previously Model::ComputeArgumentsCreate&#39;d object.
KIM_EnergyUnit const KIM_ENERGY_UNIT_eV
The standard electronvolt unit of energy.
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.
ComputeArgumentName const numberOfParticles
The standard numberOfParticles argument.
int KIM_Model_Compute(KIM_Model const *const model, KIM_ComputeArguments const *const computeArguments)
Call the Model&#39;s MODEL_ROUTINE_NAME::Compute routine.
int KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName(int const index, KIM_ComputeArgumentName *const computeArgumentName)
Get the identity of each defined standard ComputeArgumentName.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_partialEnergy
The standard partialEnergy argument.
#define MY_ERROR(message)
#define NCELLSPERSIDE
KIM_ModelRoutineName const KIM_MODEL_ROUTINE_NAME_Refresh
The standard Refresh routine.
KIM_SupportStatus const KIM_SUPPORT_STATUS_required
The standard required status.
int KIM_ComputeArguments_GetArgumentSupportStatus(KIM_ComputeArguments const *const computeArguments, KIM_ComputeArgumentName const computeArgumentName, KIM_SupportStatus *const supportStatus)
Get the SupportStatus of a ComputeArgumentName.
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:155
KIM_LengthUnit const KIM_LENGTH_UNIT_A
The standard angstrom unit of length.
LogVerbosity const error
The standard error verbosity.
KIM_TemperatureUnit const KIM_TEMPERATURE_UNIT_K
The standard Kelvin unit of temperature.
int KIM_SupportStatus_Equal(KIM_SupportStatus const lhs, KIM_SupportStatus const rhs)
Compares SupportStatus objects for equality.
KIM_Numbering const KIM_NUMBERING_zeroBased
The standard zeroBased numbering.
KIM_ComputeArgumentName const KIM_COMPUTE_ARGUMENT_NAME_particleContributing
The standard particleContributing argument.