kim-api  2.2.1+v2.2.1.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  *
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--2020, 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 #define NAMESTRFMT "%127s"
43 
44 #define FCCSPACING 5.260
45 #define DIM 3
46 #define NCELLSPERSIDE 2
47 #define NCLUSTERPARTS \
48  (4 * (NCELLSPERSIDE * NCELLSPERSIDE * NCELLSPERSIDE) \
49  + 6 * (NCELLSPERSIDE * NCELLSPERSIDE) + 3 * (NCELLSPERSIDE) + 1)
50 
51 
52 #define MY_ERROR(message) \
53  { \
54  printf("* Error : \"%s\" %d:%s\n", message, __LINE__, __FILE__); \
55  exit(1); \
56  }
57 
58 #define MY_WARNING(message) \
59  { \
60  printf("* WARNING : \"%s\" %d:%s\n", message, __LINE__, __FILE__); \
61  }
62 
63 /* Define neighborlist structure */
64 typedef struct
65 {
66  double cutoff;
68  int * NNeighbors;
69  int * neighborList;
70 } NeighList;
71 
72 /* Define prototypes */
73 void fcc_cluster_neighborlist(int half,
75  double * coords,
76  double cutoff,
77  NeighList * nl);
78 
79 int get_cluster_neigh(void * const dataObject,
80  int const numberOfNeighborLists,
81  double const * const cutoffs,
82  int const neighborListIndex,
83  int const particleNumber,
84  int * const numberOfNeighbors,
85  int const ** const neighborsOfParticle);
86 
87 void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double * coords);
88 
89 
90 /* Main program */
91 int main()
92 {
93  /* Local variable declarations */
94  double const MinSpacing = 0.8 * FCCSPACING;
95  double const MaxSpacing = 1.2 * FCCSPACING;
96  double const SpacingIncr = 0.025 * FCCSPACING;
97  double CurrentSpacing;
98  double cutpad = 0.75; /* Angstroms */
99  double force_norm;
100  int i;
101  int error;
102 
103 
104  /* KIM variable declarations */
105  KIM_Model * model;
106  /* model inputs */
107  int numberOfParticles_cluster = NCLUSTERPARTS;
108  int speciesIsSupported;
109  int particleSpecies_cluster_model[NCLUSTERPARTS];
110  int particleContributing_cluster_model[NCLUSTERPARTS];
111  double coords_cluster[NCLUSTERPARTS][DIM];
112  NeighList nl_cluster_model;
113  /* model outputs */
114  int number_of_neighbor_lists_cluster_model;
115  double influence_distance_cluster_model;
116  double const * cutoff_cluster_model;
117  double energy_cluster_model = 0.0;
118  double forces_cluster[NCLUSTERPARTS * DIM];
119 
120  char modelname[NAMESTRLEN];
121  int requestedUnitsAccepted;
122  int numberOfModelRoutineNames;
123  KIM_ModelRoutineName modelRoutineName;
124  int present;
125  int required;
126  int modelArCode;
127  int numberOfComputeArgumentNames;
128  KIM_ComputeArguments * computeArguments;
129  KIM_ComputeArgumentName computeArgumentName;
130  KIM_SupportStatus supportStatus;
131  int numberOfComputeCallbackNames;
132  KIM_ComputeCallbackName computeCallbackName;
133 
134  /* Get KIM Model names */
135  printf("Please enter valid KIM Model name: \n");
136  error = scanf(NAMESTRFMT, modelname);
137  if (1 != error) { MY_ERROR("Unable to read model name"); }
138 
139  /* initialize the model */
146  modelname,
147  &requestedUnitsAccepted,
148  &model);
149  if (error) MY_ERROR("KIM_create_model_interface()");
150 
151  /* Check for compatibility with the model */
152  if (!requestedUnitsAccepted) MY_ERROR("Must adapt to model units");
153 
154  /* Check that we know about all required routines */
156  &numberOfModelRoutineNames);
157  for (i = 0; i < numberOfModelRoutineNames; ++i)
158  {
159  KIM_MODEL_ROUTINE_NAME_GetModelRoutineName(i, &modelRoutineName);
160 
162  model, modelRoutineName, &present, &required);
163  if (error) { MY_ERROR("Unable to get ModelRoutineName."); }
164 
165  if ((present == TRUE) && (required == TRUE))
166  {
167  if (!(KIM_ModelRoutineName_Equal(modelRoutineName,
171  || KIM_ModelRoutineName_Equal(modelRoutineName,
173  || KIM_ModelRoutineName_Equal(modelRoutineName,
176  modelRoutineName,
178  || KIM_ModelRoutineName_Equal(modelRoutineName,
180  {
181  MY_ERROR("Unknown required ModelRoutineName found.");
182  }
183  }
184  }
185 
186  /* check species */
188  model, KIM_SPECIES_NAME_Ar, &speciesIsSupported, &modelArCode);
189  if ((error) || (!speciesIsSupported))
190  {
191  MY_ERROR("Species Ar not supported");
192  }
193 
194  error = KIM_Model_ComputeArgumentsCreate(model, &computeArguments);
195  if (error) { MY_ERROR("KIM_Model_ComputeArgumentsCreate"); }
196 
197  /* check arguments */
199  &numberOfComputeArgumentNames);
200  for (i = 0; i < numberOfComputeArgumentNames; ++i)
201  {
203  i, &computeArgumentName);
204  if (error) MY_ERROR("can't get argument name");
206  computeArguments, computeArgumentName, &supportStatus);
207  if (error) MY_ERROR("can't get argument supportStatus");
208 
209  /* can only handle energy and force as a required arg */
211  {
213  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialEnergy))
215  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)))
216  {
217  MY_ERROR("unsupported required argument");
218  }
219  }
220 
221  /* must have energy and forces */
222  if ((KIM_ComputeArgumentName_Equal(computeArgumentName,
225  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)))
226  {
227  if (!((KIM_SupportStatus_Equal(supportStatus,
229  || (KIM_SupportStatus_Equal(supportStatus,
231  {
232  MY_ERROR("energy or forces not available");
233  }
234  }
235  }
236 
237  /* check call backs */
239  &numberOfComputeCallbackNames);
240  for (i = 0; i < numberOfComputeCallbackNames; ++i)
241  {
243  i, &computeCallbackName);
244  if (error) MY_ERROR("can't get call back name");
246  computeArguments, computeCallbackName, &supportStatus);
247  if (error) MY_ERROR("can't get call back supportStatus");
248 
249  /* cannot handle any "required" call backs */
251  {
252  MY_ERROR("unsupported required call back");
253  }
254  }
255 
256  /* We're compatible with the model. Let's do it. */
257 
259  computeArguments,
261  &numberOfParticles_cluster)
263  computeArguments,
265  particleSpecies_cluster_model)
267  computeArguments,
269  particleContributing_cluster_model)
271  computeArguments,
273  (double *) &coords_cluster)
275  computeArguments,
277  &energy_cluster_model)
279  computeArguments,
281  (double *) &forces_cluster);
282  if (error) MY_ERROR("KIM_setm_data");
284  computeArguments,
288  &nl_cluster_model);
289 
290  KIM_Model_GetInfluenceDistance(model, &influence_distance_cluster_model);
292  &number_of_neighbor_lists_cluster_model,
293  &cutoff_cluster_model,
294  NULL); /* ignoring hint */
295  if (number_of_neighbor_lists_cluster_model != 1)
296  MY_ERROR("too many neighbor lists");
297 
298  /* setup particleSpecies */
299  error
302  &speciesIsSupported,
303  &(particleSpecies_cluster_model[0]));
304  if (error) MY_ERROR("KIM_get_species_code");
305  for (i = 1; i < NCLUSTERPARTS; ++i)
306  particleSpecies_cluster_model[i] = particleSpecies_cluster_model[0];
307 
308  /* setup particleContributing */
309  for (i = 0; i < NCLUSTERPARTS; ++i)
310  {
311  particleContributing_cluster_model[i] = 1; /* all particles contribute */
312  }
313 
314  /* setup neighbor lists */
315  /* allocate memory for list */
316  nl_cluster_model.numberOfParticles = NCLUSTERPARTS;
317  nl_cluster_model.NNeighbors = (int *) malloc(NCLUSTERPARTS * sizeof(int));
318  if (NULL == nl_cluster_model.NNeighbors) MY_ERROR("malloc unsuccessful");
319 
320  nl_cluster_model.neighborList
321  = (int *) malloc(NCLUSTERPARTS * NCLUSTERPARTS * sizeof(int));
322  if (NULL == nl_cluster_model.neighborList) MY_ERROR("malloc unsuccessful");
323 
324  /* ready to compute */
325  printf("This is Test : ex_test_Ar_fcc_cluster\n");
326  printf("---------------------------------------------------------------------"
327  "-----------\n");
328  printf("Results for KIM Model : %s\n", modelname);
329 
330  printf("%20s, %20s, %20s\n", "Energy", "Force Norm", "Lattice Spacing");
331  for (CurrentSpacing = MinSpacing; CurrentSpacing < MaxSpacing;
332  CurrentSpacing += SpacingIncr)
333  {
334  /* update coordinates for cluster */
335  create_FCC_cluster(CurrentSpacing, NCELLSPERSIDE, &(coords_cluster[0][0]));
336  /* compute neighbor lists */
338  NCLUSTERPARTS,
339  &(coords_cluster[0][0]),
340  (*cutoff_cluster_model + cutpad),
341  &nl_cluster_model);
342 
343  /* call compute functions */
344  error = KIM_Model_Compute(model, computeArguments);
345  if (error) MY_ERROR("KIM_model_compute");
346 
347  /* compute force norm */
348  force_norm = 0.0;
349  for (i = 0; i < DIM * numberOfParticles_cluster; ++i)
350  {
351  force_norm += forces_cluster[i] * forces_cluster[i];
352  }
353  force_norm = sqrt(force_norm);
354 
355  /* print the results */
356  printf("%20.10e, %20.10e, %20.10e\n",
357  energy_cluster_model,
358  force_norm,
359  CurrentSpacing);
360  }
361 
362  error = KIM_Model_ComputeArgumentsDestroy(model, &computeArguments);
363  if (error) { MY_ERROR("Unable to destroy compute arguments"); }
364 
365  /* free memory of neighbor lists */
366  free(nl_cluster_model.NNeighbors);
367  free(nl_cluster_model.neighborList);
368 
369  /* free pkim objects */
370  KIM_Model_Destroy(&model);
371 
372  /* everything is great */
373  return 0;
374 }
375 
376 void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double * coords)
377 {
378  /* local variables */
379  double FCCshifts[4][DIM];
380  double latVec[DIM];
381  int a;
382  int i;
383  int j;
384  int k;
385  int m;
386  int n;
387 
388  /* create a cubic FCC cluster of parts */
389  FCCshifts[0][0] = 0.0;
390  FCCshifts[0][1] = 0.0;
391  FCCshifts[0][2] = 0.0;
392  FCCshifts[1][0] = 0.5 * FCCspacing;
393  FCCshifts[1][1] = 0.5 * FCCspacing;
394  FCCshifts[1][2] = 0.0;
395  FCCshifts[2][0] = 0.5 * FCCspacing;
396  FCCshifts[2][1] = 0.0;
397  FCCshifts[2][2] = 0.5 * FCCspacing;
398  FCCshifts[3][0] = 0.0;
399  FCCshifts[3][1] = 0.5 * FCCspacing;
400  FCCshifts[3][2] = 0.5 * FCCspacing;
401 
402  a = 0;
403  for (i = 0; i < nCellsPerSide; ++i)
404  {
405  latVec[0] = ((double) i) * FCCspacing;
406  for (j = 0; j < nCellsPerSide; ++j)
407  {
408  latVec[1] = ((double) j) * FCCspacing;
409  for (k = 0; k < nCellsPerSide; ++k)
410  {
411  latVec[2] = ((double) k) * FCCspacing;
412  for (m = 0; m < 4; ++m)
413  {
414  for (n = 0; n < DIM; ++n)
415  {
416  coords[a * DIM + n] = latVec[n] + FCCshifts[m][n];
417  }
418  a++;
419  }
420  }
421  /* add in the remaining three faces */
422  /* pos-x face */
423  latVec[0] = NCELLSPERSIDE * FCCspacing;
424  latVec[1] = ((double) i) * FCCspacing;
425  latVec[2] = ((double) j) * FCCspacing;
426  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
427  a++;
428  for (n = 0; n < DIM; ++n)
429  {
430  coords[a * DIM + n] = latVec[n] + FCCshifts[3][n];
431  }
432  a++;
433  /* pos-y face */
434  latVec[0] = ((double) i) * FCCspacing;
435  latVec[1] = NCELLSPERSIDE * FCCspacing;
436  latVec[2] = ((double) j) * FCCspacing;
437  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
438  a++;
439  for (n = 0; n < DIM; ++n)
440  {
441  coords[a * DIM + n] = latVec[n] + FCCshifts[2][n];
442  }
443  a++;
444  /* pos-z face */
445  latVec[0] = ((double) i) * FCCspacing;
446  latVec[1] = ((double) j) * FCCspacing;
447  latVec[2] = NCELLSPERSIDE * FCCspacing;
448  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
449  a++;
450  for (n = 0; n < DIM; ++n)
451  {
452  coords[a * DIM + n] = latVec[n] + FCCshifts[1][n];
453  }
454  a++;
455  }
456  /* add in the remaining three edges */
457  latVec[0] = ((double) i) * FCCspacing;
458  latVec[1] = NCELLSPERSIDE * 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] = ((double) i) * FCCspacing;
464  latVec[2] = NCELLSPERSIDE * FCCspacing;
465  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
466  a++;
467  latVec[0] = NCELLSPERSIDE * FCCspacing;
468  latVec[1] = NCELLSPERSIDE * FCCspacing;
469  latVec[2] = ((double) i) * FCCspacing;
470  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
471  a++;
472  }
473  /* add in the remaining corner */
474  for (n = 0; n < DIM; ++n)
475  {
476  coords[a * DIM + n] = NCELLSPERSIDE * FCCspacing;
477  }
478  a++;
479 
480  return;
481 }
482 
483 
485  int numberOfParticles,
486  double * coords,
487  double cutoff,
488  NeighList * nl)
489 {
490  /* local variables */
491  int i;
492  int j;
493  int k;
494  int a;
495 
496  double dx[DIM];
497  double r2;
498  double cutoff2;
499 
500  nl->cutoff = cutoff;
501 
502  cutoff2 = cutoff * cutoff;
503 
504  for (i = 0; i < numberOfParticles; ++i)
505  {
506  a = 0;
507  for (j = 0; j < numberOfParticles; ++j)
508  {
509  r2 = 0.0;
510  for (k = 0; k < DIM; ++k)
511  {
512  dx[k] = coords[j * DIM + k] - coords[i * DIM + k];
513  r2 += dx[k] * dx[k];
514  }
515 
516  if (r2 < cutoff2)
517  {
518  if ((half && i < j) || (!half && i != j))
519  {
520  /* part j is a neighbor of part i */
521  (*nl).neighborList[i * NCLUSTERPARTS + a] = j;
522  a++;
523  }
524  }
525  }
526  /* part i has `a' neighbors */
527  (*nl).NNeighbors[i] = a;
528  }
529 
530  return;
531 }
532 
533 int get_cluster_neigh(void * const dataObject,
534  int const numberOfNeighborLists,
535  double const * const cutoffs,
536  int const neighborListIndex,
537  int const particleNumber,
538  int * const numberOfNeighbors,
539  int const ** const neighborsOfParticle)
540 {
541  /* local variables */
542  int error = TRUE;
543  NeighList * nl = (NeighList *) dataObject;
545 
546  if ((numberOfNeighborLists != 1) || (cutoffs[0] > nl->cutoff)) return error;
547 
548  if (neighborListIndex != 0) return error;
549 
550  /* initialize numNeigh */
551  *numberOfNeighbors = 0;
552 
553  if ((particleNumber >= numberOfParticles)
554  || (particleNumber < 0)) /* invalid id */
555  {
556  MY_WARNING("Invalid part ID in get_cluster_neigh");
557  return TRUE;
558  }
559 
560  /* set the returned number of neighbors for the returned part */
561  *numberOfNeighbors = (*nl).NNeighbors[particleNumber];
562 
563  /* set the location for the returned neighbor list */
564  *neighborsOfParticle
565  = &((*nl).neighborList[(particleNumber) *numberOfParticles]);
566 
567  return FALSE;
568 }
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:160
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.