Skip to content

Update susceptibility.cpp - #238

Closed
fesc3555 wants to merge 1 commit into
NanoComp:masterfrom
fesc3555:patch-2
Closed

Update susceptibility.cpp#238
fesc3555 wants to merge 1 commit into
NanoComp:masterfrom
fesc3555:patch-2

Conversation

@fesc3555

Copy link
Copy Markdown

Added checks in update_P: check, whether there is a diagonal element before you add contributions from off-diagonal elements. This avoids instabilities at boundaries for non-diagonal sigma.

Added checks in update_P: check, whether there is a diagonal element before you add contributions from off-diagonal elements. This avoids instabilities at boundaries for non-diagonal sigma.
Comment thread src/susceptibility.cpp
LOOP_OVER_VOL_OWNED(gv, c, i) {
LOOP_OVER_VOL_OWNED(gv, c, i) if(s[i]!=0) {
//"if" to avoid instabilities coming from yee-grid shifts of off-diagnal elements
+ //FIXME: this prevents materials with pure off-diagonal sigma from working

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wouldn't a purely off-diagonal sigma matrix be indefinite, and hence lead to both loss and gain?

Comment thread src/susceptibility.cpp
+ OFFDIAG(s2,w2,is2,is)));
pp[i] = pcur;
}else{
p[i]=0; //seems unnecessary, but no harm is done here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Delete the else clause, since p[i] is initialized to zero anyway.

@stevengj

Copy link
Copy Markdown
Collaborator

I just merged a PR #662 that reformats everything with clang-format, which creates lots of conflicts.

To rebase this PR onto master without having to deal manually with these formatting conflicts, follow the exact procedure given in the instructions of #662.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants