Skip to content

Commit

Permalink
move include_Landau/grad from warpx class to ferroe class
Browse files Browse the repository at this point in the history
  • Loading branch information
prkkumar committed Apr 26, 2024
1 parent 3b10f2b commit 48d96b5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 29 deletions.
35 changes: 19 additions & 16 deletions Source/FieldSolver/FerroE/FerroE.H
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,27 @@ public:
std::unique_ptr<amrex::Parser> m_ferroelectric_parser;
std::unique_ptr<amrex::MultiFab> m_ferroelectric_mf;

//Coefficients in the evolution of the polarization equation
const amrex::Real mu = 1.35e-18;
const amrex::Real gamma = 2.0e-7;
int include_Landau = 1;
int include_grad = 0;

//Landau free energy coefficients
const amrex::Real alpha_1 = -3.7116e7;
const amrex::Real alpha_11 = -2.097e8;
const amrex::Real alpha_12 = 7.974e8;
const amrex::Real alpha_111 = 1.294e9;
const amrex::Real alpha_112 = -1.95e9;
const amrex::Real alpha_123 = -2.5e9;
const amrex::Real alpha_1111 = 3.863e10;
const amrex::Real alpha_1112 = 2.529e10;
const amrex::Real alpha_1122 = 1.637e10;
const amrex::Real alpha_1123 = 1.367e10;
//Coefficients in the evolution of the polarization equation
const amrex::Real mu = 1.35e-18;
const amrex::Real gamma = 2.0e-7;

//Gradient energy coefficients
const amrex::Real G_11 = 5.1e-10;
//Landau free energy coefficients
const amrex::Real alpha_1 = -3.7116e7;
const amrex::Real alpha_11 = -2.097e8;
const amrex::Real alpha_12 = 7.974e8;
const amrex::Real alpha_111 = 1.294e9;
const amrex::Real alpha_112 = -1.95e9;
const amrex::Real alpha_123 = -2.5e9;
const amrex::Real alpha_1111 = 3.863e10;
const amrex::Real alpha_1112 = 2.529e10;
const amrex::Real alpha_1122 = 1.637e10;
const amrex::Real alpha_1123 = 1.367e10;

//Gradient energy coefficients
const amrex::Real G_11 = 5.1e-10;
};


Expand Down
10 changes: 6 additions & 4 deletions Source/FieldSolver/FerroE/FerroE.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "FerroE.H"
#include "Eff_Field_Landau.H"
#include "Eff_Field_grad.H"
#include "Eff_Field_Grad.H"
#include "FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.H"
#include "Utils/WarpXUtil.H"
#include "WarpX.H"
Expand Down Expand Up @@ -31,6 +31,8 @@ void
FerroE::ReadParameters ()
{
amrex::ParmParse pp_ferroe("ferroe");
pp_ferroe.query("include_Landau", include_Landau);
pp_ferroe.query("include_grad", include_grad);

utils::parser::Store_parserString(pp_ferroe, "ferroelectric_function(x,y,z)", m_str_ferroelectric_function);
m_ferroelectric_parser = std::make_unique<amrex::Parser>(
Expand Down Expand Up @@ -189,8 +191,8 @@ FerroE::EvolveP (amrex::Real dt)
{
amrex::Print() << " evolve P \n";
auto & warpx = WarpX::GetInstance();
int include_Landau = warpx.include_Landau;
int include_grad = warpx.include_grad;
// int include_Landau = ferroe.include_Landau;
// int include_grad = ferroe.include_grad;
const int lev = 0;
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> dx = warpx.Geom(lev).CellSizeArray();

Expand All @@ -216,7 +218,7 @@ FerroE::EvolveP (amrex::Real dt)
amrex::Box const& tpy = mfi.tilebox(Py->ixType().toIntVect());
amrex::Box const& tpz = mfi.tilebox(Pz->ixType().toIntVect());


amrex::Print() << "include_Landau = " << include_Landau << "\n";
amrex::ParallelFor(tpx, tpy, tpz,
[=] AMREX_GPU_DEVICE (int i, int j, int k) {
if (fe_arr(i,j,k)==1 and fe_arr(i+1,j,k)==1) {
Expand Down
4 changes: 0 additions & 4 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,6 @@ public:
int mag_LLG_exchange_coupling = 0;
// turn off the anisotropy coupling term H_anisotropy in H_eff for the LLG updates
int mag_LLG_anisotropy_coupling = 0;
#endif
#ifdef WARPX_FERROE
int include_Landau = 1;
int include_grad = 0;
#endif
//! If true, the current is deposited on a nodal grid and then centered onto a staggered grid
//! using finite centering of order given by #current_centering_nox, #current_centering_noy,
Expand Down
5 changes: 0 additions & 5 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,11 +1071,6 @@ WarpX::ReadParameters ()
pp_warpx.query("mag_LLG_anisotropy_coupling",mag_LLG_anisotropy_coupling);
#endif

#ifdef WARPX_FERROE
// include Landau free energy contribution to effective field
pp_warpx.query("include_Landau", include_Landau);
#endif

#ifdef WARPX_DIM_RZ
WARPX_ALWAYS_ASSERT_WITH_MESSAGE( isAnyBoundaryPML() == false || electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD,
"PML are not implemented in RZ geometry with FDTD; please set a different boundary condition using boundary.field_lo and boundary.field_hi.");
Expand Down

0 comments on commit 48d96b5

Please sign in to comment.