SKIRT / SKIRT9

SKIRT version 9 -- advanced radiative transfer in dusty systems
http://www.skirt.ugent.be
GNU Affero General Public License v3.0
34 stars 30 forks source link

RedistributeGeometryDecorator: axial and spherical powerlaw #202

Closed arlauwer closed 10 months ago

arlauwer commented 10 months ago

Description Added an abstract RedistributeGeometryDecorator that redistributes density distributions by multiplying it by a weight function. Currently there are 2 concrete sub-classes implementing a spherical and axial power law weight function.

Motivation This decorator allows for adding gradients to already implemented geometries, which would otherwise have no analytical inverse cumulative. Such as for example hyperboloids and paraboloids that are not constant.

Testing Testing involved comparing:

Context More RedistributeGeometryDecorator can be added if needed. There is also a spherical and axial exponential weight function, but these have not been included.

petercamps commented 10 months ago

Good work. I introduced a few minor changes.

Most importantly, when a configurable property is "irrelevant" its value should never be used. This is why I added the extra tests in line 32 of AxPowerLawRedistributeGeometryDecorator.

Also, by convention, we add a . at the end of floating point constants such a 0. and 1. even though the compiler will almost certainly perform the conversion from integer to double at compile time.