[S0014] Create a custom material with electric properties

 

JMAG-Designer provides not only the built-in material database, but also the function to create materials with arbitrarily defined properties(custom materials).
When creating a custom material, it is not necessary to set all parameters; only the parameters necessary for desired analysis can be set.
This script creates a custom material with the electric property parameters of an insulation material that can be used in electric field analysis.

Preconditions

  • The units of the setting values ​​follow the unit system set at [Tools]-[Preferences].

Script Function

  • Create new custom material and set the electric property parameters.
    Set the conductivity type to a constant value of 0 for electric conductivity, permittivity to a constant value of 2.4 for the real part and 0 for the imaginary part and 25000000 for dielectric strength.
# Copyright (c) 2026 JSOL CORPORATION
#
# This script is released under the MIT License.
# See the full license text at:
# https://www.jmag-international.com/scriptlibrary/jmag_script_library_mit/

def createCustomMaterialWithElectric(materialLibrary):
    """Create a new custom material and define its electrical properties"""

    materialLibrary.CreateCustomMaterial(u"material")
    userMaterial = materialLibrary.GetUserMaterial(u"material")
    userMaterial.SetValue(u"ConductivityType", u"Conductivity")
    userMaterial.SetValue(u"Conductivity", 0)
    userMaterial.SetValue(u"PermittivityType", u"Constant")
    userMaterial.SetComplexValue(u"Permittivity", 2.4, 0)
    userMaterial.SetValue(u"DielectricStrength", 25000000)

app = designer.GetApplication()
materialLibrary = app.GetMaterialLibrary()
createCustomMaterialWithElectric(materialLibrary)

Download Python source code

How to use script file

Use the JMAG Script Library after reading and agreeing to the following terms of use.

Search Filter

  • All Categories

An engineer's diary
JMAG-Express Online