Viewing Data Model Contents

The following sections provide instructions on different ways to view the contents of the data model:

Viewing a Container's Contents

To view the contents of a container, use the PrintState() command on the container. Examples for viewing the contents of singletons and viewing the contents of objects are provided below.

Viewing the Contents of a Singleton

Example 7: View the contents of a singleton


>>> DatamodelRoot().SolutionControl.PrintState()

SolutionControl
  DurationOption = EndTime
  EndTime = 0.2 [s]
  TimeStepSize = 0.001 [s]
  MinimumIterations = 1
  MaximumIterations = 10
 

Viewing the Contents of an Object

Example 8: View the contents of a participant's region object


>>> DatamodelRoot().CouplingParticipant['MAPDL-2'].Region['FSIN_1'].PrintState()

CouplingParticipant:MAPDL-2
  Region:FSIN_1
    Topology = Surface
    InputVariables = FORC,FDNS
    OutputVariables = INCD
    DisplayName = FSIN_1_System Coupling Region

 

Viewing an Object's Children

To view a list of all of an object's children, run the GetChildNames() command on the object.

Example 9: View the children of a coupling participant object


>>> DatamodelRoot().CouplingParticipant.GetChildNames()

['MAPDL-1', 'CFX-2']


If children exist for the object, then a list of the child names is returned. If children do not exist, then an empty list ('[]') is returned.

Viewing the Contents of an Object's Children

To view the contents for all of an object's children, use a Python for loop in conjunction with the GetChildNames() command.


Note:  When running a command with a for loop, in order to complete the loop, you must hit the Enter key when presented with "…" in the command console.


Example 10: View the contents of a participant's variable child objects


>>> for variable in DatamodelRoot().CouplingParticipant['MAPDL-2'].Variable.GetChildNames():
DatamodelRoot().CouplingParticipant['MAPDL-2'].Variable[variable].PrintState()
...

CouplingParticipant:MAPDL-2
  Variable:FDNS
    QuantityType = Force
    Location = Element
    DisplayName = Force Density
    TensorType = Vector
    IsExtensive = False

CouplingParticipant:MAPDL-2
  Variable:INCD
    QuantityType = Incremental Displacement
    Location = Node
    DisplayName = Incremental Displacement
    TensorType = Vector
    IsExtensive = False

CouplingParticipant:MAPDL-2
  Variable:FORC
    QuantityType = Force
    Location = Node
    DisplayName = Force
    VariableName = Force
    TensorType = Vector
    IsExtensive = True