data

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2018 License: GPL-3.0, GPL-3.0-or-later Imports: 13 Imported by: 0

Documentation

Overview

Package data provide conversion from model to structures, which are easily serialized by shield.serialize.

Index

Constants

View Source
const BlackholeMaterialID shield.MaterialID = 0

BlackholeMaterialID represent Blackhole material in shield input files.

Variables

This section is empty.

Functions

func MapParticleToShieldParticleID

func MapParticleToShieldParticleID(particle common.Particle) (int64, error)

MapParticleToShieldParticleID map Particle to shield format.

Types

type Body

type Body struct {
	ID         shield.BodyID
	Identifier string
	Arguments  []float64
}

Body represent setup.Body,

type CompoundMaterial

type CompoundMaterial struct {
	ID                                    shield.MaterialID
	StateOfMatter                         StateOfMatter
	Density                               float64
	ExternalStoppingPowerFromMaterialICRU MaterialICRU
	Elements                              []Element
	// contains filtered or unexported fields
}

CompoundMaterial represent material.Compound.

func (*CompoundMaterial) SerializeExternalStoppingPower

func (c *CompoundMaterial) SerializeExternalStoppingPower() bool

SerializeExternalStoppingPower eturn true, if ExternalStoppingPowerFromMaterialICRU should be serialized.

type Construction

type Construction struct {
	Operation Operation
	Sign      Sign
	BodyID    shield.BodyID
}

Construction represent steps to build zone by shield.

type Data

type Data struct {
	// Data needed for mat.dat file serialization.
	Materials Materials

	// Data needed for geo.dat file serialization.
	Geometry Geometry

	// Data needed for detect.dat file serialization.
	Detectors []Detector
	// Data needed for beam.dat file serialization.
	Beam beam.Beam

	// Data needed for beam.dat file serialization.
	Options options.SimulationOptions
}

Data is input for shield Serialize function.

func Convert

func Convert(setup setup.Setup) (Data, shield.SimulationContext, error)

Convert simulation setup model to easily serializable data, which is input for shield serializer. Return error, if setup data are not semantically correct.

type Detector

type Detector struct {
	ScoringType string

	// Argument can be int64, float64 or string.
	Arguments []interface{}
}

Detector represent setup.Detector,

type Element

type Element struct {
	ID                             IsotopeNUCLID
	RelativeStoichiometricFraction int64
	AtomicMass                     float64
	IValue                         float64
}

Element represent material.Element.

func (*Element) SerializeAtomicMass

func (e *Element) SerializeAtomicMass() bool

SerializeAtomicMass return true, if AtomicMass should be serialized.

func (*Element) SerializeIValue

func (e *Element) SerializeIValue() bool

SerializeIValue return true, if IValue should be serialized.

type Geometry

type Geometry struct {
	Bodies              []Body
	Zones               []Zone
	ZoneToMaterialPairs []ZoneToMaterial
}

Geometry represent ready to serialize data for geo.dat file.

type IsotopeNUCLID

type IsotopeNUCLID int64

IsotopeNUCLID is representation of element in shield mat.dat file.

type MaterialICRU

type MaterialICRU int64

MaterialICRU is representation of predefined materials in shield mat.dat file.

type Materials

type Materials struct {
	Predefined []PredefinedMaterial
	Compound   []CompoundMaterial
}

Materials contains representation of setup.MaterialsMap, which is easily serializable in shield serializer.

type Operation

type Operation string

Operation decribe how to construct zone using bodies.

const (
	// Union represent set union.
	Union Operation = "OR"

	// Intersection represent set intersection.
	Intersection Operation = "  "
)

type PredefinedMaterial

type PredefinedMaterial struct {
	ID                        shield.MaterialID
	ICRUNumber                MaterialICRU
	StateOfMatter             StateOfMatter
	Density                   float64
	LoadExternalStoppingPower bool
}

PredefinedMaterial represent material.Predefined.

func (*PredefinedMaterial) SerializeDensity

func (p *PredefinedMaterial) SerializeDensity() bool

SerializeDensity return true, if Density should be serialized.

func (*PredefinedMaterial) SerializeStateOfMatter

func (p *PredefinedMaterial) SerializeStateOfMatter() bool

SerializeStateOfMatter return true, if StateOfMatter should be serialized.

type Sign

type Sign string

Sign tells, if complement (-) is used instead of normal area (+).

const (
	// Plus represent normal area of body.
	Plus Sign = "+"

	// Minus represent complement of body.
	Minus Sign = "-"
)

type StateOfMatter

type StateOfMatter int64

StateOfMatter representation in shield mat.dat file.

type Zone

type Zone struct {
	ID            shield.ZoneID
	Constructions []Construction
}

Zone represent zone in shield files.

type ZoneToMaterial

type ZoneToMaterial struct {
	ZoneID     shield.ZoneID
	MaterialID shield.MaterialID
}

ZoneToMaterial mapping.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL