Click or drag to resize

Launching Other Types of Simulations

In addition to standard EMA3D simulations, users may with to launch S-Parameter and standalone MHARNESS simulations. This section will out line how to do that.

A standalone MHARNESS simulation can be started by changing E3DWriter for HarnessWriter and E3DSimulation for HarnessSimulation in the examples given in Launching A Basic Simulation

Basic MHARNESS run script
import clr
apipath = "ema3d.Api.V25.dll"
clr.AddReferenceToFileAndPath(apipath)

from ema3d.Api.V25.Core.Execution import E3DWriter
from ema3d.Api.V25.Core.Execution import HarnessWriter
from ema3d.Api.V25.Core.Execution import HarnessSimulation
from ema3d.Api.V25.Core.Meshing import FDMeshEngine

document = Window.ActiveWindow.Document;

# Step 1 - Mesh the geometry in the current document (Optional).
FDMeshEngine.Create(document).Mesh();

# Step 2 - Export the current simulation files.
path = HarnessWriter.Write(document, E3DWriter.GetSim())

# Step 3 - Execute the simulation and block until the simulation completes.
HarnessSimulation.Launch(path).WaitForCompletion()

Similarly, S-Parameter simulations can be launched in either integrated or standalone mode by replacing the Write calls with WriteSParameter.

Run Script With Output
import clr
apipath = "ema3d.Api.V25.dll"
clr.AddReferenceToFileAndPath(apipath)

from ema3d.Api.V25.Core.Execution import E3DWriter
from ema3d.Api.V25.Core.Execution import E3DSimulation
from ema3d.Api.V25.Core.Execution import HarnessWriter
from ema3d.Api.V25.Core.Execution import HarnessSimulation
from ema3d.Api.V25.Core.Meshing import FDMeshEngine

document = Window.ActiveWindow.Document;

## Writing and executing a coupled EMA3D and MHARNESS S-Parameter Simulation.

# Step 1 - Mesh the geometry in the current document (Optional).
FDMeshEngine.Create(document).Mesh();

# Step 2 - Export the current simulation files.
path = E3DWriter.WriteSParameter(document, E3DWriter.GetSim())

# Step 3 - Execute the simulation and block until the simulation completes.
E3DSimulation.Launch(path).WaitForCompletion()


## Writing and executing a standalone MHARNESS S-Parameter Simulation.

# Step 1 - Mesh the geometry in the current document (Optional).
FDMeshEngine.Create(document).Mesh();

# Step 2 - Export the current simulation files.
path = HarnessWriter.WriteSParameter(document, E3DWriter.GetSim())

# Step 3 - Execute the simulation and block until the simulation completes.
HarnessWriter.Launch(path).WaitForCompletion()