• 100.00% Rate
  • 29 Hits
  • 0 Missed
  • 1
  • 2
  • 3
  • 4
  • 5
  • 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
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 15x
  • 15x
  • 11x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 1x
  • 33x
  • 32x
  • 1x
  • -------------------------------------------------------------------------------
  • -- PUMAS wrapper
  • -- Author: Valentin Niess
  • -- License: GNU LGPL-3.0
  • -------------------------------------------------------------------------------
  • local clib = require('pumas.clib')
  • local pumas = {}
  • -------------------------------------------------------------------------------
  • -- Set the PUMAS library version tag
  • -------------------------------------------------------------------------------
  • do
  • local tag = clib.pumas_version()
  • local major = math.floor(tag / 100)
  • local minor = tag - 100 * major
  • pumas.version = string.format('%d.%d', major, minor)
  • end
  • -------------------------------------------------------------------------------
  • -- Import and register the subpackages
  • -------------------------------------------------------------------------------
  • local function register (pkg)
  • local p = require(pkg)
  • if p and p.register_to then
  • p.register_to(pumas)
  • end
  • end
  • register('pumas.call')
  • register('pumas.compat')
  • register('pumas.context')
  • register('pumas.coordinates')
  • register('pumas.element')
  • register('pumas.flux')
  • register('pumas.geometry')
  • register('pumas.enum')
  • register('pumas.material')
  • register('pumas.medium')
  • register('pumas.metatype')
  • register('pumas.pdg')
  • register('pumas.physics')
  • register('pumas.recorder')
  • register('pumas.state')
  • pumas.constants = require('pumas.constants')
  • -------------------------------------------------------------------------------
  • -- Register all API functions
  • -------------------------------------------------------------------------------
  • -- XXX what if only a sub-package is imported?
  • do
  • local error_ = require('pumas.error')
  • for k, v in pairs(pumas) do
  • error_.register(k, v)
  • end
  • end
  • -------------------------------------------------------------------------------
  • -- Return the package
  • -------------------------------------------------------------------------------
  • return pumas