OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
Diffusion Class Reference
Inheritance diagram for Diffusion:
Collaboration diagram for Diffusion:

Public Member Functions

void initialize (double dt) override
 Initialize the diffusion model.
 
void step (double) override
 The actual time stepping function.
 
void find_minmax ()
 A simple MPI communication example.
 
double get_psi_min () const
 
double get_psi_max () const
 
void allocate ()
 
void prepare_operators (double dt)
 
void initialize (double dt) override
 
void step (double) override
 
void find_minmax ()
 
- Public Member Functions inherited from pfc::Model
 ~Model ()
 Destroy the Model object.
 
 Model (FFT &fft, const World &world)
 
 Model (const Model &)=delete
 Disable copy constructor.
 
Modeloperator= (const Model &)=delete
 Disable copy assignment operator.
 
bool is_rank0 () const noexcept
 Check if current MPI rank is 0.
 
const Worldget_world () const noexcept
 Get the decomposition object associated with the model.
 
FFTget_fft () noexcept
 
virtual size_t get_allocated_memory_bytes () const
 
bool has_real_field (std::string_view field_name) const noexcept
 Check if the model has a real-valued field with the given name.
 
void add_real_field (std::string_view name, RealField &field)
 
bool has_complex_field (std::string_view field_name) const noexcept
 
void add_complex_field (std::string_view name, ComplexField &field)
 
RealField & get_real_field (std::string_view name)
 
const RealField & get_real_field (std::string_view name) const
 Retrieve a registered real-valued field by name (const version)
 
ComplexField & get_complex_field (std::string_view name)
 
const ComplexField & get_complex_field (std::string_view name) const
 Retrieve a registered complex-valued field by name (const version)
 
void add_field (const std::string &name, RealField &field)
 Add a field to the model.
 
void add_field (const std::string &name, ComplexField &field)
 Add a field to the model.
 
bool has_field (std::string_view field_name) const noexcept
 
virtual Field & get_field ()
 Get a reference to the default primary unknown field.
 

Public Attributes

double psi_min = 0.0
 
double psi_max = 1.0
 

Detailed Description

Member Function Documentation

◆ find_minmax()

void Diffusion::find_minmax ( )
inline

A simple MPI communication example.

We find minimum and maximum of psi locally, and then communicate them between different MPI ranks.

Examples
04_diffusion_model.cpp, and 05_simulator.cpp.
Here is the caller graph for this function:

◆ initialize() [1/2]

void Diffusion::initialize ( double  dt)
inlineoverridevirtual

Initialize the diffusion model.

This function is called before the actual time stepping starts. This is the right place to allocate memory for simulation as well as pre-calculate operators and other things needed in order to start the simulation.

Parameters
dtTime step interval

Implements pfc::Model.

Examples
04_diffusion_model.cpp, and 05_simulator.cpp.
Here is the call graph for this function:

◆ initialize() [2/2]

void Diffusion::initialize ( double  dt)
inlineoverridevirtual

Implements pfc::Model.

◆ step() [1/2]

void Diffusion::step ( double  )
inlineoverridevirtual

The actual time stepping function.

In this particular case, with a simple linear model, is basically

u(t+Δt) = ifft(opL*fft(u(t)))

Implements pfc::Model.

Examples
04_diffusion_model.cpp, and 05_simulator.cpp.
Here is the call graph for this function:

◆ step() [2/2]

void Diffusion::step ( double  )
inlineoverridevirtual

Implements pfc::Model.


The documentation for this class was generated from the following files: