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

Read initial conditions from binary file. More...

#include <iostream>
#include "../binary_reader.hpp"
#include "../field_modifier.hpp"
Include dependency graph for file_reader.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pfc::FileReader
 

Detailed Description

Read initial conditions from binary file.

This file defines the FileReader class, which reads field values from a binary file to initialize simulation state. Useful for:

  • Restarting simulations from checkpoints
  • Loading pre-computed initial conditions
  • Continuing interrupted simulations

The binary file format must match the expected field layout (domain size, decomposition, data type).

Usage:

auto ic = std::make_unique<pfc::FileReader>("checkpoint.bin");
ic->set_field_name("density");
simulator.add_initial_condition(std::move(ic));
See also
binary_reader.hpp for binary I/O operations
field_modifier.hpp for base class
Author
OpenPFC Contributors
Date
2025