Home

SimPhoNy Documentation

image

Contents

1. gt gt gt part container Particles name foo gt ws gt gt gt part part_container get_particle uid BRR zad gt gt gt part_container remove_particle part uid or directly gt gt gt part_container remove_particle uid update_bond bond Replaces an existing bond Takes the id of bond and searchs inside the container for that bond If the bond exists it is replaced with the new bond passed as parameter If the bond doesn t exist it will raise an exception Parameters bond Bond the bond that will be replaced Raises ValueError exception if the bond doesn t exists See also add_bond remove bond Examples Having a Bond that already exists in the container taken with the get bond method for example and a Particles just call the function passing the Bond as parameter gt gt gt part container Particles name foo gt gt gt gt gt bond part_container get_bond uid gt gt gt do whatever you want with the bond gt gt gt part_container update_bond bond update particle particle Replaces an existing particle Takes the id of particle and searchs inside the container for that particle If the particle exists it is replaced with the new particle passed as parameter If the particle doesn t exist 1t will raise an exception Parameters particle Particle the particle that will be replaced Raises ValueError exception if t
2. 2 Chapter 1 Simphony common SimPhoNy Documentation Release 0 1 2 dev0 build Documentation build directory if documentation has been generated using the make script in the doc directory 1 6 Directory structure 3 SimPhoNy Documentation Release 0 1 2 dev0 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 container engine and visualisation components e simphony engine A python module that provides one or more classes that implement the ABCModelingEngine interface e simphony visualisation 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 modules 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 set
3. gt gt gt part Particle gt gt gt part container Particles name foo gt gt gt part_container add_particle part data get_bond uid Returns a copy of the bond with the bond id id Parameters uid uuid UUID the id of the bond Raises KeyError when the bond is not in the container Returns Return type A copy of the bond get_particle uid Returns a copy of the particle with the particle_id id Parameters uid uuid UUID the id of the particle Raises KeyError when the particle is not in the container 22 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 Returns Return type A copy of the particle has_bond uid Checks if a bond with the given id already exists in the container has_particle uid Checks if a particle with the given id already exists in the container iter bonds ids None Generator method for iterating over the bonds of the container It can recieve any kind of seguence of bond ids to iterate over those concrete bond If nothing is passed as parameter it will iterate over all the bonds Parameters bond ids array like sequence containing the id s of the bond that will be iterated Yields Yields each bond to be used Raises KeyError exception if any of the ids passed as parameters are not in the container See also iter particles add_bond remove_bond update _bona Examples It can be
4. 23 iter_bonds simphony io h5_particles H5Particles method 29 iter_cells simphony cuds abstractmesh ABCMesh method 10 iter_cells simphony cuds mesh Mesh method 18 iter_edges simphony cuds abstractmesh ABCMesh method 10 iter_edges simphony cuds mesh Mesh method 19 iter_faces simphony cuds abstractmesh ABCMesh method 10 iter_faces simphony cuds mesh Mesh method 19 iter_lattices simphony io hS_cuds HSCUDS method 27 iter_meshes simphony io h5_cuds HSCUDS method 27 iter_nodes simphony cuds abstractlattice ABCLattice method 12 iter nodes simphony cuds lattice Lattice method 13 make cubic lattice in module simphony cuds lattice 14 make_hexagonal_lattice in module sim Phony cuds lattice 14 make_orthorombicp_lattice in module sim phony cuds lattice 14 make_rectangular_lattice in module sim phony cuds lattice 14 make_square_lattice in module simphony cuds lattice 14 Mesh class in simphony cuds mesh 16 N name simphony cuds abstractlattice ABCLattice at tribute 11 name simphony cuds abstractmesh ABCMesh attribute 10 name simphony cuds abstractparticles ABCParticles at tribute 10 name simphony cuds lattice Lattice attribute 12 name simphony cuds mesh Mesh attribute 16 name simphony cuds particles Particles attribute 21 name simphony io h5_particles H5Particles attribute 29 O open simphony io h5_cuds
5. Stores references to data containers node related data name str name of the lattice type 12 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 str Bravais lattice type should agree with the base_vect below base_vect D x float defines a Bravais lattice of dimension D 2 3 an alternative for primitive vectors size tuple of D x int number of lattice nodes in the direction of each axis origin D x float origin of lattice base_vect data get_coordinate index Get coordinate of the given index coordinate Parameters index D x int node index coordinate Returns Return type D x float get_node index Get a copy of the node corresponding to the given index Parameters index tuple of D x int 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 D x int optional node index coordinates Returns Return type A generator for LatticeNode objects origin size type update node lat_node Update the corresponding lattice node data copied Parameters lat node reference to a LatticeNode object data copied from the given node class simphony cuds lattice LatticeNode index data None A single node of a lattice index tuple of D x int D dimensional node index coordinate 3 2 CUDS 13 Sim
6. 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 P DEM FEM FVM LE Force Force DEM LBM SPH Torque Torque DEM Density Density DEM FEM FVM LE Concentration Concentration of a substance L ATM FEM FVM LE Pressure Pressure L FEM FVM LBM SP Temperature Temperature P 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 DEM RollingFriction Rolling Friction coefficient DEM VolumeFraction Volume fraction FEM FVM 2 2 CUBA Keywords 7 SimPhoNy Documentation Release 0 1 2 de
7. 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 16 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 cells dictionary of Cell Cells 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 add cell cell Adds a new cell to the mesh Parameters cell Cell Cell to be added to the mesh Raises e KeyError If other cell with the same uid was already in the mesh e TypeError If the object provided is not a cell add_edge edge Adds a new edge to the mesh Parameters edge Edge Edge to be added to the mesh Raises e KeyError If other edge with the same uid was already in the mesh e TypeError If the object provided is not an edge add_face face Adds a new face to the mesh Parameters face Face Face to be added to the mesh Raises e KeyError If other face with the same uid was already in the mesh e TypeError If the object provided is not a face add_point point Adds a new point to the mesh Parameters point Point Point to be added to the mesh Raises e KeyError If other point with the same uid was al
8. 3 e sphinxcontrib napoleon gt 0 2 10 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 setup_requires configuration option For example install_requires simphony H5I0 CUBAGen SimPhoNy Documentation Release 0 1 2 dev0 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 1 5 Documentation To build the documentation in the doc build directory run python setup py build _sphinx Note e One can use the help option with a setup py command to see all available options The documentation will be saved in the build directory 1 6 Directory structure There are four subpackages e core used for common low level classes and utility code cuds to hold all the native cuds implementations e io to hold the io specific code e bench holds basic benchmarking code e examples holds SimPhoNy example code e doc Documentation related files source Sphinx rst source files
9. F imPhoNy SimPhoNy Documentation Release 0 1 2 dev0 SimPhoNy EU FP7 Project Nr 604005 March 26 2015 Contents 1 Simphony common 1 led REPOSMOLY tragar da A WA eee eek AA KAA 1 1 2 RequememS e oee 4 Re E E OR A A ER A AR p 1 E3 Installation Era eid SS Baines AAA A AAA EE AA 2 LA Testing ca oi ae e RA A DR 2 15 Documentation AAA a A a eee WA Ewci ee 2 16 Directory Structure sose ri ee rl dd da e e a a a doda 2 2 User Manual 5 al PIUS e iria A E GARE A do br Aa 5 22 CUBA Keywords 2 25 4 n4 0 0 e ia RW a ROA a a KAA 6 3 API Reference 9 3h ETA AA enh A A A Gn i a lo AA AA WA 9 32 CUDS 24444244 64 ba eed A ie hea eee Va A beh ee bea ee 10 33 HIDES IO y ua e a So SS Ee aS Ae ww Sot Ob Se we as eS 26 4 Indices and tables 33 Python Module Index 35 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 1 2 1 Optional requirements To support the cuba generate script the following packages need to be installed 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
10. HSCUDS class method 28 origin simphony cuds abstractlattice ABCLattice at tribute 11 origin simphony cuds lattice Lattice attribute 13 P Particle class in simphony cuds particles 21 iter_particles simphony cuds abstractparticles ABCParticlBarticles class in simphony cuds particles 21 method 11 iter_particles method 23 iter_particles simphony io h5_cuds H5CUDS method 27 iter particles simphony io h5_particles H5Particles method 29 iter_points simphony cuds abstractmesh ABCMesh method 10 iter_points simphony cuds mesh Mesh method 19 simphony cuds particles Particles itersequence simphony io data_container_table DataContaineichablbond method 30 itersequence simphony io h5_cuds_items H5CUDSTItems remove_particle method 29 particles simphony cuds particles Bond attribute 20 Point class in simphony cuds mesh 20 points simphony cuds mesh Element attribute 15 points simphony cuds mesh Mesh attribute 16 R remove bond simphony cuds abstractparticles ABCParticles method 11 remove bond method 24 simphony io h5_particles H5Particles method 29 simphony cuds particles Particles sim phony cuds abstractparticles ABCParticles method 11 Index 39 SimPhoNy Documentation Release 0 1 2 dev0 remove_particle method 24 remove_particle simphony io h5_particles H5Particles method 29 simphony cuds particle
11. PhoNy Documentation Release 0 1 2 dev0 data DataContainer simphony cuds lattice make_cubic_lattice name h size origin 0 O 0 Create and return a 3D cubic lattice Parameters e name s r e h float lattice spacing e size 3x int number of lattice nodes in each axis direction e origin 3 x float 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 h size origin 0 0 Create and return a 2D hexagonal lattice Parameters e name sir e h float lattice spacing e size 2 x int number of lattice nodes in each axis direction e origin 2 x float default value 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_orthorombicp_lattice name hs size origin 0 0 0 Create and return a 3D orthorombic primitive lattice Parameters name sir hs 3 x float lattice spacings in each axis direction e size 3 x int number of lattice nodes in each axis direction e origin 3 x float default value 0 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice simphony cuds lattice make_rectangular_lattice name hs size origin 0 0 Create and return a 2D rectangular lattice Parameters name sir hs 2 x float la
12. The particle uid already exists in the container data 28 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 get bond uid get particle uid has bond uid Checks if a bond with id id exists in the container has_particle uid Checks if a particle with id id exists 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 bond uid remove_particle uid update_bond bond update_particle particle 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 __delitem_ uid Delete the row __getitem__ uid Return the Particle with the provided id _ iter Iterate over all the rows len The number of rows in the table A runtime error is raised when the number of rows in the items and data tables is not equal __ setitem__ uid item Set the particle in row with item elf the uid does not exist in the Table a new row will be appended elf the item uidis None then item uid uid add_safe item Add item while checking for a unique uid Note The item is expected to already have a uid set add_unsafe item Add item without checking for a un
13. 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 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 uuid 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 uuid class simphony io h5_particles H5Particles group Bases simphony cuds abstractparticles ABCParticles An HDFS5 backed particle container add_bond bond Add bond If bond has an id then this is used If the bond s id is None then a id is generated for the bond Returns id of bond Return type int Raises ValueError if an id is given which already exists add_particle particle Add particle If particle has a uid set then this is used If 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
14. ass in simphony cuds mesh 15 cells simphony cuds mesh Mesh attribute 16 close simphony io h5_cuds HSCUDS method 27 coordinates simphony cuds mesh Point attribute 20 coordinates simphony cuds particles Particle attribute 21 D data simphony cuds lattice Lattice attribute 13 data simphony cuds lattice LatticeNode attribute 13 data simphony cuds mesh Element attribute 16 data simphony cuds mesh Mesh attribute 16 17 data simphony cuds mesh Point attribute 20 data simphony cuds particles Bond attribute 21 data simphony cuds particles Particle attribute 21 data simphony cuds particles Particles attribute 21 22 data simphony io h5_particles H5Particles attribute 28 DataContainer class in simphony core data_container 9 DataContainerTable class in sim phony io data_container_table 30 delete_lattice simphony io h5_cuds H5CUDS method 27 delete_mesh simphony io h3_cuds H5CUDS method 27 delete_particles simphony io h5_cuds HSCUDS method 27 E Edge class in simphony cuds mesh 15 edges simphony cuds mesh Mesh attribute 16 Element class in simphony cuds mesh 15 F Face class in simphony cuds mesh 16 faces simphony cuds mesh Mesh attribute 16 from_bond simphony cuds particles Bond method 21 from_cell simphony cuds mesh Cell class method 15 from_edge simphony cuds mesh Edge class method class 15 from_element simphony cuds
15. cells Check if the mesh has cells Returns True of there are cells inside the mesh False otherwise Return type bool has_edges Check if the mesh has edges Returns True of there are edges inside the mesh False otherwise Return type bool has_faces Check if the mesh has faces Returns True of there are faces inside the mesh False otherwise Return type bool iter cells cell _uids None Returns an iterator over the selected cells Returns an iterator over the cells with uid in cell_uids If none of the uids in cell_uids exists an empty iterator is returned If there is no uuids inside cell _uuids a iterator over all cells of the mesh is returned instead Parameters cell_uids list of uid optional uids of the desired cell default empty 18 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 Returns Iterator over the selected cells Return type iter iter_edges edge_uids None Returns an iterator over the selected edges Returns an iterator over the edged with uid in edge_uid If none of the uids in edge_uids exists an empty iterator is returned If there is no uids inside edge_uids a iterator over all edges of the mesh is returned instead Parameters edge_uids list of uid optional uids of the desired edges default empty Returns Iterator over the selected edges Return type iter iter_faces face_uids None Returns an iterator over the selected faces Returns an iterator
16. ck 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_bond uid Removes the bond with the uid from the container The id passed as parameter should exists in the container If it doesn t exists nothing will happen Parameters uid uuid UUID the id of the bond to be removed See also add_bond update_bond Examples Having an id of an existing bond pass it to the function gt gt gt part_container Particles name foo 53 0 gt gt gt bond part_container get_bond id gt gt gt gt gt part_container remove_bond bond uid or directly gt gt gt part_container remove_bond id remove _particle uid Removes the particle with uid from the container The id passed as parameter should exists in the container Otherwise an expcetion will be raised Parameters uid uuid UUID the id of the particle to be removed Raises KeyError exception if the particle doesn t exist See also add_particle update_particle 24 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 Examples Having an id of an existing particle pass 1t to the function
17. cuds mesh Mesh method 20 V valid simphony io data_container_table DataContainerTable attribute 30 simphony io h5_cuds_items HS5CUDSItems attribute 30 valid simphony io indexed_data_container_table IndexedDataContainerTat attribute 31 valid simphony io h5_cuds HSCUDS method 28 simphony cuds particles Particles valid update bond simphony cuds abstractparticles ABCParticles method 11 update_bond method 25 update_bond simphony io h5_particles H5Particles method 29 update_cell simphony cuds abstractmesh ABCMesh method 10 update_cell simphony cuds mesh Mesh method 19 update_edge simphony cuds abstractmesh ABCMesh method 10 update_edge simphony cuds mesh Mesh method 19 update_existing sim phony io h5_cuds_items HSCUDSItems method 30 update face simphony cuds abstractmesh ABCMesh method 10 update face simphony cuds mesh Mesh method 20 simphony cuds particles Particles 40 Index
18. cumentation Release 0 1 2 dev0 e KeyError If the edge was not found in the mesh e TypeError If the object provided is not an edge update_face face Updates the information of a face Gets the mesh face identified by the same uuid as the provided face and updates its information with the one provided with the new face Parameters face Face Face to be updated Raises e KeyError If the face was not found in the mesh e TypeError If the object provided is not a face update_point point Updates the information of a point Gets the mesh point identified by the same id as the provided point and updates its information with the one provided with the new point Parameters point Point Point to be updated Raises e KeyError If the point was not found in the mesh e TypeError If the object provided is not a point 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 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 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 from point p
19. e simphony cuds particles Particles _ len__ simphony io indexed_data_container_table IndexedDataCoRRStREFPabie method 30 add_particle simphony io h5_particles H5Particles __ setitem__ simphony core data_container DataContainer method 28 method 9 add_particles simphony io h5_cuds H5CUDS method setitem__ simphony io data_container_table DataContainerTable 26 method 30 add_point simphony cuds abstractmesh ABCMesh __setitem__ simphony io h5_cuds_items H5CUDSItems method 10 method 29 add_point simphony cuds mesh Mesh method 17 __setitem__ simphony io indexed_data_container_table Li4lkeitaCGHARRAT69 h5_cuds_items HSCUDSItems method 31 method 29 bonds simphony cuds particles Particles attribute 21 Add_unsafe simphony io h3_cuds_items H5CUDSItems _particles simphony cuds particles Particles attribute 21 method 29 append simphony io data_container_table DataContainerTable A method 30 ABCLattice class in simphony cuds abstractlattice 11 ABCMesh class in simphony cuds abstractmesh 10 ABCParticles class in simphony cuds abstractparticles B 10 method 31 base vect simphony cuds abstractlattice ABCLattice at tribute 11 37 append simphony io indexed_data_container_table IndexedDataContaine SimPhoNy Documentation Release 0 1 2 dev0 base_vect simphony cuds lattice Lattice attribute 13 Bond class in simphony cuds particles 20 C Cell cl
20. get point uid has_cells has_edges has_faces iter cells cell_ids f iter edges edge_ids iter faces face_ids iter points point_ids update cell cell update edge edge update face face update point point class simphony cuds abstractparticles ABCParticles Abstract base class for a Particles item 10 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 name str name of particles item add bond new bond add particle new_particle get bond uid get particle uid has bond uid has_particle uid iter bonds uids None iter particles uids None remove bond uid remove particle uid update bond bond update particle particle class simphony cuds abstractlattice ABCLattice Abstract base class for a lattice name str name of lattice type str type of lattice base_vect D x float base vector of lattice size tuple of D x int lattice dimensions origin D x float lattice origin get_coordinate index Get coordinate of the given index coordinate Parameters index D x int node index coordinate Returns coordinates Return type D x float get_node index Get the lattice node corresponding to the given index 3 2 CUDS 11 SimPhoNy Documentation Release 0 1 2 dev0 Parameters index tuple of D x int node index coordinate Returns node Return type LatticeNode iter_nodes indices None Get an iterator over
21. he particle does not exists See also add_particle remove_particle Examples Having a Particle that already exists in the container taken with the get_particle method for example and a ParticleContainer just call the function passing the Particle as parameter gt gt gt part_container Particles name foo gt gt gt gt gt part part_container get_particle uid 3 2 CUDS 25 SimPhoNy Documentation Release 0 1 2 dev0 gt gt gt fdo whatever you want with the particle gt gt gt part_container update_particle part 3 3 HDF5 lO The CUDS to HDES file adapters Classes H5CUDS handle Access to CUDS hdf5 formatted files DataContainerTable root name record A proxy class to an HDF5 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 H5CUDSItems root record name A proxy class to an HDF5 group node with serialised CUDS items Table descriptions Implementation class simphony io h5_cuds H5CUDS handle Bases object Access to CUDS hdf5 formatted files add_lattice lattice Add lattice to the file Parameters e lattice Lattice lattice to be added e Returns e H5Lattice The lattice newly added to the file add mesh
22. ique uid Note The item is expected to already have a uid set 3 3 HDF5 IO 29 SimPhoNy Documentation Release 0 1 2 dev0 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 _ delitem__ uid Delete the row _ _getitem__ uid Return the DataContainer in row _ iter__ Iterate over all the rows len The number of rows in the table __setitem _ uid data Set the data in row from the DataContainer 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 indezed data container _table IndexedDataContainerTable root name data_containers record None EX pected_number None Bases abcoll Seguence A proxy class to an HDF5 group node with serialised DataContainers The clas
23. isting bond in the container there is an update_bond method for that purpose Parameters new bond Bond the new bond that will be included in the container Returns uid The id of the added bond 3 2 CUDS 21 SimPhoNy Documentation Release 0 1 2 dev0 Return type uuid UID Raises ValueError when the new particle already exists in the container See also update_bond remove_bond Examples Having a Bond and a ParticleContainer just call the function passing the Bond as parameter gt gt gt bond Bond gt gt gt part container Particles name foo gt gt gt part_container add_bond bond add_particle particle Adds the particle to the container If the new particle has no id the particle container will generate a new unique id for it If the particle has already an id user set it won t add the particle if a particle with the same id already exists If the user wants to replace an existing particle in the container there is an update_particle method for that purpose Parameters particle Particle the new particle that will be included in the container Returns uid The id of the added particle Return type uuid UUID Raises ValueError when the new particle already exists in the container See also update _particie remove _particle Examples Having a Particle and a ParticleContainer just call the function passing the Particle as parameter
24. mesh Add a mesh to the file Parameters name str name of the mesh e mesh container ABCMesh optional mesh to be added If none is give then an empty mesh is added Returns H5Mesh The mesh newly added to the file See get mesh for more information 26 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 add_particles particles Add particle container to the file Parameters particles ABCParticles Particle container to be added Returns particles A newly created container proxying the data in the HDES file Return type H5Particles close Closes a file delete _lattice name Delete lattice from file Parameters name str name of lattice to delete delete _mesh name Delete mesh from file Parameters name str name of the mesh to delete delete particles name Delete particle container from file Parameters name str name of particle container to delete get_lattice name Get lattice from file The returned lattice can be used to query and change the related data stored in the file If the file has been closed then the lattice should no longer be used Parameters name str name of lattice to return get_mesh name Get mesh from file The returned mesh can be used to query and change the related data stored in the file If the file has been closed then the mesh should no longer be used Parameters name str name
25. mesh Element class method 16 from face simphony cuds mesh Face class method 16 from_particle simphony cuds particles Particle class method 21 from point simphony cuds mesh Point class method 20 G get_bond simphony cuds abstractparticles ABCParticles method 11 get_bond simphony cuds particles Particles method 22 get_bond simphony io h5_particles H5Particles method 28 get cell simphony cuds abstractmesh ABCMesh method 10 get_cell simphony cuds mesh Mesh method 17 get_coordinate simphony cuds abstractlattice ABCLattice method 11 get_coordinate simphony cuds lattice Lattice method 13 get_edge simphony cuds abstractmesh ABCMesh method 10 get_edge simphony cuds mesh Mesh method 17 get_face simphony cuds abstractmesh ABCMesh method 10 get face simphony cuds mesh Mesh method 18 get_lattice simphony io h5_cuds H5CUDS method 27 get_mesh simphony io h5_cuds HSCUDS method 27 get_node simphony cuds abstractlattice ABCLattice method 11 get node simphony cuds lattice Lattice method 13 get_particle simphony cuds abstractparticles ABCParticles method 11 get_particle simphony cuds particles Particles method 22 get_particle simphony io h5_particles H5Particles method 29 get_particles simphony io h5_cuds HSCUDS method 27 get_point simphony cuds abstractmesh ABCMesh method 10 get_point simphony cuds me
26. ny 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 3 2 CUDS 15 SimPhoNy Documentation Release 0 1 2 dev0 uid uuid of the element data DataContainer Element data classmethod rom element element 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 uid of the face e data DataContainer object to store data relative to the face classmethod from_face face class simphony cuds mesh Mesh name Mesh object to store 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 uuid 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 str name of mesh name Str name of mesh data Data Data
27. oNy Documentation Release 0 1 2 dev0 36 Python Module Index Indez Sy mbols add_bond simphony cuds abstractparticles ABCParticles __delitem__ simphony io data_container_table DataContainerTable Method 11 method 30 add bond simphony cuds particles Particles method __delitem__ simphony io h5_cuds_items H5CUDSItems 21 method 29 add bond simphony io h5_particles H5Particles __getitem__ simphony io data_container_table DataContainerTable Method 28 method 30 add_cell simphony cuds abstractmesh ABCMesh __getitem__ simphony io h5_cuds_items H5CUDSItems method 10 method 29 add_cell simphony cuds mesh Mesh method 17 __getitem__ simphony io indexed_data_container_table IRddxGASGQContl RHEABRP cuds abstractmesh ABCMesh method 30 method 10 _ iter_ simphony io data container table DataContaine 86184820 simphony cuds mesh Mesh method 17 method 30 add face simphony cuds abstractmesh ABCMesh _ iter_ simphony io h5_cuds_items HSCUDSItems method 10 method 29 add_face simphony cuds mesh Mesh method 17 _ iter__ simphony io indexed_data_container_table Inde DIAE FEE io h5_cuds H5CUDS method method 30 26 l _len_0 simphony io data_container_table DataContainertdHineshO simphony io h5_cuds H5CUDS method 26 method 30 add_particle simphony cuds abstractparticles ABCParticles len simphony io h5_cuds_items HSCUDSItems method 11 method 29 add_particl
28. of the mesh to return get_particles name Get particle container from file The returned particle container can be used to query and change the related data stored in the file If the file has been closed then the particle container should no longer be used Parameters name str name of particle container to return iter lattices names None Returns an iterator over a subset or all of the lattices Parameters names list of str names of specific lattices to be iterated over If names is not given then all lattices will be iterated over iter meshes names None Returns an iterator over a subset or all of the meshes Parameters names list of str names of specific meshes to be iterated over If names is not given then all meshes will be iterated over iter_particles names None Returns an iterator over a subset or all of the particle containers param names names of specific particle containers to be iterated over If names is not given then all particle containers will be iterated over 3 3 HDF5 IO 27 SimPhoNy Documentation Release 0 1 2 dev0 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 e 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
29. oint class simphony cuds particles Bond particles uid None data None Class reprensenting a bond uid uuid UUID the unique id of the bond 20 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 particles tuple tuple of uuids of the particles that are participating in the bond data DataContainer DataContainer to store the attributes of the bond classmethod rom bond bond class simphony cuds particles Particle coordinates 0 0 0 0 0 0 uid None data None Class representing a particle uid uuid UUID the unique id 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 data structure for bonds storage data DataContainer data attributes of the element add_bond bond Adds the bond to the container Also like with particles if the bond has an user defined id it won t add the bond if a bond with the same id already exists and if the bond has no id the particle container will generate an unique id If the user wants to replace an ex
30. over the faces with uid in face_uids If none of the uuids in face_uids exists an empty iterator is returned If there is no uids inside face_uids a iterator over all faces of the mesh is returned instead Parameters face_uids list of uid optional uids of the desired faces default empty Returns Iterator over the selected faces Return type iter iter_points point_uids None Returns an iterator over the selected points Returns an iterator over the points with uid in point_uids If none of the ids in point_uids exists an empty iterator is returned If there is no ids inside point_uids a iterator over all points of the mesh is returned instead Parameters point_uids list of uid optional uids of the desired points default empty Returns Iterator over the selected points Return type iter update cell cell Updates the information of a cell Gets the mesh cell identified by the same uuid as the provided cell and updates its information with the one provided with the new cell Parameters cell Cell Cell to be updated Raises e KeyError If the cell was not found in the mesh e TypeError If the object provided is not a cell update_edge edge Updates the information of an edge Gets the mesh edge identified by the same id as the provided edge and updates its information with the one provided with the new edge Parameters edge Edge Edge to be updated Raises 3 2 CUDS 19 SimPhoNy Do
31. ready in the mesh e TypeError If the object provided is not a point data get_cell uid Returns a cell with a given uid Returns the cell stored in the mesh identified by uuid If such cell do not exists an exception is raised Parameters uid uid of the desired cell Returns Cell with id identified by uid Return type Cell Raises Exception If the cell identified by uuid was not found 3 2 CUDS 17 SimPhoNy Documentation Release 0 1 2 dev0 get edge uid Returns an edge with a given uuid Returns the edge stored in the mesh identified by uuid If such edge do not exists an exception is raised Parameters uid uid of the desired edge Returns Edge identified by uid Return type Edge Raises Exception If the edge identified by uuid was not found get face uid Returns a face with a given uid Returns the face stored in the mesh identified by uid If such face do not exists an exception is raised Parameters uid uid of the desired face Returns Face identified by uid Return type Face Raises Exception If the face identified by uuid was not found get_point uid Returns a point with a given uuid Returns the point stored in the mesh identified by uuid If such point do not exists an exception is raised Parameters uid uid of the desired point Returns Mesh point identified by uuid Return type Point Raises Exception If the point identified by uuid was not found has_
32. s ATM DEM FEM F Position Position of a point or node or atom ATM DEM FEM Fy Direction Geometric more general than e g velocity could be used for spin ATM FEM FVM LB Status Status of a point or node DEM LBM Label Label for a point or node ATM DEM FEM Fy Materialld Material identification number DEM FEM FVM LE ChemicalSpecie Chemical Specie ATM VIS MaterialType Material dimension and type P VIS ShapeCenter Geometrical center of the shape of the material P VIS ShapeLengthUC Length in units cells of the shape of the material VIS ShapeLength Length in angstroms of the shape of the materials VIS ShapeRadius Radius for a spherical material VIS ShapeSide Side length for a hexagonal material P VIS CrystalStorage Additional 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 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 ATM DEM LBM SE NumberOfPoints Number of points or nodes P DEM FEM FVM LE Radi
33. s Particles S simphony core data_container module 9 simphony cuds abstractlattice module 11 simphony cuds abstractmesh module 10 simphony cuds abstractparticles module 10 simphony cuds lattice module 12 simphony cuds mesh module 15 simphony cuds particles module 20 simphony io data container description module 31 simphony io data container table module 30 simphony io h5_cuds module 26 simphony io h5_cuds_items module 29 simphony io h5_particles module 28 simphony io indexed_data_container_table module 30 size simphony cuds abstractlattice ABCLattice at tribute 11 size simphony cuds lattice Lattice attribute 13 T type simphony cuds abstractlattice ABCLattice at tribute 11 type simphony cuds lattice Lattice attribute 12 13 U uid simphony cuds mesh Element attribute 15 uid simphony cuds mesh Point attribute 20 uid simphony cuds particles Bond attribute 20 uid simphony cuds particles Particle attribute 21 update simphony core data_container DataContainer method 9 update_node simphony cuds abstractlattice ABCLattice method 12 update node simphony cuds lattice Lattice method 13 update_particle simphony cuds abstractparticles ABCParticles method 11 update_particle method 25 update_particle simphony io h5_particles H5Particles method 29 update point simphony cuds abstractmesh ABCMesh method 10 update point simphony
34. s implements the Sequence api where each DataContainer instance is mapped to the row In addition the class implements update i e _setitem__ and append _ _getitem__ index Return the DataContainer in index _ iter__ Iterate over all the rows 30 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 _ len The number of rows in the table _ setitem _ index data Update the data in index append data Append the data to the end of the table Parameters data DataContainer The DataContainer instance to save Returns index The index of the saved row Return type int valid 3 3 HDF5 IO 31 SimPhoNy Documentation Release 0 1 2 dev0 32 Chapter 3 API Reference CHAPTER 4 Indices and tables e genindex e modindex e search 33 SimPhoNy Documentation Release 0 1 2 dev0 34 Chapter 4 Indices and tables Python Module Indez sim sim sim sim sim sim sim sim sim sim sim sim sim phony phony phony phony phony phony phony phony 31 phony phony phony phony phony 30 core cuds cuds cuds cuds cuds cuds data_container 9 abstractlattice abstractmesh 10 abstractparticles 10 lattice 12 mesh 15 particles 20 io data container description io data container table 30 io h5_cuds 26 io h5_cuds_items 29 10 h5_particles 28 io indexed_data_container table 35 SimPh
35. sh Mesh method 18 H H5Bondltems class in simphony io h5_particles 28 HSCUDS class in simphony io h5_cuds 26 H5CUDSltems class in simphony io h5_cuds_items 29 H5ParticleItems class in simphony io h5_particles 28 H5Particles class in simphony io h5_particles 28 has_bond simphony cuds abstractparticles ABCParticles method 11 has_bond simphony cuds particles Particles method 23 has_bond simphony io h5_particles H5Particles method 29 has_cells simphony cuds abstractmesh ABCMesh method 10 has_cells simphony cuds mesh Mesh method 18 has_edges simphony cuds abstractmesh ABCMesh method 10 38 Index SimPhoNy Documentation Release 0 1 2 dev0 has_edges simphony cuds mesh Mesh method 18 has_faces simphony cuds abstractmesh ABCMesh method 10 has_faces simphony cuds mesh Mesh method 18 L Lattice class in simphony cuds lattice 12 LatticeNode class in simphony cuds lattice 13 has_particle simphony cuds abstractparticles ABCParticleM method 11 has_particle method 23 has_particle simphony io h5_particles H5Particles method 29 simphony cuds particles Particles index simphony cuds lattice LatticeNode attribute 13 IndexedDataContainerTable class in sim phony io indexed_data_container_table 30 iter_bonds simphony cuds abstractparticles ABCParticles method 11 iter_bonds simphony cuds particles Particles method
36. the LatticeNodes described by the indices Parameters indices iterable set of D x int optional node index coordinates Returns An iterator over LatticeNode objects Return type iterator update_node lat_node Update the corresponding lattice node Parameters lat_node LatticeNode 3 2 2 Pure Python implementation Classes LatticeNode index data A single node of a lattice Lattice name type base_vect size origin A Bravais lattice Particle coordinates uid data Class representing a particle Bond particles uid data Class reprensenting a bond particles ParticleContainer Mes h name Mesh object to store points and elements Point coordinates uid data Coordinates describing a point in the space Face points uid data Face element Cel 1 points uid data Cell element Functions make_hexagonal_lattice name h size origin Create and return a 2D hexagonal lattice make_square_lattice name h size origin Create and return a 2D square lattice make_rectangular_lattice name hs size Create and return a 2D rectangular lattice make_cubic_lattice name h size origin Create and return a 3D cubic lattice make_orthorombicp_lattice name hs sizel Create and return a 3D orthorombic primitive lattice Implementation class simphony cuds lattice Lattice name type base_vect size origin A Bravais lattice
37. ttice spacings in each axis direction e size 2 x int number of lattice nodes in each axis direction e origin 2 x float default value 0 0 lattice origin Returns lattice A reference to a Lattice object Return type Lattice 14 Chapter 3 API Reference SimPhoNy Documentation Release 0 1 2 dev0 simphony cuds lattice make_square_lattice name h size origin 0 0 Create and return a 2D square lattice Parameters e name sir e h float lattice spacing e size 2 x int number of lattice nodes in each axis direction e origin 2 x float default value 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 Cell points uid None data None Cell element Element for storing 3D geometrical objects Parameters e points list of uid list of points uids defining the cell e uid uid of the cell e data DataContainer object to store data relative to the cell classmethod rom cell cell 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 uid of the edge e data DataContainer object to store data relative to the edge classmethod from_edge edge class simpho
38. up 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 1 2 dev0 2 2 CUBA Keywords Common Unified Base Attributes CUBA 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 SimulationDomainDimensions Size of the simulation domain DEM FEM FVM LE SimulationDomainOrigin Offset for the simulation domain DEM FEM FVM LE PhoNy More detailed information for each CUBA keyword is provided in the following table orphan 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 model
39. us Particle radius C DEM SPH Size For non spherical particles C DEM SPH Mass Particle mass ATM DEM Volume Volume of a particle cell etc P DEM FEM FVM LE AngularVelocity Angular velocity of a point or node DEM AngularAcceleration Angular acceleration of a point or node DEM DynamicViscosity Dynamic viscosity of fluid DEM FEM FVM LE KinematicViscosity Kinematic viscosity of fluid FEM FVM LBM DiffusionCoefficient Diffusion coefficient FEM FVM LBM ProbabilityCoefficient For stochastic processes e g sorption DEM LBM FrictionCoefficient Control particle friction 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 DEM 6 Chapter 2 User Manual SimPhoNy Documentation Release 0 1 2 dev0 Table 2 1 continued from previ Name Description Domain PhaselnteractionStrength Strength of phase interactions on a particle DEM HamakerConstant Van der Waals body body interaction DEM ZetaPotential Coulomb interaction between
40. used with a sequence as parameter or withouth it gt gt gt part_container Particles name foo BS 2 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 tin 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 tin case we need it part_container update_bond bond iter_particles ids None Generator method for iterating over the particles of the container It can recieve any kind of sequence of particle ids to iterate over those concrete particles If nothing is passed as parameter 1t will iterate over all the particles Parameters ids iterable sequence containing the id s of the particles that will be iterated Yields particle Particle Yields each particle to be used Raises KeyError exception if any of the ids passed as parameters are not e in the container 3 2 CUDS 23 SimPhoNy Documentation Release 0 1 2 dev0 See also iter_bonds add_particle remove_particle update _particle Examples It can be used with a sequence as parameter or withouth it gt gt gt part container Particles name foo SSS ds gt gt gt for particle in part_container iter_particles idl id2 id3 do stuff take the particle ba
41. v0 8 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 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 234 CUBA ACCELERATION is 22 lt CUBA ACCELERATION 22 gt 234 __setitem key value Set Update the key value only when the key is a CUBA key update args kwargs SimPhoNy Documentation Release 0 1 2 dev0 3 2 CUDS 3 2 1 Abstract CUDS interfaces Containers ABCMesh Abstract base class for mesh abstractparticles ABCParticleContainer ABCLattice Abstract base class for a lattice Description class simphony cuds abstractmesh ABCMesh Abstract base class for mesh name Str name of mesh add cell cell add edge edge add face face add point point get cell uid get edge uid get face uid

Download Pdf Manuals

image

Related Search

Related Contents

  TSP 400 Installation Manual  施工が困難な ALC や中空母材への留付けを 簡単、正確  Homelite VERSALITE UT41002 User's Manual  Pro9000 LED Laser Ibrido 1080p Proiettore Home  Philips CushionSpeaker SDC5100  SECTION 2 INSTALLATION - Sea  Samsung LA22B450C8 User Manual  MANUAL DE INSTRUCCIONES ESTUFA DE PELLET AIRE  Fresh 'n Rebel 2CC100BL mobile device charger  

Copyright © All rights reserved.
Failed to retrieve file