![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Defines the Field<T> structure and related free functions for data storage in OpenPFC. More...
#include "openpfc/core/csys.hpp"#include "openpfc/core/types.hpp"#include "openpfc/core/world.hpp"#include <array>#include <cassert>#include <functional>#include <vector>
Go to the source code of this file.
Classes | |
| struct | pfc::field::Field< T > |
Typedefs | |
| using | pfc::field::World = pfc::world::World< pfc::csys::CartesianTag > |
Functions | |
| template<typename T > | |
| Field< T > | pfc::field::create (const World &world) |
| template<typename T > | |
| const auto & | pfc::field::get_data (const Field< T > &field) |
| template<typename T > | |
| auto & | pfc::field::get_data (Field< T > &field) |
| template<typename T > | |
| const auto & | pfc::field::get_world (const Field< T > &field) |
| template<typename T > | |
| Field< T > | pfc::field::create (const World &world, std::vector< T > &&data) |
| template<typename T > | |
| Field< T > | pfc::field::create (const World &world, const std::vector< T > &data) |
| template<typename T , typename Func , typename = std::enable_if_t<std::is_invocable_v<Func, Real3>>> | |
| Field< T > | pfc::field::create (const World &world, Func &&func) |
| template<typename T , typename Func > | |
| void | pfc::field::apply (Field< T > &f, Func &&func) |
| template<typename T > | |
| auto | pfc::field::indices (const Field< T > &f) |
Defines the Field<T> structure and related free functions for data storage in OpenPFC.
Fields in OpenPFC represent structured data over a local simulation domain. A Field is parameterized by the value type T, and its layout is defined by an immutable MultiIndex<3> and CoordinateSystem, both derived from the local World.
struct Field<T> by default.m_data, m_index, and m_coordsys are publicly accessible but prefixed with m_ to indicate internal use. Users may access these directly but are encouraged to prefer free functions.pfc::field namespace.Fields support scalar types like double, but also custom vector or tensor types, e.g., Vec3f32, as long as they are trivially copyable and can be stored in std::vector<T>.
This component is designed to work seamlessly with differential operators, FFTs, and models without ever exposing internal logic unnecessarily.