Loading...
Searching...
No Matches
ff_transformable.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * FFTransformable — base class for planewave fields with dual real/reciprocal space storage.
5 *
6 * Provides typed storage for both the real-space and reciprocal-space
7 * representations of a Fourier-transformable field, plus pure virtual
8 * transform methods that subclasses implement using their specific FFT basis.
9 *
10 * Template parameters:
11 * RealRepresentationType — e.g. std::vector<std::vector<Real>> for spin-resolved grids
12 * ReciprocalRepresentationType — e.g. std::vector<Complex> for G-space coefficients
13 */
14
15namespace q3 {
16
17template <typename RealRepresentationType, typename ReciprocalRepresentationType>
19 public:
20 virtual ~FFTransformable() = default;
21
22 // ─── Representation access ───────────────────────────────────────────────
23 [[nodiscard]] const RealRepresentationType& real_space_representation() const {
24 return real_space_data_;
25 }
26 RealRepresentationType& real_space_representation() {
27 return real_space_data_;
28 }
29 [[nodiscard]] const ReciprocalRepresentationType& reciprocal_space_representation() const {
31 }
32 ReciprocalRepresentationType& reciprocal_space_representation() {
34 }
35
36 // ─── Transforms ─────────────────────────────────────────────────────────
37 virtual void to_reciprocal_space() = 0;
38 virtual void to_real_space() = 0;
39
40 protected:
41 RealRepresentationType real_space_data_;
42 ReciprocalRepresentationType reciprocal_space_data_;
43};
44
45} // namespace q3
RealRepresentationType & real_space_representation()
const RealRepresentationType & real_space_representation() const
virtual ~FFTransformable()=default
const ReciprocalRepresentationType & reciprocal_space_representation() const
RealRepresentationType real_space_data_
virtual void to_real_space()=0
virtual void to_reciprocal_space()=0
ReciprocalRepresentationType & reciprocal_space_representation()
ReciprocalRepresentationType reciprocal_space_data_