kim-api  2.1.4-git+v2.1.3-git-1-g7847914a.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
Go to the documentation of this file.
1 //
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 // 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 //
19 //
21 //
22 // Copyright (c) 2016--2019, Regents of the University of Minnesota.
23 // All rights reserved.
24 //
25 // Contributors:
26 // Ryan S. Elliott
27 //
29 //
30 // Release: This file is part of the kim-api.git repository.
31 //
34 #ifndef KIM_MODEL_HPP_
35 #define KIM_MODEL_HPP_
37 #include <string>
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;
61 class Model
62 {
63  public:
122  static int Create(Numbering const numbering,
123  LengthUnit const requestedLengthUnit,
124  EnergyUnit const requestedEnergyUnit,
125  ChargeUnit const requestedChargeUnit,
126  TemperatureUnit const requestedTemperatureUnit,
127  TimeUnit const requestedTimeUnit,
128  std::string const & modelName,
129  int * const requestedUnitsAccepted,
130  Model ** const model);
145  // \since 2.0
146  static void Destroy(Model ** const model);
168  int IsRoutinePresent(ModelRoutineName const modelRoutineName,
169  int * const present,
170  int * const required) const;
183  void GetInfluenceDistance(double * const influenceDistance) const;
211  int * const numberOfNeighborLists,
212  double const ** const cutoffs,
213  int const ** const modelWillNotRequestNeighborsOfNoncontributingParticles)
214  const;
237  void GetUnits(LengthUnit * const lengthUnit,
238  EnergyUnit * const energyUnit,
239  ChargeUnit * const chargeUnit,
240  TemperatureUnit * const temperatureUnit,
241  TimeUnit * const timeUnit) const;
263  int ComputeArgumentsCreate(ComputeArguments ** const computeArguments) const;
286  int ComputeArgumentsDestroy(ComputeArguments ** const computeArguments) const;
304  int Compute(ComputeArguments const * const computeArguments) const;
322  int Extension(std::string const & extensionID,
323  void * const extensionStructure);
344  int ClearThenRefresh();
367  int WriteParameterizedModel(std::string const & path,
368  std::string const & modelName) const;
390  int GetSpeciesSupportAndCode(SpeciesName const speciesName,
391  int * const speciesIsSupported,
392  int * const code) const;
403  void GetNumberOfParameters(int * const numberOfParameters) const;
429  int GetParameterMetadata(int const parameterIndex,
430  DataType * const dataType,
431  int * const extent,
432  std::string const ** const name,
433  std::string const ** const description) const;
453  int GetParameter(int const parameterIndex,
454  int const arrayIndex,
455  int * const parameterValue) const;
458  int GetParameter(int const parameterIndex,
459  int const arrayIndex,
460  double * const parameterValue) const;
480  int SetParameter(int const parameterIndex,
481  int const arrayIndex,
482  int const parameterValue);
485  int SetParameter(int const parameterIndex,
486  int const arrayIndex,
487  double const parameterValue);
501  void SetSimulatorBufferPointer(void * const ptr);
515  void GetSimulatorBufferPointer(void ** const ptr) const;
526  std::string const & ToString() const;
536  void SetLogID(std::string const & logID);
546  void PushLogVerbosity(LogVerbosity const logVerbosity);
554  void PopLogVerbosity();
556  private:
557  // do not allow copy constructor or operator=
558  Model(Model const &);
559  void operator=(Model const &);
561  Model();
562  ~Model();
564  ModelImplementation * pimpl;
565 }; // class Model
566 } // namespace KIM
568 #endif // KIM_MODEL_HPP_
void SetLogID(std::string const &logID)
Set the identity of the Log object associated with the Model object.
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.
An Extensible Enumeration for the TemperatureUnit&#39;s supported by the KIM API.
An Extensible Enumeration for the TimeUnit&#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.
An Extensible Enumeration for the ModelRoutineName&#39;s supported by the KIM API.
std::string const & ToString() const
Get a string representing the internal state of the Model object.
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.
void GetNeighborListPointers(int *const numberOfNeighborLists, double const **const cutoffs, int const **const modelWillNotRequestNeighborsOfNoncontributingParticles) const
Get the Model&#39;s neighbor list information.
void SetSimulatorBufferPointer(void *const ptr)
Set the Simulator&#39;s buffer pointer within the Model object.
An Extensible Enumeration for the DataType&#39;s supported by the KIM API.
int ComputeArgumentsCreate(ComputeArguments **const computeArguments) const
Create a new ComputeArguments object for the Model object.
SupportStatus const required
The standard required status.
An Extensible Enumeration for the LengthUnit&#39;s supported by the KIM API.
int Compute(ComputeArguments const *const computeArguments) const
Call the Model&#39;s MODEL_ROUTINE_NAME::Compute routine.
int SetParameter(int const parameterIndex, int const arrayIndex, int const parameterValue)
Set a parameter value for the Model.
void GetInfluenceDistance(double *const influenceDistance) const
Get the Model&#39;s influence distance.
int Extension(std::string const &extensionID, void *const extensionStructure)
Call the Model&#39;s MODEL_ROUTINE_NAME::Extension routine.
An Extensible Enumeration for the LogVerbosity&#39;s supported by the KIM API.
An Extensible Enumeration for the Numbering&#39;s supported by the KIM API.
Provides the primary interface to a KIM API Model object and is meant to be used by simulators...
Definition: KIM_Model.hpp:61
static void Destroy(Model **const model)
Destroy a previously Model::Create&#39;d object.
An Extensible Enumeration for the EnergyUnit&#39;s supported by the KIM API.
void PopLogVerbosity()
Pop a LogVerbosity from the Model object&#39;s Log object verbosity stack.
void GetSimulatorBufferPointer(void **const ptr) const
Get the Simulator&#39;s buffer pointer from the Model object.
Provides the primary interface to a KIM API ComputeArguments object and is meant to be used by simula...
void GetNumberOfParameters(int *const numberOfParameters) const
Get the number of parameter arrays provided by the Model.
An Extensible Enumeration for the ChargeUnit&#39;s supported by the KIM API.
int GetParameter(int const parameterIndex, int const arrayIndex, int *const parameterValue) const
Get a parameter value from the Model.
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 ComputeArgumentsDestroy(ComputeArguments **const computeArguments) const
Destroy a previously Model::ComputeArgumentsCreate&#39;d object.
int IsRoutinePresent(ModelRoutineName const modelRoutineName, int *const present, int *const required) const
Determine presence and required status of the given ModelRoutineName.
An Extensible Enumeration for the SpeciesName&#39;s supported by the KIM API.
int ClearThenRefresh()
Clear influence distance and neighbor list pointers and refresh Model object after parameter changes...
void PushLogVerbosity(LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the Model object&#39;s Log object verbosity stack.