summaryrefslogtreecommitdiff
path: root/Yacs++/data/PowThm.py
blob: 2ba7bf0216fa4b157a6127eac17cc7ca780debd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import os
from module_generator import Generator,Module,Service
from module_generator import CPPComponent, PYComponent

MACH=os.uname()[0]+'_'+os.uname()[4]
HOME=os.getenv("HOME")
VERSION5=os.getenv("VERSION5")
KERNEL=os.getenv("SALOME_KERNEL")
PREREQUISITES=os.getenv("SALOME_KERNEL")+"/../env_build.sh"
print "YACSGEN: install POW/THM components on "+MACH
print "         Salome kernel: "+KERNEL

context={"update":1,
	"makeflags":"-j2",
	"prerequisites":HOME+"/salome_6.6.0/env_build.sh",
	"kernel":KERNEL
        }

#--------------
# Composant POW
#--------------
POW=CPPComponent("Composant_POW",
	services=[
		Service("runPOW",
			defs="""
#include "POW.hxx"
			""",
			inport=[("Power", "double"),],
			instream=[("fuel_temperature","CALCIUM_real", "I"),
				  ("water_temperature","CALCIUM_real", "I"),
				  ("water_density","CALCIUM_real", "I"),
				  ("continueLoop","CALCIUM_integer", "I")],
			outstream=[("powerTab","CALCIUM_real", "I"),
				  ("irradiationTab","CALCIUM_real", "I")],
			body="""
POW pow_;
pow_.initialize(Power, component);
pow_.run();
			""",
		),
	],
        libs="-L"+VERSION5+"/Yacs++/lib/"+MACH+" -lYacs++" \
            " -L"+VERSION5+"/Skin++/lib/"+MACH+" -lSkin++" \
            " -L"+VERSION5+"/Ganlib/lib/"+MACH+" -lGanlib" \
            " -L"+VERSION5+"/Donjon/lib/"+MACH+" -lDonjon" \
            " -L"+VERSION5+"/Dragon/lib/"+MACH+" -lDragon" \
            " -L"+VERSION5+"/Trivac/lib/"+MACH+" -lTrivac" \
            " -L"+VERSION5+"/Utilib/lib/"+MACH+" -lUtilib" \
            " -L"+VERSION5+"/Ganlib/lib/"+MACH+" -lGanlib" \
            " -lgfortran",
        includes="-I"+VERSION5+"/Yacs++/src" \
                " -I"+VERSION5+"/Skin++/src" \
                " -I"+VERSION5+"/Ganlib/src"
)

#--------------
# Composant THM
#--------------
THM=CPPComponent("Composant_THM",
	services=[
		Service("runTHM",
			defs="""
#include "THM.hxx"
			""",
			instream=[("powerTab","CALCIUM_real", "I"),
				  ("irradiationTab","CALCIUM_real", "I")],
			outstream=[("fuel_temperature","CALCIUM_real", "I"),
				  ("water_temperature","CALCIUM_real", "I"),
				  ("water_density","CALCIUM_real", "I"),
				  ("continueLoop","CALCIUM_integer", "I")],
			body="""
THM thm_;
thm_.initialize(component);
thm_.run();
			""",
		),
	],
        libs="-L"+VERSION5+"/Yacs++/lib/"+MACH+" -lYacs++" \
            " -L"+VERSION5+"/Skin++/lib/"+MACH+" -lSkin++" \
            " -L"+VERSION5+"/Ganlib/lib/"+MACH+" -lGanlib" \
            " -L"+VERSION5+"/Donjon/lib/"+MACH+" -lDonjon" \
            " -L"+VERSION5+"/Dragon/lib/"+MACH+" -lDragon" \
            " -L"+VERSION5+"/Trivac/lib/"+MACH+" -lTrivac" \
            " -L"+VERSION5+"/Utilib/lib/"+MACH+" -lUtilib" \
            " -L"+VERSION5+"/Ganlib/lib/"+MACH+" -lGanlib" \
            " -lgfortran",
        includes="-I"+VERSION5+"/Yacs++/src" \
                " -I"+VERSION5+"/Skin++/src" \
                " -I"+VERSION5+"/Ganlib/src"
)

g=Generator(Module("couplage_module",components=[POW, THM],prefix="./DonjonTHM_install"),context)
g.generate()
g.bootstrap()
g.configure()
g.make()
g.install()
g.make_appli("PowThm_appli",
             restrict=["KERNEL","GUI","COMPONENT","YACS","CALCULATOR"])