11. Version 1.3.2

11.1. New Main Window

baspl++ has been furnished a new main window, which serves as a container for all the different object editors: When an object is selected, its editor appears automatically in the right pane of the main window. This behaviour helps to reduce clutter on the screen by having normally two windows only, namely the main window and a Scene window.

The main window contains also an error and warning message log, and the terminal window where Python commands can be entered. The -t and -g options for baspl++ behave as before.

11.2. Improved Widgets

Some, but not all editors, have been equipped with new entry widgets and spin buttons. These widgets make the inspection and modification of the object's properties more intuitive to the novice user. This is ongoing work.

11.3. Documentation

Due to the changes in appearance, much of the user manual (especially the screenshots) is outdated. Due to time constraints, the user manual has not yet been updated except for the on-line reference manual. Updated documentation will be furnished in a follow-up to this release. In the meantime, do not hesitate to send questions to smr@smr.ch.

11.4. Converters

Various converters have been created for baspl++, some of them still in an experimental stage. Many of these have been integrated in baspl++, making it possible now for converting databases from other formats to MemCom either via Python functions or via the GUI. To this end, the 'Open model..' dialogue has been augmented. The on-line reference has been updated and is almost complete. It can be invoked by typing help(...) and the name of the class, e.g. help(Part).

11.5. Improved Support for SFV Meshes and NSMB

  • ADDED: Structured Finite Volume (SFV) meshes are used by structured CFD codes such as NSMB. Such meshes can be loaded now in two different fashions: By default, the mesh is moved or displaced such that nodes coincide with the original cell centers. This permits to treat field as nodal fields and to display step textures etc. When the 'displace_sfv' option is set to 0, the mesh will not be displaced and fields will be treated as cell fields.

  • ADDED: Face selection by boundary codes for SFV meshes is accomplished via the Part.add_sfv_bc() method. The Part Editor GUI has been updated accordingly.

  • ADDED: Selective display is now possible also for SFV boundary codes. Added methods Part.set_display_bc_code(), Part.get_display_bc_code(), as well as the necessary stuff in the GUI.

11.6. External Numbers

In previous versions of baspl++, there was confusion between internal and external numbers; some methods required internal numbers, while others required external numbers. The current version of baspl++ has been changed such that in the GUI and all in Python functions and methods, external numbers must be specified and external numbers will be returned.

