Loading...
Searching...
No Matches
ChemfilesIO.h
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13#include "eon/ConFileIO.h"
14
15#include <string>
16#include <string_view>
17#include <vector>
18
19namespace eonc {
20class Matter;
21
22namespace io {
23
25[[nodiscard]] bool chemfiles_available() noexcept;
26
28[[nodiscard]] bool is_readcon_path(std::string_view filename);
29
34[[nodiscard]] bool is_chemfiles_path(std::string_view filename);
35
42void set_structure_input_format(std::string fmt);
43[[nodiscard]] const std::string &structure_input_format() noexcept;
44
51void set_config_cell(const std::vector<double> &values, bool pbc);
53[[nodiscard]] std::vector<double> parse_cell_values(const std::string &text);
55void set_default_vacuum(double angstrom);
56[[nodiscard]] double default_vacuum() noexcept;
57
65void publish_structure_input(std::string format, const std::string &cell,
66 bool pbc, double vacuum);
67
72[[nodiscard]] IoStatus inp2matter(Matter &m, const std::string &filename);
73
91[[nodiscard]] const std::string &last_cell_warning() noexcept;
92
93[[nodiscard]] IoStatus chemfiles2matter(Matter &m, const std::string &filename,
94 const std::string &format = "");
95
96} // namespace io
97} // namespace eonc
void set_structure_input_format(std::string fmt)
[Main] input_format: empty or "con" keeps readcon only.
IoStatus chemfiles2matter(Matter &, const std::string &filename, const std::string &)
bool is_chemfiles_path(std::string_view filename)
True for structure paths routed to chemfiles: a known extension (xyz, extxyz, pdb,...
IoStatus inp2matter(Matter &m, const std::string &filename)
Input entry point: .con/.convel (and .gz/.zst) go to readcon, everything else goes to chemfiles.
std::vector< double > parse_cell_values(const std::string &text)
Parse "a b c" or nine numbers; throws std::invalid_argument.
const std::string & last_cell_warning() noexcept
Read the first frame of any chemfiles-supported file into Matter.
bool chemfiles_available() noexcept
True when this build links chemfiles (-Dwith_chemfiles found it).
void publish_structure_input(std::string format, const std::string &cell, bool pbc, double vacuum)
Publish [Main] input_format, cell, pbc, and default_vacuum to the process-wide readers.
IoStatus
Structured I/O result for the client surface (nanobind-friendly).
Definition ConFileIO.h:29
double default_vacuum() noexcept
const std::string & structure_input_format() noexcept
void set_config_cell(const std::vector< double > &values, bool pbc)
Fallback cell for foreign files that carry none ([Main] cell / pbc).
bool is_readcon_path(std::string_view filename)
True for paths readcon owns: .con, .convel and their .gz/.zst forms.
void set_default_vacuum(double angstrom)
Vacuum padding per side (Angstrom) for the bounding-box default cell.
RAII resource manager for the ARTn C library with global synchronization.