-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix caspol, excluding direct field in DGF and allowing XikBloch mode #227
base: master
Are you sure you want to change the base?
Conversation
In scuff-caspol/PolModel::GetPolarizability, MD is used in a conditional statement, without properly initialized in PolModel::InitPolModel_BI
Credit to texnokrates
… Resolved conflicts in cherry-pick
…here is a delete at the end
…Matrix *) in GetDyadicGFs
Update May 21stIn principle we only need one-point DGF, so a7070c0 and 237df82 have reshaped the To prune unnecessary memory cost, for compact geometry Later on I realized that in the |
scuff-caspol was not able to calculate compact geometries as was in 9c6d0cb , not even for a simple square slab. It turns out there are several data type mismatch, and a bug that the dyadic Green's function should have been the scattering part only.
#220 is a parent of this pull request.
Data type mismatches:
M->LUSolve(RFSource)
in GetDyadicGFs.cc : M was real, RFSource is complexRFSource
to be real by copying the real part, risking the imaginary part, although the imaginary part should be always 0 from my intuition and preliminary numerical verification.M
to be complex at the very beginning of its creation, ensuring no information loss. In this way the memory consumption is doubled at some points.RFSource
can be created as a real matrix or not.XMatrix
inRWGGeometry::GetDyadicGFs
: created as complex but based on memory of double arrayXBuffer
is a pointer to a double array, butXMatrix
was created asHMatrix XMatrix(1,6,LHM_COMPLEX,LHM_NORMAL,XBuffer)
. It is verified from the source thatXMatrix
being complex is unnecessary. Fixed by 44e48b3 .Direct field should have been excluded when calculating Dyadic Green's Function for caspol
6fb404e fixed this. There must be an explicit
ScatterOnly=true
.With these patches, scuff-caspol is able to calculate the potential by a finite PEC slab, and the outcome is very close to the outcome from setting
--PECPlate
(which invokes a closed form DGF) at those locations close to the slab.