mpacts.core. mesh

In order to be able to use this module import it like this:

import mpacts.core.mesh
#or assign it to a shorter name
import mpacts.core.mesh as mes

MeshBase

class mpacts.core.mesh.MeshBase

Bases: mpacts.core.baseobject.BaseObject

Abstract Base Class for all MeshObjects, just a stub for now needs to be redesigned soon and expanded.

Raises an exception This class cannot be instantiated from Python

MeshBase(name, parent, **kwargs)
add_to_cell((MeshBase)arg1, (object)arg2, (object)arg3) → None :

Increments with given value the cell associated with given point.

get_all_cells((MeshBase)arg1) → list :

returns all cells as list of tuples, [(cell centroid, value),..]

get_cell((MeshBase)arg1, (object)arg2) → object :

returns the value associated with the cell associated with the given point. Will throw when the cell has never been set.

has_cell((MeshBase)arg1, (object)arg2) → bool :

returns whether a cell at a certain location has already been made.

set_cell((MeshBase)arg1, (object)arg2, (object)arg3) → None :

sets the value associated with the cell associated with the given point.

RegularFullGrid_Int

class mpacts.core.mesh.RegularFullGrid_Int

Bases: mpacts.core.mesh.MeshBase, mpacts.core.baseobject.BaseObject

A explicit, full storage, regular grid of integers, that can be used to calculate for instance densities. Still a work in progress, should be made more generic and powerful.
Has no default location.
  • Required keywords:
    • N (1) — The number of cells in each direction (x,y,z).
    • max (m) — Maximum (x,y,z) of the regular grid. Represent the position of one of corners of the grid.
    • min (m) — Minimum (x,y,z) of the regular grid. Represent the position of one of corners of the grid.
  • Optional keywords:
    • grid (default value = data) — Array that contains the full grid data
  • Read only properties:
    • cellsize — Size of the single cell.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: N, min, max, [grid]
RegularFullGrid_Int(name, parent, **kwargs)

RegularFullGrid_Scalar

class mpacts.core.mesh.RegularFullGrid_Scalar

Bases: mpacts.core.mesh.MeshBase, mpacts.core.baseobject.BaseObject

A explicit, full storage, regular grid of scalars, that can be used to calculate for instance densities. Still a work in progress, should be made more generic and powerful.
Has no default location.
  • Required keywords:
    • N (1) — The number of cells in each direction (x,y,z).
    • max (m) — Maximum (x,y,z) of the regular grid. Represent the position of one of corners of the grid.
    • min (m) — Minimum (x,y,z) of the regular grid. Represent the position of one of corners of the grid.
  • Optional keywords:
    • grid (default value = data) — Array that contains the full grid data
  • Read only properties:
    • cellsize — Size of the single cell.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: N, min, max, [grid]
RegularFullGrid_Scalar(name, parent, **kwargs)

RegularFullGrid_Vector

class mpacts.core.mesh.RegularFullGrid_Vector

Bases: mpacts.core.mesh.MeshBase, mpacts.core.baseobject.BaseObject

A explicit, full storage, regular grid of vectors, that can be used to calculate for instance densities. Still a work in progress, should be made more generic and powerful.
Has no default location.
  • Required keywords:
    • N (1) — The number of cells in each direction (x,y,z).
    • max (m) — Maximum (x,y,z) of the regular grid. Represent the position of one of corners of the grid.
    • min (m) — Minimum (x,y,z) of the regular grid. Represent the position of one of corners of the grid.
  • Optional keywords:
    • grid (default value = data) — Array that contains the full grid data
  • Read only properties:
    • cellsize — Size of the single cell.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: N, min, max, [grid]
RegularFullGrid_Vector(name, parent, **kwargs)

RegularSparseGrid_Int

class mpacts.core.mesh.RegularSparseGrid_Int

Bases: mpacts.core.mesh.MeshBase, mpacts.core.baseobject.BaseObject

A implicit, sparse storage, regular grid of integers, that can be used to calculate for instance densities. Still a work in progress, should be made more generic and powerful.
Has no default location.
  • Required keywords:
    • gridsize (m) — The size of a gridcell
  • Optional keywords:
    • centroid (m) (default value = 0 0 0) — Allows to set the position of the 0,0,0 centroid, by default that location is 0,0,0
object __init__(tuple args, dict kwds) :
args: name, parent kwds: gridsize, [centroid]
RegularSparseGrid_Int(name, parent, **kwargs)

RegularSparseGrid_Scalar

class mpacts.core.mesh.RegularSparseGrid_Scalar

Bases: mpacts.core.mesh.MeshBase, mpacts.core.baseobject.BaseObject

A implicit, sparse storage, regular grid of scalars, that can be used to calculate for instance densities. Still a work in progress, should be made more generic and powerful.
Has no default location.
  • Required keywords:
    • gridsize (m) — The size of a gridcell
  • Optional keywords:
    • centroid (m) (default value = 0 0 0) — Allows to set the position of the 0,0,0 centroid, by default that location is 0,0,0
object __init__(tuple args, dict kwds) :
args: name, parent kwds: gridsize, [centroid]
RegularSparseGrid_Scalar(name, parent, **kwargs)

RegularSparseGrid_Vector

class mpacts.core.mesh.RegularSparseGrid_Vector

Bases: mpacts.core.mesh.MeshBase, mpacts.core.baseobject.BaseObject

A implicit, sparse storage, regular grid of vectors, that can be used to calculate for instance densities. Still a work in progress, should be made more generic and powerful.
Has no default location.
  • Required keywords:
    • gridsize (m) — The size of a gridcell
  • Optional keywords:
    • centroid (m) (default value = 0 0 0) — Allows to set the position of the 0,0,0 centroid, by default that location is 0,0,0
object __init__(tuple args, dict kwds) :
args: name, parent kwds: gridsize, [centroid]
RegularSparseGrid_Vector(name, parent, **kwargs)