Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MLIP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tadah
MLIP
Merge requests
!7
Develop
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Develop
develop
into
main
Overview
0
Commits
5
Pipelines
1
Changes
24
Merged
Marcin Kirsz
requested to merge
develop
into
main
4 months ago
Overview
0
Commits
5
Pipelines
1
Changes
24
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
a1bc6b38
5 commits,
4 months ago
24 files
+
14356
−
58
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
24
Search (e.g. *.vue) (Ctrl+P)
include/tadah/mlip/dataset_readers/castep_castep_reader.h
0 → 100644
+
89
−
0
Options
#ifndef CASTEP_CASTEP_READER_H
#define CASTEP_CASTEP_READER_H
#include
<tadah/mlip/structure.h>
#include
<tadah/mlip/structure_db.h>
#include
<tadah/mlip/dataset_readers/dataset_reader.h>
#include
<iostream>
#include
<fstream>
#include
<sstream>
#include
<vector>
#include
<stdexcept>
/**
* @class CastepCastepReader
* @brief A class for reading and parsing CASTEP .castep files.
*
* Implements data extraction and processing for molecular dynamics
* simulations (both constant and non-constant volume),
* geometry optimization, and single-point energy calculations.
*
* Supports concatenated .castep files, such as an MD run followed
* by a geometry optimization.
*
* The output units are:
* - eV for energy
* - Ångström for distance
* - eV/Å for force
* - eV/ų for pressure (converted from GPa)
* - ps for time
*
* If there is no stress tensor, it is set to zero.
*
* Example usage:
* @code
* StructureDB my_db;
* // Using the basic constructor
* CastepCastepReader reader1(my_db);
* reader1.read_data("test.castep");
* reader1.parse_data();
* reader1.print_summary();
*
* // Using the constructor with filename
* CastepCastepReader reader2(my_db, "test.castep");
* reader2.print_summary();
* @endcode
*/
class
CastepCastepReader
:
public
DatasetReader
{
public:
/**
* @brief Constructs a CastepCastepReader with a StructureDB reference.
* @param db Reference to a StructureDB object for storing parsed data.
*/
CastepCastepReader
(
StructureDB
&
db
);
/**
* @brief Constructs a CastepCastepReader and reads the specified file.
* @param db Reference to a StructureDB object for storing parsed data.
* @param filename Name of the .castep file to read.
*/
CastepCastepReader
(
StructureDB
&
db
,
const
std
::
string
&
filename
);
/**
* @brief Reads data from a specified .castep file.
* @param filename The name of the .castep file to read data from.
*/
virtual
void
read_data
(
const
std
::
string
&
filename
)
override
;
/**
* @brief Parses the data read from the .castep file.
*/
virtual
void
parse_data
()
override
;
/**
* @brief Prints a summary of the parsed .castep data.
*/
virtual
void
print_summary
()
const
override
;
protected:
std
::
string
raw_data_
;
/**< Stores raw file data */
std
::
string
filename_
;
/**< Filename of the .castep file */
// Unit conversion factors
double
p_conv
=
0.00624150913
;
/**< Conversion factor from GPa to eV/A^3 */
};
#endif // CASTEP_CASTEP_READER_H
Loading