Properties can really be just about any Python object. Properties can be attributed to a set of geometrical elements.
Classes defined in module properties
A class for storing properties in a database.
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.
Add a dictionary to the Dict object.
The data can be a dict or Dict type object.
Return the value for key or a default.
This is the equivalent of the dict get method, except that it returns only the default value if the key was not found in self, and there is no _default_ method or it raised a KeyError.
Replaces the setdefault function of a normal dictionary.
This is the same as the get method, except that it also sets the default value if get found a KeyError.
A class for storing material properties.
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.
Add a dictionary to the Dict object.
The data can be a dict or Dict type object.
Return the value for key or a default.
This is the equivalent of the dict get method, except that it returns only the default value if the key was not found in self, and there is no _default_ method or it raised a KeyError.
Replaces the setdefault function of a normal dictionary.
This is the same as the get method, except that it also sets the default value if get found a KeyError.
A class for storing section properties.
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.
Add a dictionary to the Dict object.
The data can be a dict or Dict type object.
Return the value for key or a default.
This is the equivalent of the dict get method, except that it returns only the default value if the key was not found in self, and there is no _default_ method or it raised a KeyError.
Replaces the setdefault function of a normal dictionary.
This is the same as the get method, except that it also sets the default value if get found a KeyError.
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 section dict should at least have a key ‘sectiontype’, defining the type of section.
Currently the following sectiontype values are known by module fe_abq for export to Abaqus/Calculix:
- ‘solid’ : a solid 2D or 3D section,
- ‘circ’ : a plain circular section,
- ‘rect’ : a plain rectangular section,
- ‘pipe’ : a hollow circular section,
- ‘box’ : a hollow rectangular section,
- ‘I’ : an I-beam,
- ‘general’ : anything else (automatically set if not specified).
- ‘rigid’ : a rigid body
The other possible (useful) keys in the section dict depend on the sectiontype. Again for fe_abq:
- for sectiontype ‘solid’ : thickness
- the sectiontype ‘general’: cross_section, moment_inertia_11, moment_inertia_12, moment_inertia_22, torsional_constant
- for sectiontype ‘circ’: radius
- for sectiontype ‘rigid’: refnode, density, thickness
Create or replace the section properties of the element.
If ‘section’ is a dict, it will be added to the global SectionDB. If ‘section’ is a string, this string will be used as a key to search in the global SectionDB.
Compute the section characteristics of specific sections.
Add a dictionary to the Dict object.
The data can be a dict or Dict type object.
Create or replace the material properties of the element.
If the argument is a dict, it will be added to the global MaterialDB. If the argument is a string, this string will be used as a key to search in the global MaterialDB.
Return the value for key or a default.
This is the equivalent of the dict get method, except that it returns only the default value if the key was not found in self, and there is no _default_ method or it raised a KeyError.
Replaces the setdefault function of a normal dictionary.
This is the same as the get method, except that it also sets the default value if get found a KeyError.
Distributed loading on an element.
Add a dictionary to the Dict object.
The data can be a dict or Dict type object.
Return the value for key or a default.
This is the equivalent of the dict get method, except that it returns only the default value if the key was not found in self, and there is no _default_ method or it raised a KeyError.
Replaces the setdefault function of a normal dictionary.
This is the same as the get method, except that it also sets the default value if get found a KeyError.
Distributed loading on an element edge.
Add a dictionary to the Dict object.
The data can be a dict or Dict type object.
Return the value for key or a default.
This is the equivalent of the dict get method, except that it returns only the default value if the key was not found in self, and there is no _default_ method or it raised a KeyError.
Replaces the setdefault function of a normal dictionary.
This is the same as the get method, except that it also sets the default value if get found a KeyError.
A class for storing coordinate systems.
A class for storing an amplitude.
The amplitude is a list of tuples (time,value).
atime (amplitude time) can be either STEP TIME (default in Abaqus) or TOTAL TIME
smoothing (optional) is a float (from 0. to 0.5, suggested value 0.05) representing the fraction of the time interval before and after each time point during which the piecewise linear time variation will be replaced by a smooth quadratic time variation (avoiding infinite accelerations). Smoothing should be used in combination with TABULAR (set 0.05 as default value?)
A database class for all properties.
This class collects all properties that can be set on a geometrical model.
This should allow for storing:
Materials and sections use their own database for storing. They can be specified on creating the property database. If not specified, default ones are created from the files distributed with pyFormex.
Add a dictionary to the Dict object.
The data can be a dict or Dict type object.
Return the value for key or a default.
This is the equivalent of the dict get method, except that it returns only the default value if the key was not found in self, and there is no _default_ method or it raised a KeyError.
Replaces the setdefault function of a normal dictionary.
This is the same as the get method, except that it also sets the default value if get found a KeyError.
Set the materials database to an external source
Set the sections database to an external source
Print the property database
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 module properties
Set the global materials database.
If mat is a MaterialDB, it will be used as the global MaterialDB. Else, a new global MaterialDB will be created, initialized from the argument mat.
Set the global sections database.
If sec is a SectionDB, it will be used as the global SectionDB. Else, a new global SectionDB will be created, initialized from the argument sec.
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.
Check that a variable is an list of values or (id,value) tuples
This convenience function checks that the argument is either:
If ok, return the values as a list of (int,float) tuples.
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.
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.
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.