Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new Laplacian for exchange BC #38

Merged
merged 73 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5e71370
change plot.period to plot.intervals
Jun 10, 2021
b2d7bbd
changed plot.period to plot.intervals
Jun 10, 2021
3a82ef3
updated Examples/Tests/Macroscopic_Maxwell/inputs_3d_LLG_noMs
jackieyao0114 Jun 10, 2021
7daf765
Merge branch 'development' of https://github.com/jackieyao0114/artemi…
jackieyao0114 Jun 10, 2021
ce7f3d8
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
jackieyao0114 Jun 10, 2021
1b9fdb1
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jun 10, 2021
aed980f
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jun 15, 2021
eea5c52
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jun 22, 2021
328c46c
Merge branch 'development' of https://github.com/jackieyao0114/artemi…
jackieyao0114 Jun 25, 2021
3200d03
some tweaks Examples/Tests/Macroscopic_Maxwell/inputs_3d_LLG_noMs
jackieyao0114 Jun 29, 2021
6dde33a
fixed bug in getting mag_exchange_init_style and mag_anisotropy_init_…
jackieyao0114 Jun 30, 2021
bfc0b01
Merge branch 'development' of https://github.com/jackieyao0114/artemi…
ajnonaka Jul 1, 2021
f581c09
EOL whitespace
ajnonaka Jul 1, 2021
e6685e3
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jul 7, 2021
d603691
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jul 7, 2021
a61bcc1
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jul 7, 2021
23bf869
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jul 8, 2021
428471e
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jul 14, 2021
7f08cae
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jul 22, 2021
ae6397c
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Jul 29, 2021
b78d170
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 9, 2021
8dd6bd3
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 9, 2021
58ee426
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 10, 2021
7df7291
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 10, 2021
849ccf1
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 11, 2021
5a048e1
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 12, 2021
eaa1002
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 16, 2021
57df4c6
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 26, 2021
8a6a97d
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Aug 30, 2021
0d3db52
Merge branch 'development' of https://github.com/ajnonaka/artemis int…
ajnonaka Aug 30, 2021
eacbac7
new Laplacian for exchange BC
prkkumar Sep 21, 2021
a2b5637
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Sep 22, 2021
15aeca0
Neumann BC with one-sided derivative at corners
prkkumar Sep 22, 2021
490ba05
fixes for components of M and nodality
prkkumar Sep 22, 2021
afe86ed
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Oct 4, 2021
9ec0d3f
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Oct 5, 2021
cf51157
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Oct 21, 2021
2b415ea
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Oct 21, 2021
d66c56f
exchange BC test case
prkkumar Oct 25, 2021
bfbf34c
detect boundary based on Ms rather than M
Oct 27, 2021
d917ea4
pass n_coefs_* in 1st order derivative calculations
prkkumar Oct 27, 2021
6fdcb80
properly initialize H_IndexType
ajnonaka Oct 27, 2021
c404dfd
proper stag bug fix
prkkumar Oct 27, 2021
83c5b54
Merge remote-tracking branch 'andy/H_IndexType' into exchange_bc
prkkumar Oct 27, 2021
71379de
exchange BC input file
prkkumar Oct 28, 2021
c9611de
exchangeBC test input file
Nov 2, 2021
9474991
Update GNUmakefile
prkkumar Nov 3, 2021
c1c7bdf
Fix typo in input file
prkkumar Nov 3, 2021
8f34bd5
Tabs
prkkumar Nov 3, 2021
93dfcfd
EOL
prkkumar Nov 3, 2021
be520a3
increase range of magnetic region so faces at interface are guarantee…
ajnonaka Nov 22, 2021
347d907
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Nov 22, 2021
b978353
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
ajnonaka Nov 22, 2021
b1f2be1
fill ghost cells for M_prev after each iteration
ajnonaka Nov 22, 2021
b35916a
constant magnetic properties
Nov 23, 2021
fa1a655
bugfix; use zface only in z loop
ajnonaka Nov 24, 2021
d3637db
revert these files
ajnonaka Nov 24, 2021
495ccfd
Fixes for Neumann BC
prkkumar Dec 7, 2021
ca8195d
bug fix yface
prkkumar Dec 7, 2021
e10bce6
Merge branch 'exchange_bc' of https://github.com/prkkumar/artemis int…
prkkumar Dec 7, 2021
3e17bcc
added test cases input and post processing bash
jackieyao0114 Feb 14, 2022
06ac081
resolve conflict
prkkumar Feb 14, 2022
188683a
Merge branch 'exchange_bc' of github.com:prkkumar/artemis into exchan…
prkkumar Feb 14, 2022
598eb15
fixed conflict when merging from development
jackieyao0114 Feb 15, 2022
3d5af9a
clean up magnetic property arrays without parsing; added back lev in …
jackieyao0114 Feb 15, 2022
c2c5996
fixed conflict
prkkumar Feb 15, 2022
cae3a93
Merge branch 'exchange_bc' of https://github.com/prkkumar/artemis int…
prkkumar Feb 15, 2022
5aba187
Merge branch 'development' of https://github.com/ECP-WarpX/artemis in…
jackieyao0114 Feb 15, 2022
e9acf98
fixed conflict when merging from prabhat exchange_bc
jackieyao0114 Feb 15, 2022
7e59c80
Merge pull request #2 from jackieyao0114/my_exchange_bc
prkkumar Feb 15, 2022
68237e3
style fix
prkkumar Feb 16, 2022
6c876bb
EOL
prkkumar Feb 16, 2022
7b86303
remove wrongly named files
prkkumar Feb 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,156 @@ struct CartesianYeeAlgorithm {

#endif

#ifdef WARPX_MAG_LLG
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is specific to LLG and mainly does laplacian, lets move this to a different file, in the same directory
CartesianYeeLaplacian.H
This would avoid conflicts when we merge and keep things clean


/**
* Perform divergence of gradient along x on M field when exchange coupling is on */
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real LaplacianDx_Mag (
amrex::Array4<amrex::Real> const& F,
amrex::Real const * const coefs_x,
int const i, int const j, int const k, int const ncomp=0 ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just so that the code is more readable, can we define a separate function GradientDx so that the Neumann boundary condition pops up? In this case, to calculate LaplacianDx_Mag, call GradientDx to calculate its derivatives.


amrex::Real const inv_dx = coefs_x[0];
if ( F(i+1,j,k) == 0.) //non-magnetic on right
{
if (F(i,j+1,k) == 0. || F(i,j,k+1) == 0.) //Top corner is non-magnetic -- left sided 2nd order derivative
{
return inv_dx*inv_dx*(2.*F(i,j,k) - 5.*F(i-1,j,k) + 4.*F(i-2,j,k) - F(i-3,j,k));
}
else if (F(i,j-1,k) == 0. || F(i,j,k-1) == 0.) //Bottom corner is non-magnetic -- right sided 2nd order derivative
{
return inv_dx*inv_dx*(2.*F(i,j,k) - 5.*F(i+1,j,k) + 4.*F(i+2,j,k) - F(i+3,j,k));
}
else
{
return inv_dx*(0. - DownwardDx(F, coefs_x, i, j, k, ncomp));
}
}
else if (F(i-1,j,k) == 0.) //non-magnetic on left
{
if (F(i,j+1,k) == 0. || F(i,j,k+1) == 0.) //Top corner is non-magnetic -- left sided 2nd order derivative
{
return inv_dx*inv_dx*(2.*F(i,j,k) - 5.*F(i-1,j,k) + 4.*F(i-2,j,k) - F(i-3,j,k));
}
else if (F(i,j-1,k) == 0. || F(i,j,k-1) == 0.) //Bottom corner is non-magnetic -- right sided 2nd order derivative
{
return inv_dx*inv_dx*(2.*F(i,j,k) - 5.*F(i+1,j,k) + 4.*F(i+2,j,k) - F(i+3,j,k));
}
else
{
return inv_dx*(UpwardDx(F, coefs_x, i, j, k, ncomp) - 0.);
}
}
else
{
return inv_dx*(UpwardDx(F, coefs_x, i, j, k, ncomp) - DownwardDx(F, coefs_x, i, j, k, ncomp));
}
}

/**
* Perform divergence of gradient along y on M field when exchange coupling is on*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real LaplacianDy_Mag (
amrex::Array4<amrex::Real> const& F,
amrex::Real const * const coefs_y,
int const i, int const j, int const k, int const ncomp=0 ) {

amrex::Real const inv_dy = coefs_y[0];
if ( F(i,j+1,k) == 0.) //non-magnetic on right
{
if (F(i+1,j,k) == 0. || F(i,j,k+1) == 0.) //Top corner is non-magnetic -- left sided 2nd order derivative
{
return inv_dy*inv_dy*(2.*F(i,j,k) - 5.*F(i,j-1,k) + 4.*F(i,j-2,k) - F(i,j-3,k));
}
else if (F(i-1,j,k) == 0. || F(i,j,k-1) == 0.) //Bottom corner is non-magnetic -- right sided 2nd order derivative
{
return inv_dy*inv_dy*(2.*F(i,j,k) - 5.*F(i,j+1,k) + 4.*F(i,j+2,k) - F(i,j+3,k));
}
else
{
return inv_dy*(0. - DownwardDy(F, coefs_y, i, j, k, ncomp));
}
}
else if (F(i,j-1,k) == 0.) //non-magnetic on left
{
if (F(i+1,j,k) == 0. || F(i,j,k+1) == 0.) //Top corner is non-magnetic -- left sided 2nd order derivative
{
return inv_dy*inv_dy*(2.*F(i,j,k) - 5.*F(i,j-1,k) + 4.*F(i,j-2,k) - F(i,j-3,k));
}
else if (F(i-1,j,k) == 0. || F(i,j,k-1) == 0.) //Bottom corner is non-magnetic -- right sided 2nd order derivative
{
return inv_dy*inv_dy*(2.*F(i,j,k) - 5.*F(i,j+1,k) + 4.*F(i,j+2,k) - F(i,j+3,k));
}
else
{
return inv_dy*(UpwardDy(F, coefs_y, i, j, k, ncomp) - 0.);
}
}
else
{
return inv_dy*(UpwardDy(F, coefs_y, i, j, k, ncomp) - DownwardDy(F, coefs_y, i, j, k, ncomp));
}
}

/**
* Perform divergence of gradient along z on M field when exchange coupling is on*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real LaplacianDz_Mag (
amrex::Array4<amrex::Real> const& F,
amrex::Real const * const coefs_z,
int const i, int const j, int const k, int const ncomp=0 ) {

amrex::Real const inv_dz = coefs_z[0];
if ( F(i,j,k+1) == 0.) //non-magnetic on right
{
if (F(i+1,j,k) == 0. || F(i,j+1,k) == 0.) //Top corner is non-magnetic -- left sided 2nd order derivative
{
return inv_dz*inv_dz*(2.*F(i,j,k) - 5.*F(i,j,k-1) + 4.*F(i,j,k-2) - F(i,j,k-3));
}
else if (F(i-1,j,k) == 0. || F(i,j-1,k) == 0.) //Bottom corner is non-magnetic -- right sided 2nd order derivative
{
return inv_dz*inv_dz*(2.*F(i,j,k) - 5.*F(i,j,k+1) + 4.*F(i,j,k+2) - F(i,j,k+3));
}
else
{
return inv_dz*(0. - DownwardDz(F, coefs_z, i, j, k, ncomp));
}
}
else if (F(i,j,k-1) == 0.) //non-magnetic on left
{
if (F(i+1,j,k) == 0. || F(i,j+1,k) == 0.) //Top corner is non-magnetic -- left sided 2nd order derivative
{
return inv_dz*inv_dz*(2.*F(i,j,k) - 5.*F(i,j,k-1) + 4.*F(i,j,k-2) - F(i,j,k-3));
}
else if (F(i-1,j,k) == 0. || F(i,j-1,k) == 0.) //Bottom corner is non-magnetic -- right sided 2nd order derivative
{
return inv_dz*inv_dz*(2.*F(i,j,k) - 5.*F(i,j,k+1) + 4.*F(i,j,k+2) - F(i,j,k+3));
}
else
{
return inv_dz*(UpwardDz(F, coefs_z, i, j, k, ncomp) - 0.);
}
}
else
{
return inv_dz*(UpwardDz(F, coefs_z, i, j, k, ncomp) - DownwardDz(F, coefs_z, i, j, k, ncomp));
}
}

/**
* Compute the sum to get Laplacian of M field when exchange coupling is on*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
static amrex::Real Laplacian_Mag (
amrex::Array4<amrex::Real> const& F,
amrex::Real const * const coefs_x, amrex::Real const * const coefs_y, amrex::Real const * const coefs_z,
int const i, int const j, int const k, int const ncomp=0 ) {

return LaplacianDx_Mag(F, coefs_x, i, j, k, ncomp) + LaplacianDy_Mag(F, coefs_y, i, j, k, ncomp) + LaplacianDz_Mag(F, coefs_z, i, j, k, ncomp);
}

#endif

};

#endif // WARPX_FINITE_DIFFERENCE_ALGORITHM_CARTESIAN_YEE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian(
// H_exchange
if (mag_exchange_arrx == 0._rt) amrex::Abort("The mag_exchange_arrx is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arrx / PhysConst::mu0 / mag_Ms_arrx / mag_Ms_arrx;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down Expand Up @@ -298,9 +298,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian(
// H_exchange
if (mag_exchange_arry == 0._rt) amrex::Abort("The mag_exchange_arry is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arry / PhysConst::mu0 / mag_Ms_arry / mag_Ms_arry;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down Expand Up @@ -411,9 +411,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian(
// H_exchange
if (mag_exchange_arrz == 0._rt) amrex::Abort("The mag_exchange_arrz is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arrz / PhysConst::mu0 / mag_Ms_arrz / mag_Ms_arrz;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian_2nd(
// H_exchange
if (mag_exchange_arrx == 0._rt) amrex::Abort("The mag_exchange_arrx is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arrx / PhysConst::mu0 / mag_Ms_arrx / mag_Ms_arrx;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down Expand Up @@ -275,9 +275,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian_2nd(
// H_exchange
if (mag_exchange_arry == 0._rt) amrex::Abort("The mag_exchange_arry is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arry / PhysConst::mu0 / mag_Ms_arry / mag_Ms_arry;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down Expand Up @@ -356,9 +356,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian_2nd(
// H_exchange
if (mag_exchange_arrz == 0._rt) amrex::Abort("The mag_exchange_arrz is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arrz / PhysConst::mu0 / mag_Ms_arrz / mag_Ms_arrz;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down Expand Up @@ -510,9 +510,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian_2nd(
// H_exchange
if (mag_exchange_arrx == 0._rt) amrex::Abort("The mag_exchange_arrx is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arrx / PhysConst::mu0 / mag_Ms_arrx / mag_Ms_arrx;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_xface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down Expand Up @@ -620,9 +620,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian_2nd(
// H_exchange
if (mag_exchange_arry == 0._rt) amrex::Abort("The mag_exchange_arry is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arry / PhysConst::mu0 / mag_Ms_arry / mag_Ms_arry;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_yface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down Expand Up @@ -731,9 +731,9 @@ void FiniteDifferenceSolver::MacroscopicEvolveHMCartesian_2nd(
// H_exchange
if (mag_exchange_arrz == 0._rt) amrex::Abort("The mag_exchange_arrz is 0.0 while including the exchange coupling term H_exchange for H_eff");
amrex::Real const H_exchange_coeff = 2.0 * mag_exchange_arrz / PhysConst::mu0 / mag_Ms_arrz / mag_Ms_arrz;
Hx_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
Hx_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 0);
Hy_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 1);
Hz_eff += H_exchange_coeff * T_Algo::Laplacian_Mag(M_zface, coefs_x, coefs_y, coefs_z, i, j, k, 2);
}

if (mag_anisotropy_coupling == 1){
Expand Down