kim-api  2.3.0+v2.3.0.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_ModelDriverCreate.hpp
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_DRIVER_CREATE_HPP_
32 #define KIM_MODEL_DRIVER_CREATE_HPP_
33 
34 #include <sstream>
35 #include <string>
36 
37 #ifndef KIM_FUNCTION_TYPES_HPP_
38 #include "KIM_FunctionTypes.hpp" // IWYU pragma: export
39 #endif
40 
41 namespace KIM
42 {
43 // Forward declarations
44 class LogVerbosity;
45 class LanguageName;
46 class Numbering;
47 class ModelRoutineName;
48 class SpeciesName;
49 class LengthUnit;
50 class EnergyUnit;
51 class ChargeUnit;
52 class TemperatureUnit;
53 class TimeUnit;
54 class ModelDriverCreateImplementation;
55 
56 
65 {
66  public:
77  void
78  GetParameterFileDirectoryName(std::string const ** const directoryName) const;
79 
89  void GetNumberOfParameterFiles(int * const numberOfParameterFiles) const;
90 
109  int GetParameterFileName(int const index,
110  std::string const ** const parameterFileName) const;
111 
129  int const index, std::string const ** const parameterFileBasename) const;
130 
144  int SetModelNumbering(Numbering const numbering);
145 
164  void SetInfluenceDistancePointer(double const * const influenceDistance);
165 
191  int const numberOfNeighborLists,
192  double const * const cutoffs,
193  int const * const modelWillNotRequestNeighborsOfNoncontributingParticles);
194 
199 
216  int SetRoutinePointer(ModelRoutineName const modelRoutineName,
217  LanguageName const languageName,
218  int const required,
219  Function * const fptr);
220 
239  int SetSpeciesCode(SpeciesName const speciesName, int const code);
240 
270  int SetParameterPointer(int const extent,
271  int * const ptr,
272  std::string const & name,
273  std::string const & description);
274 
276  int SetParameterPointer(int const extent,
277  double * const ptr,
278  std::string const & name,
279  std::string const & description);
280 
295  void SetModelBufferPointer(void * const ptr);
296 
320  int SetUnits(LengthUnit const lengthUnit,
321  EnergyUnit const energyUnit,
322  ChargeUnit const chargeUnit,
323  TemperatureUnit const temperatureUnit,
324  TimeUnit const timeUnit);
325 
356  static int ConvertUnit(LengthUnit const fromLengthUnit,
357  EnergyUnit const fromEnergyUnit,
358  ChargeUnit const fromChargeUnit,
359  TemperatureUnit const fromTemperatureUnit,
360  TimeUnit const fromTimeUnit,
361  LengthUnit const toLengthUnit,
362  EnergyUnit const toEnergyUnit,
363  ChargeUnit const toChargeUnit,
364  TemperatureUnit const toTemperatureUnit,
365  TimeUnit const toTimeUnit,
366  double const lengthExponent,
367  double const energyExponent,
368  double const chargeExponent,
369  double const temperatureExponent,
370  double const timeExponent,
371  double * const conversionFactor);
372 
388  void LogEntry(LogVerbosity const logVerbosity,
389  std::string const & message,
390  int const lineNumber,
391  std::string const & fileName) const;
392 
394  void LogEntry(LogVerbosity const logVerbosity,
395  std::stringstream const & message,
396  int const lineNumber,
397  std::string const & fileName) const;
398 
409  std::string const & ToString() const;
410 
411  private:
412  // do not allow copy constructor or operator=
414  void operator=(ModelDriverCreate const &);
415 
418 
419  ModelDriverCreateImplementation * pimpl;
420 }; // class ModelDriverCreate
421 } // namespace KIM
422 
423 #endif // KIM_MODEL_DRIVER_CREATE_HPP_
int GetParameterFileBasename(int const index, std::string const **const parameterFileBasename) const
Get a particular parameter file basename. The file is located in the Model&#39;s parameter file directory...
std::string const & ToString() const
Get a string representing the internal state of the Model object.
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.
An Extensible Enumeration for the ModelRoutineName&#39;s supported by the KIM API.
void GetNumberOfParameterFiles(int *const numberOfParameterFiles) const
Get the number of parameter files provided by the parameterized model.
void SetModelBufferPointer(void *const ptr)
Set the Model&#39;s buffer pointer within the Model object.
SupportStatus const required
The standard required status.
An Extensible Enumeration for the LengthUnit&#39;s supported by the KIM API.
void LogEntry(LogVerbosity const logVerbosity, std::string const &message, int const lineNumber, std::string const &fileName) const
Write a log entry into the log file.
void() Function(void)
Generic function type.
int SetModelNumbering(Numbering const numbering)
Set the Model&#39;s particle Numbering.
Provides the interface to a KIM API Model object for use by models within their MODEL_ROUTINE_NAME::C...
An Extensible Enumeration for the LogVerbosity&#39;s supported by the KIM API.
An Extensible Enumeration for the LanguageName&#39;s supported by the KIM API.
An Extensible Enumeration for the Numbering&#39;s supported by the KIM API.
int GetParameterFileName(int const index, std::string const **const parameterFileName) const
Get a particular parameter file name.
int SetUnits(LengthUnit const lengthUnit, EnergyUnit const energyUnit, ChargeUnit const chargeUnit, TemperatureUnit const temperatureUnit, TimeUnit const timeUnit)
Set the Model&#39;s base unit values.
An Extensible Enumeration for the EnergyUnit&#39;s supported by the KIM API.
void SetNeighborListPointers(int const numberOfNeighborLists, double const *const cutoffs, int const *const modelWillNotRequestNeighborsOfNoncontributingParticles)
Set the Model&#39;s neighbor list data pointers.
int SetRoutinePointer(ModelRoutineName const modelRoutineName, LanguageName const languageName, int const required, Function *const fptr)
Set the function pointer for the ModelRoutineName of interest.
void GetParameterFileDirectoryName(std::string const **const directoryName) const
Get absolute path name of the temporary directory where parameter files provided by the model are wri...
int SetParameterPointer(int const extent, int *const ptr, std::string const &name, std::string const &description)
Set the next parameter data pointer to be provided by the model.
An Extensible Enumeration for the ChargeUnit&#39;s supported by the KIM API.
int SetSpeciesCode(SpeciesName const speciesName, int const code)
Set integer code for supported SpeciesName.
An Extensible Enumeration for the SpeciesName&#39;s supported by the KIM API.
void SetInfluenceDistancePointer(double const *const influenceDistance)
Set the Model&#39;s influence distance data pointer.
static int ConvertUnit(LengthUnit const fromLengthUnit, EnergyUnit const fromEnergyUnit, ChargeUnit const fromChargeUnit, TemperatureUnit const fromTemperatureUnit, TimeUnit const fromTimeUnit, LengthUnit const toLengthUnit, EnergyUnit const toEnergyUnit, ChargeUnit const toChargeUnit, TemperatureUnit const toTemperatureUnit, TimeUnit const toTimeUnit, double const lengthExponent, double const energyExponent, double const chargeExponent, double const temperatureExponent, double const timeExponent, double *const conversionFactor)
Get the multiplicative factor to convert between a derived unit represented in two different sets of ...