KIM API V2
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--2018, 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.0.0-alpha.0 package.
31 //
32 
33 
34 #ifndef KIM_MODEL_HPP_
35 #define KIM_MODEL_HPP_
36 
37 #include <string>
38 
39 #ifndef KIM_FUNC_HPP_
40 #include "KIM_func.hpp"
41 #endif
42 
43 namespace KIM
44 {
45 // Forward declarations
46 class LogVerbosity;
47 class DataType;
48 class LanguageName;
49 class SpeciesName;
50 class Numbering;
51 class LengthUnit;
52 class EnergyUnit;
53 class ChargeUnit;
54 class TemperatureUnit;
55 class TimeUnit;
56 class ArgumentName;
57 class CallbackName;
58 class SupportStatus;
59 class ModelImplementation;
60 
61 
62 class Model
63 {
64  public:
65  static int Create(Numbering const numbering,
66  LengthUnit const requestedLengthUnit,
67  EnergyUnit const requestedEnergyUnit,
68  ChargeUnit const requestedChargeUnit,
69  TemperatureUnit const requestedTemperatureUnit,
70  TimeUnit const requestedTimeUnit,
71  std::string const & modelName,
72  int * const requestedUnitsAccepted,
73  Model ** const model);
74  static void Destroy(Model ** const model);
75 
76  void GetInfluenceDistance(double * const influenceDistance) const;
77 
78  void GetNeighborListCutoffsPointer(int * const numberOfCutoffs,
79  double const ** const cutoffs) const;
80 
81  int GetArgumentSupportStatus(ArgumentName const argumentName,
82  SupportStatus * const supportStatus) const;
83  int GetCallbackSupportStatus(CallbackName const callbackName,
84  SupportStatus * const supportStatus) const;
85 
86  void GetUnits(LengthUnit * const lengthUnit,
87  EnergyUnit * const energyUnit,
88  ChargeUnit * const chargeUnit,
89  TemperatureUnit * const temperatureUnit,
90  TimeUnit * const timeUnit) const;
91 
92 
93  int SetArgumentPointer(ArgumentName const argumentName,
94  int const * const ptr);
95  int SetArgumentPointer(ArgumentName const argumentName,
96  double const * const ptr);
97 
98  int SetCallbackPointer(CallbackName const callbackName,
99  LanguageName const languageName,
100  func * const fptr,
101  void const * const dataObject);
102 
103  int Compute() const;
105 
106  int GetSpeciesSupportAndCode(KIM::SpeciesName const speciesName,
107  int * const speciesIsSupported,
108  int * const code) const;
109 
110  void GetNumberOfParameters(int * const numberOfParameters) const;
112  int const index, DataType * const dataType, int * extent,
113  std::string * const description) const;
114  int GetParameter(int const parameterIndex, int const arrayIndex,
115  int * const parameterValue) const;
116  int GetParameter(int const parameterIndex, int const arrayIndex,
117  double * const parameterValue) const;
118  int SetParameter(int const parameterIndex, int const arrayIndex,
119  int const parameterValue);
120  int SetParameter(int const parameterIndex, int const arrayIndex,
121  double const parameterValue);
122 
123  void SetSimulatorBufferPointer(void * const ptr);
124  void GetSimulatorBufferPointer(void ** const ptr) const;
125 
126  std::string String() const;
127 
128  void SetLogID(std::string const & logID);
129  void PushLogVerbosity(LogVerbosity const logVerbosity);
130  void PopLogVerbosity();
131 
132  private:
133  // do not allow copy constructor or operator=
134  Model(Model const &);
135  void operator=(Model const &);
136 
137  Model();
138  ~Model();
139 
140  ModelImplementation * pimpl;
141 }; // class Model
142 } // namespace KIM
143 #endif // KIM_MODEL_HPP_
void SetLogID(std::string const &logID)
std::string String() const
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)
void GetUnits(LengthUnit *const lengthUnit, EnergyUnit *const energyUnit, ChargeUnit *const chargeUnit, TemperatureUnit *const temperatureUnit, TimeUnit *const timeUnit) const
int Compute() const
void GetNeighborListCutoffsPointer(int *const numberOfCutoffs, double const **const cutoffs) const
int ClearInfluenceDistanceAndCutoffsThenRefreshModel()
int GetParameterDataTypeExtentAndDescription(int const index, DataType *const dataType, int *extent, std::string *const description) const
void SetSimulatorBufferPointer(void *const ptr)
int SetCallbackPointer(CallbackName const callbackName, LanguageName const languageName, func *const fptr, void const *const dataObject)
int SetParameter(int const parameterIndex, int const arrayIndex, int const parameterValue)
void GetInfluenceDistance(double *const influenceDistance) const
static void Destroy(Model **const model)
int SetArgumentPointer(ArgumentName const argumentName, int const *const ptr)
void PopLogVerbosity()
void GetSimulatorBufferPointer(void **const ptr) const
int GetArgumentSupportStatus(ArgumentName const argumentName, SupportStatus *const supportStatus) const
void GetNumberOfParameters(int *const numberOfParameters) const
int GetParameter(int const parameterIndex, int const arrayIndex, int *const parameterValue) const
int GetCallbackSupportStatus(CallbackName const callbackName, SupportStatus *const supportStatus) const
int GetSpeciesSupportAndCode(KIM::SpeciesName const speciesName, int *const speciesIsSupported, int *const code) const
void() func()
Definition: KIM_func.hpp:40
void PushLogVerbosity(LogVerbosity const logVerbosity)