Home

SimPhoNy Documentation

image

Contents

1. 20 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 Parameters uids iterable of uuid UUID optional seguence containing the id s of the bond that will be iterated When the uids are provided then the bonds are returned in the same order the uids are returned by the iterable If uids is None then all bonds are returned by the interable and there is no restriction on the order that they are returned Yields bond Bond The next Bond item Raises KeyError if any of the ids passed as parameters are not in the container Examples It can be used with a sequence as parameter or without it gt gt gt particles Particles name foo BSP ea gt gt gt for bond in particles iter_bonds idl id2 id3 do stuff gt gt gt for bond in particles iter_bond do stuff it will iterate over all the bond iter_particles uids None Generator method for iterating over the particles of the container It can receive any kind of sequence of particle uids to iterate over those concrete particles If nothing is passed as parameter it will iterate over all the particles Parameters uids iterable of uuid UUID optional sequence containing the uids of the par ticles that will be iterated When the uids are provided then the particles are returned in the same order the uids are returned by the iterable If uids is None then all particles are returned by the interable and the
2. Create and return a 3D cubic lattice make_body_centered_cubic_lattice name h size Create and return a 3D body centered cubic lattice make_face_centered_cubic_lattice name h size Create and return a 3D face centered cubic lattice make_rhombohedral_lattice name h angle size Create and return a 3D rhombohedral lattice make_tetragonal_lattice name hxy hz size Create and return a 3D tetragonal lattice make_body_centered_tetragonal_lattice name Create and return a 3D body centered tetragonal lattice make_hexagonal_lattice name hxy hz size Create and return a 3D hexagonal lattice make_orthorhombic_lattice name hs size Create and return a 3D orthorhombic lattice make_body_centered_orthorhombic_lattice Create and return a 3D body centered orthorhombic lattice make_face_centered_orthorhombic_lattice Create and return a 3D face centered orthorhombic lattice make_base_centered_orthorhombic_lattice Create and return a 3D base centered orthorhombic lattice make_monoclinic_lattice name hs beta size Create and return a 3D monoclinic lattice make_base_centered_monoclinic_lattice name Create and return a 3D base centered monoclinic lattice make_triclinic_lattice name hs angles size Create and return a 3D triclinic lattice Implementation class simphony cuds lattice Lattice name
3. UUID hex uid String 32 UUID hex data Data particles Ulnt8 MAX_NUMBER_PARTICLES_IN_BOND 12 mask Bool number of columns in Data n_particles 0 lt Integer lt MAK NUMBER PARTICLES IN BOND NoUidRecord Row data Data mask Bool number of columns in Data uid String 32 UUID hex coordinates Float64 3 O oata row Fig 2 7 Figure 3 Diagram of the Particles based storage The Particles container is stored using one table for the container data attribute and two groups to holding the particle and bond items separately Each item group has two tables one for the item information i e particle or bond and one for the item data Indexing into the item and data tables takes place by using the same uid hex for both O H5Mesh Group cuds version int E contaierbata Table Points Table O Edges Table O Faces Table Cells Table O Data Table Tow NoLidRecord Tow Point Tow Edge ow Face Tom Cell Tom Record Edge Row uid String 32 UUID hex NovidrecordiRow Pointsirow Facetrow cettrow record Rom gt uid 1 Stringi32 UUID hex uid 1 String 32 UUID hex data Data BA AA TU data Stringl32 UUID hes data String 32 UUID hex data String 32 UUID hex Meta irinaz SGU ex mask Bool
4. simphony cuds particles Particles V valid simphony io data_container_table DataContainerTable attribute 47 simphony io h5_cuds_items HSCUDSItems attribute 47 valid valid simphony io indexed_data_container_table IndexedDataContainerTat attribute 47 valid simphony io h5_cuds H5CUDS method 41 56 Index
5. Get an iterator over the LatticeNodes described by the indices Parameters indices iterable set of int 3 optional When indices i e node index coor dinates are provided then nodes are returned in the same order of the provided indices If indices is None there is no restriction on the order the nodes that are returned Returns An iterator over LatticeNode objects 3 2 CUDS SimPhoNy Documentation Release 0 2 1 Return type iterator primitive cell update nodes nodes Update the corresponding lattice nodes Parameters nodes iterator of LatticeNodes 3 2 2 Pure Python implementation Classes PrimitiveCell pl p2 p3 bravais_lattice A primitive cell of a Bravais lattice BravaisLattice The 3D Bravais lattices Lattice name primitive_cell size origin A Bravais lattice LatticeNode index data A single node of a lattice Particles name Class that represents a container of particles and bonds Bond particles uid data Class representing a bond Particle coordinates uid data Class representing a particle Mesh name Mesh object to store points and elements Point coordinates uid data Coordinates describing a point in the space Edge points uid data Edge element Face points uid data Face element Cel 1 points uid data Cell element Functions make_cubic_lattice name h size origin
6. e g sorption DEM LBM FrictionCoefficient Control particle friction LP DEM LBM ScalingCoefficient Coarsening or time scale bridging DEM LBM EquationOfStateCoefficient Equation of state for multiphase fluids FEM FVM LBM SP ContanctAngle Wettability in multiphase flows LBM Amphiphilicity Hydrophilic phile behaviour of a particle C DEM PhaselnteractionStrength Strength of phase interactions on a particle P DEM 6 Chapter 2 User Manual SimPhoNy Documentation Release 0 2 1 Table 2 1 continued from previ Name Description Domain HamakerConstant Van der Waals body body interaction C DEM ZetaPotential Coulomb interaction between particles DEM lonValenceEffect Coulomb interaction between particles DEM DebyeLength Electrostatic effects of particles in solution DEM SmoothingLength Half of kernel cut off for all splines SPH LatticeSpacing Distance between adjacent lattice nodes LBM TimeStep Length of a discrete time step DEM FEM FVM LE NumberOfTimeSteps Number of discrete time steps DEM FEM FVM LE Force Force C DEM LBM SPH Torque Torque DEM Density Density DEM FEM FVM LE Concentration Concentration of a substance P ATM FEM FVM LE Pre
7. primitive_cell size origin A Bravais lattice Stores references to data containers node related data name str name of lattice 24 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 primitive cell PrimitiveCell primitive cell specifying the 3D Bravais lattice size int 3 lattice dimensions origin float 3 lattice origin data DataContainer high level CUBA data assigned to lattice count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container data get_node index Get a copy of the node corresponding to the given index Parameters index int 3 node index coordinate Returns Return type A reference to a LatticeNode object iter_nodes indices None Get an iterator over the LatticeNodes described by the indices Parameters indices iterable set of int 3 optional When indices i e node index coor dinates are provided then nodes are returned in the same order of the provided indices If indices is None there is no restriction on the order the nodes that are returned Returns Return type A generator for LatticeNode objects origin size update_nodes nodes Update the corre
8. 46 simphony io h5_lattice module 42 simphony io h5_mesh module 43 simphony io h5_particles module 41 simphony io indexed_data_container_table module 47 size simphony cuds abc_lattice ABCLattice attribute 23 size simphony cuds lattice Lattice attribute 25 size simphony io h5_lattice H5Lattice attribute 43 U uid simphony cuds mesh Element attribute 30 uid simphony cuds mesh Point attribute 34 uid simphony cuds particles Bond attribute 34 uid simphony cuds particles Particle attribute 34 update simphony core data_container DataContainer method 15 update_bonds simphony cuds abc_particles ABCParticles method 22 update bonds method 38 simphony cuds particles Particles method 47 update_faces simphony cuds abc_mesh ABCMesh method 19 update_faces simphony cuds mesh Mesh method 34 update_faces simphony io h5_mesh H5Mesh method 46 update nodes simphony cuds abc_lattice ABCLattice method 24 update nodes simphony cuds lattice Lattice method 25 update_nodes simphony io h5_lattice HSLattice method 43 update_particles sim phony cuds abc_particles ABCParticles method 22 update_particles method 39 update_particles simphony io h5_particles H5Particles method 42 update_points simphony cuds abc_mesh ABCMesh method 19 update_points simphony cuds mesh Mesh method 34 update_points simphony io h5_mesh H5Mesh method 46
9. H5CUDS class The provided api is currently a reduced version of the Modelling Engine api and supports adding and manipulating CUDS containers Please also note that returned containers from the get methods are live proxy objects on top of the HDF5 storage in contrast to the common offline save and read operations 2 4 1 HDF5 Stored Layout Data are stored in HDFS files using a separate layout for each type of CUDS container The stored layout of the containers is provided below using a pseudo uml description for the HDF5 based layout of the data stored in the files Warning This is the provisional storage layout and is under continuous development Backwards compatibility 1s not expected to be supported before version 1 0 0 of the simphony common library File Lattice Particles Mesh 10 Chapter 2 User Manual SimPhoNy Documentation Release 0 2 1 H5CUDS Group particle Group Particle mesh Group Bond lattice Group Lattice cuds_version int v name string particle children of type H5Particles v name string mesh children of type HSMesh _v_name string lattice children of type H5Lattice H5Lattice Fig 2 5 Figure 1 Diagram of the top level layout of the HDFS based files Each type of CUDS container is stored under the related section as an independent group 2 4 HDF5 Storage 11 SimPhoNy Documentation Release 0 2 1 c H5Lattice G
10. One can use the help option with a setup py command to see all available options e The documentation will be saved in the build directory e Not all the png files of the UML diagrams are used 1 6 Directory structure There are four subpackages e core used for common low level classes and utility code e cuds to hold all the native cuds implementations e io to hold the io specific code 2 Chapter 1 Simphony common SimPhoNy Documentation Release 0 2 1 e bench holds basic benchmarking code e examples holds SimPhoNy example code e doc Documentation related files source Sphinx rst source files build Documentation build directory if documentation has been generated using the make script in the doc directory 1 7 SimPhoNy Framework The simphony library is the core component of the SimPhoNy Framework information on setting up the framework is provided on a separate repository https github com simphony simphony framework 1 7 SimPhoNy Framework 3 SimPhoNy Documentation Release 0 2 1 4 Chapter 1 Simphony common CHAPTER 2 User Manual 2 1 Plugins The SimPhoNy library can extended through two entry points for contributing python modules that contain engine and visualisation components e simphony engine A python module that provides one or more classes that implement the ABCModelingEngine interface e simphony visualisati
11. Remove the bonds with the provided uids 3 2 CUDS 37 SimPhoNy Documentation Release 0 2 1 The uids passed as parameter should exists in the container If any uid doesn t exist an exception will be raised Parameters uids uu id UUID the uid of the bond to be removed Examples Having a set of uids of existing bonds pass it to the method gt gt gt particles Particles name foo gt gt gt gt gt bondl particles get_bond uidl gt gt gt bond2 particles get_bond uid2 gt gt gt gt gt gt particles remove_bonds bondl uid bond2 uid or gt gt gt particles remove_bond uidl uid2 remove _particles uids Remove the particles with the provided uids from the container The uids inside the iterable should exists in the container Otherwise an exception will be raised Parameters uid uuid UUID the uid of the particle to be removed Raises KeyError If any particle doesn t exist Examples Having a set of uids of existing particles pass it to the method gt gt gt particles Particles name foo e sid gt gt gt particlel particles get_particle uidl gt gt gt particle2 particles get_particle uid2 gt gt gt gt gt gt particles remove_particle partl uid part2 uid or directly gt gt gt particles remove_particle uidl uid2 update_bonds iterable Updates a set of bonds from the provided iterable
12. Takes the uids of the bonds and searches inside the container for those bond If the bonds exists they are replaced in the container If any bond doesn t exist it will raise an exception Parameters iterable iterable of Bond objects the bonds that will be replaced Raises ValueError If any bond doesn t exist Examples Given a set of Bond objects that already exists in the container taken with the get_bond method for example just call the function passing the set of Bond as parameter 38 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 gt gt gt particles Particles name foo gt gt gt gt gt bondl particles get_bond uidl gt gt gt bond2 particles get_bond uid2 gt gt gt fdo whatever you want with the bonds gt gt gt particles update_bond bondl bond2 update _particles iterable Updates a set of particles from the provided iterable Takes the uids of the particles and searches inside the container for those particles If the particles exists they are replaced in the container If any particle doesn t exist it will raise an exception Parameters iterable iterable of Particle objects the particles that will be replaced Raises ValueError If any particle inside the iterable does not exist Examples Given a set of Particle objects that already exists in the container taken with the get_particle method
13. a exception is raised Parameters uid UUID uid of the desired face Returns Face identified by uid Return type Face Raises Exception If the face identified by uid was not found 44 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 get point uid Returns a point with a given uid Returns the point stored in the mesh identified by uid If such point do not exists an exception is raised Parameters uid UUID uid of the desired point Returns Mesh point identified by uid Return type Point Raises Exception If the point identified by uid was not found has_cells Check if the mesh container has cells Returns True of there are cells inside the mesh False otherwise Return type bool has_edges Check if the mesh container has edges Returns True of there are edges inside the mesh False otherwise Return type bool has_ faces Check if the mesh container has faces Returns True of there are faces inside the mesh False otherwise Return type bool iter cells uids None Returns an iterator over cells Parameters uids iterable of uuid UUID or None When the uids are provided then the cells are returned in the same order the uids are returned by the iterable If uids is None then all cells are returned by the interable and there is no restriction on the order that they are returned Returns Iterator over the selected cells Return type iter iter edges uids None Returns
14. an iterator over edges Parameters uids iterable of uuid UUID or None When the uids are provided then the edges are returned in the same order the uids are returned by the iterable If uids is None then all edges are returned by the interable and there is no restriction on the order that they are returned Returns Iterator over the selected edges Return type iter iter faces uids None Returns an iterator over faces Parameters uids iterable of uuid UUID or None When the uids are provided then the faces are returned in the same order the uids are returned by the iterable If uids is None then all faces are returned by the interable and there is no restriction on the order that they are returned 3 3 HDF5 IO 45 SimPhoNy Documentation Release 0 2 1 Returns Iterator over the faces Return type iter iter_points uids None Returns an iterator over points Parameters uids iterable of uuid UUID or None When the uids are provided then the points are returned in the same order the uids are returned by the iterable If uids is None then all points are returned by the interable and there is no restriction on the order that they are returned Returns Iterator over the points Return type iter name update cells cells Updates the information of every cell in cells Gets the mesh cells identified by the same uids as the ones provided in cells and updates their information Parameters cellss iterable
15. angle between the conventional unit cell edges in radians e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_tetragonal_lattice name hvy hz size origin 0 0 0 Create and return a 3D tetragonal lattice Parameters e name sir hxy float lattice spacing in the xy plane e hz float lattice spacing in the z direction e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_triclinic_lattice name hs angles size origin 0 0 0 Create and return a 3D triclinic lattice Parameters e name sir hs float 3 lattice spacings in each axis direction e angles float 3 angles between the conventional unit cell edges in radians e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice Mesh module This module contains the implementation to store access and modify a mesh class simphony cuds mesh Cel1 points uid None data None Cell element Element for storing 3D geometrical objects P
16. are a list of common keywords transcending across different scales meth ods and modelling engines They provide a standard nomenclature for attributes variables and parameters in Sim PhoNy More detailed information for each CUBA keyword is provided in the following table Name Description Domain Id Universal unique id represented as a hex string size 32 ATM DEM FEM F Name Naming of high level objects e g solver models ATM DEM FEM F Position Position of a point or node or atom L ATM DEM FEM Fy Direction Geometric more general than e g velocity could be used for spin PATM FEM FVM LE Status Status of a point or node P DEM LBM Label Label for a point or node L ATM DEM FEM F Materialld Material identification number L DEM FEM FVM LE ChemicalSpecie Chemical Specie ATM VIS MaterialType Material dimension and type VIS ShapeCenter Geometrical center of the shape of the material P VIS ShapeLengthUC Length in units cells of the shape of the material P VIS ShapeLength Length in angstroms of the shape of the materials P VIS ShapeRadius Radius for a spherical material P VIS ShapeSide Side length for a hexagonal material VIS CrystalStorage Add
17. containers the description does not define remove operations e The Lattice container does not have an add item operation Snapshot principle All CUDS containers native or proxy based are owners of their data and will always return components that contain a copy snapshot of the internal data representation As a result the information of an item extracted with a get operation before and after a simulation run is not expected to be the same The snapshot principle also means that the returned CUDS items do not depend anymore on the container instance they where extracted from 2 3 3 CUDS Items Low level items are smallest objects that can hold CUBA information in SimPhoNy simulations Each CUDS container supports a specific set of these types as presented in Fig 2 8 Chapter 2 User Manual SimPhoNy Documentation Release 0 2 1 a ABCParticles name str data DataContainer add_particles iterable iterable of Particle uuid UVID name str get_particle uid uuid UUID Particle prim_cell PrimitiveCell update_particles iterable iterable of Particle size int 3 remove_particles uids iterable of uuid UUID origin float 3 iter_particles uids iterable of uuid UUID optional iterator of Particle unordered data DataContainer has_particle uid uuid UUID boolean get_node index int 3 LatticeNode add_bonds iterable iterable of Bond uuid UUID update_nodes nodes iterable of LatticeNode get_bond uid uuid U
18. foo gt gt gt gt gt gt particles remove_particles uidl uid2 update bonds iterable Updates a set of bonds from the provided iterable Takes the uids of the bonds and searches inside the container for those bond If the bonds exists they are replaced in the container If any bond doesn t exist it will raise an exception Parameters iterable iterable of Bond objects the bonds that will be replaced Raises ValueError If any bond doesn t exist Examples Given a set of Bond objects that already exists in the container taken with the get_bond method for example just call the function passing the set of Bond as parameter gt gt gt particles Particles name foo ESA ews gt gt gt bondl particles get_bond uidl gt gt gt bond2 particles get_bond uid2 gt gt gt fdo whatever you want with the bonds gt gt gt particles update_bonds bondl bond2 update _particles iterable Updates a set of particles from the provided iterable Takes the uids of the particles and searches inside the container for those particles If the particles exists they are replaced in the container If any particle doesn t exist it will raise an exception Parameters iterable iterable of Particle objects the particles that will be replaced Raises ValueError If any particle inside the iterable does not exist 22 Chapter 3 API Reference SimPhoNy Doc
19. name Remove a dataset from the engine Parameters name str name of CUDS container to be deleted Raises ValueError If there is no dataset with the given name valid Checks if file is valid i e open class simphony io h5_particles H5BondItems root name bonds Bases simphony io h5_cuds_items H5CUDSItems A proxy class to an HDF5 group node with serialised Bonds The class implements the Mutable Mapping api where each Bond instance is mapped to uid class simphony io h5_particles H5ParticleItems root name particles Bases simphony io h5_cuds_items H5CUDSItems A proxy class to an HDF5 group node with serialised Particles The class implements the Mutable Mapping api where each Particle instance is mapped to uid class simphony io h5_particles H5Particles group Bases simphony cuds abc_particles ABCParticles An HDFS5 backed particle container add bonds iterable Add a set of bonds If the bonds have an uid then they are used If any of the bond s uid is None then a uid is generated for the bond Returns uid uid of bond Return type uuid UUID Raises ValueError if an uid is given which already exists add _particles iterable Add a set of particles If the particles have a uid set then they are used If any of the particle s uid is None then a new uid is generated for the particle Returns uid uid of particle Return type uuid UUID Raises ValueError Any particle uid alrea
20. of Cell Cells to be updated Raises KeyError If any cell was not found in the mesh container update_edges edges Updates the information of an edge Gets the mesh edges identified by the same uids as the ones provided edges and updates their information Parameters edges iterable of Edge Edges to be updated Raises KeyError If any edge was not found in the mesh container update faces faces Updates the information of a face Gets the mesh faces identified by the same uids as the ones provided in faces and updates their information Parameters faces iterable of Face Faces to be updated Raises KeyError If any face was not found in the mesh container update points points Updates the information of a point Gets the mesh points identified by the same uids as the ones provided points and updates their information Parameters points iterable of Point Points to be updated Raises KeyError If any point was not found in the mesh container class simphony io h5_cuds_items H5CUDSItems root record name items Bases _abcoll MutableMapping A proxy class to an HDF5 group node with serialised CUDS items The class implements the Mutable Mapping api where each item instance is mapped to uuid add_safe item Add item while checking for a unique uid Note The item is expected to already have a uid set 46 Chapter 3 API Reference SimPhoNy Documentation Rel
21. the mapping and iterables where the keys are CUBA enum members For convenience keywords can be passed as capitalized CUBA enum members gt gt gt DataContainer ACCELERATION 2 34 CUBA ACCELERATION is 22 lt CUBA ACCELERATION 22 gt 234 update args kwargs 3 2 CUDS 3 2 1 Abstract CUDS interfaces Containers 15 SimPhoNy Documentation Release 0 2 1 abstractmesh ABCMesh abstractparticles ABCParticles abstractlattice ABCLattice Description class simphony cuds abc mesh ABCMesh Abstract base class for mesh name str name of mesh add cells cell Adds a set of new cells to the mesh Parameters cells iterable of Cell Cell to be added to the mesh Raises ValueError If other cell with a duplicated uid was already in the mesh add_edges edge Adds a set of new edges to the mesh Parameters edges iterable of Edge Edge to be added to the mesh Raises ValueError If other edge with a duplicated uid was already in the mesh add_faces face Adds a set of new faces to the mesh Parameters faces iterable of Face Face to be added to the mesh Raises ValueError If other face with a duplicated uid was already in the mesh add points points Adds a set of new points to the mesh Parameters points iterable of Point Points to be added to the mesh Raises ValueError If other point with a duplicated uid was already in the m
22. uid of the point e coordinates list of double set of coordinates x y z describing the point position e data DataContainer object to store point data uid uuid UUID uid of the point data DataContainer object to store point data coordinates list of double set of coordinates x y z describing the point position classmethod rom point point class simphony cuds particles Bond particles uid None data None Class representing a bond uid uuid UUID the uid of the bond particles tuple tuple of uids of the particles that are participating in the bond data DataContainer DataContainer to store the attributes of the bond classmethod from_bond bond class simphony cuds particles Particle coordinates 0 0 0 0 0 0 uid None data None Class representing a particle 34 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 uid uuid UUID the uid of the particle coordinates list tuple x y z coordinates of the particle data DataContainer DataContainer to store the attributes of the particle classmethod from_particle particle class simphony cuds particles Particles name Class that represents a container of particles and bonds Class provides methods to add particles and bonds remove them and update them name str name of the particle container _particles dict data structure for particles storage _bonds dict d
23. with a duplicated uid was already in the mesh add_points points Adds a set of new points to the mesh Parameters points iterable of Point Points to be added to the mesh Raises ValueError If other point with a duplicated uid was already in the mesh count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container data get cell uid Returns a cell with a given uid Returns the cell stored in the mesh identified by uid If such a cell does not exists an exception is raised Parameters uid unid UUID uid of the desired cell 3 2 CUDS 31 SimPhoNy Documentation Release 0 2 1 Returns cell Cell identified by uid Return type Cell Raises e KeyError If the cell identified by uuid was not found e TypeError When uid is not uuid UUID get edge uid Returns an edge with a given uid Returns the edge stored in the mesh identified by uid If such edge do not exists an exception is raised Parameters uid uuid UUID uid of the desired edge Returns edge Edge identified by uid Return type Edge Raises e KeyError If the edge identified by uid was not found e TypeError When uid is not uuid UUI
24. 08 ImPhoNy SimPhoNy Documentation Release 0 2 1 SimPhoNy EU FP7 Project Nr 604005 December 09 2015 Contents 1 Simphony common 1 led REPOSMOLY tragar da A WA eee eek AA KAA 1 1 2 REQUIFEMEMS e opes 4 Re E E OR A E A AR es 1 13 Installation Exts PA AA A AA wed aa 2 LA Testing cao ke ee Sh lee EG Bae Re REDS Re SRS BAe SOEs 2 LS Documentation 2 40566 44406455664 te bibs A eee heed PEG a ae 2 1 6 Directory structure lt s sop se ek Ae oe A A we BS AS ee ee he a 2 1 7 SimPhoNy Framework ase ece e me eee ea IAA Ga ae ae a a 3 2 User Manual 5 2A USOS a a o e RA A AA 5 22 ICUBAKEYWOTA SE 606 0 a KAA AU a da 6 223 AGWDS Datars tuciunes Pi oo tse E A A BG A AO Beh oe Means 7 24 JAIDFS Storage taa a RA eee bok e rl he gas a eR ae a eS 10 3 API Reference 15 BS COTE 2s bee ee eh RAE Bea Be ORR EAR Sea EE oe a Ge ee al Baa el 15 32 UDS ba pa ss Gh pode A Altes A at Ao 15 39 HDH JO alo arrasa ee Aes o ts eee he eS See 39 4 Indices and tables 49 Python Module Index 51 CHAPTER 1 Simphony common The native implementation of the SimPhoNy cuds objects and io code http www simphony project eu 1 1 Repository Simphony common is hosted on github https github com simphony simphony common 1 2 Requirements e enum34 gt 1 0 4 e stevedore gt 1 2 0 e numpy gt 1 4 1 1 2 1 Optional requirements To support the cuba generate script the following packages need to be inst
25. BCMesh method 17 get_face simphony cuds mesh Mesh method 32 get_face simphony io h5_mesh H5Mesh method 44 get_node simphony cuds abc_lattice ABCLattice method 23 get_node simphony cuds lattice Lattice method 25 get_node simphony io h5_lattice H5Lattice method 42 get_particle simphony cuds abc_particles ABCParticles method 20 get_particle simphony cuds particles Particles method 36 get_particle simphony io h5_particles H5Particles method 41 get_point simphony cuds abc_mesh ABCMesh method 17 get_point simphony cuds mesh Mesh method 32 get_point simphony io h5_mesh H5Mesh method 44 H H5BondlItems class in simphony io h5_particles 41 HSCUDS class in simphony io h5_cuds 40 HS5CUDSTtems class in simphony io h5_cuds_items 46 H5Lattice class in simphony io h5_lattice 42 H5Mesh class in simphony io h5_mesh 43 H5ParticleItems class in simphony io h5_particles 41 H5Particles class in simphony io h5_particles 41 has bond simphony cuds abc_particles ABCParticles method 20 has bond simphony cuds particles Particles method 36 has bond simphony io h5_particles H5Particles method 42 has_cells simphony cuds abc_mesh ABCMesh method 17 has_cells simphony cuds mesh Mesh method 32 has_cells simphony io h5_mesh H5Mesh method 45 has_edges simphony cuds abc_mesh ABCMesh method 17 has_edges simphony cuds mesh Mesh metho
26. D get face uid Returns a face with a given uid Returns the face stored in the mesh identified by uid If such a face does not exists an exception is raised Parameters uid uuid UUID uid of the desired face Returns face Face identified by uid Return type Face Raises e KeyError If the face identified by uid was not found e TypeError When uid is not uuid UUID get_point uid Returns a point with a given uid Returns the point stored in the mesh identified by uid If such point do not exists an exception is raised Parameters uid uuid UUID uid of the desired point Returns point Mesh point identified by uuid Return type Point Raises e KeyError If the point identified by uid was not found e TypeError When uid is not uuid UUID has_cells Check if the mesh has cells Returns result True of there are cells inside the mesh False otherwise Return type bool has_edges Check if the mesh has edges 32 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 Returns result True of there are edges inside the mesh False otherwise Return type bool has faces Check if the mesh has faces Returns result True of there are faces inside the mesh False otherwise Return type bool iter cells uids None Returns an iterator over cells Parameters uids iterable of uuid UUID or None When the uids are provided then the cells are returned in the same order
27. DS method 40 coordinates simphony cuds mesh Point attribute 34 coordinates simphony cuds particles Particle attribute 39 count_of simphony cuds abc_lattice ABCLattice method 23 count_of simphony cuds abc_mesh ABCMesh method 16 count_of simphony cuds abc_particles ABCParticles method 20 count_of simphony cuds lattice Lattice method 25 count_of simphony cuds mesh Mesh method 31 count_of simphony cuds particles Particles method 36 count_of simphony io hS_lattice H5Lattice method 42 count_of simphony io h5_mesh H5Mesh method 44 count_of simphony io h5_particles H5Particles method 41 create new simphony io h5_lattice HSLattice class method 42 data simphony cuds abc_lattice ABCLattice attribute 23 simphony cuds abc_particles ABCParticles at tribute 19 data 53 SimPhoNy Documentation Release 0 2 1 data simphony cuds lattice Lattice attribute 25 data simphony cuds lattice LatticeNode attribute 25 data simphony cuds mesh Element attribute 30 data simphony cuds mesh Mesh attribute 31 data simphony cuds mesh Point attribute 34 data simphony cuds particles Bond attribute 34 data simphony cuds particles Particle attribute 35 data simphony cuds particles Particles attribute 35 36 data simphony io h5_lattice H5Lattice attribute 42 data simphony io h5_mesh H5Mesh attribute 43 44 data simphony io h5_particles H5Particles a
28. UID Bond iter_nodes indices iterable of int 3 optional iterator of LatticeNode update_bonds iterable iterable of Bond get_coordinate index int 3 float 3 remove_bonds uids iterable of uuid UUID iter_bonds uids iterable of uuid UUID foptional iterator of Bond unordered count of key CUDSitem integer has_bond uid uuid UUID boolean count_of key CUDSItem integer name str data DataContainer add_points points iterable of Point uwid UUID get_point uid uuid UUID Point update_points points iterable of Point iter_point uids iterable of uuid UUID optional iterator of Point unordered add_edges edges iterable of Edge uuid UU D get_edge uid uuid UUID Edge update_edges edges iterable of Edge iter_edge uids iterable of uuid UUID optional iterator of Edge unordered has_edges boolean add_faces faces iterable of Face uuid UU ID get_edge uid uuid UUID Face update_faces faces iterable of Face iter_faces uids iterable of uuid UUID optional iterator of Face unordered has_faces boolean add_cells cells iterable of Cell uuid UUID get_edge uid uuid UUID cell update_celis cells iterable of Cell iter_cells uids iterable of uuid UUID optional iterator of Cell unordered has_cells boolean bravais_lattice int count_of key CUDSItem integer Fig 2 2 Figure 2 UML description of a CUDS Containers Edge classmethods from_edge edge E
29. alled prior to installing Simphony e click gt 3 3 e pyyaml gt 3 11 e tabulate gt 0 7 4 To support the HDF5 based native IO e PyTables gt 3 1 1 To support the documentation built you need the following packages e sphinx gt 1 2 3 e sphinxcontrib napoleon gt 0 2 10 e mock Note Packages that depend on the optional features and use setuptools should append the H510 and or CUBAGen identifier next to simphony in their set up_requires configuration option For example install reguires simphony H5I0 CUBAGen SimPhoNy Documentation Release 0 2 1 Will make sure that the requirements of HSIO and CUBAGen support are installed see setuptools extras for more information 1 3 Installation The package requires python 2 7 x installation is based on setuptools build and install python setup py install or build for in place development python setup py develop 1 4 Testing To run the full test suite run python m unittest discover p testx 1 5 Documentation To build the documentation in the doc build directory run python setup py build_sphinx If you recreate the uml diagrams you need to have java and xdot installed sudo apt get install default jre xdot A copy of the plantuml jar needs also to be available in the doc folder Running make uml inside the doc directory will recreate all the UML diagrams Note e
30. arameters e points list of uid list of points uids defining the cell e uid uuid UUID uid of the cell e data DataContainer object to store data relative to the cell classmethod rom cell cell 3 2 CUDS 29 SimPhoNy Documentation Release 0 2 1 class simphony cuds mesh Edge points uid None data None Edge element Element for storing 1D geometrical objects Parameters e points list of uid list of points uids defining the edge e uid uuid UUID uid of the edge e data DataContainer object to store data relative to the edge classmethod from_edge edge class simphony cuds mesh Element points uid None data None Element base class Element for storing geometrical objects Parameters e uid uid of the edge e points list of uid list of points uids defining the edge e data DataContainer object to store data relative to the element points list of uid list of points uids defining the element uid uuid UUID uid of the element data DataContainer Element data class simphony cuds mesh Face points uid None data None Face element Element for storing 2D geometrical objects Parameters e points list of uid list of points uids defining the face e uid uuid UUID uid of the face e data DataContainer object to store data relative to the face classmethod rom face face class simphony cuds mesh Mesh name Mesh object to stor
31. article Particle gt gt gt particles Particles name foo gt gt gt uids particles add_particles particle_list count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container get_bond uid Returns a copy of the bond with the bond id id Parameters uid uuid UUID the uid of the bond Raises KeyError when the bond is not in the container Returns bond A copy of the internally stored bond info Return type Bond get_particle uid Returns a copy of the particle with the particle_id id Parameters uid uuid UUID the uid of the particle Raises KeyError when the particle is not in the container Returns particle A copy of the internally stored particle info Return type Particle has_bond uid Checks if a bond with the given uid already exists in the container has_particle uid Checks if a particle with the given uid already exists in the container iter_bonds uids None Generator method for iterating over the bonds of the container It can receive any kind of sequence of bond ids to iterate over those concrete bond If nothing is passed as parameter it will iterate over all the bonds
32. ata structure for bonds storage data DataContainer data attributes of the element add bonds iterable Adds a set of bonds to the container Also like with particles if any bond has a defined uid it won t add the bond if a bond with the same uid already exists and if the bond has no uid the particle container will generate an uid If the user wants to replace an existing bond in the container there is an update_bonds method for that purpose Parameters iterable iterable of Bond objects the new bond that will be included in the container Returns uuid The uuids of the added bonds Return type list of uuid UUID Raises ValueError when there is a bond with an uuid that already exists in the container Examples Add a set of bonds to a Particles container gt gt gt bonds_list Bond Bond gt gt gt particles Particles name foo gt gt gt particles add_bond bonds_list add _particles iterable Adds a set of particles from the provided iterable to the container If any particle have no uids the container will generate a new uids for it If the particle has already an ulds it won t add the particle if a particle with the same uid already exists If the user wants to replace an existing particle in the container there is an update_particles method for that purpose Parameters iterable iterable of Particle objects the new set of particles that will be included i
33. d 32 has_edges simphony io h5_mesh H5Mesh method 45 has_faces simphony cuds abc_mesh ABCMesh method 17 has_faces simphony cuds mesh Mesh method 33 has_faces simphony io h5_mesh H5Mesh method 45 has_particle simphony cuds abc_particles ABCParticles method 20 has_particle method 36 has_particle simphony io h5_particles H5Particles method 42 simphony cuds particles Particles 54 Index SimPhoNy Documentation Release 0 2 1 index simphony cuds lattice LatticeNode attribute 25 IndexedDataContainerTable class in sim phony io indexed_data_container_table 47 iter_bonds simphony cuds abc_particles ABCParticles method 20 iter bonds simphony cuds particles Particles method 36 iter_bonds simphony io h5_particles H5Particles method 42 iter_cells simphony cuds abc_mesh ABCMesh method 18 iter_cells simphony cuds mesh Mesh method 33 iter_cells simphony io h5_mesh H5Mesh method 45 iter_datasets simphony io h3_cuds H5CUDS method 40 iter_edges simphony cuds abc_mesh ABCMesh method 18 iter_edges simphony cuds mesh Mesh method 33 iter_edges simphony io h5_mesh H5Mesh method 45 iter_faces simphony cuds abc_mesh ABCMesh method 18 iter_faces simphony cuds mesh Mesh method 33 iter_faces simphony io hS_mesh H5Mesh method 45 iter_nodes simphony cuds abc_lattice ABCLattice method 23 iter_nodes simphony cud
34. d already exists in the container has_particle uid Checks if a particle with the given uid already exists in the container iter_bonds uids None Generator method for iterating over the bonds of the container It can receive any kind of sequence of bond ids to iterate over those concrete bond If nothing is passed as parameter it will iterate over all the bonds Parameters uids iterable of uuid UUID optional sequence containing the id s of the bond that will be iterated When the uids are provided then the bonds are returned in the same order the uids are returned by the iterable If uids is None then all bonds are returned by the interable and there is no restriction on the order that they are returned 36 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 Yields bond Bond The nezt Bond item Raises KeyError if any of the ids passed as parameters are not in the container Examples It can be used with a sequence as parameter or without it gt gt gt part container Particles name foo SSS 236 gt gt gt for bond in part_container iter_bonds idl id2 id3 do stuff take the bond back to the container so it will be updated in case we need it part_container update_bond bond gt gt gt for bond in part_container iter_bond fdo stuff it will iterate over all the bond take the bond back to the container so it will be updated in case we ne
35. dge Edge copy uid uuid UUID uid uuid UUID data DataContainer data DataContainer coordinates double 3 particles uuid UUID classmethods classmethod from_particle particle Particle Particle copy from_bond bond Bond Bond copy Face classmethods from facelface Face Face copy ssmethods cla from_cell cell Cell Cell copy LatticeNode O Element uid uuid UUID data DataContainer data DataContainer uid uuid UUID index int 3 coordinates double 3 methods data DataContainer lassmethods points uuid UVID from_node node LatticeNode LatticeNode copy classi from_point point Point Point copy Fig 2 3 Figure 3 UML diagram of the CUDS items and their relations 2 3 CUDS Data Structures 9 SimPhoNy Documentation Release 0 2 1 2 3 4 Core items init data DataContainer DataContainer init PRCUBAKeywords DataContainer getitem key CUBA object setitem key CUBA value object delitem key CUBA _iter_ iterator of contained keys en int contains key CUBA boolean Fig 2 4 Figure 4 UML diagram of the DataContainer The CUBA attribute container part of the SimPhoNy core A dictionary like object maps CUBA enum keys to they values In its native python implementation it can support all CUBA attributes 2 4 HDF5 Storage Cuds containers can be stored in HDF5 files using the
36. dy exists in the container count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container data get_bond uid 3 3 HDF5 IO 41 SimPhoNy Documentation Release 0 2 1 get_particle uid has bond uid Checks if a bond with uid uid ezists in the container has particle uid Checks if a particle with uid uid ezists in the container iter bonds ids None Get iterator over particles iter particles ids None Get iterator over particles name The name of the container remove bonds uids remove particles uids update bonds iterable update particles iterable class simphony io h5_lattice H5Lattice group Bases simphony cuds abc lattice ABCLattice H5Lattice object to use HSCUDS lattices count of item_type Return the count of item type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item type in the container Return type int Raises ValueError If the type of the item is not supported in the current container classmethod create new group primitive_cell size origin record None C
37. e points and elements Stores general mesh information Points and Elements such as Edges Faces and Cells and provide the methods to interact with them The methods are divided in four different blocks 1 methods to get the related item with the provided uid 2 methods to add a new item or replace 3 generator methods that return iterators over all or some of the mesh items and 4 inspection methods to identify if there are any edges faces or cells described in the mesh Parameters name stv name of mesh 30 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 name str name of mesh data Data Data relative to the mesh points dictionary of Point Points of the mesh edges dictionary of Edge Edges of the mesh faces dictionary of Face Faces of the mesh cells dictionary of Cell Cells of the mesh add cells cells Adds a set of new cells to the mesh Parameters cells iterable of Cell Cell to be added to the mesh Raises ValueError If other cell with a duplicated uid was already in the mesh add_edges edges Adds a set of new edges to the mesh Parameters edges iterable of Edge Edge to be added to the mesh Raises ValueError If other edge with a duplicated uid was already in the mesh add_faces faces Adds a set of new faces to the mesh Parameters faces iterable of Face Face to be added to the mesh Raises ValueError If other face
38. ease 0 2 1 add unsafe item Add item without checking for a unigue uid Note The item is expected to already have a uid set itersequence sequence Iterate over a sequence of row ids update_existing item Update an item if it already exists valid A PyTables table is opened created and the object is valid class simphony io data_container_table DataContainerTable root name data_containers record None Bases _abcoll MutableMapping A proxy class to an HDF5 group node with serialised DataContainers The class implements the Mutable Mapping api where each DataContainer instance is mapped to uuid append data Append the data to the end of the table Parameters data DataContainer The DataContainer instance to save Returns uid The index of the saved row Return type uuid UUID itersequence sequence Iterate over a sequence of row ids valid A PyTables table is opened created and the object is valid class simphony io indexed_data_container_table IndexedDataContainerTable root name data_containers record None ex pected_number None Bases _abcoll Sequence A proxy class to an HDF5 group node with serialised DataContainers The class implements the Sequence api where each DataContainer instance is mapped to the row In addition the class implements update i e __ set item__ and append append data Append the data to the end of the table Parameters data DataContain
39. ed it part_container update_bond bond iter_particles uids None Generator method for iterating over the particles of the container It can receive any kind of sequence of particle uids to iterate over those concrete particles If nothing is passed as parameter it will iterate over all the particles Parameters uids iterable of uuid UUID optional sequence containing the uids of the par ticles that will be iterated When the uids are provided then the particles are returned in the same order the uids are returned by the iterable If uids is None then all particles are returned by the interable and there is no restriction on the order that they are returned Yields particle Particle The Particle item Raises KeyError if any of the ids passed as parameters are not in the container Examples It can be used with a sequence as parameter or without it gt gt gt part_container Particles name foo gt gt gt gt gt gt for particle in part_container iter_particles uidl uid2 uid3 do stuff take the particle back to the container so it will be updated in case we need it part_container update_particle particle gt gt gt for particle in part_container iter_particles do stuff it will iterate over all the particles take the particle back to the container so it will be updated in case we need it part_container update_particle particle remove bonds uids
40. er The DataContainer instance to save Returns index The index of the saved row Return type int valid 3 3 HDF5 IO 47 SimPhoNy Documentation Release 0 2 1 48 Chapter 3 API Reference CHAPTER 4 Indices and tables e genindex e modindex e search 49 SimPhoNy Documentation Release 0 2 1 50 Chapter 4 Indices and tables Python Module Indez sim sim sim sim sim sim sim sim sim sim sim sim sim sim sim phony phony phony phony phony phony phony phony 47 phony phony phony phony phony phony phony 47 core data container 15 cuds abc_lattice 23 cuds abc_mesh 16 cuds abc_particles 19 cuds lattice 24 cuds mesh 29 cuds particles 34 10 io h5_cuds 40 io io h5_lattice 42 io iO h5_particles 41 io DO data_container_description data_container_table 47 h5_cuds_items 46 h5_mesh 43 indexed_data_container_table 51 SimPhoNy Documentation Release 0 2 1 52 Python Module Index Index Symbols _bonds simphony cuds particles Particles attribute 35 _particles simphony cuds particles Particles attribute 35 A ABCLattice class in simphony cuds abc_lattice 23 ABCMesh class in simphony cuds abc_mesh 16 ABCParticles class in simphony cuds abc_particles 19 add_bonds simphony cuds abc_particles ABCParticles method 19 add_bonds simphony cuds pa
41. es Faces and Cells and provide the methods to interact with them The methods are divided in four diferent blocks 1 methods to get the related item with the provided uid 2 methods to add a new item or replace 3 generator methods that return iterators over all or some of the mesh items and 4 inspection methods to identify if there are any edges faces or cells described in the mesh data Data Data relative to the mesh name String Name of the mesh See also get point get edge get face get cell add point add edge add face add cell update point update edge update face update cell iter points iter edges iter faces iter cells has edges has faces has cells create points table create edges table create faces table create cells table add cells cells Adds a new set of cells to the mesh container Parameters cells iterable of Cell Cells to be added to the mesh container Raises KeyError If other cell with the same uid was already in the mesh add_edges edges Adds a new set of edges to the mesh container Parameters edges iterable of Edge Edges to be added to the mesh container Raises KeyError If other edge with the same uid was already in the mesh 3 3 HDF5 IO 43 SimPhoNy Documentation Release 0 2 1 add faces faces Adds a new set of faces to the mesh container Parameters faces iterable of Face Faces to be added to the mesh containe
42. esh count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container get cell uid Returns a cell with a given uid Returns the cell stored in the mesh identified by uid If such a cell does not exists an exception is raised Parameters uid unid UUID uid of the desired cell Returns cell Cell identified by uid Return type Cell Raises 16 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 e KeyError If the cell identified by uuid was not found e TypeError When uid is not uuid UUID get edge uid Returns an edge with a given uid Returns the edge stored in the mesh identified by uid If such edge do not exists an exception is raised Parameters uid uu id UUID uid of the desired edge Returns edge Edge identified by uid Return type Edge Raises e KeyError If the edge identified by uid was not found e TypeError When uid is not uuid UUID get_face uid Returns a face with a given uid Returns the face stored in the mesh identified by uid If such a face does not exists an exception is raised Parameters uid uuid UUID uid of the desired face Returns face Face identif
43. for example just call the function passing the Particle items as parameter gt gt gt part container Particles name foo SSS pes gt gt gt partl part_container get_particle uidl gt gt gt part2 part_container get_particle uid2 gt gt gt fdo whatever you want with the particles gt gt gt part_container update_particle partl part2 3 3 HDF5 IO The CUDS to HDES file adapters Classes H5CUDS handle Access to CUDS hdf5 formatted files DataContainerTable root name record A proxy class to an HDFS group node with serialised DataContainers IndexedDataContainerTable root name A proxy class to an HDF5 group node with serialised DataContainers H5Particles group An HDFS5 backed particle container H5Lattice group H5Lattice object to use HSCUDS lattices H5Mesh group meshFile H5Mesh H5CUDSItems root record name A proxy class to an HDF5 group node with serialised CUDS items Table descriptions 3 3 HDF5 IO 39 SimPhoNy Documentation Release 0 2 1 Implementation class simphony io h5_cuds H5CuDS handle Bases object Access to CUDS hdf5 formatted files add_dataset container Add a CUDS container Parameters container ABCMesh ABCParticles ABCLattice The CUDS container to be added Raises e TypeError If the container type is not supported by the engine e ValueError If there is already a dataset with the g
44. ied by the same uid as the provided edge and updates its information with the one provided with the new edge Parameters edges iterable of Edge Edge to be updated 18 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 Raises ValueError If the any edge was not found in the mesh update_faces face Updates the information of a set of faces Gets the mesh face identified by the same uid as the provided face and updates its information with the one provided with the new face Parameters faces iterable of Face Face to be updated Raises ValueError If the any face was not found in the mesh update points point Updates the information of a set of points Gets the mesh point identified by the same uid as the provided point and updates its information with the one provided with the new point Parameters points iterable of Point Point to be updated Raises ValueError If the any point was not found in the mesh class simphony cuds abc_particles ABCParticles Abstract base class for a container of particles items name str name of particles item data DataContainer The data associated with the container add bonds iterable Adds a set of bonds to the container Also like with particles if any bond has a defined uid it won t add the bond if a bond with the same uid already exists and if the bond has no uid the particle container will generate an uid If the user wan
45. ied by uid Return type Face Raises e KeyError If the face identified by uid was not found e TypeError When uid is not uuid UUID get_point uid Returns a point with a given uid Returns the point stored in the mesh identified by uid If such point do not exists an exception is raised Parameters uid uuid UUID uid of the desired point Returns point Mesh point identified by uuid Return type Point Raises e KeyError If the point identified by uid was not found e TypeError When uid is not uuid UUID has_cells Check if the mesh has cells Returns result True of there are cells inside the mesh False otherwise Return type bool has_edges Check if the mesh has edges Returns result True of there are edges inside the mesh False otherwise Return type bool 3 2 CUDS 17 SimPhoNy Documentation Release 0 2 1 has faces Check if the mesh has faces Returns result True of there are faces inside the mesh False otherwise Return type bool iter cells uids None Returns an iterator over cells Parameters uids iterable of uuid UUID or None When the uids are provided then the cells are returned in the same order the uids are returned by the iterable If uids is None then all cells are returned by the interable and there is no restriction on the order that they are returned Yields cell Cell iter edges uids None Returns an iterator over edges Parameters uids i
46. igin 0 0 0 Create and return a 3D body centered cubic lattice Parameters e name s r e h float lattice spacing e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_body_centered_orthorhombic_lattice name hs size origin 0 0 0 Create and return a 3D body centered orthorhombic lattice Parameters e name sir e hs float 3 lattice spacings in each axis direction e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin 26 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make body centered tetragonal lattice name hxy hz size origin 0 0 0 Create and return a 3D body centered tetragonal lattice Parameters e name sir e hxy float lattice spacing in the xy plane e hz float lattice spacing in the z direction e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_cubic_lattice name h size origin 0 0 0 Create and retu
47. iner is added the CUDS modelling engine will copy into internal memory only the uid mapping and the CUBA information that it can support The user needs to refer to the wrapper package to identify what information is retained When a CUDS container is returned as a result of a get operation in a modelling engine the returned Container is a proxy to the information stored in the internal memory if the wrapper modelling engine 2 3 CUDS Data Structures 7 SimPhoNy Documentation Release 0 2 1 A ABCModelingEngine BC DataContainer CM DataContainer SP DataContainer add_dataset container AGC Mesh ABCParticles ABCLatticep remove_dataset name str get_dataset name str ARC Mesh ABC Particles ABC Lattice get_dataset_names iterable of str iter_datasets names iterable of str foptional iterator unordered Fig 2 1 Figure 1 UML description of a CUDS modelling engine 2 3 2 CUDS containers The CUDS containers with the exception of the Lattice are multi type container i e contain different types of objects For each type the following operations are currently supported e Add an item to the container e Get an item from the container based on the uid e Remove an item from the container based on the uid e Update an item e Iterate over all or some of the items given an iterable of uids Note e Lattice items do not have a uid but are accessed based on i j k index tuples e For Mesh and Lattice
48. ith the one provided with the new cell Parameters cells iterable of Cell Cell to be updated Raises ValueError If the any cell was not found in the mesh update_edges edges Updates the information of a set of edges 3 2 CUDS 33 SimPhoNy Documentation Release 0 2 1 Gets the mesh edge identified by the same uid as the provided edge and updates its information with the one provided with the new edge Parameters edges iterable of Edge Edge to be updated Raises ValueError If the any edge was not found in the mesh update faces faces Updates the information of a set of faces Gets the mesh face identified by the same uid as the provided face and updates its information with the one provided with the new face Parameters faces iterable of Face Face to be updated Raises ValueError If the any face was not found in the mesh update points points Updates the information of a set of points Gets the mesh point identified by the same uid as the provided point and updates its information with the one provided with the new point Parameters points iterable of Point Point to be updated Raises ValueError If the any point was not found in the mesh class simphony cuds mesh Point coordinates uid None data None Coordinates describing a point in the space Set of coordinates x y z describing a point in the space and data about that point Parameters e uid uuid UUID
49. itional information for visualization P VIS NameUC Name of the unit cell of the component ATM VIS Lattice Vectors Lattice vectors of unit cell of the component ATM VIS SymmetryLatticeVectors Symmetry Group ATM VIS Occupancy Occupancy of an atomic position P ATM VIS BondLabel Unique ID of atoms ATM VIS BondType Type of label ATM VIS Velocity Velocity of a point or node ATM DEM FEM F Acceleration Acceleration of a point or node PATM DEM LBM SE NumberOfPoints Number of points or nodes LP DEM FEM FVM LE Radius Particle radius C DEM SPH Size For non spherical particles C DEM SPH Mass Particle mass P ATM DEM Volume Volume of a particle cell etc L DEM FEM FVM LE AngularVelocity Angular velocity of a point or node C DEM AngularAcceleration Angular acceleration of a point or node P DEM SimulationDomainDimensions Size of the simulation domain P DEM FEM FVM LE SimulationDomainOrigin Offset for the simulation domain L DEM FEM FVM LE DynamicViscosity Dynamic viscosity of fluid DEM FEM FVM LE KinematicViscosity Kinematic viscosity of fluid PFEM FVM LBM DiffusionCoefficient Diffusion coefficient PFEM FVM LBM ProbabilityCoefficient For stochastic processes
50. iven name close Closes a file get_dataset name Get the dataset Parameters name str name of CUDS container to be retrieved Returns A proxy of the dataset named name that is stored internally in the File Return type container Raises ValueError If there is no dataset with the given name get_dataset_names Returns the names of the all the datasets in the engine workspace iter datasets names None Returns an iterator over a subset or all of the containers Parameters names sequence of str optional names of specific containers to be iterated over If names is not given then all containers will be iterated over classmethod open filename mode a title Returns a SimPhony file and returns an opened CudsFile Parameters e filename str Name of file to be opened mode str The mode to open the file w Write a new file is created an existing file with the same name would be deleted a Append an existing file is opened for reading and writing and if the file does not exist it is created r ReadOnly This is a very restrictive mode that will through errors at any attempt to modify the data e title str Title attribute of root node only applies to a file which is being created e Raises Raises e ValueError If the file has an incompatible version 40 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 remove dataset
51. lnumber of columns in Data ee ee point uids J String 32 MAX POINTS IN EDGE point uids J String 32 MAK POINTS IN FACE point uids String 32 MAX POINTS IN CELL i n_po nts 2 lt Integer lt MAX_POINTS_IN_EDGE n_po nts 3 lt Integer lt MAK POINTS IN FACE n_po nts 4 lt Integer lt MAK POINTS IN CELL ete T diiri ika pvatatrow Fig 2 8 Figure 4 Diagram of the Mesh based storage The Mesh container is stored using 6 tables one for the container data attribute one for all the item data information one for the points and one for each type of elements i e edge face and cell Indexing to the point or element tables is using the item uid while the item data information is accessed using a separate set of uids mapping to the entries in the data table 2 4 HDF5 Storage 13 SimPhoNy Documentation Release 0 2 1 14 Chapter 2 User Manual CHAPTER 3 API Reference 3 1 Core Core components and objects of the simphony package For a list of the CUBA keywords see CUBA Keywords Classes DataContainer args kwargs A DataContainer instance Implementation class simphony core data_container DataContainer args kwargs Bases dict A DataContainer instance The DataContainer object is implemented as a python dictionary whose keys are restricted to be members of the CUBA enum class The data container can be initialized like a typical python dict using
52. n the container Returns uids The uids of the added particles 3 2 CUDS 35 SimPhoNy Documentation Release 0 2 1 Return type list of uuid UUID Raises ValueError when there is a particle with an uids that already exists in the container Examples Add a set of particles to a Particles container gt gt gt particle_list Particle Particle gt gt gt particles Particles name foo gt gt gt uids particles add_particles particle_list count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container data get_bond uid Returns a copy of the bond with the bond id id Parameters uid uuid UUID the uid of the bond Raises KeyError when the bond is not in the container Returns bond A copy of the internally stored bond info Return type Bond get_particle uid Returns a copy of the particle with the particle_id id Parameters uid uuid UUID the uid of the particle Raises KeyError when the particle is not in the container Returns particle A copy of the internally stored particle info Return type Particle has_bond uid Checks if a bond with the given ui
53. ng in the z direction e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_monoclinic_lattice name hs beta size origin 0 0 0 Create and return a 3D monoclinic lattice Parameters e name str hs float 3 lattice spacings in each axis direction beta float angle between the conventional unit cell edges in radians e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_orthorhombic_lattice name hs size origin 0 0 0 Create and return a 3D orthorhombic lattice Parameters e name sir e hs float 3 lattice spacings in each axis direction e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_rhombohedral_lattice name h angle size origin 0 0 0 Create and return a 3D rhombohedral lattice Parameters e name str e h float lattice spacing 28 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 e angle float
54. on A python module that provides a simple function to show visualise the high level CUDS containers To declare that a package contains a visualisation or engine module for simphony a developer has to add an entry point definition in the setup py of the contributing package e g setup entry_points simphony engine lt name gt lt module_path gt Where lt module path gt is a module where the engine class es can be found like my_cool_engine_plugin cool_engine342 and lt name gt is the user visible name that the cool_engine432 module will have inside the SimPhoNy framework It is important that lt name gt is unique and specific to the contributed components e g name default is probably a very bad choice e g setup entry_points simphony engine cool my_cool_engine_plugin cool_engine342 Will allow the user to import the new engine from inside the simphony module as follows from simphony engine import cool cool is now a reference to th xternal module my_cool_engine_plugin cool_engine342 If the name of the provided engine class is EngFast then the user should be able to d engine cool EngFast Note The examples plugin folder of the simphony common repository contains a dummy package that con tributes python modules to both SimPhoNy Documentation Release 0 2 1 2 2 CUBA Keywords Common Unified Base Attributes CUBA
55. r Raises KeyError If other face with the same uid was already in the mesh add points points Adds a new set of points to the mesh container Parameters points iterable of Point Points to be added to the mesh container Raises KeyError If other point with the same uid was already in the mesh count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container data get cell uid Returns an cell with a given uid Returns the cell stored in the mesh identified by uid If such cell do not exists a exception is raised Parameters uid UUID uid of the desired cell Returns Cell identified by uid Return type Cell Raises Exception If the cell identified by uid was not found get edge uid Returns an edge with a given uid Returns the edge stored in the mesh identified by uid If such edge do not exists a exception is raised Parameters uid UUID uid of the desired edge Returns Edge identified by uid Return type Edge Raises Exception If the edge identified by uid was not found get face uid Returns an face with a given uid Returns the face stored in the mesh identified by uid If such face do not exists
56. re is no restriction on the order that they are returned Yields particle Particle The Particle item Raises KeyError if any of the ids passed as parameters are not in the container Examples It can be used with a sequence as parameter or without it gt gt gt particles Particles name foo gt gt gt gt gt gt for particle in particles iter_particles uidl uid2 uid3 do stuff gt gt gt for particle in particles iter_particles do stuff remove_bonds uids Remove the bonds with the provided uids The uids passed as parameter should exists in the container If any uid doesn t exist an exception will be raised Parameters uids uuid UUID the uid of the bond to be removed 3 2 CUDS 21 SimPhoNy Documentation Release 0 2 1 Examples Having a set of uids of existing bonds pass it to the method gt gt gt particles Particles name foo gt gt gt gt gt gt particles remove_bonds uidl uid2 remove _particles uids Remove the particles with the provided uids from the container The uids inside the iterable should exists in the container Otherwise an exception will be raised Parameters uid uuid UUID the uid of the particle to be removed Raises KeyError If any particle doesn t exist Examples Having a set of uids of existing particles pass it to the method gt gt gt particles Particles name
57. reate a new lattice in H5CUDS file Parameters e group HDF5 group in PyTables file reference to a group folder in PyTables file where the tables for lattice and data will be located e primitive_cell PrimitiveCell primitive cell specifying the 3D Bravais lattice size int 3 number of lattice nodes in the direction of each axis e origin float 3 origin of lattice e record tables IsDescription A class that describes column types for PyTables table data get_node index Get a copy of the node corresponding to the given index Parameters index int 3 node index coordinate Returns Return type A reference to a LatticeNode object 42 Chapter 3 API Reference SimPhoNy Documentation Release 0 2 1 iter_nodes indices None Get an iterator over the LatticeNodes described by the ids Parameters indices iterable set of int 3 optional node index coordinates Returns Return type A generator for LatticeNode objects name origin size update_nodes nodes Updates H5Lattice data for a LatticeNode Parameters nodes iterable of LatticeNode objects reference to LatticeNode objects Mesh File This module contains the implentation to store acces and modify a file storing mesh data class simphony io h5_mesh H5Mesh group meshFile Bases simphony cuds abc_mesh ABCMesh H5Mesh Interface of the mesh file driver Stores general mesh information Points and Elements such as Edg
58. rn a 3D cubic lattice Parameters e name str e h float lattice spacing e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_face_centered_cubic_lattice name h size origin 0 0 0 Create and return a 3D face centered cubic lattice Parameters e name sir e h float lattice spacing e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_face_centered_orthorhombic_lattice name hs size origin 0 0 0 Create and return a 3D face centered orthorhombic lattice Parameters e name sir e hs float 3 lattice spacings in each axis direction e size int 3 Number of lattice nodes in each axis direction 3 2 CUDS 27 SimPhoNy Documentation Release 0 2 1 e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_hexagonal_lattice name hvy hz size origin 0 0 0 Create and return a 3D hexagonal lattice Parameters e name sir e hxy float lattice spacing in the xy plane e hz float lattice spaci
59. roup _v_name str lt name gt lattice Table Nodes data Table ContainerData prim_cell array of float 3 bravais_lattice int size int 3 origin float 3 cuds_version int c ContainerData Table v_name String data row NoUidRecord _v_name str lattice row NoUidRecord NoUidRecord Row data Data mask Bool number of columns in Data c Data Row Fig 2 6 Figure 2 Diagram of the Lattice based storage The Lattice is stored using two table nodes one for the container data attribute and one for the lattice nodes data information The 12 nodes data are stored using the numpy ndenumerate function to convert from i j k lattice enaprars gt URSP Manu al SimPhoNy Documentation Release 0 2 1 H5Particles Group _N_name String lt name gt particles Group Particles bonds Group Bonds data Table ContainerData Node Attribute cuds_version int Particles Group Bonds Group _v_name string particles _v_name string bonds items Table Particles items Table Bonditems data Table Data data Table Data containerata Table Nou l yaa Particleltems Table Data Table Bonditems Table V name String Particles V name String data _N_name String Bonds row Particle row Record row Bond Record Row uid String 32
60. rticles Particles method 35 add bonds simphony io h5_particles H5Particles method 41 add cells simphony cuds abc_mesh ABCMesh method 16 add_cells simphony cuds mesh Mesh method 31 add_cells simphony io h5_mesh H5Mesh method 43 add_dataset simphony io h5_cuds H5CUDS method 40 add_edges simphony cuds abc_mesh ABCMesh method 16 add_edges simphony cuds mesh Mesh method 31 add_edges simphony io h5_mesh H5Mesh method 43 add_faces simphony cuds abc_mesh ABCMesh method 16 add_faces simphony cuds mesh Mesh method 31 add_faces simphony io h3_mesh H5Mesh method 43 add_particles simphony cuds abc_particles ABCParticles method 19 add_particles method 35 add_particles simphony io h5_particles H5Particles method 41 add_points simphony cuds abc_mesh ABCMesh method 16 add_points simphony cuds mesh Mesh method 31 add_points simphony io h5_mesh H5Mesh method 44 simphony cuds particles Particles add_safe simphony io h5_cuds_items HSCUDSItems method 46 add_unsafe simphony io h5_cuds_items HSCUDSItems method 46 append simphony io data_container_table DataContainerTable method 47 append simphony io indexed_data_container_table IndexedDataContaine method 47 B Bond class in simphony cuds particles 34 C Cell class in simphony cuds mesh 29 cells simphony cuds mesh Mesh attribute 31 close simphony io hS_cuds HSCU
61. s abc_mesh ABCMesh attribute 16 name simphony cuds abc_particles ABCParticles at tribute 19 name simphony cuds lattice Lattice attribute 24 name simphony cuds mesh Mesh attribute 30 name simphony cuds particles Particles attribute 35 name simphony io h3_lattice H5Lattice attribute 43 name simphony io h5_mesh H5Mesh attribute 43 46 name simphony io h5_particles H5Particles attribute 42 itersequence simphony io data_container_table DataContajpent e mphony io h5_cuds HSCUDS class method 40 method 47 itersequence simphony io h5_cuds_items HSCUDSItems method 47 L Lattice class in simphony cuds lattice 24 LatticeNode class in simphony cuds lattice 25 M make_base_centered_monoclinic_lattice in module simphony cuds lattice 25 make_base_centered_orthorhombic_lattice in module simphony cuds lattice 26 origin simphony cuds abc_lattice ABCLattice attribute 23 origin simphony cuds lattice Lattice attribute 25 origin simphony io hS_lattice H5Lattice attribute 43 P Particle class in simphony cuds particles 34 Particles class in simphony cuds particles 35 particles simphony cuds particles Bond attribute 34 Point class in simphony cuds mesh 34 points simphony cuds mesh Element attribute 30 points simphony cuds mesh Mesh attribute 31 Index 55 SimPhoNy Documentation Release 0 2 1 primitive_cell simphony cuds abc_lattice ABCLa
62. s lattice Lattice method 25 iter_nodes simphony io h5_lattice HSLattice method 42 iter_particles simphony cuds abc_particles ABCParticles method 21 iter_particles method 37 iter_particles simphony io h5_particles H5Particles method 42 iter_points simphony cuds abc_mesh ABCMesh method 18 iter_points simphony cuds mesh Mesh method 33 iter_points simphony io h5_mesh H5Mesh method 46 simphony cuds particles Particles make body centered cubic lattice in module sim phony cuds lattice 26 make_body_centered_orthorhombic_lattice in module simphony cuds lattice 26 make_body_centered_tetragonal_lattice simphony cuds lattice 27 make_cubic_lattice in module simphony cuds lattice 27 make face centered cubic lattice in module phony cuds lattice 27 make face centered orthorhombic lattice in module simphony cuds lattice 27 in module sim make_hexagonal_lattice in module sim Phony cuds lattice 28 make monoclinic lattice in module sim phony cuds lattice 28 make_orthorhombic_lattice in module sim phony cuds lattice 28 make _rhombohedral_lattice in module sim phony cuds lattice 28 make tetragonal lattice in module sim phony cuds lattice 29 make triclinic lattice in module sim phony cuds lattice 29 Mesh class in simphony cuds mesh 30 N name simphony cuds abc lattice ABCLattice attribute 23 name simphony cud
63. sponding lattice nodes data copied Parameters nodes iterable of LatticeNode objects reference to LatticeNode objects from where the data is copied to the Lattice class simphony cuds lattice LatticeNode index data None A single node of a lattice index tuple of int 3 node index coordinate data DataContainer 3 2 CUDS 25 SimPhoNy Documentation Release 0 2 1 simphony cuds lattice make base centered monoclinic lattice name hs beta size origin 0 0 0 Create and return a 3D base centered monoclinic lattice Parameters e name sir e hs float lattice spacing in each axis direction beta float angle between the conventional unit cell edges in radians e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make _ base centered orthorhombic_lattice name hs size origin 0 0 0 Create and return a 3D base centered orthorhombic lattice Parameters e name sir e hs float 3 lattice spacings in each axis direction e size int 3 Number of lattice nodes in each axis direction e origin float 3 default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_ body _centered cubic lattice name h size or
64. ssure Pressure L FEM FVM LBM SP Temperature Temperature DEM FEM FVM LE Distribution Single particle distribution function ATM LBM VIS OrderParameter Phase field in multiphase flows LBM OriginalPosition Position at the beginning of the calculation DEM DeltaDisplacement Displacement during the last time step DEM ExternalAppliedForce Externally applied force force fields interactions etc DEM EulerAngles Euler Angles DEM Sphericity Sphericity of the particle DEM YoungModulus Young Modulus DEM PoissonRatio Poisson Ratio DEM LnOfRestitutionCoefficient Natural Logarithm of the Restitution Coefficient P DEM RollingFriction Rolling Friction coefficient DEM VolumeFraction Volume fraction PFEM FVM 2 3 CUDS Data Structures The Common Unified Data Structures CUDS define the expected interface for the modelling engine wrappers the visualisation api the top level CUDS containers i e Mesh Lattice and Particles and the low level CUDS components e g Point Bond LatticeNode Note The CUDS API is constantly evolving and changes through the processes of the SSB and the designated workgroups 2 3 1 Modelling engine The CUDS engine supports operations to add get and remove CUDS containers from the internal memory of the engine wrapper to setup the SD state of the simulations When a CUDS conta
65. terable of uuid UUID or None When the uids are provided then the edges are returned in the same order the uids are returned by the iterable If uids is None then all edges are returned by the interable and there is no restriction on the order that they are returned Yields edge Edge iter_faces uids None Returns an iterator over faces Parameters uids iterable of uuid UUID or None When the uids are provided then the faces are returned in the same order the uids are returned by the iterable If uids is None then all faces are returned by the interable and there is no restriction on the order that they are returned Yields face Face iter_points uids None Returns an iterator over points Parameters uids iterable of uuid UUID or None When the uids are provided then the points are returned in the same order the uids are returned by the iterable If uids is None then all points are returned by the interable and there is no restriction on the order that they are returned Yields point Point update_cells cell Updates the information of a set of cells Gets the mesh cell identified by the same uid as the provided cell and updates its information with the one provided with the new cell Parameters cells iterable of Cell Cell to be updated Raises ValueError If the any cell was not found in the mesh update edges edge Updates the information of a set of edges Gets the mesh edge identif
66. the uids are returned by the iterable If uids is None then all cells are returned by the interable and there is no restriction on the order that they are returned Yields cell Cell iter_edges uids None Returns an iterator over edges Parameters uids iterable of uuid UUID or None When the uids are provided then the edges are returned in the same order the uids are returned by the iterable If uids is None then all edges are returned by the interable and there is no restriction on the order that they are returned Yields edge Edge iter faces uids None Returns an iterator over faces Parameters uids iterable of uuid UUID or None When the uids are provided then the faces are returned in the same order the uids are returned by the iterable If uids is None then all faces are returned by the interable and there is no restriction on the order that they are returned Yields face Face iter_points uids None Returns an iterator over points Parameters uids iterable of uuid UUID or None When the uids are provided then the points are returned in the same order the uids are returned by the iterable If uids is None then all points are returned by the interable and there is no restriction on the order that they are returned Yields cell Cell update_cells cells Updates the information of a set of cells Gets the mesh cell identified by the same uid as the provided cell and updates its information w
67. ts to replace an existing bond in the container there is an update bonds method for that purpose Parameters iterable iterable of Bond objects the new bond that will be included in the container Returns uuid The uuids of the added bonds Return type list of uuid UUID Raises ValueError when there is a bond with an uuid that already exists in the container Examples Add a set of bonds to a Particles container gt gt gt bonds list Bond Bond gt gt gt particles Particles name foo gt gt gt particles add_bonds bonds list add_particles iterable Adds a set of particles from the provided iterable to the container If any particle have no uids the container will generate a new uids for it If the particle has already an ulds it won t add the particle if a particle with the same uid already exists If the user wants to replace an existing particle in the container there is an update_particles method for that purpose 3 2 CUDS 19 SimPhoNy Documentation Release 0 2 1 Parameters iterable iterable of Particle objects the new set of particles that will be included in the container Returns uids The uids of the added particles Return type list of uuid UUID Raises ValueError when there is a particle with an uids that already exists in the container Examples Add a set of particles to a Particles container gt gt gt particle_list P
68. ttice at tribute 23 24 primitive_cell simphony cuds lattice Lattice attribute update_bonds simphony io h5_particles H5Particles method 42 update_cells simphony cuds abc_mesh ABCMesh 24 method 18 update_cells simphony cuds mesh Mesh method 33 R update_cells simphony io hS_mesh H5Mesh method remove_bonds simphony cuds abc_particles ABCParticles 46 method 21 update edges simphony cuds abc_mesh ABCMesh remove_bonds simphony cuds particles Particles method 18 method 37 update_edges simphony cuds mesh Mesh method 33 remove bonds simphony io h5_particles H5Particles update edges simphony io h5_mesh H5Mesh method method 42 46 remove_dataset simphony io h5_cuds H5CUDS update_existing sim method 40 phony io h5_cuds_items HSCUDSItems remove_particles phony cuds abc_particles ABCParticles method 22 remove_particles method 38 remove_particles simphony io h5_particles H5Particles method 42 sim simphony cuds particles Particles S simphony core data_container module 15 simphony cuds abc_lattice module 23 simphony cuds abc_mesh module 16 simphony cuds abc_particles module 19 simphony cuds lattice module 24 simphony cuds mesh module 29 simphony cuds particles module 34 simphony io data_container_description module 47 simphony io data_container_table module 47 simphony io h5_cuds module 40 simphony io h5_cuds_items module
69. ttribute 41 DataContainer class in simphony core data_container 15 DataContainerTable class in sim phony io data_container_table 47 E Edge class in simphony cuds mesh 29 edges simphony cuds mesh Mesh attribute 31 Element class in simphony cuds mesh 30 F Face class in simphony cuds mesh 30 faces simphony cuds mesh Mesh attribute 31 from_bond simphony cuds particles Bond class method 34 from_cell simphony cuds mesh Cell class method 29 from_edge simphony cuds mesh Edge class method 30 from_face simphony cuds mesh Face class method 30 from_particle simphony cuds particles Particle class method 35 from point simphony cuds mesh Point class method 34 G get_bond simphony cuds abc_particles ABCParticles method 20 get bond simphony cuds particles Particles method 36 get_bond simphony io h5_particles H5Particles method 41 get_cell simphony cuds abc_mesh ABCMesh method 16 get_cell simphony cuds mesh Mesh method 31 get_cell simphony io h5_mesh H5Mesh method 44 get_coordinate simphony cuds abc_lattice ABCLattice method 23 get_dataset simphony io h5_cuds H5CUDS method 40 get_dataset_names method 40 get_edge simphony cuds abc_mesh ABCMesh method 17 simphony io h5_cuds HSCUDS get_edge simphony cuds mesh Mesh method 32 get_edge simphony io h5_mesh H5Mesh method 44 get_face simphony cuds abc_mesh A
70. umentation Release 0 2 1 Examples Given a set of Particle objects that already exists in the container taken with the get_particle method for example just call the function passing the Particle items as parameter gt gt gt part_container Particles name foo gt gt gt fdo whatever you want with the particles gt gt gt part_container update_particles partl part2 class simphony cuds abc_lattice ABCLattice Abstract base class for a lattice name str name of lattice primitive cell PrimitiveCell primitive cell specifying the 3D Bravais lattice size int 3 lattice dimensions origin float 3 lattice origin data DataContainer high level CUBA data assigned to lattice count_of item_type Return the count of item_type in the container Parameters item type CUDSItem The CUDSItem enum of the type of the items to return the count of Returns count The number of items of item_type in the container Return type int Raises ValueError If the type of the item is not supported in the current container get_coordinate ind Get coordinate of the given index coordinate Parameters ind int 3 node index coordinate Returns coordinates Return type float 3 get_node index Get the lattice node corresponding to the given index Parameters index int 3 node index coordinate Returns node Return type LatticeNode iter_nodes indices None

Download Pdf Manuals

image

Related Search

Related Contents

T。T。 締付工具取扱説明書  Sennheiser CH 700 S  Les injections  CA7028 - Instrumart  Toshiba W-608 VCR User Manual    MANUAL DE INSTALAÇÃO CAPA STEP AIR CROSS  MANUAL DE SERVICIO  Bissell 2X Service Manual    

Copyright © All rights reserved.
Failed to retrieve file