Click or drag to resize

ChargeBodySourceManager Class

A class that manages the assignment of Charge body sources.
Inheritance Hierarchy
SystemObject
  ema3d.Api.V26.Charging.ExcitationChargeBodySourceManager

Namespace: ema3d.Api.V26.Charging.Excitation
Assembly: ema3d.Api.V26 (in ema3d.Api.V26.dll) Version: 0.0.0.0
Syntax
public sealed class ChargeBodySourceManager

The ChargeBodySourceManager type exposes the following members.

Properties
 NameDescription
Public propertyEnableCoupledAveraged Sets the single coupled source to be either coupled averaged or to the default, coupled.
Top
Methods
 NameDescription
Public methodAssignAnalyticSource(IDesignBody, Double) Assigns an analytic source with a specified source strength to a single body.
Public methodAssignAnalyticSource(IEnumerableIDesignBody, Double) Assigns an analytic source with a specified source strength to multiple bodies.
Public methodAssignCoupled(IDesignBody) Assigns the Charge body source manager's coupled source to a single body.
Public methodAssignCoupled(IEnumerableIDesignBody) Assigns the Charge body source manager's coupled source to multiple bodies.
Public methodAttachSignalFromFileToCoupled Creates a signal from a filepath and attaches the signal to the coupled source. Automatically sets coupled source to be Coupled Averaged.
Public methodAttachSignalToCoupled Attaches a signal defined within the API to the coupled source. Automatically sets coupled source to be Coupled Averaged.
Public methodStatic memberCreate Create a new Charge body source manager instance.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Example
Python
from ema3d.Api.V26.Charging.Excitation import ChargeBodySourceManager as ChargeBodySourceManager
from ema3d.Api.V26.Core import Signals as Signals

_body_source_manager = ChargeBodySourceManager.Create()

body_list = [b for b in GetRootPart().Bodies]

# Multi-body assignment or single body assignments can be made.
_body_source_manager.AssignAnalyticSource(body_list[0:2], 2.5)
_body_source_manager.AssignCoupled(body_list[2:4])

# Attach a signal defined in a file to the coupled source.
filepath = r"signal_filepath.dat"
_body_source_manager.AttachSignalFromFileToCoupled(filepath, "signal_from_file", Window.ActiveWindow.Document)

# Attach a signal defined in the API to the coupled source.
gaussian_signal = Signals.GaussianSignal.Create(Window.ActiveWindow.Document)
gaussian_signal.Amplitude = 1
gaussian_signal.Alpha = 1e16
gaussian_signal.TPeak = 1e-8

_body_source_manager.AttachSignalToCoupled(gaussian_signal, "signal_from_api")
See Also