Skip to content
This repository
tree: dbf9d645f6
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 75 lines (59 sloc) 2.604 kb
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 66 67 68 69 70 71 72 73 74
"""C++ wrapper for material class."""
from libcpp.map cimport map
from libcpp.set cimport set

cimport std


cdef extern from "material.h" namespace "pyne":
    # Cython does not allow for typdef'ing tamplated types :(
    #ctypedef map[int, double] comp_map
    #ctypedef map[int, double].iterator comp_iter

    cdef cppclass Material:
        # Constuctors
        Material()
        Material(map[int, double]) except +
        Material(map[int, double], double) except +
        Material(map[int, double], double, std.string) except +
        Material(map[int, double], double, std.string, double) except +
        Material(char *) except +
        Material(char *, double) except +
        Material(char *, double, std.string) except +
        Material(char *, double, std.string, double) except +

        # Attributes
        map[int, double] comp
        double mass
        std.string name
        double atoms_per_mol

        # Methods
        void norm_comp() except +
        void from_hdf5(char *, char *) except +
        void from_hdf5(char *, char *, int) except +
        void from_hdf5(char *, char *, int, int) except +

        void write_hdf5(char *, char *, char *) except +
        void write_hdf5(char *, char *, char *, float) except +
        void write_hdf5(char *, char *, char *, float, int) except +

        void from_text(char *) except +

        void write_text(char *) except +

        void normalize() except +
        map[int, double] mult_by_mass() except +
        double molecular_weight(double) except +

        # Substream Methods
        Material sub_mat(set[int], std.string) except +
        Material set_mat(set[int], double, std.string) except +
        Material del_mat(set[int], std.string) except +

        Material sub_range(int, int, std.string) except +
        Material set_range(int, int, double, std.string) except +
        Material del_range(int, int, std.string) except +

        Material sub_u(std.string) except +
        Material sub_pu(std.string) except +
        Material sub_lan(std.string) except +
        Material sub_act(std.string) except +
        Material sub_tru(std.string) except +
        Material sub_ma(std.string) except +
        Material sub_fp(std.string) except +

        # Atom frac member functions
        map[int, double] to_atom_frac() except +
        void from_atom_frac(map[int, double]) except +

        # Operator Overloads
        Material operator+(double) except +
        Material operator+(Material) except +
        Material operator*(double) except +
        Material operator/(double) except +
Something went wrong with that request. Please try again.