kim-api  2.1.2+v2.1.2.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 #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  { MY_ERROR("Unknown required ModelRoutineName found."); }
181  }
182  }
183 
184  /* check species */
186  model, KIM_SPECIES_NAME_Ar, &speciesIsSupported, &modelArCode);
187  if ((error) || (!speciesIsSupported))
188  { MY_ERROR("Species Ar not supported"); }
189 
190  error = KIM_Model_ComputeArgumentsCreate(model, &computeArguments);
191  if (error) { MY_ERROR("KIM_Model_ComputeArgumentsCreate"); }
192 
193  /* check arguments */
195  &numberOfComputeArgumentNames);
196  for (i = 0; i < numberOfComputeArgumentNames; ++i)
197  {
199  i, &computeArgumentName);
200  if (error) MY_ERROR("can't get argument name");
202  computeArguments, computeArgumentName, &supportStatus);
203  if (error) MY_ERROR("can't get argument supportStatus");
204 
205  /* can only handle energy and force as a required arg */
207  {
209  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialEnergy))
211  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)))
212  { MY_ERROR("unsupported required argument"); }
213  }
214 
215  /* must have energy and forces */
216  if ((KIM_ComputeArgumentName_Equal(computeArgumentName,
219  computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)))
220  {
221  if (!((KIM_SupportStatus_Equal(supportStatus,
223  || (KIM_SupportStatus_Equal(supportStatus,
225  { MY_ERROR("energy or forces not available"); }
226  }
227  }
228 
229  /* check call backs */
231  &numberOfComputeCallbackNames);
232  for (i = 0; i < numberOfComputeCallbackNames; ++i)
233  {
235  i, &computeCallbackName);
236  if (error) MY_ERROR("can't get call back name");
238  computeArguments, computeCallbackName, &supportStatus);
239  if (error) MY_ERROR("can't get call back supportStatus");
240 
241  /* cannot handle any "required" call backs */
243  { MY_ERROR("unsupported required call back"); }
244  }
245 
246  /* We're compatible with the model. Let's do it. */
247 
249  computeArguments,
251  &numberOfParticles_cluster)
253  computeArguments,
255  particleSpecies_cluster_model)
257  computeArguments,
259  particleContributing_cluster_model)
261  computeArguments,
263  (double *) &coords_cluster)
265  computeArguments,
267  &energy_cluster_model)
269  computeArguments,
271  (double *) &forces_cluster);
272  if (error) MY_ERROR("KIM_setm_data");
274  computeArguments,
278  &nl_cluster_model);
279 
280  KIM_Model_GetInfluenceDistance(model, &influence_distance_cluster_model);
282  &number_of_neighbor_lists_cluster_model,
283  &cutoff_cluster_model,
284  NULL); /* ignoring hint */
285  if (number_of_neighbor_lists_cluster_model != 1)
286  MY_ERROR("too many neighbor lists");
287 
288  /* setup particleSpecies */
289  error
292  &speciesIsSupported,
293  &(particleSpecies_cluster_model[0]));
294  if (error) MY_ERROR("KIM_get_species_code");
295  for (i = 1; i < NCLUSTERPARTS; ++i)
296  particleSpecies_cluster_model[i] = particleSpecies_cluster_model[0];
297 
298  /* setup particleContributing */
299  for (i = 0; i < NCLUSTERPARTS; ++i)
300  {
301  particleContributing_cluster_model[i] = 1; /* all particles contribute */
302  }
303 
304  /* setup neighbor lists */
305  /* allocate memory for list */
306  nl_cluster_model.numberOfParticles = NCLUSTERPARTS;
307  nl_cluster_model.NNeighbors = (int *) malloc(NCLUSTERPARTS * sizeof(int));
308  if (NULL == nl_cluster_model.NNeighbors) MY_ERROR("malloc unsuccessful");
309 
310  nl_cluster_model.neighborList
311  = (int *) malloc(NCLUSTERPARTS * NCLUSTERPARTS * sizeof(int));
312  if (NULL == nl_cluster_model.neighborList) MY_ERROR("malloc unsuccessful");
313 
314  /* ready to compute */
315  printf("This is Test : ex_test_Ar_fcc_cluster\n");
316  printf("---------------------------------------------------------------------"
317  "-----------\n");
318  printf("Results for KIM Model : %s\n", modelname);
319 
320  printf("%20s, %20s, %20s\n", "Energy", "Force Norm", "Lattice Spacing");
321  for (CurrentSpacing = MinSpacing; CurrentSpacing < MaxSpacing;
322  CurrentSpacing += SpacingIncr)
323  {
324  /* update coordinates for cluster */
325  create_FCC_cluster(CurrentSpacing, NCELLSPERSIDE, &(coords_cluster[0][0]));
326  /* compute neighbor lists */
328  NCLUSTERPARTS,
329  &(coords_cluster[0][0]),
330  (*cutoff_cluster_model + cutpad),
331  &nl_cluster_model);
332 
333  /* call compute functions */
334  error = KIM_Model_Compute(model, computeArguments);
335  if (error) MY_ERROR("KIM_model_compute");
336 
337  /* compute force norm */
338  force_norm = 0.0;
339  for (i = 0; i < DIM * numberOfParticles_cluster; ++i)
340  { force_norm += forces_cluster[i] * forces_cluster[i]; }
341  force_norm = sqrt(force_norm);
342 
343  /* print the results */
344  printf("%20.10e, %20.10e, %20.10e\n",
345  energy_cluster_model,
346  force_norm,
347  CurrentSpacing);
348  }
349 
350  error = KIM_Model_ComputeArgumentsDestroy(model, &computeArguments);
351  if (error) { MY_ERROR("Unable to destroy compute arguments"); }
352 
353  /* free memory of neighbor lists */
354  free(nl_cluster_model.NNeighbors);
355  free(nl_cluster_model.neighborList);
356 
357  /* free pkim objects */
358  KIM_Model_Destroy(&model);
359 
360  /* everything is great */
361  return 0;
362 }
363 
364 void create_FCC_cluster(double FCCspacing, int nCellsPerSide, double * coords)
365 {
366  /* local variables */
367  double FCCshifts[4][DIM];
368  double latVec[DIM];
369  int a;
370  int i;
371  int j;
372  int k;
373  int m;
374  int n;
375 
376  /* create a cubic FCC cluster of parts */
377  FCCshifts[0][0] = 0.0;
378  FCCshifts[0][1] = 0.0;
379  FCCshifts[0][2] = 0.0;
380  FCCshifts[1][0] = 0.5 * FCCspacing;
381  FCCshifts[1][1] = 0.5 * FCCspacing;
382  FCCshifts[1][2] = 0.0;
383  FCCshifts[2][0] = 0.5 * FCCspacing;
384  FCCshifts[2][1] = 0.0;
385  FCCshifts[2][2] = 0.5 * FCCspacing;
386  FCCshifts[3][0] = 0.0;
387  FCCshifts[3][1] = 0.5 * FCCspacing;
388  FCCshifts[3][2] = 0.5 * FCCspacing;
389 
390  a = 0;
391  for (i = 0; i < nCellsPerSide; ++i)
392  {
393  latVec[0] = ((double) i) * FCCspacing;
394  for (j = 0; j < nCellsPerSide; ++j)
395  {
396  latVec[1] = ((double) j) * FCCspacing;
397  for (k = 0; k < nCellsPerSide; ++k)
398  {
399  latVec[2] = ((double) k) * FCCspacing;
400  for (m = 0; m < 4; ++m)
401  {
402  for (n = 0; n < DIM; ++n)
403  { coords[a * DIM + n] = latVec[n] + FCCshifts[m][n]; }
404  a++;
405  }
406  }
407  /* add in the remaining three faces */
408  /* pos-x face */
409  latVec[0] = NCELLSPERSIDE * FCCspacing;
410  latVec[1] = ((double) i) * FCCspacing;
411  latVec[2] = ((double) j) * FCCspacing;
412  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
413  a++;
414  for (n = 0; n < DIM; ++n)
415  { coords[a * DIM + n] = latVec[n] + FCCshifts[3][n]; }
416  a++;
417  /* pos-y face */
418  latVec[0] = ((double) i) * FCCspacing;
419  latVec[1] = NCELLSPERSIDE * 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  { coords[a * DIM + n] = latVec[n] + FCCshifts[2][n]; }
425  a++;
426  /* pos-z face */
427  latVec[0] = ((double) i) * FCCspacing;
428  latVec[1] = ((double) j) * FCCspacing;
429  latVec[2] = NCELLSPERSIDE * FCCspacing;
430  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
431  a++;
432  for (n = 0; n < DIM; ++n)
433  { coords[a * DIM + n] = latVec[n] + FCCshifts[1][n]; }
434  a++;
435  }
436  /* add in the remaining three edges */
437  latVec[0] = ((double) i) * FCCspacing;
438  latVec[1] = NCELLSPERSIDE * FCCspacing;
439  latVec[2] = NCELLSPERSIDE * FCCspacing;
440  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
441  a++;
442  latVec[0] = NCELLSPERSIDE * FCCspacing;
443  latVec[1] = ((double) i) * FCCspacing;
444  latVec[2] = NCELLSPERSIDE * FCCspacing;
445  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
446  a++;
447  latVec[0] = NCELLSPERSIDE * FCCspacing;
448  latVec[1] = NCELLSPERSIDE * FCCspacing;
449  latVec[2] = ((double) i) * FCCspacing;
450  for (n = 0; n < DIM; ++n) { coords[a * DIM + n] = latVec[n]; }
451  a++;
452  }
453  /* add in the remaining corner */
454  for (n = 0; n < DIM; ++n)
455  { coords[a * DIM + n] = NCELLSPERSIDE * FCCspacing; }
456  a++;
457 
458  return;
459 }
460 
461 
463  int numberOfParticles,
464  double * coords,
465  double cutoff,
466  NeighList * nl)
467 {
468  /* local variables */
469  int i;
470  int j;
471  int k;
472  int a;
473 
474  double dx[DIM];
475  double r2;
476  double cutoff2;
477 
478  nl->cutoff = cutoff;
479 
480  cutoff2 = cutoff * cutoff;
481 
482  for (i = 0; i < numberOfParticles; ++i)
483  {
484  a = 0;
485  for (j = 0; j < numberOfParticles; ++j)
486  {
487  r2 = 0.0;
488  for (k = 0; k < DIM; ++k)
489  {
490  dx[k] = coords[j * DIM + k] - coords[i * DIM + k];
491  r2 += dx[k] * dx[k];
492  }
493 
494  if (r2 < cutoff2)
495  {
496  if ((half && i < j) || (!half && i != j))
497  {
498  /* part j is a neighbor of part i */
499  (*nl).neighborList[i * NCLUSTERPARTS + a] = j;
500  a++;
501  }
502  }
503  }
504  /* part i has `a' neighbors */
505  (*nl).NNeighbors[i] = a;
506  }
507 
508  return;
509 }
510 
511 int get_cluster_neigh(void * const dataObject,
512  int const numberOfNeighborLists,
513  double const * const cutoffs,
514  int const neighborListIndex,
515  int const particleNumber,
516  int * const numberOfNeighbors,
517  int const ** const neighborsOfParticle)
518 {
519  /* local variables */
520  int error = TRUE;
521  NeighList * nl = (NeighList *) dataObject;
523 
524  if ((numberOfNeighborLists != 1) || (cutoffs[0] > nl->cutoff)) return error;
525 
526  if (neighborListIndex != 0) return error;
527 
528  /* initialize numNeigh */
529  *numberOfNeighbors = 0;
530 
531  if ((particleNumber >= numberOfParticles)
532  || (particleNumber < 0)) /* invalid id */
533  {
534  MY_WARNING("Invalid part ID in get_cluster_neigh");
535  return TRUE;
536  }
537 
538  /* set the returned number of neighbors for the returned part */
539  *numberOfNeighbors = (*nl).NNeighbors[particleNumber];
540 
541  /* set the location for the returned neighbor list */
542  *neighborsOfParticle
543  = &((*nl).neighborList[(particleNumber) *numberOfParticles]);
544 
545  return FALSE;
546 }
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.