3. Simples Applications
All Simples applications are text-based, accessed though a shell command line interface, i.e Simples applications must be invoked from a shell, such as the Unix bash shell.
Example invocation of eigenfrequency extraction application b2print_eigenfrequencies (virtual environment activated):
bash-prompt> b2print_eigenfrequencies zaltbommel.b2m
Eigenfrequencies case=1, cycle=0
MODENUM EIGENVALUE FREQUENCY OMEGA MODALK MODALM
0 1 7.216 0.4275 2.686 7.216 1
1 2 7.634 0.4397 2.763 7.634 1
2 3 16.2 0.6407 4.025 16.2 1
3 4 19.13 0.6961 4.374 19.13 1
4 5 19.4 0.701 4.404 19.4 1
5 6 27.51 0.8348 5.245 27.51 1
6 7 36.23 0.9579 6.019 36.23 1
7 8 53.11 1.16 7.288 53.11 1
8 9 58.47 1.217 7.647 58.47 1
9 10 61 1.243 7.81 61 1
Example invocation of eigenfrequency extraction application b2print_eigenfrequencies (no virtual environment):
bash-prompt> export B2PREFIX=<path-to-virtual-environment>
bash-prompt> $B2PREFIX/bin/b2print_eigenfrequencies zaltbommel.b2m
3.1. Python 3 Simples Interpreter
usage: pysimples [-b | --batch] [SCRIPT]
pysimples - a Simples python3 interpreter (since version
2.5.4). Launches a python3 interpreter with simples module.
pysimples can be operated from outside the virtual environment.
arguments:
SCRIPT Optional Python3 script file name.
options:
-b | --batch Executes interpreter in batch mode, i.e interpreter
terminates after termination of SCRIPT.
-h Prints this help string and exits.
Note: pysimples contains an "execfile(name)" function for executing
Python3 scripts.
3.2. b2dofinit
usage: b2dofinit [-h] [--case CASE] DBNAME
b2dofinit creates initial dof and dofd (if any) solution fields at time=0.0,
i.e solution cycle=0 for a given case. If no initial values are found zero-
values initial solution fields are generated. Works for branch 1 only!
positional arguments:
DBNAME B2000++ model database name
options:
-h, --help show this help message and exit
--case CASE Specifies case (default is 1).
3.3. b2modal
usage: b2modal [-h] [--modes MODES] -d DCASE -v VCASE [-f FCASE] [--zeta ZETA]
[--hfunc HFUNC] [--T TIME1] [--nsteps NSTEPS]
[--dof_init_id DOFINIT] [--dofdot_init_id DOFDINIT]
[--dofinc DOFINC] [--verbose] [--debug]
DBNAME
b2modal performs a modal analysis, solving the equations of motion
in structural analysis, for a given B2000++ database containing free
vibration modes, initial boundary conditions (dof_init, dofdot_init),
and loads (nbc) from a previous b2000++ run. (Version 2.5.4)
positional arguments:
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
--modes MODES Vibration mode identifiers to be processed. Default:
1, i.e free vibration mode 1. List of values must be
enclosed in quotes.
-d DCASE, --dynamic_case DCASE
Identifier of transient load case to be created by
b2modal (no default).
-v VCASE, --free_vibration_case VCASE
Identifier of case containing free vibration mode
identifiers (no default).
-f FCASE, --force_case FCASE
Identifier of case defining the transient analysis
force vector ("right-hand side"). Default: 0 (no
forces).
--zeta ZETA Modal damping value(s). Default damping. List of
values must be enclosed in quotes.
--hfunc HFUNC Name of Python module file containing time history
function "def hfunc(t):". Default: Function returning
1.0 for all t
--T TIME1 Integration time period. Default: 1.0
--nsteps NSTEPS Number of integration steps (100).
--dof_init_id DOFINIT
Identifier of initial condition DOF ("displacements").
Default: 0, i.e no initial displacements
--dofdot_init_id DOFDINIT
Identifier of initial condition DOF-dot id
("velocities"). Default: 0, i.e no initial velocities
--dofinc DOFINC Compute DOFs ("displacements") for each dofinc-th time
step. Default: 1, i.e compute for each time step. This
can be time-consuming for large models and many time
steps.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
An example case is foound in the B2000++ examples collection und
$B2EXAMPLES/dynamic.simple_beam.
3.4. b2plot_csv
usage: b2plot_csv [-h] [-o ONAME] [--legend LEGEND] [--lfontsize LFONTSIZE]
[--title TITLE] [--lx LABELX] [--ly LABELY]
[--xscale SCALEX] [--yscale SCALEY] [--linew LINEW]
[--width WIDTH] [--height HEIGHT] [--fontsize FONTSIZE]
[--marker MARKER] [--show] [--colors COLORS] [--verbose]
[--debug]
[FILE ...]
Plots one or more CSV x-y value files produced by Simples and
generates plot format file, such as PNG, SVG. (Version 2.5.4)
positional arguments:
FILE CSV x-y values file name.
options:
-h, --help show this help message and exit
-o ONAME, --output ONAME
Plot file name. Default: output.svg
--legend LEGEND Plot legend at position (matplotlib): 'best', 'upper
right', 'upper left', 'lower left', 'lower right',
'right', 'center left', 'center right', 'lower
center', 'upper center', 'center'. Default: 'best'.
--lfontsize LFONTSIZE
Legend font size in pt.
--title TITLE Graph title.
--lx LABELX X-axis label.
--ly LABELY Y-axis label.
--xscale SCALEX X axis values scale factor (1.0).
--yscale SCALEY Y axis values scale factor (1.0).
--linew LINEW Curve line width in mm (0.5). 0.0 draws no solid line.
--width WIDTH Graph width in mm (150.).
--height HEIGHT Graph height in mm (100.).
--fontsize FONTSIZE Font size in pt (12).
--marker MARKER Curve marker (matplotlib symbols). Default is no
marker.
--show Display figure on screen.
--colors COLORS Define color name(s) for graphs. If more than one
color is specified, the list must be enclosed in " "
and items must be comma-separated. Default colors are
"black,r,g,b,c,m,y,brown".
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
3.5. b2plot_stack
usage: b2plot_stack [-h] [-b BRANCH] [--case CASE] [--subcase SUBCASE]
[--cycle CYCLE] [--subcycle SUBCYCLE] [-f FIELD]
[--scale SCALE] [--show] [-p GPOINT] [--xunits XUNITS]
[--yunits YUNITS] [-t ZLIMIT] [--verbose] [--debug]
EID DBNAME
Plot sampling-point solutions, specifically laminate stresses and strains (STRESS, STRAIN, etc.), through the shell z coordinate for a given Gauss point in the r-s plane and for one or more elements. Works for shell elements only. Each plot is saved to a file "DBNAME,FIELD=,CASE=,CYCLE=,EID=,IP=.svg". (Version 2.5.4)
positional arguments:
EID Element identifier of element to be plotted.
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
-b BRANCH, --branch BRANCH
Branch (mesh) to be processed. Default is 1.
--case CASE Specifies the solution case. Default is 1.
--subcase SUBCASE, --mode SUBCASE
Specifies the solution subcase or mode. Default is
None.
--cycle CYCLE Specifies the (nonlinear) solution cycle. Default is
None. A value of -1 selects the last cycle.
--subcycle SUBCYCLE Specifies the solution subcycle or mode number.
Default is None.
-f FIELD, --field FIELD
Specifies the solution field name.
--scale SCALE Solution scale factor. Default: 1.0.
--show Show plot on display.
-p GPOINT, -g GPOINT, --gpoint GPOINT
Specifies r,s Gauss point (dedfault is 1).
--xunits XUNITS X-axis units to be displayed. Default: None.
--yunits YUNITS Y-axis units to be displayed. Default: None.
-t ZLIMIT, --tol ZLIMIT
Set values < tol to 0.0 (default is 1.e-13).
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
3.6. b2print_buckling_loads
usage: b2print_buckling_loads [-h] [--to TO] [--floatf FLOATF] [--case CASE]
[--subcase SUBCASE] [--cycle CYCLE]
[--subcycle SUBCYCLE] [--verbose] [--debug]
DBNAME
Prints the buckling loads (critical loads) of all computed buckling modes of a case. (Version 2.5.4)
positional arguments:
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
--to TO Output format: "str" (printable text, default), "csv"
(CSV format).
--floatf FLOATF Specifies the float format. Default is '.4g'.
--case CASE Specifies the solution case. Default is 1.
--subcase SUBCASE, --mode SUBCASE
Specifies the solution subcase or mode. Default is
None.
--cycle CYCLE Specifies the (nonlinear) solution cycle. Default is
None. A value of -1 selects the last cycle.
--subcycle SUBCYCLE Specifies the solution subcycle or mode number.
Default is None.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
3.7. b2print_dataset
usage: b2print_solutions [-h] [--to TO] [--floatf FLOATF] [--verbose]
[--debug]
SETNAME DBNAME
Print a B2000++ data set. In current version, only F and I
datasets are processed. (Version 2.5.4)
positional arguments:
SETNAME MemCom dataset name.
DBNAME B2000++ model database name (required). Must be of the form
"path/name.b2m". "path/name" or "path/name." are also ok
(".b2m" is added).
options:
-h, --help show this help message and exit
--to TO Output format: "str" (printable text, default), "csv" (CSV
format).
--floatf FLOATF Specifies the float format. Default is '.4g'.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
Example: Print dataset "COOR.1":
prompt> b2print_dataset COOR.1 truss.b2m
Dataset COOR.1
XG YG ZG
0 0 0 0
1 1 0.5 0
2 0 1 0
3 1 1.5 0
Example: Print dataset "NODA.1":
prompt> b2print_dataset NODA.1 truss
Dataset NODA.1
EID NLCS_INDEX TRANSFORM_INDEX NODE_TYPE
0 1 0 0 0
1 2 0 0 0
2 3 0 0 0
3 4 0 0 0
3.8. b2print_eigenfrequencies
usage: b2print_eigenfrequencies [-h] [--to TO] [--floatf FLOATF] [--case CASE]
[--subcase SUBCASE] [--cycle CYCLE]
[--subcycle SUBCYCLE] [--verbose] [--debug]
[--frequencies] [--cfrequencies] [--modalk]
[--modalm] [--eigenvalues]
DBNAME
Prints the eigenfrequencies of all computed eigenmodes of a free vibration analysis.
If no items are selected, all items are printed. (Version 2.5.4)
positional arguments:
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
--to TO Output format: "str" (printable text, default), "csv"
(CSV format).
--floatf FLOATF Specifies the float format. Default is '.4g'.
--case CASE Specifies the solution case. Default is 1.
--subcase SUBCASE, --mode SUBCASE
Specifies the solution subcase or mode. Default is
None.
--cycle CYCLE Specifies the (nonlinear) solution cycle. Default is
None. A value of -1 selects the last cycle.
--subcycle SUBCYCLE Specifies the solution subcycle or mode number.
Default is None.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
--frequencies Frequencies.
--cfrequencies Circular frequencies ("omega").
--modalk Modal stffness.
--modalm Modal mass.
--eigenvalues Computed eigenvalues.
3.9. b2print_elements
usage: b2print_elements [-h] [--items ITEMS] [--sets SETS] [--eltypes ELTYPES]
[--to TO] [--floatf FLOATF] [--verbose] [--debug]
DBNAME
Print all mesh elements. By default all elements are printed.
If neither --sets or --items or --eltypes are specified all elements are
extracted. ***EXPERIMENTAL*** Might change... (Version 2.5.4)
positional arguments:
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
--items ITEMS, -i ITEMS
Selects items (node, elements) by identifier (int).
Default is all items found. If more than one item is
specified, the items list must be enclosed in " " and
items must be comma-separated.
--sets SETS Selects sets (node, elements, ...) by name(s) (str).
No default. If more than one set name is specified,
the set names list must be enclosed in " " and names
must be comma-separated.
--eltypes ELTYPES Selects element types by name(s) (str). No default. If
more than one name is specified, the names list must
be enclosed in " " and names must be comma-separated.
--to TO Output format: "str" (printable text, default), "csv"
(CSV format).
--floatf FLOATF Specifies the float format. Default is '.4g'.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
Example: Print all elements (by element type!) of "mixed.b2m":
b2print_elements mixed.b2m
FE Mesh Elements "R2.S" (ityp=64), All elements of type R2.S
IID EID MID PID Node_1 Node_2
16 17 1 0 1 6
17 18 1 0 1 7
FE Mesh Elements "Q4.S.MITC" (ityp=71), All elements of type Q4.S.MITC
IID EID MID PID Node_1 Node_2 Node_3 Node_4
18 19 1 0 5 21 41 35
19 20 1 0 21 22 42 41
...
FE Mesh Elements "B2.S.RS" (ityp=151), All elements of type B2.S.RS
IID EID MID PID Node_1 Node_2
0 1 0 1 1 9
1 2 0 1 9 10
...
3.10. b2print_mesh
*** NOTE App withdrawn, please run b2print_nodes and/or b2print_elements ***
3.11. b2print_nodes
***EXPERIMENTAL*** Might change...
usage: b2print_nodes [-h] [--items ITEMS] [--sets SETS] [--floatf FLOATF]
[--verbose] [--debug] [--to TO]
DBNAME
Print mesh nodes. By default all nodes are
printed (if neither --sets or --items are specified all nodes are
printed). (Version 2.5.4)
positional arguments:
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
--items ITEMS, -i ITEMS
Selects items (node, elements) by identifier (int).
Default is all items found. If more than one item is
specified, the items list must be enclosed in " " and
items must be comma-separated.
--sets SETS Selects sets (node, elements, ...) by name(s) (str).
No default. If more than one set name is specified,
the set names list must be enclosed in " " and names
must be comma-separated.
--floatf FLOATF Specifies the float format. Default is '.4g'.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
--to TO Output format: "str" (printable text, default), "csv"
(CSV format).
Example: Print all nodes of model "demo.b2m":
b2print_nodes demo.b2m
Example: Print all nodes of node set "column1" of model "demo.b2m":
b2print_nodes --sets=column1 demo.b2m
3.12. b2print_solutions
usage: b2print_solutions [-h] [--case CASE] [--subcase SUBCASE]
[--cycle CYCLE] [--subcycle SUBCYCLE] [--items ITEMS]
[--sets SETS] [--points CPOINTS] [-f FIELD] [--local]
[--available] [--to TO] [--floatf FLOATF]
[--maxofelement] [--verbose] [--debug]
DBNAME
Prints a solution field for a given solution field name and a
(load) case, a (load) cycle, etc. If neither --items or --sets or
--points are specified all item (node, elements) will be selected (Version 2.5.4)
positional arguments:
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
--case CASE Specifies the solution case. Default is 1.
--subcase SUBCASE, --mode SUBCASE
Specifies the solution subcase or mode. Default is
None.
--cycle CYCLE Specifies the (nonlinear) solution cycle. Default is
None. A value of -1 selects the last cycle.
--subcycle SUBCYCLE Specifies the solution subcycle or mode number.
Default is None.
--items ITEMS, -i ITEMS
Selects items (node, elements) by identifier (int).
Default is all items found. If more than one item is
specified, the items list must be enclosed in " " and
items must be comma-separated.
--sets SETS Selects sets (node, elements, ...) by name(s) (str).
No default. If more than one set name is specified,
the set names list must be enclosed in " " and names
must be comma-separated.
--points CPOINTS Selects modeler point names (str). No default. The
list must be enclosed in " " and point names must be
comma-separated.
-f FIELD, --field FIELD
Specifies the solution field name.
--local Prints the DOF values in local reference system (if
applicable). Default if omitted is the global
reference system.
--available Print names of available fields for a specific case ("
--case" option) and quits.
--to TO Output format: "str" (printable text, default), "csv"
(CSV format).
--floatf FLOATF Specifies the float format. Default is '.4g'.
--maxofelement Prints the maximum value of the field of the element.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
Solution fields names of available solution fields for a specific case
can be obtained with the "--available" option (together with the
"--case"" option)3. Standard solution field names include "DOF",
"DOFD", "DOFDD", "DISP" (displacements and rotations), "FORC" (forces,
i.e right-hand sides), "RCFO" (reactions), "STRESS" (stresses),
"STRAIN" (strains), etc.
Example: Extract and print the (default) DOF solution (here:
displacements and rotations of shell elements) of (default)
case 1. From example case $B2EXAMPLES/static/scordelis_lo_roof.
b2print_solutions scordelis_lo_roof.b2m
Extract and print stresses of all elements. From example case
$B2EXAMPLES/static/scordelis_lo_roof.
b2print_solutions -f stresses scordelis_lo_roof.b2m
Extract and print stresses of element 1. From example case
$B2EXAMPLES/static/scordelis_lo_roof.
b2print_solutions -f stresses --item=1 scordelis_lo_roof.b2m
Extract displacements of all nodes of model " scordelis_lo_roof.b2m"
and pipe into a spreadsheet (libreoffice):
f=`mktemp`; b2print_solutions --to=csv scordelis_lo_roof.b2m >$f; libreoffice --calc $f
3.13. b2print_stack
usage: b2print_stack [-h] [-f FIELD] [--case CASE] [--subcase SUBCASE]
[--cycle CYCLE] [--subcycle SUBCYCLE] [-b BRANCH]
[--scale SCALE] [-t ZLIMIT] [--floatf FLOATF] [--verbose]
[--debug]
EID DBNAME
Extract and print sampling-point solutions (STRESS, STRAIN, etc.)
for one or more elements. Intended for printing laminate stresses and strains. (Version 2.5.4)
positional arguments:
EID Element identifier of element to be printed.
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
-f FIELD, --field FIELD
Specifies the solution field name.
--case CASE Specifies the solution case. Default is 1.
--subcase SUBCASE, --mode SUBCASE
Specifies the solution subcase or mode. Default is
None.
--cycle CYCLE Specifies the (nonlinear) solution cycle. Default is
None. A value of -1 selects the last cycle.
--subcycle SUBCYCLE Specifies the solution subcycle or mode number.
Default is None.
-b BRANCH, --branch BRANCH
Branch (mesh) to be processed. Default is 1.
--scale SCALE Solution scale factor. Default: 1.0.
-t ZLIMIT, --tol ZLIMIT
Set values < tol to 0.0 (default is 1.e-13).
--floatf FLOATF Specifies the float format. Default is '.4g'.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.
3.14. b2print_steps
usage: b2print_steps [-h] [--to TO] [--floatf FLOATF] [--case CASE]
[--subcase SUBCASE] [--verbose] [--debug]
DBNAME
b2print_steps prints load/time steps information, i.e time,
delta-time, stage time, stage_number, and stage identifier of the solution
cycles of a given case.
(Version 2.5.4)
positional arguments:
DBNAME B2000++ model database name (required). Must be of the
form "path/name.b2m". "path/name" or "path/name." are
also ok (".b2m" is added).
options:
-h, --help show this help message and exit
--to TO Output format: "str" (printable text, default), "csv"
(CSV format).
--floatf FLOATF Specifies the float format. Default is '.4g'.
--case CASE Specifies the solution case. Default is 1.
--subcase SUBCASE, --mode SUBCASE
Specifies the solution subcase or mode. Default is
None.
--verbose May produce additional informative output.
--debug Debug mode, prints traceback and optional application-
dependent printout.