Multiple Solver Instances in GUI & sif Synchronization
Posted: 12 Feb 2018, 13:11
Hi,
It is a neat idea to allow users to add solver tabs (that don't exist by default) to the GUI using custom tailored xml files (or via File>Definitions… menu items). This feature could potentially eliminate the need for manual sif file modifications, but in its present form it still can't do it.
The problem is that one can add only one unique functional instance of a solver to the GUI, which might not be sufficient for many cases. For example in this sif file:
(The associated mesh and project file can be found in this thread: viewtopic.php?f=3&t=4916&start=0)
we have to add two unique FluxSolver sections to the sif file, which can't be done using the GUI, not even with the help of an xml file (at least I couldn't do it via File>Definitions… menu items).
If the developers want this feature to really work, then the GUI code needs to be modified to allow multiple instances of the same solver (with different IDs and content) in the GUI (and in the sif file).
Another suggestion is to modify the GUI in such a way as to establish an automatic bidirectional live synchronization between the GUI model and the sif file. What is in the sif file, should be also in the GUI model, and vice versa.
When the user opens a sub-menu item in the Model menu to modify it, the code should read the relevant data from the sif file and use/show that in the GUI. When the user closes a Model sub-menu popup window, the data it contains (which might have been modified by the user) should be automatically written to the sif file. This way the model data is stored at only one place, in the sif file, and the GUI data will be an identical copy of the sif file. This will also allow users to manually modify the sif file, and the changes will be mirrored in the GUI as well, so they can continue to use the GUI for further adjustments.
Zoltan
It is a neat idea to allow users to add solver tabs (that don't exist by default) to the GUI using custom tailored xml files (or via File>Definitions… menu items). This feature could potentially eliminate the need for manual sif file modifications, but in its present form it still can't do it.
The problem is that one can add only one unique functional instance of a solver to the GUI, which might not be sufficient for many cases. For example in this sif file:
Code: Select all
$ Density_M = 1.205
$ Angular_Frequency_M = 2155
Header
CHECK KEYWORDS Warn
Mesh DB "." "."
Include Path ""
Results Directory ""
End
Simulation
Max Output Level = 10
Coordinate System = Cartesian
Coordinate Mapping(3) = 1 2 3
Simulation Type = Steady state
Steady State Max Iterations = 1
Output Intervals = 1
Timestepping Method = BDF
BDF Order = 1
Solver Input File = tube.sif
Post File = tube.ep
End
Constants
Gravity(4) = 0 -1 0 9.82
Stefan Boltzmann = 5.67e-08
Permittivity of Vacuum = 8.8542e-12
Boltzmann Constant = 1.3807e-23
Unit Charge = 1.602e-19
End
Body 1
Target Bodies(1) = 1
Name = "Body Property 1"
Equation = 1
Material = 1
Initial condition = 1
End
Solver 1
Equation = Helmholtz Equation
Procedure = "HelmholtzSolve" "HelmholtzSolver"
Variable = -dofs 2 Pressure Wave
Stabilize = True
Bubbles = False
Lumped Mass Matrix = False
Optimize Bandwidth = True
Steady State Convergence Tolerance = 1.0e-5
Nonlinear System Convergence Tolerance = 1.0e-8
Nonlinear System Max Iterations = 20
Nonlinear System Newton After Iterations = 3
Nonlinear System Newton After Tolerance = 1.0e-3
Nonlinear System Relaxation Factor = 1
Linear System Solver = Direct
Linear System Direct Method = Banded
End
Solver 2
Equation = "flux compute 1"
Procedure = "FluxSolver" "FluxSolver"
Calculate Flux = Logical True
Target Variable = String "Pressure Wave 2"
Flux Coefficient = String "Cv"
Linear System Solver = Direct
Linear System Direct Method = Banded
End
Solver 3
Equation = "flux compute 2"
Procedure = "FluxSolver" "FluxSolver"
Calculate Flux = Logical True
Target Variable = String "Pressure Wave 1"
Flux Coefficient = String "Cv"
Linear System Solver = Direct
Linear System Direct Method = Banded
End
Solver 4
Equation = Result Output
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Save Geometry Ids = False
Output File Name = tube
Output Format = Vtu
Scalar Field 2 = Pressure wave 2
Scalar Field 1 = Pressure wave 1
Vector Field 1 = Pressure wave 2 flux
Vector Field 2 = Pressure wave 1 flux
End
Equation 1
Name = "Helmholtz"
Angular Frequency = $ Angular_Frequency_M
Active Solvers(4) = 1 2 3 4
End
Material 1
Name = "Air (room temperature)"
Viscosity = 1.983e-5
Heat expansion Coefficient = 3.43e-3
Heat Conductivity = 0.0257
Relative Permittivity = 1.00059
Sound speed = 343.0
Heat Capacity = 1005.0
Density = $ Density_M
Cv = Real $ 1/(Density_M * Angular_Frequency_M)
End
Initial Condition 1
Name = "InitialCondition 1"
Pressure Wave 1 = 0
Pressure Wave 2 = 0
End
Boundary Condition 1
Target Boundaries(1) = 6
Name = "In"
Pressure Wave 2 = 0
Pressure Wave 1 = 100
End
Boundary Condition 2
Target Boundaries(4) = 2 3 4 5
Name = "Walls"
Wave Flux 1 = 0
Wave Flux 2 = 0
End
Boundary Condition 3
Target Boundaries(1) = 1
Name = "Out"
Wave impedance 1 = 343
Wave impedance 2 = 0
End
we have to add two unique FluxSolver sections to the sif file, which can't be done using the GUI, not even with the help of an xml file (at least I couldn't do it via File>Definitions… menu items).
If the developers want this feature to really work, then the GUI code needs to be modified to allow multiple instances of the same solver (with different IDs and content) in the GUI (and in the sif file).
Another suggestion is to modify the GUI in such a way as to establish an automatic bidirectional live synchronization between the GUI model and the sif file. What is in the sif file, should be also in the GUI model, and vice versa.
When the user opens a sub-menu item in the Model menu to modify it, the code should read the relevant data from the sif file and use/show that in the GUI. When the user closes a Model sub-menu popup window, the data it contains (which might have been modified by the user) should be automatically written to the sif file. This way the model data is stored at only one place, in the sif file, and the GUI data will be an identical copy of the sif file. This will also allow users to manually modify the sif file, and the changes will be mirrored in the GUI as well, so they can continue to use the GUI for further adjustments.
Zoltan