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:
- comm
Comm
The communicator object created for this xfer object instance.
- comm
- 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:
- mesh
Component
orGroup
or None The openmdao subsystem that has an output of coordinates.
- mesh
- 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:
- subsystem
Component
orGroup
or None The openmdao subsystem that handles all the computations for this solver. Transfer schemes can return multiple subsystems
- subsystem
- 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:
- subsystem
Component
orGroup
or None
- subsystem
- 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:
- subsystem
Component
orGroup
or None
- subsystem
- 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