Skip to content

Add primitive float type to the matter models #29

@szabo137

Description

@szabo137

Description

One should add a type parameter T to AbstractMatterModel and propagate this down to each concrete implementation. This allows for generic but type-aware implementation of the interface functions.

Validation and testing

using ElectronicStructureModels
using Unitful
using Test

ne = 1e23f0u"cm^(-3)"
temp = 1.0f0u"T"

s = IdealElectronGas(ne,temp)

@test temperature(s) isa Float32
@test electron_density(s) isa Float32

Motivation

Currently, the primitive floating point types in the matter models are pinned down to float64. This becomes a problem downstream, if differential cross sections need to be computed for a given float precision.

Target audience

Photon transport, XRTSProbing.jl

Metadata

Metadata

Assignees

No one assigned

    Labels

    MonteCarloTransportIndicated that the issue is related to the upstream usage in a Monte-Carlo Transport Code.enhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions