Atom topic feed | site map | contact | login | Protection des données personnelles | Powered by FluxBB | réalisation artaban
You are not logged in.
Pages: 1
Hello,
In order to debug my simulation, I want to save the last converged step in my rmed before the simulation crashs. Is it possible to do so in Salome Meca / Code_aster ?
Thanks a lot for your help
Adrien
Offline
Hi APereira,
How exactly are you running your simulation? Is everything in a single .comm file (i.e. the IMPR_RESU operator printing the results to the MED file is in the same file as your e.g. STAT_NON_LINE)? If this is the case, then I'd recommend that you split your .comm file into 2 of them: one for the DEBUT procedure (where the material assignment, boundary condition definition, mesh group creations, etc., are defined) and in a second file the POURSUITE (i.e. continuation) procedure, which will contain everything related to your post-processing steps.
Here is a small example for your first file:
# Input file start
DEBUT(
LANG='en',
PAR_LOT='NON',
);
# Definition of material(s)
MAT_1=DEFI_MATERIAU(
...
);
# Define mesh file
MESH=LIRE_MAILLAGE(
FORMAT='MED',
UNITE=20,
);
# Creation of node groups and so ...
MESH=DEFI_GROUP(
CREA_GROUP_NO=_F(
...
),
MAILLAGE=MESH,
reuse=MESH,
);
# Model definition of phenomena and element types
MODEL=AFFE_MODELE(
AFFE=(
...
);
# First bc
BC_1=AFFE_CHAR_MECA(
...
);
# Second bc
BC[1]=AFFE_CHAR_CINE(
...
);
# and more
# Nonlinear static analysis definition
SIM=STAT_NON_LINE(
CARA_ELEM=CARAELEM,
CHAM_MATER=MAT_1,
EXCIT=(_F(
CHARGE=BC_1,
),
_F(
CHARGE=BC_2,
),
),
# And whatever other setting you might have or want
);
# End of your simulation step (WITHOUT POSTPROCESSING)
FIN(
INFO_RESU='NON',
RETASSAGE='NON',
);
In a second file:
# Input file start
POURSUITE(
IGNORE_ALARM=('SUPERVIS_1', 'ALGORITH11_87'),
LANG='en',
PAR_LOT='NON',
IMPR_MACRO='OUI'
);
# Solution fields in file
IMPR_RESU(
FORMAT='MED',
RESU=(
... # Whatever field you'd like to post-process
),
UNITE=80,
);
# End of your post-processing step
FIN(
INFO_RESU='NON',
RETASSAGE='NON',
);
Now, I normally run my simulations with as_run by executing from the terminal:
as_run simulation.export
and subsequently:
as_run postproc.export
where simulation.export and postproc.export would look something like this, respectively:
P actions make_etude
P aster_root <PATH_TO_YOUR_ASTER_INSTALATION>
#OTHER SYSTEM CONFIGURATION, DEPENDING ON YOUR CASE (memory and whatnot)
P rep_trav <#IMPORTANT: here goes the PATH where the global directory will be written to. This directory will contain all partial/complete data generated by your simulation (independently whether it was successful or not, meaning that if you had already some written steps, they'll appear here)>
F comm PATH_TO_YOUR_SIMULATION_COMM/simulation.comm D 1
F mmed PATH_TO_YOUR_MED_MESH D/mesh.med D 20
F mess PATH_TO_YOUR_SIMULATION_MESSAGES/messages.mess R 6
F erre PATH_TO_YOUR_ERROR_MESSAGES/errors.mess R 9
and:
P actions make_etude
P aster_root <PATH_TO_YOUR_ASTER_INSTALATION>
#OTHER SYSTEM CONFIGURATION, DEPENDING ON YOUR CASE (memory and whatnot)
P rep_trav <#IMPORTANT: here goes the PATH where the global directory was written to. This directory will contain all partial/complete data generated by your simulation (independently whether it was successful or not, meaning that if you had already some written steps, they'll appear here) and will be used in this step as a starting point>
F comm PATH_TO_YOUR_POSTPROC_COMM/postproc.comm D 1
F rmed PATH_TO_YOUR_RESULT_MED_MESH D/result.rmed R 80
F mess PATH_TO_YOUR_POURSUITE_MESSAGES/postproc.mess R 6
F erre PATH_TO_YOUR_ERROR_MESSAGES/errors.mess R 9
If you instead use ASTK within Salome Meca, then all the info in the .export files is exactly the one that you will fill in there (but with a somehow "nicer" UI).
Now, if you use AsterStudy... then I cannot further help you
With this you should at least be able to access the last converged simulation step (ofc, as long as you printed it out in ARCHIVAGE or something alike)
Cheers,
Guillermo
Offline
Hello,
In order to debug my simulation, I want to save the last converged step in my rmed before the simulation crashs. Is it possible to do so in Salome Meca / Code_aster ?
Thanks a lot for your help
Adrien
Hi!
Add in .comm python clause try/except, like:
try:
res = STAT_NON_LINE
....
except:
pass
Regards
Offline
Add in .comm python clause try/except, like:
You are right, this might be an easier approach if you want to keep it on the same .comm file as per in this document: code-aster.org/V2/doc/v14/en/man_d/d5/d5.01.02.pdf (page 8, 5.5. Recovery of the exceptions in macro):
try:
__resu = STAT_NON_LINE (...)
except NonConvergenceError ace exc:
resu = self.get_last_concept ()
# I assume here you'll have to do your IMPR_RESU:
IMPR_RESU(RESULTAT=resu, FORMAT='MED')
Guillermo
Offline
Pages: 1