Internal numbers represent the indices into an array, for example the internal node number 30 represents the 31. value (Python's indices start at 0 like C/C++, not with 1 like FORTRAN). Internal numbers are of course contiguous. External numbers are not necessarily contiguous and are usually crafted such that they can be easily remembered (e.g. node 10011001 is a corner node on a rectangular plate). They are used extensively in CSM codes.

In such cases, a mapping from internal to external numbers is provided on the database. If no such mapping is provided, then the rule external_number = internal_number + 1 is employed. Thus when no external numbers are defined (such as in CFD models), the behaviour remains unchanged. Some of the affected methods:

  • Part.add_elements()

  • Part.add_faceset()

  • Part.add_nodes()

The Model Editor has been changed such that external as well as internal numbers may be specified to look up a branch, node, or element.

11.7. Select Elements by Group and Panel

Many unstructured CFD codes attribute to elements a group and panel number, the latter indicating the corresponding CAD surface patch. baspl++'s Part.add_elements() method has been augmented to accept optional 'groups' and 'panels' parameters, thus allowing for selecting all elements belonging to a certain group and/or panel.

11.8. Selective Display

For pre-processing purposes it is often convenient to display different regions of a model in different colours. Further it is useful to display only a selection of these regions (e.g. the far field in CFD model). Once elements have been added to a Part object, they may be coloured either:

  • All in the same colour (default). This corresponds to the previous behaviour.

  • Coloured by groups (if defined), where elements of each group are given a different (fixed) colour.

  • Coloured by branch, where elements of each branch are given a different (fixed) colour.

  • Coloured by SFV boundary code (if defined), where elements having been selected with a BC are given the colour of that BC.

Selective display can be enabled with the GUI or by means of the Part.set_set_display_selected() method. Either by the GUI or by means of the Part.set_display_group(), Part.set_display_panel(), Part.set_display_branch(), or Part.set_display_bc() functions, the display of the previously added elements can be toggled for the different regions.

11.9. Access to baspl++ Arrays

  • IMPROVED: Performance of printing of arrays such as coordinates and field values has been greatly improved.

  • IMPROVED: Modification of arrays is easier. Example:

    # scale coordinates from m to mm...
    for br in self.branches.keys():
        br.coordinates *= 1000.0
  • CHANGED: The 'array' constructor is now imported directly into baspl++, thus it is sufficient to write

    a=array([1,2])

    while

    a=Numeric.array([1,2])

    is still valid. The former corresponds to the output of the array print functions.

11.10. Derived Models

Normally, a model is loaded from database and as such, the Model object has a database associated to it. Derived Model objects have instead of a MemCom database a Part object associated to it. They behave such that all nodes and elements selected by the Part object and the corresponding field values have been stored on a database and then loaded like a normal Model object.

As such, derived Model objects can be used for instance, to make a cut through a cut, or to make a cut through selected elements only (not the whole Model). Derived Model objects have a single branch. For each derived Model, the Model.Branch object to access coordinates and element connectivity and the Field and Field.Branch objects behave as it is the case for normal models.

m=Model(/path/to/database.mc')
p=Part(m)                        # create a part from which to derive 
p.add_elements(groups=1)         # add elements belonging to group 1 

md=Model(part=p)                 # create a derived Model 
print md.branches[1].coordinates # print coordinates

f=md.get_field('PRES', cycle=1)  # get pressure field
print f.branches[1]              # and print only selected nodes

11.11. Changes and Improvements in the Python API

  • IMPROVED: The create_script() function works more reliably andsupports now all baspl++ classes.

  • ADDED: The Line class is useful for annotating curves and graphs, but can also be used to annotate 3D models.

  • ADDED: The Text class allows for inserting multi-line text into Scene objects. Font and colour are configurable.

  • CHANGED: The Model class is no longer derived from the memcom.db class, but instead has a new property Model.db, through which the MemCom database can be accessed. This was needed for derived Models as they do not have any database associated with them.

  • CHANGED: The Field and Model classes were changed such that m[1] or f[1] do not work anymore to access the respective Branch object. Instead use m.branches[1] or f.branches[1].

    m.branches and f.branches are dictionaries where Model.Branch rsp. Field.Branch objects can be accessed by their external branch number. f.ibranches and m.ibranches are tuples, where the Model.Branch rsp. Field.Branch objects can be accessed by their internal branch numbers.

  • IMPROVED: The database extraction has been repaired and modified. The function is Model.extract() and works on all field types except indexed fields. For more information, type help(Model.extract).

  • CHANGED: Replaced many getter functions by properties in the Model and Field classes. This makes their use a bit simpler and requires less typing. An overview of these properties can be found by typing help(Model), help(Model.Branch), help(Field), and help(Field.Branch).

  • IMPROVED: Made Part.set_displacement_scale() tolerant against (x, y, z) and ((x, y ,z)).

  • CHANGED: If the point (origin) of a cut is outside the Model's bounding box, an exception is raised. Reason: The GUI's scale widgets can take values within the bounding box only, thus an inconsistency would occur between the actual values of the cutting planes' point and the displayed values in the GUI. Therefore the cutting plane's point is now constrained to the Model's bounding box.

11.12. Display Improvements and Bug Fixes

  • FIXED: When working with different Part object having different "mirror" settings (e.g. Part_1 with "nv" and Part_2 with "xz"), switching between the two Parts when editing would affect the mirror settings.

  • FIXED: Prism (PR) elements were wrongly displayed.

  • FIXED: 2-order tetrahedral (TE10) elements were wrongly displayed.

  • FIXED: In postscript output, the Scene axes were sometimes wrong.

  • FIXED: Part.add_nodes() would add the nodes twice.

  • FIXED: On point sets, only half of the vectors would be drawn. (In combination with the previous error, a vector for each node would still be drawn).

  • ADDED: Vectors on interpolated nodes can now be switched on/off. Switching interpolated nodes off is useful for force fields, because there are no forces on interpolated nodes.

  • IMPROVED: Introduced the necessary functionality in b2Epar to support edges and sub-edges, and modified b2Lineset and b2Faceset::add_border() accordingly. Now BORDER works with higher-order elements too.

11.13. Other Improvements and Bug Fixes

  • FIXED: When attempting to create a Model object, but the database does not exist or cannot be accessed, the Model object would anyway appear in the main window. Fixed.

  • IMPROVED: For nodal and cell fields, if the dimension of the dataset does not correspond to the number of nodes/elements for the branch in question, an exception is raised. This prevents crashes due to wrongly-sized field datasets on the database.

  • IMPROVED: Tecplot converter has been made a bit more robust against variations of the ASCII format of the tecplot files.

  • IMPROVED: Increased the size for the (internal) gradient buffer from 10'000 to 50'000 floating-point numbers. This has become necessary for elements with more than 100 layers.

  • IMPROVED: Removed objects_manager functions from on-line help. This makes the reading of the on-line help much easier. A problem is still that methods cannot be grouped by subject but are ordered alphabetically instead.

  • FIXED: When closing baspl++, the destructor of the class VideoOutputStream would not be terminated correctly, resulting in a warning message on the terminal.

  • IMPROVED: When reloading a Field with a different parameter (e.g. cycle), name collisions could occur with already loaded Field objects. The previous behaviour in that case was raising an exception. This would prevent loading the same field data twice, but was a hindrance for scripts etc., because it required the user to make sure that no other field which could create a name collision is loaded. The new behaviour is to allow Field objects having the same parameters (thus the same data) coexist, but altering the name of the reloaded field by adding a '_1', '_2', etc. to its name.

  • FIXED: In the load dialog, conversion to MemCom would not work if the database directory was not the startup directory of baspl++.

  • FIXED: On systems with 100dpi fonts, the different editors did not completely fit into the main window. Because of this, some of the widgets were not visible. Now the main window is enlarged when an editor is selected that does not fit into the main window.

  • FIXED: When deriving models from cuts, a segmentation fault could occur.

  • FIXED: function RotateField of b2Util.C failed on call with dim != 3 (invalid read on Array[ii+2] when dim = 2).

  • FIXED: When assigning slices to ArrayAccess objects, the dimensions of the right value were not correctly taken into account.

  • FIXED: The scalar field selection in the Part Editor displayed also fields not belonging to the Part's Model.

  • ADDED: Material-ID (MID) group selection 'add_elements' did not work for 'U' meshes. The necessary functionality was added in B2000 and in baspl++.

  • IMPROVED: When the main window is closed or sys.exit() is entered on the command line or called from within a script, baspl++ exits.

  • CHANGED: In case of a script error, the baspl++ banner is not printed.

  • FIXED: Open the F50 model failed, valgrind returning some invalid write. Invalid (old) database with ELGR.*. Now the length of ELGR.* is tested.

  • IMPROVED: Fixed baspl++ such that it does not require an EPAR or ENAM dataset on the database. Useful for point-cloud databases.

  • FIXED: Displaying Curve objects with bezier interpolation enabled, but zero points, resulted in a "out of memory" error.

  • FIXED: Two recently introduced errors in the Model class regarding internal and external node numbering have been found.