- This topic has 3 replies, 2 voices, and was last updated 1 year, 7 months ago by Sawyer Ge.
-
AuthorPosts
-
-
January 1, 1970 at 12:00 am #81253Scott NewmanModerator
(Awaiting moderation)
-
January 1, 1970 at 12:00 am #83857Scott NewmanModerator
(Awaiting moderation)
-
April 26, 2023 at 2:33 pm #79994Timothy YangMember
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
-
April 26, 2023 at 2:33 pm #81255Scott NewmanModerator
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
-
April 26, 2023 at 2:33 pm #83859Scott NewmanModerator
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
-
April 27, 2023 at 1:19 am #81257Alysa WooldridgeMember
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 TrueDim 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.RefreshInputFieldDim 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, FalseDim 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, FalseDim 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, FalseNumIterations = 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
-
April 27, 2023 at 1:19 am #83861Alysa WooldridgeMember
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 TrueDim 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.RefreshInputFieldDim 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, FalseDim 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, FalseDim 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, FalseNumIterations = 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
-
May 1, 2023 at 2:36 pm #81277Scott NewmanModerator
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
-
May 1, 2023 at 2:36 pm #83881Scott NewmanModerator
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
-
-
AuthorPosts
- You must be logged in to reply to this topic.