Automatic resizing in the data tree window

Moderator: GiD Team

Post Reply
fcdiass
Posts: 16
Joined: Fri Nov 08, 2019 8:04 pm

Automatic resizing in the data tree window

Post by fcdiass »

When using the new problem type approach (with the customlib), is possible to change the state of some fields from 'hidden' to 'normal' and vice versa.

Considering the GiD version 14, the opened window is adjusted according to the number of fields with the state 'hidden' or 'normal'. However, in version 15 it does not happen and, sometimes, it causes a very uncomfortable experience for the user.

For example, the following code shows this strange behavior in versions 14 and 15 of GiD:

Code: Select all

    <container n="numericalSolver" pn="Numerical solver" state="normal" icon="tree/SolverOption" help="Numerical solver">
		<value n="n_typeName" pn="Solver type" v="ArmadilloSolver" values="ArmadilloSolver,LisSolver" dict="ArmadilloSolver,Direct - Armadillo,LisSolver,Iterative - Lis" state='normal' help="Select an option">
		
			<dependencies value='ArmadilloSolver' node="../value[@tag1='nSolv']" att1="state" v1='hidden' actualize="1"/>
			<dependencies value='ArmadilloSolver' node="../value[@n='n_advancedOptions']" att1="v" v1='No' actualize="1"/>
            
			<dependencies value='LisSolver' node="../value[@tag1='nSolv']" att1="state" v1='hidden' actualize="1"/>
			<dependencies value='LisSolver' node="../value[@n='n_solverMethod' or @n='n_precond' or @n='n_maxIter' or @n='n_tol' or @n='n_printIterations' or @n='n_advancedOptions']" att1="state" v1='normal' actualize="1"/>
            
		</value>
        
        <!-- solverMethod -->
		<value n="n_solverMethod"    pn="Solver method"         tag1='nSolv' v="bicgstab" values="jacobi,gs,sor,cg,bicg,cgs,bicgstab,gmres" editable="0" state="hidden" actualize="1" help="Solver method options\n\n - jacobi: Jacobi\n - gs: Gauss-Seidel\n - sor: Successive over-relaxation\n - cg: Conjugated Gradient\n - bicg: Biconjugated Gradient\n - cgs: Conjugated Gradient-Squared\n - bicgstab: Biconjugated Gradient Stabilized\n - gmres: Generalized Minimal Residual">
            <dependencies condition="@v!='sor'"   node="../value[@n='n_sorOmega']"     att1="state" v1='hidden' actualize="1"/>
            <dependencies condition="@v!='gmres'" node="../value[@n='n_gmresRestart']" att1="state" v1='hidden' actualize="1"/>
            
			<dependencies value='sor'   node="../value[@n='n_sorOmega']"     att1="state" v1='normal' actualize="1"/>
			<dependencies value='gmres' node="../value[@n='n_gmresRestart']" att1="state" v1='normal' actualize="1"/>
        </value>
        
            <!-- solverMethod optionals -->
            <value n="n_sorOmega"        pn="sorOmega"      tag1='nSolv' v="1.9"    string_is="double"  editable="1" state="hidden"  actualize="1" help="sorOmega" />
            <value n="n_gmresRestart"    pn="gmresRestart"  tag1='nSolv' v="40"     string_is="integer" editable="1" state="hidden"  actualize="1" help="gmresRestart" />

		<value n="n_precond" pn="Preconditioner" tag1='nSolv' v="none" values="none,jacobi,ssor,ilu,ilut,iluc,sainv" editable="0" state="hidden" actualize="1" help="Preconditioner options:\n\n - none: without preconditioner\n - jacobi: Jacobi\n - ssor: Symmetric successive over-relaxation\n - ilu: Incomplete LU(k) factorization\n - ilut: Dual Threshold Incomplete LU Factorization\n - iluc: Crout ILU\n - sainv: Stabilized Approximate Inverse">
            <dependencies condition="@v!='ssor'"  node="../value[@n='n_ssorOmega']"                   att1="state" v1='hidden' actualize="1"/>
            <dependencies condition="@v!='ilu'"   node="../value[@n='n_iluFill']"                     att1="state" v1='hidden' actualize="1"/>
            <dependencies condition="@v!='iluc'"  node="../value[@n='n_ilucDrop' or @n='n_ilucRate']" att1="state" v1='hidden' actualize="1"/>
            <dependencies condition="@v!='sainv'" node="../value[@n='n_sainvDrop']"                   att1="state" v1='hidden' actualize="1"/>
            
			<dependencies value='ssor'  node="../value[@n='n_ssorOmega']"                   att1="state" v1='normal' actualize="1"/>
			<dependencies value='ilu'   node="../value[@n='n_iluFill']"                     att1="state" v1='normal' actualize="1"/>
			<dependencies value='iluc'  node="../value[@n='n_ilucDrop' or @n='n_ilucRate']" att1="state" v1='normal' actualize="1"/>
			<dependencies value='sainv' node="../value[@n='n_sainvDrop']"                   att1="state" v1='normal' actualize="1"/>
        </value>
        
            <!-- precond optionals -->
            <value n="n_ssorOmega" pn="ssorOmega" tag1='nSolv' v="1.9"  string_is="double"  editable="1" state="hidden"  actualize="1" help="Value must be between 0 and 2" />
            <value n="n_iluFill"   pn="iluFill"   tag1='nSolv' v="0"    string_is="integer" editable="1" state="hidden"  actualize="1" help="Fill level of the ILU(k)" />
            <value n="n_ilucDrop"  pn="ilucDrop"  tag1='nSolv' v="0.05" string_is="double"  editable="1" state="hidden"  actualize="1" help="Drop criterion" />
            <value n="n_ilucRate"  pn="ilucRate"  tag1='nSolv' v="5.0"  string_is="double"  editable="1" state="hidden"  actualize="1" help="Ratio of the maximum value used in fill-in strategy" />
            <value n="n_sainvDrop" pn="sainvDrop" tag1='nSolv' v="0.05" string_is="double"  editable="1" state="hidden"  actualize="1" help="Drop criterion" />
            
        <value n="n_maxIter"         pn="Max. number of iter."  tag1='nSolv' v="1000"     string_is="integer" editable="1" state="hidden"  actualize="1" help="Maximum number of iterations" />
        <value n="n_tol"             pn="Convergence tolerance" tag1='nSolv' v="1e-12"    string_is="double"  editable="1" state="hidden"  actualize="1" help="Convergence tolerance" />
        <value n="n_printIterations" pn="Print iterations"      tag1='nSolv' v="true"     values="true,false" editable="0" state="hidden"  actualize="1" help="Print iterations" />
        
        
        <!-- Advanced options -->
        <value n="n_advancedOptions" pn="Advanced options"      tag1='nSolv' v="No"     values="No,Yes" editable="0" state="hidden"  actualize="1" help="Advanced options">
            <dependencies value="No"  node="../value[@n='n_threads' or @n='n_precision' or @n='n_convCond']" att1="state" v1="hidden"/> 
            <dependencies value="Yes" node="../value[@n='n_threads' or @n='n_precision' or @n='n_convCond']" att1="state" v1="normal"/> 
        </value>
        
        <value n="n_threads"         pn="Threads (0 = Max.)"    tag1='nSolv' v="0"        string_is="integer"  editable="1" state="hidden" actualize="1" help="Number of threads (0 = Max.)" />
		<value n="n_precision"       pn="Precision"             tag1='nSolv' v="double"   values="double,quad" editable="0" state="hidden" actualize="1" help="Precision"/>
		<value n="n_convCond"        pn="Convergence condition" tag1='nSolv' v="nrm2_r"   values="nrm2_r,nrm2_b,nrm1_b" editable="0" state="hidden" actualize="1" help="Convergence condition"/>
        
    </container>
  • Behavior with GiD version 14:
    A double cick in the container "Numerical solver" in data tree open the following window:
    GiD_14_window_1.png
    GiD_14_window_1.png (12.48 KiB) Viewed 2466 times
    If the value is changed in the box 'Solver type' to 'Iterative - Lis' option, the window in the data tree is resized to contain more information:
    GiD_14_window_2.png
    GiD_14_window_2.png (35.44 KiB) Viewed 2466 times
  • Behavior with GiD version 15:
    A double cick in the container "Numerical solver" in data tree open the following window (similar to version 14):
    GiD_15_window_1.png
    GiD_15_window_1.png (12.28 KiB) Viewed 2466 times
    If the value is changed in the box 'Solver type' to 'Iterative - Lis' option, the window in the data tree is not resized, but a scrollbar is added:
    GiD_15_window_2.png
    GiD_15_window_2.png (12.34 KiB) Viewed 2466 times
In my opinion, the solution adopted in version 14 is much more elegant. I would like to know if is there something that I could do to reproduce the behavior of version 14 in version 15.
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Automatic resizing in the data tree window

Post by escolano »

You are right that the 'old behavior' looks better for a case like yours.
But the 'new behavior' solve a problem (a lot of fields or a small screen size) with an 'scrollable container'.
What happen if the problemtype define more fields that the available screen space ?
Then the last fields become unfeasible: the user is not able to see or fill them!!

We will try to enhance the current behavior in next GiD versions, to look better in several scenaries, but It is difficult to have good control of sizes with scrolled widgets.

About the trick that you want to do: yes, you can set this Tcl global variable to 1 to have the old behavior
set ::CUSTOM_LIB_WINDOW_VALUES_SCROLLED 1
you can do it for example in the event of load your problemtype

Code: Select all

proc GiD_Event_InitProblemtype { dir } {
  set ::CUSTOM_LIB_WINDOW_VALUES_SCROLLED 1  
}
Post Reply