OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
world_queries.hpp File Reference

World query and coordinate transformation functions. More...

#include "csys.hpp"
#include "types.hpp"
#include "world.hpp"
#include <vector>
Include dependency graph for world_queries.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  pfc::world
 Namespace for decomposition-related classes and functions.
 

Functions

template<typename T >
Int3 pfc::world::get_size (const World< T > &world) noexcept
 
template<typename T >
int pfc::world::get_size (const World< T > &world, int index)
 
template<typename T >
size_t pfc::world::get_total_size (const World< T > &world) noexcept
 
const autopfc::world::get_lower (const CartesianWorld &world) noexcept
 Get the lower bounds of the world.
 
const autopfc::world::get_lower (const CartesianWorld &world, int index)
 Get the lower bounds of the world in a specific dimension.
 
const autopfc::world::get_upper (const CartesianWorld &world) noexcept
 Get the upper bounds of the world in a specific dimension.
 
auto pfc::world::get_upper (const CartesianWorld &world, int index)
 Get the upper bounds of the world in a specific dimension.
 
template<typename T >
const autopfc::world::get_coordinate_system (const World< T > &world) noexcept
 Get the coordinate system of the world.
 
const Real3 & pfc::world::get_spacing (const CartesianWorld &world) noexcept
 
double pfc::world::get_spacing (const CartesianWorld &world, int index) noexcept
 
const Real3 & pfc::world::get_origin (const CartesianWorld &world) noexcept
 
double pfc::world::get_origin (const CartesianWorld &world, int index) noexcept
 
template<typename T >
auto pfc::world::to_coords (const World< T > &world, const Int3 &indices) noexcept
 
template<typename T >
auto pfc::world::to_indices (const World< T > &world, const Real3 &coords) noexcept
 
template<typename T >
double pfc::world::physical_volume (const World< T > &world) noexcept
 Compute physical volume of domain.
 
template<typename T >
bool pfc::world::is_1d (const World< T > &world) noexcept
 Check if domain is 1D (only x-direction has > 1 point)
 
template<typename T >
bool pfc::world::is_2d (const World< T > &world) noexcept
 Check if domain is 2D (x and y have > 1 point, z has 1)
 
template<typename T >
bool pfc::world::is_3d (const World< T > &world) noexcept
 Check if domain is 3D (all dimensions have > 1 point)
 
template<typename T >
int pfc::world::dimensionality (const World< T > &world) noexcept
 Get dimensionality as integer.
 
template<typename T >
Real3 pfc::world::get_lower_bounds (const World< T > &world) noexcept
 Get physical lower bounds (origin corner)
 
template<typename T >
Real3 pfc::world::get_upper_bounds (const World< T > &world) noexcept
 Get physical upper bounds (far corner)
 
template<typename T >
std::array< std::vector< double >, 3 > pfc::world::coordinates (const World< T > &world) noexcept
 

Detailed Description

World query and coordinate transformation functions.

This file contains functions for querying World properties and performing coordinate transformations:

Query Functions:

  • get_size(), get_total_size() - Grid dimensions
  • get_spacing(), get_origin() - Coordinate system parameters
  • get_lower_bounds(), get_upper_bounds() - Physical domain bounds
  • physical_volume() - Total physical volume
  • is_1d(), is_2d(), is_3d(), dimensionality() - Dimension queries

Coordinate Transformations:

  • to_coords() - Grid indices → physical coordinates
  • to_indices() - Physical coordinates → grid indices

All functions are zero-cost inline operations with no runtime overhead.

See also
world.hpp for the core World struct definition
world_factory.hpp for World creation functions