Debian Codegraph @

avogadro/io/vaspformat.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_IO_VASPFORMAT_H
7 #define AVOGADRO_IO_VASPFORMAT_H
8
9 #include "fileformat.h"
10
11 namespace Avogadro::Io {
12
13 /**
14 * @class PoscarFormat vaspformat.h <avogadro/io/vaspformat.h>
15 * @brief Implementation of the generic POSCAR format.
16 * @author Patrick S. Avery
17 */
18
19 class AVOGADROIO_EXPORT PoscarFormat : public FileFormat
20 {
21 public:
22 PoscarFormat() = default;
23 ~PoscarFormat() override = default;
24
25 Operations supportedOperations() const override
26 {
27 return ReadWrite | File | Stream | String;
28 }
29
30 FileFormat* newInstance() const override { return new PoscarFormat; }
31 std::string identifier() const override { return "Avogadro: POSCAR"; }
32 std::string name() const override { return "POSCAR"; }
33 std::string description() const override
34 {
35 return "Format used by VASP that contains crystal cell and atom info.";
36 }
37
38 std::string specificationUrl() const override
39 {
40 return "https://www.vasp.at/wiki/POSCAR";
41 }
42
43 std::vector<std::string> fileExtensions() const override;
44 std::vector<std::string> mimeTypes() const override;
45
46 [[nodiscard]] bool read(std::istream& inStream, Core::Molecule& mol) override;
47 [[nodiscard]] bool write(std::ostream& outStream,
48 const Core::Molecule& mol) override;
49 };
50
51 class AVOGADROIO_EXPORT OutcarFormat : public FileFormat
52 {
53 public:
54 OutcarFormat() = default;
55 ~OutcarFormat() override = default;
56
57 Operations supportedOperations() const override
58 {
59 return Read | File | Stream | String;
60 }
61
62 FileFormat* newInstance() const override { return new OutcarFormat; }
63 std::string identifier() const override { return "Avogadro: OUTCAR"; }
64 std::string name() const override { return "OUTCAR"; }
65 std::string description() const override
66 {
67 return "Format used by VASP that contains trajectory output of a DFT/MD "
68 "calculation.";
69 }
70
71 std::string specificationUrl() const override
72 {
73 return "https://www.vasp.at/wiki/OUTCAR";
74 }
75
76 std::vector<std::string> fileExtensions() const override;
77 std::vector<std::string> mimeTypes() const override;
78
79 [[nodiscard]] bool read(std::istream& inStream, Core::Molecule& mol) override;
80
81 // unimplemented
82 [[nodiscard]] bool write(std::ostream& outStream,
83 const Core::Molecule& mol) override;
84 };
85
86 } // namespace Avogadro::Io
87
88 #endif // AVOGADRO_IO_VASPFORMAT_H