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

Convenience functions for World creation. More...

#include "strong_types.hpp"
#include "types.hpp"
#include "world.hpp"
#include "world_factory.hpp"
#include <stdexcept>
#include <string>
Include dependency graph for world_helpers.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

CartesianWorld pfc::world::uniform (int size)
 Create uniform grid with unit spacing at origin.
 
CartesianWorld pfc::world::uniform (int size, double spacing)
 Create uniform grid with specified spacing.
 
CartesianWorld pfc::world::from_bounds (Int3 size, Real3 lower, Real3 upper, Bool3 periodic={true, true, true})
 Create grid from physical bounds (automatically computes spacing).
 
CartesianWorld pfc::world::with_spacing (Int3 size, Real3 spacing)
 Create grid with default origin but custom spacing.
 
CartesianWorld pfc::world::with_origin (Int3 size, Real3 origin)
 Create grid with custom origin but unit spacing.
 

Detailed Description

Convenience functions for World creation.

This file contains convenience functions that simplify common World creation patterns. These functions provide shortcuts for frequently-used configurations:

  • uniform(size) - Cubic grid with unit spacing
  • uniform(size, spacing) - Cubic grid with custom spacing
  • from_bounds() - Create from physical domain bounds
  • with_spacing() - Grid with custom spacing at origin
  • with_origin() - Grid with custom origin and unit spacing

These helpers make World creation more ergonomic for common use cases while delegating to the core factory functions in world_factory.hpp.

See also
world.hpp for the core World struct definition
world_factory.hpp for the fundamental create() functions