tot_jac_builder.py

A tool to make it easier to investigate coloring of jacobians with different sparsity structures.

class openmdao.test_suite.tot_jac_builder.TotJacBuilder(rows, cols)[source]

Bases: object

__init__(rows, cols)[source]

Initialize self. See help(type(self)) for accurate signature.

add_block(block, start_row, start_col)[source]
add_block_diag(shapes, start_row, start_col, density=1.0)[source]
add_col(idx, density=1.0)[source]
add_random_points(npoints)[source]
add_row(idx, density=1.0)[source]
color(mode='auto', stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
create_block(shape, density=1.0)[source]
create_col(density=1.0)[source]
create_row(density=1.0)[source]
density_info()[source]
static eisenstat(n)[source]

Return a builder containing an Eisenstat’s example Jacobian of size n+1 x n.

Should be colorable with n/2 + 2 colors using bidirectional coloring.

The columns in Eisenstat’s example are pairwise structurally nonorthogonal, so a fwd directional coloring would require n groups.

static make_blocks(num_blocks, min_shape, max_shape)[source]
static make_jac(n_dense_rows=0, row_density=1.0, n_dense_cols=0, col_density=1.0, n_blocks=0, min_shape=(1, 1), max_shape=(2, 2), n_random_pts=0)[source]
show(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
shuffle_rows()[source]
openmdao.test_suite.tot_jac_builder.rand_jac()[source]