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).
KIM_SimulatorModel.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.git repository.
31 //
32 
33 
34 #ifndef KIM_SIMULATOR_MODEL_HPP_
35 #define KIM_SIMULATOR_MODEL_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
41 // Forward declarations
42 class LogVerbosity;
43 class SimulatorModelImplementation;
44 
142 {
143  public:
172  static int Create(std::string const & simulatorModelName,
173  SimulatorModel ** const simulatorModel);
174 
189  // \since 2.1
190  static void Destroy(SimulatorModel ** const simulatorModel);
191 
192 
205  void
206  GetSimulatorNameAndVersion(std::string const ** const simulatorName,
207  std::string const ** const simulatorVersion) const;
208 
218  void GetNumberOfSupportedSpecies(int * const numberOfSupportedSpecies) const;
219 
232  int GetSupportedSpecies(int const index,
233  std::string const ** const speciesName) const;
234 
253 
263  int TemplateMapIsOpen() const;
264 
279  //
293  int AddTemplateMap(std::string const & key, std::string const & value);
294 
306  void CloseTemplateMap();
307 
318  void GetNumberOfSimulatorFields(int * const numberOfSimulatorFields) const;
319 
339  int GetSimulatorFieldMetadata(int const fieldIndex,
340  int * const extent,
341  std::string const ** const fieldName) const;
342 
343 
363  int GetSimulatorFieldLine(int const fieldIndex,
364  int const lineIndex,
365  std::string const ** const lineValue) const;
366 
377  void
378  GetParameterFileDirectoryName(std::string const ** const directoryName) const;
379 
392  std::string const ** const specificationFileName) const;
393 
402  void GetNumberOfParameterFiles(int * const numberOfParameterFiles) const;
403 
421  int GetParameterFileName(int const index,
422  std::string const ** const parameterFileName) const;
423 
436  void SetSimulatorBufferPointer(void * const ptr);
437 
450  void GetSimulatorBufferPointer(void ** const ptr) const;
451 
463  std::string const & ToString() const;
464 
475  void SetLogID(std::string const & logID);
476 
486  void PushLogVerbosity(LogVerbosity const logVerbosity);
487 
495  void PopLogVerbosity();
496 
497  private:
498  // do not allow copy constructor or operator=
500  void operator=(SimulatorModel const &);
501 
502  SimulatorModel();
503  ~SimulatorModel();
504 
505  SimulatorModelImplementation * pimpl;
506 }; // class SimulatorModel
507 } // namespace KIM
508 
509 #endif // KIM_SIMULATOR_MODEL_HPP_
void GetSimulatorNameAndVersion(std::string const **const simulatorName, std::string const **const simulatorVersion) const
Get the SimulatorModel&#39;s simulator name and version.
void GetNumberOfParameterFiles(int *const numberOfParameterFiles) const
Get the number of parameter files provided by the SimulatorModel.
void PopLogVerbosity()
Pop a LogVerbosity from the SimulatorModel object&#39;s Log object verbosity stack.
void GetSimulatorBufferPointer(void **const ptr) const
Get the Simulator&#39;s buffer pointer from the SimulatorModel object.
CollectionItemType const simulatorModel
The standard simulatorModel CollectionItemType.
std::string const & ToString() const
Get a string representing the internal state of the SimulatorModel object.
void GetNumberOfSupportedSpecies(int *const numberOfSupportedSpecies) const
Get the number of species supported by the SimulatorModel.
void SetSimulatorBufferPointer(void *const ptr)
Set the Simulator&#39;s buffer pointer within the SimulatorModel object.
An Extensible Enumeration for the LogVerbosity&#39;s supported by the KIM API.
void GetSpecificationFileName(std::string const **const specificationFileName) const
Get the SimulatorModel&#39;s specification file basename (file name without path). The file is located in...
void CloseTemplateMap()
Close the template map and perform template substitutions.
static int Create(std::string const &simulatorModelName, SimulatorModel **const simulatorModel)
Create a new KIM API SimulatorModel object.
void GetParameterFileDirectoryName(std::string const **const directoryName) const
Get absolute path name of the temporary directory where parameter files provided by the simulator mod...
int AddTemplateMap(std::string const &key, std::string const &value)
Add a new key-value entry to the template map.
int GetParameterFileName(int const index, std::string const **const parameterFileName) const
Get the basename (file name without path) of a particular parameter file. The file is located in the ...
Provides the primary interface to a KIM API SimulatorModel object and is meant to be used by simulato...
int GetSupportedSpecies(int const index, std::string const **const speciesName) const
Get a species name supported by the SimulatorModel.
void OpenAndInitializeTemplateMap()
Open and initialize the template map for simulator field line substitutions.
int GetSimulatorFieldMetadata(int const fieldIndex, int *const extent, std::string const **const fieldName) const
Get the metadata for the simulator field of interest.
void PushLogVerbosity(LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the SimulatorModel object&#39;s Log object verbosity stack.
int TemplateMapIsOpen() const
Determine if the template map is open.
static void Destroy(SimulatorModel **const simulatorModel)
Destroy a previously SimulatorModel::Create&#39;d object.
void SetLogID(std::string const &logID)
Set the identity of the Log object associated with the SimulatorModel object.
int GetSimulatorFieldLine(int const fieldIndex, int const lineIndex, std::string const **const lineValue) const
Get a line for the simulator field of interest with all template substitutions performed (Requires th...
void GetNumberOfSimulatorFields(int *const numberOfSimulatorFields) const
Get the number of simulator fields provided by the SimulatorModel.