Skip to content

Commit

Permalink
Fix filter 4
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz committed Oct 7, 2023
1 parent fc34ae7 commit 879763a
Showing 1 changed file with 91 additions and 91 deletions.
182 changes: 91 additions & 91 deletions Source/radiation/filter.H
Original file line number Diff line number Diff line change
Expand Up @@ -540,129 +540,129 @@ namespace filter
}
else if constexpr (width == 3) {
if (Er_stencil(-1) == -1.0_rt) {
lamfil = ff3b0(0) * lam(0) +
ff3b0(1) * lam(1) +
ff3b0(2) * lam(2) +
ff3b0(3) * lam(3);
lamfil = ff3b0(0) * lam_stencil(0) +
ff3b0(1) * lam_stencil(1) +
ff3b0(2) * lam_stencil(2) +
ff3b0(3) * lam_stencil(3);
}
else if (Er_stencil(-2) == -1.0_rt) {
lamfil = ff3b1(-1) * lam(-1) +
ff3b1( 0) * lam( 0) +
ff3b1( 1) * lam( 1) +
ff3b1( 2) * lam( 2) +
ff3b1( 3) * lam( 3);
lamfil = ff3b1(-1) * lam_stencil(-1) +
ff3b1( 0) * lam_stencil( 0) +
ff3b1( 1) * lam_stencil( 1) +
ff3b1( 2) * lam_stencil( 2) +
ff3b1( 3) * lam_stencil( 3);
}
else if (Er_stencil(-3) == -1.0_rt) {
lamfil = ff3b2(-2) * lam(-2) +
ff3b2(-1) * lam(-1) +
ff3b2( 0) * lam( 0) +
ff3b2( 1) * lam( 1) +
ff3b2( 2) * lam( 2) +
ff3b2( 3) * lam( 3);
lamfil = ff3b2(-2) * lam_stencil(-2) +
ff3b2(-1) * lam_stencil(-1) +
ff3b2( 0) * lam_stencil( 0) +
ff3b2( 1) * lam_stencil( 1) +
ff3b2( 2) * lam_stencil( 2) +
ff3b2( 3) * lam_stencil( 3);
}
else if (Er_stencil(1) == -1.0_rt) {
lamfil = ff3b0(3) * lam(-3) +
ff3b0(2) * lam(-2) +
ff3b0(1) * lam(-1) +
ff3b0(0) * lam( 0);
lamfil = ff3b0(3) * lam_stencil(-3) +
ff3b0(2) * lam_stencil(-2) +
ff3b0(1) * lam_stencil(-1) +
ff3b0(0) * lam_stencil( 0);
}
else if (Er_stencil(2) == -1.0_rt) {
lamfil = ff3b1( 3) * lam(-3) +
ff3b1( 2) * lam(-2) +
ff3b1( 1) * lam(-1) +
ff3b1( 0) * lam( 0) +
ff3b1(-1) * lam( 1);
lamfil = ff3b1( 3) * lam_stencil(-3) +
ff3b1( 2) * lam_stencil(-2) +
ff3b1( 1) * lam_stencil(-1) +
ff3b1( 0) * lam_stencil( 0) +
ff3b1(-1) * lam_stencil( 1);
}
else if (Er_stencil(3) == -1.0_rt) {
lamfil = ff3b2( 3) * lam(-3) +
ff3b2( 2) * lam(-2) +
ff3b2( 1) * lam(-1) +
ff3b2( 0) * lam( 0) +
ff3b2(-1) * lam( 1) +
ff3b2(-2) * lam( 2);
lamfil = ff3b2( 3) * lam_stencil(-3) +
ff3b2( 2) * lam_stencil(-2) +
ff3b2( 1) * lam_stencil(-1) +
ff3b2( 0) * lam_stencil( 0) +
ff3b2(-1) * lam_stencil( 1) +
ff3b2(-2) * lam_stencil( 2);
}
else {
lamfil = ff3(0,S) * lam(0) +
ff3(1,S) * (lam(-1) + lam(1)) +
ff3(2,S) * (lam(-2) + lam(2)) +
ff3(3,S) * (lam(-3) + lam(3));
lamfil = ff3(0,S) * lam_stencil(0) +
ff3(1,S) * (lam_stencil(-1) + lam_stencil(1)) +
ff3(2,S) * (lam_stencil(-2) + lam_stencil(2)) +
ff3(3,S) * (lam_stencil(-3) + lam_stencil(3));
}
}
else if constexpr (width == 4) {
if (Er_stencil(-1) == -1.0_rt) {
lamfil = ff4b0(0) * lam(0) +
ff4b0(1) * lam(1) +
ff4b0(2) * lam(2) +
ff4b0(3) * lam(3) +
ff4b0(4) * lam(4);
lamfil = ff4b0(0) * lam_stencil(0) +
ff4b0(1) * lam_stencil(1) +
ff4b0(2) * lam_stencil(2) +
ff4b0(3) * lam_stencil(3) +
ff4b0(4) * lam_stencil(4);
}
else if (Er_stencil(-2) == -1.0_rt) {
lamfil = ff4b1(-1) * lam(-1) +
ff4b1( 0) * lam( 0) +
ff4b1( 1) * lam( 1) +
ff4b1( 2) * lam( 2) +
ff4b1( 3) * lam( 3) +
ff4b1( 4) * lam( 4);
lamfil = ff4b1(-1) * lam_stencil(-1) +
ff4b1( 0) * lam_stencil( 0) +
ff4b1( 1) * lam_stencil( 1) +
ff4b1( 2) * lam_stencil( 2) +
ff4b1( 3) * lam_stencil( 3) +
ff4b1( 4) * lam_stencil( 4);
}
else if (Er_stencil(-3) == -1.0_rt) {
lamfil = ff4b2(-2) * lam(-2) +
ff4b2(-1) * lam(-1) +
ff4b2( 0) * lam( 0) +
ff4b2( 1) * lam( 1) +
ff4b2( 2) * lam( 2) +
ff4b2( 3) * lam( 3) +
ff4b2( 4) * lam( 4);
lamfil = ff4b2(-2) * lam_stencil(-2) +
ff4b2(-1) * lam_stencil(-1) +
ff4b2( 0) * lam_stencil( 0) +
ff4b2( 1) * lam_stencil( 1) +
ff4b2( 2) * lam_stencil( 2) +
ff4b2( 3) * lam_stencil( 3) +
ff4b2( 4) * lam_stencil( 4);
}
else if (Er_stencil(-4) == -1.0_rt) {
lamfil = ff4b3(-3) * lam(-3) +
ff4b3(-2) * lam(-2) +
ff4b3(-1) * lam(-1) +
ff4b3( 0) * lam( 0) +
ff4b3( 1) * lam( 1) +
ff4b3( 2) * lam( 2) +
ff4b3( 3) * lam( 3) +
ff4b3( 4) * lam( 4);
lamfil = ff4b3(-3) * lam_stencil(-3) +
ff4b3(-2) * lam_stencil(-2) +
ff4b3(-1) * lam_stencil(-1) +
ff4b3( 0) * lam_stencil( 0) +
ff4b3( 1) * lam_stencil( 1) +
ff4b3( 2) * lam_stencil( 2) +
ff4b3( 3) * lam_stencil( 3) +
ff4b3( 4) * lam_stencil( 4);
}
else if (Er_stencil(1) == -1.0_rt) {
lamfil = ff4b0(4) * lam(-4) +
ff4b0(3) * lam(-3) +
ff4b0(2) * lam(-2) +
ff4b0(1) * lam(-1) +
ff4b0(0) * lam( 0);
lamfil = ff4b0(4) * lam_stencil(-4) +
ff4b0(3) * lam_stencil(-3) +
ff4b0(2) * lam_stencil(-2) +
ff4b0(1) * lam_stencil(-1) +
ff4b0(0) * lam_stencil( 0);
}
else if (Er_stencil(2) == -1.0_rt) {
lamfil = ff4b1( 4) * lam(-4) +
ff4b1( 3) * lam(-3) +
ff4b1( 2) * lam(-2) +
ff4b1( 1) * lam(-1) +
ff4b1( 0) * lam( 0) +
ff4b1(-1) * lam( 1);
lamfil = ff4b1( 4) * lam_stencil(-4) +
ff4b1( 3) * lam_stencil(-3) +
ff4b1( 2) * lam_stencil(-2) +
ff4b1( 1) * lam_stencil(-1) +
ff4b1( 0) * lam_stencil( 0) +
ff4b1(-1) * lam_stencil( 1);
}
else if (Er_stencil(3) == -1.0_rt) {
lamfil = ff4b2( 4) * lam(-4) +
ff4b2( 3) * lam(-3) +
ff4b2( 2) * lam(-2) +
ff4b2( 1) * lam(-1) +
ff4b2( 0) * lam( 0) +
ff4b2(-1) * lam( 1) +
ff4b2(-2) * lam( 2);
lamfil = ff4b2( 4) * lam_stencil(-4) +
ff4b2( 3) * lam_stencil(-3) +
ff4b2( 2) * lam_stencil(-2) +
ff4b2( 1) * lam_stencil(-1) +
ff4b2( 0) * lam_stencil( 0) +
ff4b2(-1) * lam_stencil( 1) +
ff4b2(-2) * lam_stencil( 2);
}
else if (Er_stencil(4) == -1.0_rt) {
lamfil = ff4b3( 4) * lam(-4) +
ff4b3( 3) * lam(-3) +
ff4b3( 2) * lam(-2) +
ff4b3( 1) * lam(-1) +
ff4b3( 0) * lam( 0) +
ff4b3(-1) * lam( 1) +
ff4b3(-2) * lam( 2) +
ff4b3(-3) * lam( 3);
lamfil = ff4b3( 4) * lam_stencil(-4) +
ff4b3( 3) * lam_stencil(-3) +
ff4b3( 2) * lam_stencil(-2) +
ff4b3( 1) * lam_stencil(-1) +
ff4b3( 0) * lam_stencil( 0) +
ff4b3(-1) * lam_stencil( 1) +
ff4b3(-2) * lam_stencil( 2) +
ff4b3(-3) * lam_stencil( 3);
}
else {
lamfil = ff4(0,S) * lam(0) +
ff4(1,S) * (lam(-1) + lam(1)) +
ff4(2,S) * (lam(-2) + lam(2)) +
ff4(3,S) * (lam(-3) + lam(3)) +
ff4(4,S) * (lam(-4) + lam(4));
lamfil = ff4(0,S) * lam_stencil(0) +
ff4(1,S) * (lam_stencil(-1) + lam_stencil(1)) +
ff4(2,S) * (lam_stencil(-2) + lam_stencil(2)) +
ff4(3,S) * (lam_stencil(-3) + lam_stencil(3)) +
ff4(4,S) * (lam_stencil(-4) + lam_stencil(4));
}
}

Expand Down

0 comments on commit 879763a

Please sign in to comment.