command_post.py 2.4 KB
Newer Older
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
import os,sys,shutil

from pylmgc90.chipy import *
from numpy import *

# plage de fichiers a traiter
min=1
max=40

names= ['DOF','GPV','Vloc_Rloc']

inters_dict={}
InitIntersToVTK(['CLALp'],inters_dict)


# nom du repertoire ou on va faire le post
tmp='post'

tmp=os.getcwd()+'/'+tmp+'/'

if os.path.isdir(tmp):
  print "Le repertoire ",tmp," existe deja, ca n'est pas la peine de le creer"

  # on teste la presence de DATBOX
  if os.path.isdir(tmp+'DATBOX'):
    # on le vire si il existe 
    shutil.rmtree(tmp+'DATBOX')

  shutil.copytree('./DATBOX',tmp+'DATBOX')
else:
  os.mkdir(tmp)
  shutil.copytree('./DATBOX',tmp+'DATBOX')

overall_SetWorkingDirectory(tmp)

print "C'est partie"

####

checkDirectories()

# ne sert pas a grand chose
dt = 1.

######## etat 0 ###########################

### computation's parameters definition ### 
overall_DIME(2,1)

utilities_logMes('INIT TIME STEPPING')
TimeEvolution_SetTimeStep(dt)

print 'READ BODIES'
MAILx_ReadBodies()

print 'READ MODELS'
models_ReadModels()

print 'READ BEHAVIOURS'
bulk_behav_ReadBehaviours()
tact_behav_ReadBehaviours()
### models initialization ###
print 'INIT MODELS'
models_InitModels()
ExternalModels_InitModels()

#LOADS
mecaMAILx_LoadModels()

mecaMAILx_LoadBehaviours()

mecaMAILx_PushProperties()
models_StoreProperties()
ExternalModels_CheckProperties()

CLxxx_LoadTactors()
ALpxx_LoadTactors()

### initial and boundary conditions ###
print 'READ INI DOF'
TimeEvolution_ReadIniDof()
mecaMAILx_ReadIniDof()

TimeEvolution_ReadIniGPV()
mecaMAILx_ReadIniGPV()

TimeEvolution_ReadIniVlocRloc()
CLALp_ReadIniVlocRloc()

90
91
fim = startCollection(tmp+'DISPLAY/mecafe.pvd')
fii = startCollection(tmp+'DISPLAY/inters.pvd')
92
93
94

k=0
utilities_logMes('tact')
95
writeMecafeToVTK(tmp+'DISPLAY/mecafe'+'_'+str(k)+'.vtu',fim,2)
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

for k in xrange(min,max+1,1):
    #
    utilities_logMes('on traite le set : '+str(k))
    #
    for name in names:    
      shutil.copy('./OUTBOX/'+name+'.OUT.'+str(k),tmp+'DATBOX/'+name+'.INI')

    utilities_logMes('READ INI DOF')
    TimeEvolution_ReadIniDof()
    mecaMAILx_ReadIniDof()

    TimeEvolution_ReadIniGPV()
    mecaMAILx_ReadIniGPV()

    utilities_logMes('tact')
112
    writeMecafeToVTK(tmp+'DISPLAY/mecafe'+'_'+str(k)+'.vtu',fim,2)
113
114
115
116
117

    TimeEvolution_ReadIniVlocRloc()
    CLALp_ReadIniVlocRloc()

    utilities_logMes('inter')
118
    writeIntersToVTK(tmp+'DISPLAY/inters'+'_'+str(k)+'.vtp',fii,inters_dict,0.3e-1)
119
120
121
122
123

stopCollection(fim)
stopCollection(fii)