Skip to content

matprop_card

converter.converter.fluka.cards.matprop_card

MatPropsCard dataclass

Class representing description of material properties in FLUKA input. Every material assignment is represented by one line: codwed - "MAT-PROP" what(1) - 0 - ignored what(2) - 0 - ignored what(3) - average ionisation potential what(4) - material name what(5) - empty, default what(4) what(6) - 0 step length in assigning indices sdum - empty documentation: https://flukafiles.web.cern.ch/manual/chapters/description_input/description_options/mat-prop.html#mat-prop skipcq: FLK-W505

Source code in yaptide/converter/converter/fluka/cards/matprop_card.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@dataclass
class MatPropsCard:
    """
    Class representing description of material properties in FLUKA input.
    Every material assignment is represented by one line:
        codwed - "MAT-PROP"
        what(1) - 0 - ignored
        what(2) - 0 - ignored
        what(3) - average ionisation potential
        what(4) - material name
        what(5) - empty, default what(4)
        what(6) - 0 step length in assigning indices
        sdum - empty
    documentation: https://flukafiles.web.cern.ch/manual/chapters/description_input/description_options/mat-prop.html#mat-prop skipcq: FLK-W505
    """

    data: list[IonisationPotential] = field(default_factory=list)
    codewd: str = "MAT-PROP"

    def __str__(self) -> str:
        """Return card as string."""
        result = ""
        for ionisation_potential in self.data:
            what = [
                0.0,
                0.0,
                ionisation_potential.ionisation_potential,
                ionisation_potential.material_name,
                "",
                0.0,
            ]
            result += str(Card(self.codewd, what)) + "\n"
        return result.strip()

codewd class-attribute instance-attribute

codewd = 'MAT-PROP'

data class-attribute instance-attribute

data = field(default_factory=list)

__init__

__init__(data=list(), codewd='MAT-PROP')

__str__

__str__()

Return card as string.

Source code in yaptide/converter/converter/fluka/cards/matprop_card.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def __str__(self) -> str:
    """Return card as string."""
    result = ""
    for ionisation_potential in self.data:
        what = [
            0.0,
            0.0,
            ionisation_potential.ionisation_potential,
            ionisation_potential.material_name,
            "",
            0.0,
        ]
        result += str(Card(self.codewd, what)) + "\n"
    return result.strip()