Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2019-09-11 04:01:14

maxmss
Member
Registered: 2019-09-03
Posts: 9

EXTR_TABLE still works to extract data from the Post_Releve_T table?

Hello everyone,

I did a thermal analysis and then I got the results with POST_RELEVE_T, now I want to extract the data from the table in a variable as follows:

T1=POST_RELEVE_T(ACTION=_F(OPERATION='EXTRACTION',
                                 INTITULE='Temperature',
                                 RESULTAT=TEMP,
                                 NOM_CHAM='TEMP',
                                 TOUT_ORDRE='OUI',
                                 GROUP_NO=('MNODOS'),
                                 TOUT_CMP='OUI',),);

VAR1 = T1.EXTR_TABLE();

IMPR_RESU(FORMAT='MED',
          RESU=_F(RESULTAT=TEMP,),);

but it doesn't seem to work, when open my .comm file,  in the case view ( data settings) appears: "Invalid: Syntax Problem" in the variable category.

I'm using salome 8.

I really appreciate your help.

Best regards,
Max

Offline

#2 2019-09-11 07:18:04

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,569

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

hello

as far as i know  this command, VAR1 = T1.EXTR_TABLE(), is unknwon to code_aster
maybe the operator CALC_TABLE should do the job, read the doc

jean pierre aubry

Offline

#3 2019-09-11 10:34:06

chenghui62000
Member
From: Norway
Registered: 2018-06-19
Posts: 79

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

Can you upload your mess file to make the question clearer?
For me, I have used the table.EXTR_TABLE() in my study successfully.
Best regards,
Hui Cheng

Offline

#4 2019-09-11 18:09:30

maxmss
Member
Registered: 2019-09-03
Posts: 9

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

Thank you both for your answers.

Mr.  Jean Pierre Aubry, the document I read to do the above is called "Methods Python of access to the objects Aster", this document is of 2015. I don't know if this instruction is still available in Salome-Meca 8.


Perhaps it is necessary to clarify what I want to do.
I have a 3d model to which I apply a temperature restriction with TEMP_IMPO, and two heat flows: one defined by a formula and using AFFE_CHAR_THER_F, the other is simply a normal heat flow with AFFE_CHAR_THER.

The heat flux by formula is defined as follows:
Q= (A/L)(K)(Tref - Tfl)

At the beginning all the parameters of the formula are given by the user. What I want to do is get the temperature values (with POST_RELEVE_T) of the surface of my model and after replace the temperature values in the heat formula mentioned above in Tfl, it means turning Tfl into a variable.

This is an iterative process in which code aster initially applies the thermal loads, solve with THER_NON_LINE, then reads the surface temperature values and with these values it introduces them back to the heat formula and then repeats the process until obtaining a desired temperature range on the surface.

For this reason first get the temperatures values with POST_RELEVE_T, and then save the data in a variable using Var1 = Table.EXTR_TABLE () to access the temperature value in a specific node or the average temperature in a group of nodes. Finally, in a python loop I will try to replace this value in the heat formula. Is what I want to do possible?


I attach my .comm and .mess file

Max

Last edited by maxmss (2019-09-12 06:29:56)


Attachments:
heatm.zip, Size: 3.85 KiB, Downloads: 12

Offline

#5 2019-09-12 13:34:12

chenghui62000
Member
From: Norway
Registered: 2018-06-19
Posts: 79

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

you can use  DEBUT(PAR_LOT='NON')  instead of DEBUT()
and try again

Offline

#6 2019-09-12 18:15:30

maxmss
Member
Registered: 2019-09-03
Posts: 9

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

I already tried but it doesn't seem to work.
The error says that the name with which I save the table with POST_RELEVE_T is not defined (T1).

do you have any example where you use this instruction Table.EXTR_TBL(); ?


Best regards,
Max

Offline

#7 2019-09-13 07:10:09

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,569

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

hello

read carefully the .mess file, it says

erreur de syntaxe,  Erreur de nom: name 'T1' is not defined ligne 40

which means syntax error at line 40
at the beginning of the code you have

VAR1 = T1.EXTR_TABLE()

