Home Forums FDTD Batch export analysis files?

Viewing 8 reply threads
  • Author
    Posts
    • #81253
      Scott Newman
      Moderator

      (Awaiting moderation)

    • #83857
      Scott Newman
      Moderator

      (Awaiting moderation)

    • #79994
      Timothy Yang
      Member

      I have about a hundred sequentially named FDTD analysis files ExampleFDTD-00*.fda
      Is there any way to do a batch export on these analysis files, so that I don’t have to open each one individually with the analyzer and export it manually?

      Best regards

    • #81255
      Scott Newman
      Moderator

      Hello Timothy,

      Using VBScript within the designer as part of the simulation setup you can configure the product to export data as simulation sweeps are completed. You will find commands in the “VB Scripting Reference Manual” that is linked to within the “Help Topics” in the Help Menu. However, this must be done at the design stage. There is not a way to batch export after the simulations are complete.

      Which observers do you have and what data are you looking to export.

      Scott

    • #83859
      Scott Newman
      Moderator

      Hello Timothy,

      Using VBScript within the designer as part of the simulation setup you can configure the product to export data as simulation sweeps are completed. You will find commands in the “VB Scripting Reference Manual” that is linked to within the “Help Topics” in the Help Menu. However, this must be done at the design stage. There is not a way to batch export after the simulations are complete.

      Which observers do you have and what data are you looking to export.

      Scott

    • #81257

      Hello, thank you for taking the time to reply.

      Dim Linear1
      Set Linear1 = WGMgr.CreateObj ( "WGLinear", WGMgr.FindID( "Linear" ) )
      Linear1.SetPosition 0.4, 0.002, 2.1, 0.002
      Linear1.SetAttr "WidthExpr", "0.1"
      Linear1.SetAttr "Depth", "0"
      Linear1.SetAttr "StartThickness", "0.000000"
      Linear1.SetAttr "EndThickness", "0.000000"
      Linear1.SetProfileName "ChannelPro1"
      Linear1.SetDefaultThicknessTaperMode True

      Dim InputPlane1
      Set InputPlane1 = InputPlaneMgr.CreateInputObj ("Continuous", "Rectangular", InputPlaneMgr.FindID( "InputPlane"), "Vertical" )
      'Common data for 2D and 3D.
      InputPlane1.SetPosition 0.08
      InputPlane1.SetDirection "Forward"
      InputPlane1.SetWaveLength "0.3"
      InputPlane1.SetEnabled True
      'Data for 2D.
      InputPlane1.SetAmplitudeOrPower "Amplitude", "1.0"
      InputPlane1.SetRefLocal
      InputPlane1.SetCenterPos "0.0"
      InputPlane1.SetHalfWidth "6.0"
      InputPlane1.SetTiltingAngle "0"
      'Data for 3D.
      InputPlane1.SetAmplitudeExpr3D "1.0"
      InputPlane1.SetRefLocal3D
      InputPlane1.SetCenterPosExpr3D "0.0", "0.0"
      InputPlane1.SetHalfWidthExpr3D "0.5", "0.5"
      InputPlane1.SetTiltingAngleExpr3D "0"
      InputPlane1.SetLYPolarization3D
      InputPlane1.RefreshInputField

      Dim Reflection
      Set Reflection = ObservePtMgr.CreateObservationPoint ( ObservePtMgr.FindID( "ObservationPoint" ) )
      Reflection.SetCenter CDbl( 0.04 ), CDbl( 0 )
      Reflection.SetDepthExpr ""
      Reflection.SetEnabled True
      Reflection.Collect2DTE False, False
      Reflection.Collect2DTM False, False
      Reflection.Collect3D True, True, False, False, False, False

      Dim InBetween
      Set InBetween = ObservePtMgr.CreateObservationPoint ( ObservePtMgr.FindID( "ObservationPoint" ) )
      InBetween.SetCenter CDbl( 0.2 ), CDbl( 0 )
      InBetween.SetDepthExpr ""
      InBetween.SetEnabled True
      InBetween.Collect2DTE False, False
      InBetween.Collect2DTM False, False
      InBetween.Collect3D True, True, False, False, False, False

      Dim InsideMaterial
      Set InsideMaterial = ObservePtMgr.CreateObservationPoint ( ObservePtMgr.FindID( "ObservationPoint" ) )
      InsideMaterial.SetCenter CDbl( 0.8 ), CDbl( 0 )
      InsideMaterial.SetDepthExpr ""
      InsideMaterial.SetEnabled True
      InsideMaterial.Collect2DTE False, False
      InsideMaterial.Collect2DTM False, False
      InsideMaterial.Collect3D True, True, False, False, False, False

      NumIterations = 6

      For x = 1 to NumIterations
      InputPlane1.SetWaveLength x*0.1
      ParamMgr.Simulate
      Next

      This is the Macro I am using. I am trying to do a quasi 1-D simulation for a material. I have 1 continuous sinusoidal wave and 3 observation points. 1 behind the EM source, 1 between the EM source and the material, and 1 inside the material.

      I would like to repeat this simulation for several wavelengths and retrieve the electric field amplitude over time for all 3 observation points

    • #83861

      Hello, thank you for taking the time to reply.

      Dim Linear1
      Set Linear1 = WGMgr.CreateObj ( "WGLinear", WGMgr.FindID( "Linear" ) )
      Linear1.SetPosition 0.4, 0.002, 2.1, 0.002
      Linear1.SetAttr "WidthExpr", "0.1"
      Linear1.SetAttr "Depth", "0"
      Linear1.SetAttr "StartThickness", "0.000000"
      Linear1.SetAttr "EndThickness", "0.000000"
      Linear1.SetProfileName "ChannelPro1"
      Linear1.SetDefaultThicknessTaperMode True

      Dim InputPlane1
      Set InputPlane1 = InputPlaneMgr.CreateInputObj ("Continuous", "Rectangular", InputPlaneMgr.FindID( "InputPlane"), "Vertical" )
      'Common data for 2D and 3D.
      InputPlane1.SetPosition 0.08
      InputPlane1.SetDirection "Forward"
      InputPlane1.SetWaveLength "0.3"
      InputPlane1.SetEnabled True
      'Data for 2D.
      InputPlane1.SetAmplitudeOrPower "Amplitude", "1.0"
      InputPlane1.SetRefLocal
      InputPlane1.SetCenterPos "0.0"
      InputPlane1.SetHalfWidth "6.0"
      InputPlane1.SetTiltingAngle "0"
      'Data for 3D.
      InputPlane1.SetAmplitudeExpr3D "1.0"
      InputPlane1.SetRefLocal3D
      InputPlane1.SetCenterPosExpr3D "0.0", "0.0"
      InputPlane1.SetHalfWidthExpr3D "0.5", "0.5"
      InputPlane1.SetTiltingAngleExpr3D "0"
      InputPlane1.SetLYPolarization3D
      InputPlane1.RefreshInputField

      Dim Reflection
      Set Reflection = ObservePtMgr.CreateObservationPoint ( ObservePtMgr.FindID( "ObservationPoint" ) )
      Reflection.SetCenter CDbl( 0.04 ), CDbl( 0 )
      Reflection.SetDepthExpr ""
      Reflection.SetEnabled True
      Reflection.Collect2DTE False, False
      Reflection.Collect2DTM False, False
      Reflection.Collect3D True, True, False, False, False, False

      Dim InBetween
      Set InBetween = ObservePtMgr.CreateObservationPoint ( ObservePtMgr.FindID( "ObservationPoint" ) )
      InBetween.SetCenter CDbl( 0.2 ), CDbl( 0 )
      InBetween.SetDepthExpr ""
      InBetween.SetEnabled True
      InBetween.Collect2DTE False, False
      InBetween.Collect2DTM False, False
      InBetween.Collect3D True, True, False, False, False, False

      Dim InsideMaterial
      Set InsideMaterial = ObservePtMgr.CreateObservationPoint ( ObservePtMgr.FindID( "ObservationPoint" ) )
      InsideMaterial.SetCenter CDbl( 0.8 ), CDbl( 0 )
      InsideMaterial.SetDepthExpr ""
      InsideMaterial.SetEnabled True
      InsideMaterial.Collect2DTE False, False
      InsideMaterial.Collect2DTM False, False
      InsideMaterial.Collect3D True, True, False, False, False, False

      NumIterations = 6

      For x = 1 to NumIterations
      InputPlane1.SetWaveLength x*0.1
      ParamMgr.Simulate
      Next

      This is the Macro I am using. I am trying to do a quasi 1-D simulation for a material. I have 1 continuous sinusoidal wave and 3 observation points. 1 behind the EM source, 1 between the EM source and the material, and 1 inside the material.

      I would like to repeat this simulation for several wavelengths and retrieve the electric field amplitude over time for all 3 observation points

    • #81277
      Scott Newman
      Moderator

      The command you are looking for is in the VBScript manual and it is GetTimeSeries( String fieldcomponent ) so to export the Ex field for “InsideMaterial” as “InsideMaterial_Ex_#.f2d” where the # is the iteration number then you would need to place the following in your for loop after the ParamMgr.Simulate call

      Set inside_data = InsideMaterial.GetTimeSeries ( “Ex” )
      inside_data.WriteF2D (“InsideMaterial_Ex_” & x & “.f2d”

      You would need to repeat that line for each observation point / field component combination you need.

      Please note it is advised to put a wait command after the simulate before any processing or restarting the loop. So right after the ParamMgr.Simulate you should have a WGMgr.Sleep( 50 ).

      Scott

    • #83881
      Scott Newman
      Moderator

      The command you are looking for is in the VBScript manual and it is GetTimeSeries( String fieldcomponent ) so to export the Ex field for “InsideMaterial” as “InsideMaterial_Ex_#.f2d” where the # is the iteration number then you would need to place the following in your for loop after the ParamMgr.Simulate call

      Set inside_data = InsideMaterial.GetTimeSeries ( “Ex” )
      inside_data.WriteF2D (“InsideMaterial_Ex_” & x & “.f2d”

      You would need to repeat that line for each observation point / field component combination you need.

      Please note it is advised to put a wait command after the simulate before any processing or restarting the loop. So right after the ParamMgr.Simulate you should have a WGMgr.Sleep( 50 ).

      Scott

Viewing 8 reply threads
  • You must be logged in to reply to this topic.