Alamo
PFC.H
Go to the documentation of this file.
1//
2// Basic implementation of the phase field crystal model of Elder et al, 2002.
3//
4// Free energy functional is:
5//
6// .. math::
7//
8// \mathcal{F} = \int \Big[ \frac{1}{2}\eta\Big((q^2+\nabla^2)^2 - \epsilon\Big)\eta + \frac{1}{4}\eta^4 \Big]d\mathbf{x}
9//
10// Order parameter evolves with Cahn-Hilliard kinetics:
11//
12// .. math::
13//
14// \frac{\partial \eta}{\partial t} = \nabla^2 \frac{\delta\mathcal{F}}{\delta\eta}
15//
16// The variational derivative is
17//
18// .. math::
19//
20// \frac{\delta\mathcal{F}}{\delta\eta} = \eta^3 + (q^4-\epsilon)\eta + 2q^2\nabla^2\eta + \nabla^4\eta
21//
22// The semi-implicit spectral update is
23//
24// .. math::
25//
26// \eta_{n+1} = \frac{\hat{\eta}_n - dt\,\mathbf{\omega}^2 \mathcal{F}[\eta^3_n]}
27// {1 + dt\,[(q^4-\epsilon)\mathbf{\omega}^2 - 2q^2\mathbf{\omega}^4 + \mathbf{\omega}^6]}
28//
29
30#ifndef INTEGRATOR_PFC_H
31#define INTEGRATOR_PFC_H
32
33#include <AMReX.H>
34#include <AMReX_MLMG.H>
35
36#include "IC/IC.H"
37#include "BC/BC.H"
38#include "IO/ParmParse.H"
40
41namespace Integrator
42{
43
44class PFC : public Integrator
45{
46public:
47
48 /// Basic constructor (don't use)
49 PFC();
50
51 /// Destroy pointers defined in Parse
52 ~PFC();
53
54 /// Use this constructor
56 { Parse(*this, pp); }
57
58 /// Scan input values and initialize fields
59 static void Parse(PFC& value, IO::ParmParse& pp);
60
61protected:
62
63 /// Set values in fields
64 void Initialize (int lev) override;
65 /// Integrate eta over one timestep on lev
66 void Advance (int lev, Set::Scalar time, Set::Scalar dt) override;
67 /// Mark any cells that need to be refined
68 void TagCellsForRefinement (int lev, amrex::TagBoxArray& tags, amrex::Real time, int ngrow) override;
69
70private:
71
72 Set::Field<Set::Scalar> eta_mf; /// Order parameter field
73 Set::Field<Set::Scalar> grad_chempot_mf; /// Field to calculate FFT of nonlinar part
74
75 BC::BC<Set::Scalar> *bc; /// eta's bc object
76 IC::IC<Set::Scalar> *ic; /// eta's ic object
77
80
81};
82}
83#endif
Definition BC.H:42
Pure abstract IC object from which all other IC objects inherit.
Definition IC.H:23
amrex::Vector< amrex::Real > dt
Timesteps for each level of refinement.
Definition Integrator.H:381
Set::Field< Set::Scalar > grad_chempot_mf
Order parameter field.
Definition PFC.H:73
void TagCellsForRefinement(int lev, amrex::TagBoxArray &tags, amrex::Real time, int ngrow) override
Mark any cells that need to be refined.
Definition PFC.cpp:138
~PFC()
Destroy pointers defined in Parse.
Definition PFC.cpp:19
static void Parse(PFC &value, IO::ParmParse &pp)
Scan input values and initialize fields.
Definition PFC.cpp:25
PFC()
Basic constructor (don't use)
Definition PFC.cpp:16
IC::IC< Set::Scalar > * ic
eta's bc object
Definition PFC.H:76
Set::Scalar eps
Definition PFC.H:79
Set::Field< Set::Scalar > eta_mf
Definition PFC.H:72
BC::BC< Set::Scalar > * bc
Field to calculate FFT of nonlinar part.
Definition PFC.H:75
Set::Scalar q0
eta's ic object
Definition PFC.H:78
void Initialize(int lev) override
Set values in fields.
Definition PFC.cpp:130
PFC(IO::ParmParse &pp)
Use this constructor.
Definition PFC.H:55
void Advance(int lev, Set::Scalar time, Set::Scalar dt) override
Integrate eta over one timestep on lev.
Definition PFC.cpp:123
Collection of numerical integrator objects.
Definition AllenCahn.H:41
amrex::Real Scalar
Definition Base.H:19
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector
Definition Base.H:20