anufrievroman / freepaths

Monte Carlo simulator of phonon and heat transport in nanostructures
https://anufrievroman.gitbook.io/freepaths
Other
16 stars 4 forks source link

Source distributions as objects #19

Closed anufrievroman closed 9 months ago

anufrievroman commented 9 months ago

Instead of hard-coding the distributions, they could be objects like random, lambert, directional etc with the property direction.

phigas commented 9 months ago

Another idea is to have an option to not generate phonons in sources if they are inside a hole. This way holes could extend into sources without having to place the sources around the holes.

anufrievroman commented 9 months ago

Yes, that's definitely a good idea!

anufrievroman commented 9 months ago

The phonon generation inside holes is fixed. And the original idea I actually reconsidered and thought that it's an unnecessary complication which breaks backwards compatibility, so I'll close this issue.

phigas commented 9 months ago

I partly disagree. Adding a direction parameter that simply adds a certain angle onto every generated phonon does not break backwards compatability (if the default value is set to 0) and still permits the source to be rotated.

anufrievroman commented 9 months ago

Well, I mean, I'd have to replace random_up to random + angle = 0 but maybe it's okay, we always break this kind of compatibility anyways. I gave up on the idea of making separate classes for distributions, but decided to add angle parameter or Source object, and rename the distributions then.

anufrievroman commented 9 months ago

Implemented in ed005e289894412380b33505d353f9660e6147ef

anufrievroman commented 9 months ago

So, final version of the sources is like that. I'll close this issue then,