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

Always use Kottke algorithm #44

Merged
merged 1 commit into from Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions configure.ac
Expand Up @@ -71,11 +71,6 @@ if test "$ok" = "no"; then
AC_DEFINE(CHECK_DISABLE,1,[Define to disable sanity checks in code])
fi

AC_ARG_ENABLE(kottke, [AC_HELP_STRING([--disable-kottke],[disable new anisotropic smoothing based on Kottke algorithm])], ok=$enableval, ok=yes)
if test "$ok" = "yes"; then
AC_DEFINE(KOTTKE,1,[Define to enable Kottke anisotropic smoothing])
fi

AC_ARG_WITH(inv-symmetry,[AC_HELP_STRING([--with-inv-symmetry],[take advantage of (and require) inv. sym.])], inv_sym=$withval, inv_sym=no)
if test "$inv_sym" = "no"; then
AC_DEFINE(SCALAR_COMPLEX,1,[Define to use complex fields and
Expand Down
55 changes: 0 additions & 55 deletions mpb/epsilon.c
Expand Up @@ -318,7 +318,6 @@ static int mean_epsilon_func(symmetric_matrix *meps,

{
symmetric_matrix eps2, epsinv2;
#ifdef KOTTKE /* new anisotropic smoothing, based on Kottke algorithm */
symmetric_matrix eps1, delta;
double Rot[3][3], norm, n0, n1, n2;
material_epsilon(mat2, &eps2, &epsinv2);
Expand Down Expand Up @@ -421,60 +420,6 @@ static int mean_epsilon_func(symmetric_matrix *meps,
|| maxwell_sym_matrix_positive_definite(meps),
"negative mean epsilon from Kottke algorithm");
# endif

#else /* !KOTTKE, just compute mean epsilon and mean inverse epsilon */
material_epsilon(mat2, &eps2, &epsinv2);

meps->m00 = fill * (meps->m00 - eps2.m00) + eps2.m00;
meps->m11 = fill * (meps->m11 - eps2.m11) + eps2.m11;
meps->m22 = fill * (meps->m22 - eps2.m22) + eps2.m22;
#ifdef WITH_HERMITIAN_EPSILON
CASSIGN_SCALAR(meps->m01,
fill * (CSCALAR_RE(meps->m01) -
CSCALAR_RE(eps2.m01)) + CSCALAR_RE(eps2.m01),
fill * (CSCALAR_IM(meps->m01) -
CSCALAR_IM(eps2.m01)) + CSCALAR_IM(eps2.m01));
CASSIGN_SCALAR(meps->m02,
fill * (CSCALAR_RE(meps->m02) -
CSCALAR_RE(eps2.m02)) + CSCALAR_RE(eps2.m02),
fill * (CSCALAR_IM(meps->m02) -
CSCALAR_IM(eps2.m02)) + CSCALAR_IM(eps2.m02));
CASSIGN_SCALAR(meps->m12,
fill * (CSCALAR_RE(meps->m12) -
CSCALAR_RE(eps2.m12)) + CSCALAR_RE(eps2.m12),
fill * (CSCALAR_IM(meps->m12) -
CSCALAR_IM(eps2.m12)) + CSCALAR_IM(eps2.m12));
#else
meps->m01 = fill * (meps->m01 - eps2.m01) + eps2.m01;
meps->m02 = fill * (meps->m02 - eps2.m02) + eps2.m02;
meps->m12 = fill * (meps->m12 - eps2.m12) + eps2.m12;
#endif

meps_inv->m00 = fill * (meps_inv->m00 - epsinv2.m00) + epsinv2.m00;
meps_inv->m11 = fill * (meps_inv->m11 - epsinv2.m11) + epsinv2.m11;
meps_inv->m22 = fill * (meps_inv->m22 - epsinv2.m22) + epsinv2.m22;
#ifdef WITH_HERMITIAN_EPSILON
CASSIGN_SCALAR(meps_inv->m01,
fill * (CSCALAR_RE(meps_inv->m01) -
CSCALAR_RE(epsinv2.m01)) + CSCALAR_RE(epsinv2.m01),
fill * (CSCALAR_IM(meps_inv->m01) -
CSCALAR_IM(epsinv2.m01)) + CSCALAR_IM(epsinv2.m01));
CASSIGN_SCALAR(meps_inv->m02,
fill * (CSCALAR_RE(meps_inv->m02) -
CSCALAR_RE(epsinv2.m02)) + CSCALAR_RE(epsinv2.m02),
fill * (CSCALAR_IM(meps_inv->m02) -
CSCALAR_IM(epsinv2.m02)) + CSCALAR_IM(epsinv2.m02));
CASSIGN_SCALAR(meps_inv->m12,
fill * (CSCALAR_RE(meps_inv->m12) -
CSCALAR_RE(epsinv2.m12)) + CSCALAR_RE(epsinv2.m12),
fill * (CSCALAR_IM(meps_inv->m12) -
CSCALAR_IM(epsinv2.m12)) + CSCALAR_IM(epsinv2.m12));
#else
meps_inv->m01 = fill * (meps_inv->m01 - epsinv2.m01) + epsinv2.m01;
meps_inv->m02 = fill * (meps_inv->m02 - epsinv2.m02) + epsinv2.m02;
meps_inv->m12 = fill * (meps_inv->m12 - epsinv2.m12) + epsinv2.m12;
#endif
#endif
}

return 1;
Expand Down
2 changes: 0 additions & 2 deletions src/maxwell/maxwell_eps.c
Expand Up @@ -438,11 +438,9 @@ void set_maxwell_dielectric(maxwell_data *md,
s1, s2, s3, mesh_prod_inv,
r, epsilon_data)) {

#ifdef KOTTKE /* mepsilon did new anisotropic smoothing w/Kottke algorithm */
maxwell_sym_matrix_invert(md->eps_inv + xyz_index,
&eps_mean);
goto got_eps_inv;
#endif

norm0 = R[0][0] * normal[0] + R[1][0] * normal[1]
+ R[2][0] * normal[2];
Expand Down