hello,
1. i just put an empty .prb file so that gid recognizes
the TclTkExample.gid as a problem type.
I didn't define any condition, materials nor problem
data, so the other files are not needed.
( .cnd, .bas, .mat, .bas)
2. Sure, you can have as many tcl files as you want, but
remember to use the 'source' tcl-command in your
'proc InitGidProject {}' routine. For examle:
YourProblemType.tcl:
(...)
proc InitGIDProject { dir } {
(...)
set YourProblemTypeDirectory $dir
source [ file join $YourProblemTypeDirectory AnotherTclFile1.tcl]
source [ file join $YourProblemTypeDirectory AnotherTclFile2.tcl]
source [ file join $YourProblemTypeDirectory AnotherTclFile3.tcl]
(...)
}
(...)
This 'source' command reads and executes the contents of these files,
so if you define procedures/functions/commands inside these files,
after the 'source' command you can use them.
3. by now there is no way to make tcl-files hidden to the user, or to
encrypt them.
One way is to have the tcl-files encrypted and let the 'InitGIDProject'
call an external program do unencrypt them, make the 'source', and
delete the unencrypted files. Once the 'source' command is issued,
the other tcl-files are not longer needed, so you can delete them.
YourProblemType.tcl:
(...)
proc InitGIDProject { dir } {
(...)
set YourProblemTypeDirectory $dir
set old_dir [ pwd]
cd TemporaryDirectory "YourTemporalDirectory"
foreach file "AnotherTclFile1.tcl AnotherTclFile2.tcl AnotherTclFile3.tcl" {
set abs_file [ file join $YourProblemTypeDirectory $file]
set tmp_file [ file join $TemporaryDirectory $file.tmp]
exec [ file join $YourProblemTypeDirectory Unencrypt] $abs_file $tmp_file
source $tmp_file
file delete $tmp_file
}
cd $old_dir
(...)
}
(...)
4. the reason for the files to be present is to allow user to view, mesh the
project on another machine, or pass the example to another colegue,
to view the materials assignement, conditions, problem data, and so on,
with no need to copy the whole problem type.
Also avoids compatibility problems which surely appears when something
is changed in the conditions, materials or problem data of the problem
type and the data from the project can not be matched with the new rules.
Instead of having a useless project, with this method you still have a
useful and working project. There is a posibility to change, actualize
the problem type of an old project inside GiD.
Note that nor the .tcl files, nor the calculation executable are copied
to the project.gid directory.
beside this, the size of these files is insignificant to the sizes of
the .msh, .geo or the .dat file of a big project ( thousand of surfaces
or millions of elements).
hope it helps.
miguel
Vilaysak Sayakoummane wrote:
Hi there
Thank Miguel and Ramon for your replying. Miguel
thank again for your attached files. In addition, what
I need to know more are:
1. How all the files,refer to your ProblemType
tclTkExample files, (TclTkExample.cnd,
TcltkExample.prb, clTkExample.mat, TclTkExample.bas,
and so on. These files are standard file in
problemtype_name) work in this new Menu
TclTkExample.
2. Can we have TclTk file in the Problemtype_name more
than 1? in case I need to create more windows and more
modifications? if this file could be only 1 name then
it would be to big to get lost easily.
3. How can we make ProblemType_name files as hidden
files,. in case we don't want the Users see our source
codes.
4. How could we avoid having all the files like files
.cnd, *.prb, *.mat, *.unit rewritten again in the
project_name files. For example, I run my project
problem in my problemType_name (Fanthom.gid) and I
save the project problem as "cantilever.gid".. After
clicking Calculate then I got the results..In this
folder cantilever.gid, why I still have those files
cantilever.cnd, cantilever.prb, cantilever.mat
actullay those files are unnecessary to be written out
again. This is waste of computer memories. Do you have
any option to avoid having those files written out
again?
Regards
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
--
--------------------------------------------------------------------------------
Miguel A. de Riera Pasenau
miguel at cimne.upc.es http://gid.cimne.upc.es