kim-api-v2  2.0.0+912e79a.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_Model.hpp
Go to the documentation of this file.
1 //
2 // CDDL HEADER START
3 //
4 // The contents of this file are subject to the terms of the Common Development
5 // and Distribution License Version 1.0 (the "License").
6 //
7 // You can obtain a copy of the license at
8 // http://www.opensource.org/licenses/CDDL-1.0. See the License for the
9 // specific language governing permissions and limitations under the License.
10 //
11 // When distributing Covered Code, include this CDDL HEADER in each file and
12 // include the License file in a prominent location with the name LICENSE.CDDL.
13 // If applicable, add the following below this CDDL HEADER, with the fields
14 // enclosed by brackets "[]" replaced with your own identifying information:
15 //
16 // Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
17 //
18 // CDDL HEADER END
19 //
20 
21 //
22 // Copyright (c) 2016--2019, Regents of the University of Minnesota.
23 // All rights reserved.
24 //
25 // Contributors:
26 // Ryan S. Elliott
27 //
28 
29 //
30 // Release: This file is part of the kim-api-v2-2.0.0 package.
31 //
32 
33 
34 #ifndef KIM_MODEL_HPP_
35 #define KIM_MODEL_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
41 // Forward declarations
42 class LogVerbosity;
43 class DataType;
44 class ModelRoutineName;
45 class SpeciesName;
46 class Numbering;
47 class LengthUnit;
48 class EnergyUnit;
49 class ChargeUnit;
50 class TemperatureUnit;
51 class TimeUnit;
52 class ComputeArguments;
53 class ModelImplementation;
54 
61 class Model
62 {
63  public:
81 
120  static int Create(Numbering const numbering,
121  LengthUnit const requestedLengthUnit,
122  EnergyUnit const requestedEnergyUnit,
123  ChargeUnit const requestedChargeUnit,
124  TemperatureUnit const requestedTemperatureUnit,
125  TimeUnit const requestedTimeUnit,
126  std::string const & modelName,
127  int * const requestedUnitsAccepted,
128  Model ** const model);
129 
143  // \since 2.0
144  static void Destroy(Model ** const model);
145 
163  int IsRoutinePresent(ModelRoutineName const modelRoutineName,
164  int * const present,
165  int * const required) const;
166 
178  void GetInfluenceDistance(double * const influenceDistance) const;
179 
202  int * const numberOfNeighborLists,
203  double const ** const cutoffs,
204  int const ** const modelWillNotRequestNeighborsOfNoncontributingParticles)
205  const;
206 
228  void GetUnits(LengthUnit * const lengthUnit,
229  EnergyUnit * const energyUnit,
230  ChargeUnit * const chargeUnit,
231  TemperatureUnit * const temperatureUnit,
232  TimeUnit * const timeUnit) const;
233 
254  int ComputeArgumentsCreate(ComputeArguments ** const computeArguments) const;
255 
277  int ComputeArgumentsDestroy(ComputeArguments ** const computeArguments) const;
278 
295  int Compute(ComputeArguments const * const computeArguments) const;
296 
313  int Extension(std::string const & extensionID,
314  void * const extensionStructure);
315 
335  int ClearThenRefresh();
336 
358  int WriteParameterizedModel(std::string const & path,
359  std::string const & modelName) const;
360 
381  int GetSpeciesSupportAndCode(SpeciesName const speciesName,
382  int * const speciesIsSupported,
383  int * const code) const;
384 
393  void GetNumberOfParameters(int * const numberOfParameters) const;
394 
416  int GetParameterMetadata(int const parameterIndex,
417  DataType * const dataType,
418  int * const extent,
419  std::string const ** const name,
420  std::string const ** const description) const;
421 
438  int GetParameter(int const parameterIndex,
439  int const arrayIndex,
440  int * const parameterValue) const;
441 
443  int GetParameter(int const parameterIndex,
444  int const arrayIndex,
445  double * const parameterValue) const;
446 
463  int SetParameter(int const parameterIndex,
464  int const arrayIndex,
465  int const parameterValue);
466 
468  int SetParameter(int const parameterIndex,
469  int const arrayIndex,
470  double const parameterValue);
471 
484  void SetSimulatorBufferPointer(void * const ptr);
485 
498  void GetSimulatorBufferPointer(void ** const ptr) const;
499 
509  std::string const & ToString() const;
510 
519  void SetLogID(std::string const & logID);
520 
529  void PushLogVerbosity(LogVerbosity const logVerbosity);
530 
537  void PopLogVerbosity();
538 
539  private:
540  // do not allow copy constructor or operator=
541  Model(Model const &);
542  void operator=(Model const &);
543 
544  Model();
545  ~Model();
546 
547  ModelImplementation * pimpl;
548 }; // class Model
549 } // namespace KIM
550 
551 #endif // KIM_MODEL_HPP_
std::string const & ToString() const
Get a string representing the internal state of the Model object.
Provides the primary interface to a KIM API ComputeArguments object and is meant to be used by simula...
void PushLogVerbosity(LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the Model object&#39;s Log object verbosity stack.
int ClearThenRefresh()
Clear influence distance and neighbor list pointers and refresh Model object after parameter changes...
static int Create(Numbering const numbering, LengthUnit const requestedLengthUnit, EnergyUnit const requestedEnergyUnit, ChargeUnit const requestedChargeUnit, TemperatureUnit const requestedTemperatureUnit, TimeUnit const requestedTimeUnit, std::string const &modelName, int *const requestedUnitsAccepted, Model **const model)
Create a new KIM API Model object.
void GetUnits(LengthUnit *const lengthUnit, EnergyUnit *const energyUnit, ChargeUnit *const chargeUnit, TemperatureUnit *const temperatureUnit, TimeUnit *const timeUnit) const
Get the Model&#39;s base unit values.
void GetInfluenceDistance(double *const influenceDistance) const
Get the Model&#39;s influence distance.
int ComputeArgumentsCreate(ComputeArguments **const computeArguments) const
Create a new ComputeArguments object for the Model object.
void GetNeighborListPointers(int *const numberOfNeighborLists, double const **const cutoffs, int const **const modelWillNotRequestNeighborsOfNoncontributingParticles) const
Get the Model&#39;s neighbor list information.
An Extensible Enumeration for the ChargeUnit&#39;s supported by the KIM API.
An Extensible Enumeration for the LengthUnit&#39;s supported by the KIM API.
An Extensible Enumeration for the LogVerbosity&#39;s supported by the KIM API.
An Extensible Enumeration for the EnergyUnit&#39;s supported by the KIM API.
int WriteParameterizedModel(std::string const &path, std::string const &modelName) const
Call the Model&#39;s MODEL_ROUTINE_NAME::WriteParameterizedModel routine.
void PopLogVerbosity()
Pop a LogVerbosity from the Model object&#39;s Log object verbosity stack.
int GetParameter(int const parameterIndex, int const arrayIndex, int *const parameterValue) const
Get a parameter value from the Model.
void GetSimulatorBufferPointer(void **const ptr) const
Get the Simulator&#39;s buffer pointer from the Model object.
void SetLogID(std::string const &logID)
Set the identity of the Log object associated with the Model object.
An Extensible Enumeration for the ModelRoutineName&#39;s supported by the KIM API.
int ComputeArgumentsDestroy(ComputeArguments **const computeArguments) const
Destroy a previously Model::ComputeArgumentsCreate&#39;d object.
static void Destroy(Model **const model)
Destroy a previously Model::Create&#39;d object.
An Extensible Enumeration for the TimeUnit&#39;s supported by the KIM API.
int SetParameter(int const parameterIndex, int const arrayIndex, int const parameterValue)
Set a parameter value for the Model.
void GetNumberOfParameters(int *const numberOfParameters) const
Get the number of parameter arrays provided by the Model.
Provides the primary interface to a KIM API Model object and is meant to be used by simulators...
Definition: KIM_Model.hpp:61
SupportStatus const required
The standard required status.
An Extensible Enumeration for the Numbering&#39;s supported by the KIM API.
An Extensible Enumeration for the TemperatureUnit&#39;s supported by the KIM API.
An Extensible Enumeration for the SpeciesName&#39;s supported by the KIM API.
An Extensible Enumeration for the DataType&#39;s supported by the KIM API.
int GetParameterMetadata(int const parameterIndex, DataType *const dataType, int *const extent, std::string const **const name, std::string const **const description) const
Get the metadata associated with one of the Model&#39;s parameter arrays.
int IsRoutinePresent(ModelRoutineName const modelRoutineName, int *const present, int *const required) const
Determine presence and required status of the given ModelRoutineName.
int GetSpeciesSupportAndCode(SpeciesName const speciesName, int *const speciesIsSupported, int *const code) const
Get the Model&#39;s support and code for the requested SpeciesName.
int Extension(std::string const &extensionID, void *const extensionStructure)
Call the Model&#39;s MODEL_ROUTINE_NAME::Extension routine.
void SetSimulatorBufferPointer(void *const ptr)
Set the Simulator&#39;s buffer pointer within the Model object.
int Compute(ComputeArguments const *const computeArguments) const
Call the Model&#39;s MODEL_ROUTINE_NAME::Compute routine.