HomerReid / scuff-em

A comprehensive and full-featured computational physics suite for boundary-element analysis of electromagnetic scattering, fluctuation-induced phenomena (Casimir forces and radiative heat transfer), nanophotonics, RF device engineering, electrostatics, and more. Includes a core library with C++ and python APIs as well as many command-line applications.
http://www.homerreid.com/scuff-em
GNU General Public License v2.0
126 stars 50 forks source link

--EPFile option and .trans file #58

Open vifehu opened 8 years ago

vifehu commented 8 years ago

Hi Homer,

I am writing to tell you about the option —EPFile of SCUFF-NEQ. We are trying to calculate the penetration depth of thermal radiation and the results obtained depend on how the geometric transformation of our objects is defined for SCUFF-NEQ.

If we include the displacement in the .scuffgeo file, the routine works perfectly. However, if we specify it through a .trans file, the program does not work properly in the transformed region.

Probably there is just a small bug in the —EPFile option that calculates the field distribution before reading the transformation. Which are your thoughts on this?

Thank you very much for your help!

Best,

Víctor

HomerReid commented 8 years ago

Thanks for the bug report. I found the issue. The difficulty was that the data structure used to determine when evaluation points are inside surfaces was initialized when the surface was first read in from the mesh file, and then didn't get updated when geometrical transformations were applied. The solution is simply to untransform the point appropriately when attempting to determine whether it lives inside a transformed surface.

I tested it on a small example and I believe the bug is fixed in 1c3310a320be6b7fed5bac1024eda6f048354f30. Please test and let me know how it goes.