Skip to content

lowmat_card

converter.converter.fluka.cards.lowmat_card

LowMatsCard dataclass

Class representing description of low-energy neutron cross sections in Fluka input. Every material is represented by one line: codwed - "LOW-MAT" what(1) - Name of the Fluka material what(3) - what(6) not used sdum - Name of the low-energy neutron material documentation: https://flukafiles.web.cern.ch/manual/chapters/description_input/description_options/low-mat.html#low-mat # skipcq: FLK-W505

Source code in yaptide/converter/converter/fluka/cards/lowmat_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
@dataclass
class LowMatsCard:
    """
    Class representing description of low-energy neutron cross sections in Fluka input.
    Every material is represented by one line:
        codwed - "LOW-MAT"
        what(1) - Name of the Fluka material
        what(3) - what(6) not used
        sdum - Name of the low-energy neutron material
        documentation: https://flukafiles.web.cern.ch/manual/chapters/description_input/description_options/low-mat.html#low-mat # skipcq: FLK-W505
    """

    data: list[FlukaLowMat] = field(default_factory=list)
    codewd: str = "LOW-MAT"

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

codewd class-attribute instance-attribute

codewd = 'LOW-MAT'

data class-attribute instance-attribute

data = field(default_factory=list)

__init__

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

__str__

__str__()

Return card as string.

Source code in yaptide/converter/converter/fluka/cards/lowmat_card.py
21
22
23
24
25
26
27
28
def __str__(self) -> str:
    """Return card as string."""
    result = ""
    for lowmat in self.data:
        what = [lowmat.material_name]
        sdum = lowmat.low_energy_neutron_material
        result += str(Card(self.codewd, what, sdum)) + "\n"
    return result.strip()