kim-api  2.3.0+v2.3.0.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_Model.h
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 /* */
9 /* SPDX-License-Identifier: LGPL-2.1-or-later */
10 /* */
11 /* This library is free software; you can redistribute it and/or */
12 /* modify it under the terms of the GNU Lesser General Public */
13 /* License as published by the Free Software Foundation; either */
14 /* version 2.1 of the License, or (at your option) any later version. */
15 /* */
16 /* This library is distributed in the hope that it will be useful, */
17 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
19 /* Lesser General Public License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with this library; if not, write to the Free Software Foundation, */
23 /* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
24 /* */
25 
26 /* */
27 /* Release: This file is part of the kim-api-2.3.0 package. */
28 /* */
29 
30 
31 #ifndef KIM_MODEL_H_
32 #define KIM_MODEL_H_
33 
34 /* Forward declarations */
35 #ifndef KIM_LOG_VERBOSITY_DEFINED_
36 #define KIM_LOG_VERBOSITY_DEFINED_
37 
43 #endif
44 
45 #ifndef KIM_DATA_TYPE_DEFINED_
46 #define KIM_DATA_TYPE_DEFINED_
47 
52 typedef struct KIM_DataType KIM_DataType;
53 #endif
54 
55 #ifndef KIM_MODEL_ROUTINE_NAME_DEFINED_
56 #define KIM_MODEL_ROUTINE_NAME_DEFINED_
57 
63 #endif
64 
65 #ifndef KIM_SPECIES_NAME_DEFINED_
66 #define KIM_SPECIES_NAME_DEFINED_
67 
73 #endif
74 
75 #ifndef KIM_NUMBERING_DEFINED_
76 #define KIM_NUMBERING_DEFINED_
77 
83 #endif
84 
85 #ifndef KIM_LENGTH_UNIT_DEFINED_
86 #define KIM_LENGTH_UNIT_DEFINED_
87 
93 #endif
94 
95 #ifndef KIM_ENERGY_UNIT_DEFINED_
96 #define KIM_ENERGY_UNIT_DEFINED_
97 
103 #endif
104 
105 #ifndef KIM_CHARGE_UNIT_DEFINED_
106 #define KIM_CHARGE_UNIT_DEFINED_
107 
113 #endif
114 
115 #ifndef KIM_TEMPERATURE_UNIT_DEFINED_
116 #define KIM_TEMPERATURE_UNIT_DEFINED_
117 
123 #endif
124 
125 #ifndef KIM_TIME_UNIT_DEFINED_
126 #define KIM_TIME_UNIT_DEFINED_
127 
132 typedef struct KIM_TimeUnit KIM_TimeUnit;
133 #endif
134 
135 #ifndef KIM_COMPUTE_ARGUMENTS_DEFINED_
136 #define KIM_COMPUTE_ARGUMENTS_DEFINED_
137 
143 #endif
144 
145 
146 #ifndef KIM_MODEL_DEFINED_
147 #define KIM_MODEL_DEFINED_
148 
155 typedef struct KIM_Model KIM_Model;
156 #endif
157 
165 int KIM_Model_Create(KIM_Numbering const numbering,
166  KIM_LengthUnit const requestedLengthUnit,
167  KIM_EnergyUnit const requestedEnergyUnit,
168  KIM_ChargeUnit const requestedChargeUnit,
169  KIM_TemperatureUnit const requestedTemperatureUnit,
170  KIM_TimeUnit const requestedTimeUnit,
171  char const * const modelName,
172  int * const requestedUnitsAccepted,
173  KIM_Model ** const model);
174 
182 void KIM_Model_Destroy(KIM_Model ** const model);
183 
191 int KIM_Model_IsRoutinePresent(KIM_Model const * const model,
192  KIM_ModelRoutineName const modelRoutineName,
193  int * const present,
194  int * const required);
195 
204 void KIM_Model_GetInfluenceDistance(KIM_Model const * const model,
205  double * const influenceDistance);
206 
217  KIM_Model const * const model,
218  int * const numberOfNeighborLists,
219  double const ** const cutoffs,
220  int const ** const modelWillNotRequestNeighborsOfNoncontributingParticles);
221 
229 void KIM_Model_GetUnits(KIM_Model const * const model,
230  KIM_LengthUnit * const lengthUnit,
231  KIM_EnergyUnit * const energyUnit,
232  KIM_ChargeUnit * const chargeUnit,
233  KIM_TemperatureUnit * const temperatureUnit,
234  KIM_TimeUnit * const timeUnit);
235 
245  KIM_Model const * const model,
246  KIM_ComputeArguments ** const computeArguments);
247 
257  KIM_Model const * const model,
258  KIM_ComputeArguments ** const computeArguments);
259 
267 int KIM_Model_Compute(KIM_Model const * const model,
268  KIM_ComputeArguments const * const computeArguments);
269 
277 int KIM_Model_Extension(KIM_Model * const model,
278  char const * const extensionID,
279  void * const extensionStructure);
280 
288 int KIM_Model_ClearThenRefresh(KIM_Model * const model);
289 
298 int KIM_Model_WriteParameterizedModel(KIM_Model const * const model,
299  char const * const path,
300  char const * const modelName);
301 
310 int KIM_Model_GetSpeciesSupportAndCode(KIM_Model const * const model,
311  KIM_SpeciesName const speciesName,
312  int * const speciesIsSupported,
313  int * const code);
314 
323 void KIM_Model_GetNumberOfParameters(KIM_Model const * const model,
324  int * const numberOfParameters);
325 
334 int KIM_Model_GetParameterMetadata(KIM_Model const * const model,
335  int const parameterIndex,
336  KIM_DataType * const dataType,
337  int * const extent,
338  char const ** const name,
339  char const ** const description);
340 
350 int KIM_Model_GetParameterInteger(KIM_Model const * const model,
351  int const parameterIndex,
352  int const arrayIndex,
353  int * const parameterValue);
354 
364 int KIM_Model_GetParameterDouble(KIM_Model const * const model,
365  int const parameterIndex,
366  int const arrayIndex,
367  double * const parameterValue);
368 
377 int KIM_Model_SetParameterInteger(KIM_Model * const model,
378  int const parameterIndex,
379  int const arrayIndex,
380  int const parameterValue);
381 
390 int KIM_Model_SetParameterDouble(KIM_Model * const model,
391  int const parameterIndex,
392  int const arrayIndex,
393  double const parameterValue);
394 
404  void * const ptr);
405 
414 void KIM_Model_GetSimulatorBufferPointer(KIM_Model const * const model,
415  void ** const ptr);
416 
424 char const * KIM_Model_ToString(KIM_Model const * const model);
425 
433 void KIM_Model_SetLogID(KIM_Model * const model, char const * const logID);
434 
442 void KIM_Model_PushLogVerbosity(KIM_Model * const model,
443  KIM_LogVerbosity const logVerbosity);
444 
452 void KIM_Model_PopLogVerbosity(KIM_Model * const model);
453 
454 #endif /* KIM_MODEL_H_ */
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's influence distance.
int KIM_Model_WriteParameterizedModel(KIM_Model const *const model, char const *const path, char const *const modelName)
Call the Model's MODEL_ROUTINE_NAME::WriteParameterizedModel routine.
void KIM_Model_GetUnits(KIM_Model const *const model, KIM_LengthUnit *const lengthUnit, KIM_EnergyUnit *const energyUnit, KIM_ChargeUnit *const chargeUnit, KIM_TemperatureUnit *const temperatureUnit, KIM_TimeUnit *const timeUnit)
Get the Model's base unit values.
int KIM_Model_GetParameterMetadata(KIM_Model const *const model, int const parameterIndex, KIM_DataType *const dataType, int *const extent, char const **const name, char const **const description)
Get the metadata associated with one of the Model's parameter arrays.
void KIM_Model_Destroy(KIM_Model **const model)
Destroy a previously Model::Create'd object.
void KIM_Model_PushLogVerbosity(KIM_Model *const model, KIM_LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the Model object's Log object verbosity stack.
void KIM_Model_GetNeighborListPointers(KIM_Model const *const model, int *const numberOfNeighborLists, double const **const cutoffs, int const **const modelWillNotRequestNeighborsOfNoncontributingParticles)
Get the Model's neighbor list information.
An Extensible Enumeration for the EnergyUnit's supported by the KIM API.
void KIM_Model_PopLogVerbosity(KIM_Model *const model)
Pop a LogVerbosity from the Model object's Log object verbosity stack.
int KIM_Model_GetSpeciesSupportAndCode(KIM_Model const *const model, KIM_SpeciesName const speciesName, int *const speciesIsSupported, int *const code)
Get the Model's support and code for the requested SpeciesName.
An Extensible Enumeration for the LengthUnit's supported by the KIM API.
An Extensible Enumeration for the ChargeUnit's supported by the KIM API.
int KIM_Model_SetParameterDouble(KIM_Model *const model, int const parameterIndex, int const arrayIndex, double const parameterValue)
Set a parameter value for the Model.
void KIM_Model_SetSimulatorBufferPointer(KIM_Model *const model, void *const ptr)
Set the Simulator's buffer pointer within the Model object.
SupportStatus const required
The standard required status.
int KIM_Model_ComputeArgumentsCreate(KIM_Model const *const model, KIM_ComputeArguments **const computeArguments)
Create a new ComputeArguments object for the Model object.
char const * KIM_Model_ToString(KIM_Model const *const model)
Get a string representing the internal state of the Model object.
An Extensible Enumeration for the Numbering's supported by the KIM API.
Definition: KIM_Numbering.h:41
int KIM_Model_SetParameterInteger(KIM_Model *const model, int const parameterIndex, int const arrayIndex, int const parameterValue)
Set a parameter value for the Model.
An Extensible Enumeration for the DataType's supported by the KIM API.
Definition: KIM_DataType.h:41
int KIM_Model_GetParameterDouble(KIM_Model const *const model, int const parameterIndex, int const arrayIndex, double *const parameterValue)
Get a parameter value from the Model.
An Extensible Enumeration for the ModelRoutineName's supported by the KIM API.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.
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.
void KIM_Model_GetNumberOfParameters(KIM_Model const *const model, int *const numberOfParameters)
Get the number of parameter arrays provided by the Model.
An Extensible Enumeration for the TimeUnit's supported by the KIM API.
Definition: KIM_TimeUnit.h:41
int KIM_Model_ClearThenRefresh(KIM_Model *const model)
Clear influence distance and neighbor list pointers and refresh Model object after parameter changes...
int KIM_Model_ComputeArgumentsDestroy(KIM_Model const *const model, KIM_ComputeArguments **const computeArguments)
Destroy a previously Model::ComputeArgumentsCreate'd object.
int KIM_Model_Extension(KIM_Model *const model, char const *const extensionID, void *const extensionStructure)
Call the Model's MODEL_ROUTINE_NAME::Extension routine.
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.
int KIM_Model_GetParameterInteger(KIM_Model const *const model, int const parameterIndex, int const arrayIndex, int *const parameterValue)
Get a parameter value from the Model.
int KIM_Model_Compute(KIM_Model const *const model, KIM_ComputeArguments const *const computeArguments)
Call the Model's MODEL_ROUTINE_NAME::Compute routine.
void KIM_Model_GetSimulatorBufferPointer(KIM_Model const *const model, void **const ptr)
Get the Simulator's buffer pointer from the Model object.
An Extensible Enumeration for the TemperatureUnit's supported by the KIM API.
void KIM_Model_SetLogID(KIM_Model *const model, char const *const logID)
Set the identity of the Log object associated with the Model object.
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
An Extensible Enumeration for the SpeciesName's supported by the KIM API.