kim-api  2.3.1-git+v2.3.0-git-2-g378406f9.GNU.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 // 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.git repository.
28 //
29 
30 
31 #ifndef KIM_SIMULATOR_MODEL_HPP_
32 #define KIM_SIMULATOR_MODEL_HPP_
33 
34 #include <string>
35 
36 namespace KIM
37 {
38 // Forward declarations
39 class LogVerbosity;
40 class SimulatorModelImplementation;
41 
139 {
140  public:
169  static int Create(std::string const & simulatorModelName,
170  SimulatorModel ** const simulatorModel);
171 
186  // \since 2.1
187  static void Destroy(SimulatorModel ** const simulatorModel);
188 
189 
202  void
203  GetSimulatorNameAndVersion(std::string const ** const simulatorName,
204  std::string const ** const simulatorVersion) const;
205 
215  void GetNumberOfSupportedSpecies(int * const numberOfSupportedSpecies) const;
216 
229  int GetSupportedSpecies(int const index,
230  std::string const ** const speciesName) const;
231 
250 
260  int TemplateMapIsOpen() const;
261 
276  //
290  int AddTemplateMap(std::string const & key, std::string const & value);
291 
303  void CloseTemplateMap();
304 
315  void GetNumberOfSimulatorFields(int * const numberOfSimulatorFields) const;
316 
336  int GetSimulatorFieldMetadata(int const fieldIndex,
337  int * const extent,
338  std::string const ** const fieldName) const;
339 
340 
360  int GetSimulatorFieldLine(int const fieldIndex,
361  int const lineIndex,
362  std::string const ** const lineValue) const;
363 
374  void
375  GetParameterFileDirectoryName(std::string const ** const directoryName) const;
376 
389  std::string const ** const specificationFileName) const;
390 
399  void GetNumberOfParameterFiles(int * const numberOfParameterFiles) const;
400 
420  int GetParameterFileName(int const index,
421  std::string const ** const parameterFileName) const;
422 
441  int const index, std::string const ** const parameterFileBasename) const;
442 
455  void SetSimulatorBufferPointer(void * const ptr);
456 
469  void GetSimulatorBufferPointer(void ** const ptr) const;
470 
482  std::string const & ToString() const;
483 
494  void SetLogID(std::string const & logID);
495 
505  void PushLogVerbosity(LogVerbosity const logVerbosity);
506 
514  void PopLogVerbosity();
515 
516  private:
517  // do not allow copy constructor or operator=
519  void operator=(SimulatorModel const &);
520 
521  SimulatorModel();
522  ~SimulatorModel();
523 
524  SimulatorModelImplementation * pimpl;
525 }; // class SimulatorModel
526 } // namespace KIM
527 
528 #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.
int GetParameterFileBasename(int const index, std::string const **const parameterFileBasename) const
Get the basename (file name without path) of a particular parameter file. The file is located in the ...
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.