Skip to content

Commit 08a1b89

Browse files
committed
Add output functionality for Code_Aster
1 parent 1b181e5 commit 08a1b89

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

cht/adapter.comm

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ isSteadyState = ("steady-state" in settings["simulation"]) and (settings["simula
3333
# Include case definition.comm.
3434
# Defines: MESH, MODEL, BC[], MAT[], MATS
3535
INCLUDE(UNITE=91)
36-
36+
3737
# ==========================================================================================
3838
# Create and initialize the adapter
3939
# ==========================================================================================
@@ -62,13 +62,13 @@ while adapter.isCouplingOngoing():
6262

6363
adapter.writeCheckpoint()
6464
adapter.readCouplingData()
65-
65+
6666
# ======================================================================================
6767
# Solve
6868
# ======================================================================================
69-
69+
7070
if isSteadyState:
71-
71+
7272
if participant["non-linear"]:
7373
TEMP = THER_NON_LINE(
7474
MODELE=MODEL,
@@ -92,12 +92,12 @@ while adapter.isCouplingOngoing():
9292
)
9393

9494
else:
95-
95+
9696
STEP = DEFI_LIST_REEL(
9797
DEBUT=time,
9898
INTERVALLE=(_F(JUSQU_A=time+dt, NOMBRE=1))
9999
)
100-
100+
101101
if participant["non-linear"]:
102102
TEMP = THER_NON_LINE(
103103
MODELE=MODEL,
@@ -134,11 +134,11 @@ while adapter.isCouplingOngoing():
134134
# Output if necessary
135135
k += 1
136136
if k % settings["simulation"]["output-frequency"] == 0:
137-
filename = "output-" + str(k) + ".rmed"
138-
DEFI_FICHIER(FICHIER=filename, UNITE=80)
139-
IMPR_RESU(FORMAT='MED', RESU=_F(RESULTAT=TEMP))
140-
call(["mv", filename, settings["base-path"] + "/" + participant["directory"]])
141-
DEFI_FICHIER(ACTION='LIBERER', UNITE=80)
137+
filename = "REPE_OUT/output-" + str(k) + ".rmed"
138+
DEFI_FICHIER(FICHIER=filename, UNITE=80+k, TYPE='BINARY')
139+
IMPR_RESU(FORMAT='MED', UNITE=80+k, RESU=_F(RESULTAT=TEMP))
140+
#call(["mv", filename, settings["base-path"] + "/" + participant["directory"]])
141+
DEFI_FICHIER(ACTION='LIBERER', UNITE=80+k)
142142

143143
# Use current solution as initial condition for the next time step
144144
if time > 0:
@@ -153,7 +153,7 @@ while adapter.isCouplingOngoing():
153153

154154
DETRUIRE(CONCEPT=_F(NOM=TEMP))
155155
DETRUIRE(CONCEPT=_F(NOM=T))
156-
156+
157157
if not isSteadyState:
158158
DETRUIRE(CONCEPT=_F(NOM=STEP))
159159

0 commit comments

Comments
 (0)