General framework for attributing properties to geometrical elements.
Properties can really be just about any Python object. Properties can be attributed to a set of geometrical elements.
A class for storing properties in a database.
Initialize a database.
The database can be initialized with a dict.
Database objects have the following methods:
Import all records from a database file.
For now, it can only read databases using flatkeydb. args and kargs can be used to specify arguments for the FlatDB constructor.
A class for storing material properties.
Initialize a materials database.
If data is a dict, it contains the database. If data is a string, it specifies a filename where the database can be read.
MaterialDB objects have the following methods:
A class for storing section properties.
Initialize a section database.
If data is a dict, it contains the database. If data is a string, it specifies a filename where the database can be read.
SectionDB objects have the following methods:
Properties related to the section of an element.
An element section property can hold the following sub-properties:
the geometric properties of the section. This can be a dict or a string. If it is a string, its value is looked up in the global section database. The required data in the dict depend on the sectiontype. Currently the following keys are used by fe_abq.py:
the type of section: should be one of following:
!! Currently only ‘solid’ and ‘general’ are allowed.
Create a new element section property. Empty by default.
ElemSection objects have the following methods:
Create or replace the section properties of the element.
If ‘section’ is a dict, it will be added to ‘self.secDB’. If ‘section’ is a string, this string will be used as a key to search in ‘self.secDB’.
Create or replace the material properties of the element.
If the argument is a dict, it will be added to ‘self.matDB’. If the argument is a string, this string will be used as a key to search in ‘self.matDB’.
Distributed loading on an element.
Create a new element load. Empty by default.
An element load can hold the following sub-properties: - label: the distributed load type label. - value: the magnitude of the distibuted load.
ElemLoad objects have the following methods:
Distributed loading on an element edge.
Create a new element edge load. Empty by default.
An element edgeload can hold the following sub-properties: - edge: the element edge number - label: the distributed load type label (‘x’,’y’,’z’). - value: the magnitude of the distibuted load.
EdgeLoad objects have the following methods:
A class for storing coordinate systems.
Create a new coordinate system.
CoordSystem objects have the following methods:
A class for storing an amplitude.
The amplitude is a list of tuples (time,value).
Create a new amplitude.
Amplitude objects have the following methods:
A database class for all properties.
This class collects all properties that can be set on a geometrical model.
This should allow for storing:
Create a new properties database.
PropertyDB objects have the following methods:
Create a new property, empty by default.
A property can hold almost anything, just like any Dict type. It has however four predefined keys that should not be used for anything else than explained hereafter:
Besides these, any other fields may be defined and will be added without checking.
Return all properties of type kind matching tag and having attr.
kind is either ‘’, ‘n’, ‘e’ or ‘m’ If rec is given, it is a list of record numbers or a single number. If a tag or a list of tags is given, only the properties having a matching tag attribute are returned.
attr and noattr are lists of attributes. Only the properties having all the attributes in attr and none of the properties in noattr are returned. Attributes whose value is None are treated as non-existing.
If delete==True, the returned properties are removed from the database.
Delete properties.
This is equivalent to getProp() but the returned properties are removed from the database.
Create a new node property, empty by default.
A node property can contain any combination of the following fields:
Create a new element property, empty by default.
An elem property can contain any combination of the following fields:
Functions defined in the module properties
- properties.checkIdValue(values)¶
Check that a variable is a list of (id,value) tuples
id should be convertible to an int, value to a float. If ok, return the values as a list of (int,float) tuples.
- properties.checkArrayOrIdValue(values)¶
Check that a variable is an list of values or (id,value) tuples
This convenience function checks that the argument is either:
- a list of 6 float values (or convertible to it), or
- a list of (id,value) tuples where id is convertible to an int, value to a float.
If ok, return the values as a list of (int,float) tuples.
- properties.checkString(a, valid)¶
Check that a string a has one of the valid values.
This is case insensitive, and returns the upper case string if valid. Else, an error is raised.
- properties.autoName(base)¶
- properties.Nset()¶
- properties.Eset()¶
- properties.FindListItem(l, p)¶
Find the item p in the list l.
If p is an item in the list (not a copy of it!), this returns its position. Else, -1 is returned.
Matches are found with a ‘is’ function, not an ‘==’. Only the first match will be reported.
- properties.RemoveListItem(l, p)¶
Remove the item p from the list l.
If p is an item in the list (not a copy of it!), it is removed from the list. Matches are found with a ‘is’ comparison. This is different from the normal Python list.remove() method, which uses ‘==’. As a result, we can find complex objects which do not allow ‘==’, such as ndarrays.