25#ifndef __FIELD4D_HPP__
26#define __FIELD4D_HPP__
43 std::array<std::unique_ptr<Periodic_function<double>>, 4>
components_;
55 smooth_periodic_function_ptr_t<double>
const* ptr_rg{
nullptr};
56 spheric_function_set_ptr_t<double>
const* ptr_mt{
nullptr};
57 if (ptr__[i] && ptr__[i]->rg.ptr) {
58 ptr_rg = &ptr__[i]->rg;
60 if (ptr__[i] && ptr__[i]->mt.ptr) {
61 ptr_mt = &ptr__[i]->mt;
63 if (ctx_.full_potential()) {
65 components_[i] = std::make_unique<Periodic_function<double>>(ctx_, [&](
int ia){
return lmax__;},
nullptr,
68 components_[i] = std::make_unique<Periodic_function<double>>(ctx_, ptr_rg);
88 RTE_ASSERT(i >= 0 && i <= 2);
93 inline auto const&
vector(
int i)
const
95 RTE_ASSERT(i >= 0 && i <= 2);
99 inline auto& component(
int i)
101 RTE_ASSERT(i >= 0 && i <= 3);
109 throw std::runtime_error(
"invalid access");
114 inline auto const& component(
int i)
const
116 RTE_ASSERT(i >= 0 && i <= 3);
127 inline void fft_transform(
int direction__)
130 component(i).rg().fft_transform(direction__);
139 inline auto const& ctx()
const
146 std::vector<Spheric_function_set<double, atom_index_t>*> result;
169 std::vector<Smooth_periodic_function<double>*> result;
Four-component function consisting of scalar and vector parts.
auto & scalar()
Return scalar part of the field.
std::array< std::unique_ptr< Periodic_function< double > >, 4 > components_
Four components of the field: scalar, vector_z, vector_x, vector_y.
auto & component_raise(int i)
Throws error in case of invalid access.
auto const & vector(int i) const
Return component of the vector part of the field.
auto const & scalar() const
Return scalar part of the field.
Field4D(Simulation_context &ctx__, lmax_t lmax__, std::array< periodic_function_ptr_t< double > const *, 4 > ptr__={nullptr, nullptr, nullptr, nullptr})
Constructor.
auto & vector(int i)
Return component of the vector part of the field.
Simulation context is a set of parameters and objects describing a single simulation.
int num_mag_dims() const
Number of dimensions in the magnetization vector.
Memory management functions and classes.
Namespace of the SIRIUS library.
Contains declaration and partial implementation of sirius::Periodic_function class.
Describe external pointers to periodic function.
Contains typedefs, enums and simple descriptors.