]> SALOME platform Git repositories - tools/yacsgen.git/blob - Examples/ast2/components.py
Salome HOME
CCAR: add two examples with Code_Aster : ast1 and ast2
[tools/yacsgen.git] / Examples / ast2 / components.py
1 """
2  Example with one Code_Aster component and one fortran component
3 """
4 import os
5 from module_generator import Generator,Module,ASTERComponent,Service,F77Component
6
7 context={'update':1,"prerequisites":"/local/cchris/.packages.d/envSalome50",
8           "kernel":"/local/chris/SALOME2/RELEASES/Install/KERNEL_V5"}
9 aster_home="/local/chris/ASTER/instals"
10 aster_root=os.path.join(aster_home,"NEW9")
11 asrun=os.path.join(aster_home,"ASTK/ASTK_SERV/bin/as_run")
12
13 fcompodir=os.path.join(os.getcwd(),"fcompo")
14 myasterdir=os.path.join(os.getcwd(),"myaster","bibpyt")
15 install_prefix="./install"
16 appli_dir="appli"
17 export="""F exec %s D 0
18 R cmde %s D 0
19 """ % (os.path.join(os.getcwd(),"myaster","aster.exe"),os.path.join(os.getcwd(),"myaster","commande"))
20
21 c1=ASTERComponent("caster",services=[
22           Service("s1",inport=[("argv","string"),("a","double"),("b","long"),("c","string")],
23                        outport=[("d","double")],
24                        instream=[("aa","CALCIUM_double","T"),("ab","CALCIUM_double","I"),
25                                  ("ac","CALCIUM_integer","I"),("ad","CALCIUM_real","I"),
26                                  ("ae","CALCIUM_string","I"),("af","CALCIUM_complex","I"),
27                                  ("ag","CALCIUM_logical","I"),
28                          ],
29                        outstream=[("ba","CALCIUM_double","T"),("bb","CALCIUM_double","I")],
30                  ),
31          ],
32          aster_dir=aster_root,
33          exe_path=os.path.join(os.getcwd(),"exeaster"),
34          asrun=asrun,
35          kind="exe",
36          export_extras=export,
37          )
38           
39 c2=F77Component("cfort",services=[
40           Service("s1",inport=[("a","double"),("b","long"),("c","string")],
41                        outport=[("d","double"),("e","long"),("f","string")],
42                        instream=[("a","CALCIUM_double","T"),("b","CALCIUM_double","I")],
43                        outstream=[("ba","CALCIUM_double","T"),("bb","CALCIUM_double","I"),
44                                   ("bc","CALCIUM_integer","I"),("bd","CALCIUM_real","I"),
45                                   ("be","CALCIUM_string","I"),("bf","CALCIUM_complex","I"),
46                                   ("bg","CALCIUM_logical","I"),
47                          ],
48                        defs="",body="",
49                  ),
50          ],
51          kind="exe",
52          exe_path=os.path.join(fcompodir,"prog"),
53          )
54
55 g=Generator(Module("astmod",components=[c1,c2],prefix=install_prefix),context)
56 g.generate()
57 g.bootstrap()
58 g.configure()
59 g.make()
60 g.install()
61 g.make_appli(appli_dir,restrict=["KERNEL","GUI","YACS"])