Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

add Material #227

Description

@nathanfranklin

In relation with #226 (https://publicwiki-01.fraunhofer.de/SimPhoNy-Project/index.php/MaterialRelations_proposal), a Material class has been defined by the SSB as the following:

class Material(object):
    """A class that represents a material.

    Class describes a material and its data.

    Attributes
    ----------
    description : str
        textual description of the material
    uid : uuid.UUID
        the id of the material.
    data : DataContainer
        data associated with this material

    """

And the the uid of materials will be used like the following:

material_foo = Material(name="foo")
material.data[CUBA.MASS] = 1.0  # this is a common mass for entities of this material type

p = Particle()
p.data[CUBA.MATERIAL] = material_foo.uid

engine.SD.add_material(material_foo)

dataset = engine.get_dataset("some_name")
dataset.add_particles([p])

This requires:

  • Adding a new attribute (CUBA.MATERIAL) with type that can represent the UUID
  • Adding Material class (plus tests and documentation)
  • Add SD object to contain these materials (i.e. add_material, get_material, delete_material, update_material) (plus tests and documentation)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions