Documentation
¶
Overview ¶
Package material implement material model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compound ¶
type Compound struct {
Name string `json:"name"`
// Density of the medium in g/cm³ - mandatory.
Density float64 `json:"density"`
// StateOfMatter - mandatory.
StateOfMatter StateOfMatter `json:"stateOfMatter"`
Elements []Element `json:"elements"`
// Load stopping power from external file - optional. The file is selected
// just like in case of Predefined material named by this string.
ExternalStoppingPowerFromPredefined string `json:"externalStoppingPowerFromPredefined,omitempty"`
}
Compound material type - create material by defining isotope mixture.
func (Compound) MarshalJSON ¶
MarshalJSON json.Marshaller implementation.
type Element ¶
type Element struct {
Isotope string `json:"isotope"`
RelativeStoichiometricFraction int64 `json:"relativeStoichiometricFraction"`
// Override atomic mass - optional.
AtomicMass float64 `json:"atomicMass,omitempty"`
// Mean excitation energy (I-value) in eV - optional.
IValue float64 `json:"iValue,omitempty"`
}
Element is a basic building block of Compound.
type IsotopeRecord ¶
IsotopeRecord contains data needed on frontend related to Isotopes.
func Isotopes ¶
func Isotopes() []IsotopeRecord
Isotopes return list of all available isotopes for material.Element.
type Material ¶
type Material struct {
ID ID `json:"id"`
Color color.Color `json:"color"`
Type Type `json:"materialInfo"`
}
Material defines the zone material that is used in the simulation.
func (*Material) UnmarshalJSON ¶
UnmarshalJSON custom Unmarshal function. material.Type is recognized by material/type in json.
type Predefined ¶
type Predefined struct {
PredefinedID string `json:"predefinedId"`
// Density of the medium in g/cm³ - optional.
Density float64 `json:"density,omitempty"`
// State of matter - optional
StateOfMatter StateOfMatter `json:"stateOfMatter,omitempty"`
// Load stopping power from external file.
LoadExternalStoppingPower bool `json:"loadExternalStoppingPower,omitempty"`
}
Predefined material type - choose material definition from predefined material list by name.
func (Predefined) MarshalJSON ¶
func (p Predefined) MarshalJSON() ([]byte, error)
MarshalJSON json.Marshaller implementation.
type PredefinedMaterialRecord ¶
type PredefinedMaterialRecord struct {
Value string `json:"value"`
Name string `json:"name"`
Color color.Color `json:"color"`
}
PredefinedMaterialRecord contains data needed on frontend related to PredefinedMaterials.
func PredefinedMaterials ¶
func PredefinedMaterials() []PredefinedMaterialRecord
PredefinedMaterials return list of all available material.Predefined and Colors assigned to them.
type StateOfMatter ¶
type StateOfMatter int
StateOfMatter represent state of material.
const ( // NonDefined - only allowed for Predifined NonDefined = iota // Solid state of matter. Solid StateOfMatter = iota // Gas state of matter. Gas // Liquid state of matter. Liquid )
func (StateOfMatter) MarshalJSON ¶
func (s StateOfMatter) MarshalJSON() ([]byte, error)
MarshalJSON json.Marshaller implementation.
func (*StateOfMatter) UnmarshalJSON ¶
func (s *StateOfMatter) UnmarshalJSON(b []byte) error
UnmarshalJSON json.Unmarshaller implementation.