Builders

In large multiphysics problems, creation and connection of the OpenMDAO model can be complicated and time-consuming. The design of MPhys is based on builder classes in order to reduce the burden on the user. Most of the assembly of the OpenMDAO model with MPhys is handled by a set of builder helper objects.

Developers wishing to integrate their code to MPhys should subclass the builder and implement the methods relevant to their code. Not all builders need to implement all the methods. For example, a transfer scheme builder may not need a precoupling post coupling subsystem in the scenario.

class mphys.Builder[source]

MPHYS builder base class. Template for developers to create their builders.

Because the MPI communicator that will be used inside the OpenMDAO problem is not known when the builder is instantiated. The actual solver, transfer scheme, etc. should not be instantiated in the constructor.

initialize(comm)[source]

Initialize the solver, transfer scheme, etc. This method will be called when the MPI comm is available

Parameters:
commComm

The communicator object created for this xfer object instance.

get_mesh_coordinate_subsystem(scenario_name=None)[source]

The subsystem that contains the subsystem that will return the mesh coordinates

Parameters:
scenario_namestr or None

The name of the scenario calling the builder.

Returns:
meshComponent or Group or None

The openmdao subsystem that has an output of coordinates.

get_coupling_group_subsystem(scenario_name=None)[source]

The subsystem that this builder will add to the CouplingGroup

Parameters:
scenario_namestr or None

The name of the scenario calling the builder.

Returns:
subsystemComponent or Group or None

The openmdao subsystem that handles all the computations for this solver. Transfer schemes can return multiple subsystems

get_pre_coupling_subsystem(scenario_name=None)[source]

Method that returns the openmdao subsystem to be added to each scenario before the coupling group

Parameters:
scenario_namestr or None

The name of the scenario calling the builder.

Returns:
subsystemComponent or Group or None
get_post_coupling_subsystem(scenario_name=None)[source]

Method that returns the openmdao subsystem to be added to each scenario after the coupling group

Parameters:
scenario_namestr or None

The name of the scenario calling the builder.

Returns:
subsystemComponent or Group or None
get_number_of_nodes()[source]

Method that returns the number of nodes defining the interface (input) mesh

Returns:
number_of_nodesint

number of nodes in the computational domain

get_ndof()[source]

The number of degrees of freedom used at each output location.

Returns:
ndofint

number of degrees of freedom of each node in the domain

get_tagged_indices(tags)[source]

Method that returns grid IDs for a list of body/boundary tags.

Parameters:
tagslist of integers or strings
Returns:
grid_idslist

list of grid IDs that correspond to given body/boundary tags