you are trying to allocate to VAR1 a value from the T1 table which does not exist at this time
if you want to use that method you have to use it at the right place in the code and not in the declaration part

jean pierre aubry

Offline

#8 2019-09-13 07:38:00

maxmss
Member
Registered: 2019-09-03
Posts: 9

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

Hello Jean Pierre Aubry, thanks for your reply.

The fact is that I defined "VAR1" after instruction T1. I agree with you, I could not assign a variable to something that does not yet exist but is not the case.
What I don't understand is because it indicates line 40, when I actually defined VAR1 on line 214

Max

Last edited by maxmss (2019-09-13 08:19:16)

Offline

#9 2019-09-13 08:22:35

maxmss
Member
Registered: 2019-09-03
Posts: 9

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

I attach an example of simpler mechanical analysis where I try to perform the same operation, I would be very grateful if you could try run it in your Salome distribution.

I attach my  .med and .comm files.


Best regards,
Max


Attachments:
testextrtable.zip, Size: 21.48 KiB, Downloads: 11

Offline

#10 2019-09-13 08:36:55

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,569

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

on line 43 of message file i can read this
VAR1 = T1.EXTR_TABLE()
which taking into account the 3 lines header of mess age file is equivalent to line 40 of command file
i cannot say more

regarding the attached example i will run it on code_aster stand alone as i do not use salome_meca

Offline

#11 2019-09-13 08:58:41

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,569

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

attached is the modified.comm that runs

i do not understand what you want to do with VAR1= TBL.EXTR_TABLE();   
chapter 11 in my book contains an example how to use a TABLE from   POST_RELEVE_T
there is no need to use "Methods Python of access to the objects Aster" for most problems

Last edited by jeanpierreaubry (2019-09-13 09:08:01)


Attachments:
mechanic.comm, Size: 2.18 KiB, Downloads: 13

Offline

#12 2019-09-14 04:36:05

maxmss
Member
Registered: 2019-09-03
Posts: 9

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

Thanks again Mr. Jean Pierre Aubry.

As I mentioned almost at the beginning of this post, what I need to do is get the surface temperature data of my model (that's why I used POST_RELEVE_T) to replace those data in a previously used formula.

I used the heat transfer formula:   Q= (A/L)(K)(Tref - Tfl)  and at the beginning all the parameters of the formula are given by the user.


What I want to do is use the data obtained with POST_RELEVE_T in the Tfl variable (initially Tfl is a value given by the user) of the heat transfer formula to perform an iterative process to obtain a range of desired temperatures on the surface of my model.

For this reason i try to use VAR1 = Table.EXTR_TABLE () to save the temperature data read from the surface in a variable, and then reintroduce it into the heat transfer formula, specifically on Tfl.

Is there a different way to achieve what I want without using VAR1 = Table.EXTR_TABLE ()?

Max

Last edited by maxmss (2019-09-14 04:38:48)

Offline

#13 2019-09-14 08:26:46

konyaro
Member
From: Genève
Registered: 2016-04-02
Posts: 158

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

Hello maxmss,
your code works fine if launched outside of Asterstudy with as_run, as you can see in the attached mess file.

Your problem comes probably from the fact that Asterstudy moves the variables at the beginning of the script, so TBL is not created yet. You should split your stage into 2 stages with the 2nd stage beginning with VAR1 = TBL.EXTR_TABLE().

Konyaro


Attachments:
mechanic.mess, Size: 46.55 KiB, Downloads: 7

失敗は成功のもと (L'échec est la base de la réussite)

Offline

#14 2019-09-15 19:52:39

maxmss
Member
Registered: 2019-09-03
Posts: 9

Re: EXTR_TABLE still works to extract data from the Post_Releve_T table?

Thank you very much Konyaro, you really made my day.

Indeed, I tested my code in astk and it worked.The problem seems to be that aster first executes the lines where variables are defined and then the rest of the code.

I still have to prove if what I mentioned earlier is possible, that is, use the data that i take with VAR1 = table.EXTR_TABLE () to replace it in the formula used for heat transfer(at the beginning all the parameters are given but now I want to change one of those parameters (Tfl) for the values of VAR1) in a python loop.

Max

Offline

Board footer