Difference between revisions of "Contrib:Claws/Code Aster/comms"

From CAELinuxWiki
Jump to: navigation, search
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Comm files
+
[[Contrib:Claws/Code_Aster|'''<-Link: Back to Contrib:Claws/Code_Aster''']] <br />
  
== Contents ==
+
[[Image:Signature transparent scaled small.png]]<br />
 +
'''Command file snippets''' <br />
  
 +
== Contents ==
  
 
== Extracting max/min principal stress of a model ==
 
== Extracting max/min principal stress of a model ==
Line 13: Line 15:
 
                   VALE_MIN='OUI',
 
                   VALE_MIN='OUI',
 
                   SOUS_TITRE='Principal_max_min',),);
 
                   SOUS_TITRE='Principal_max_min',),);
Explanation:
+
;Definition
*IMPR_RESU means 'write result', that can either be written to a 3d-model or printed to the .resu file (or other file)
+
 
*FORMAT = RESULTAT means that the result should be formatted for text as opposed to a 3d-model file format such as 'med', I-DEAS or other.
+
:*IMPR_RESU means 'write result', that can either be written to a 3d-model or printed to the .resu file (or other file)
*RESULTAT=RESU: Use the calculated result 'RESU'
+
:*FORMAT = RESULTAT means that the result should be formatted for text as opposed to a 3d-model file format such as 'med', I-DEAS or other.
*NOM_CHAM: Name of field to write; we want the 'equivalent nodal stress'
+
:*RESULTAT=RESU: Use the calculated result 'RESU'
*FORM_TABL: Format as a table
+
:*NOM_CHAM: Name of field to write; we want the 'equivalent nodal stress'
*VALE_MIN/MAX: Display min/max values of the field
+
:*FORM_TABL: Format as a table
*SOUS_TITRE: Sub-title in the .resu file
+
:*VALE_MIN/MAX: Display min/max values of the field
 +
:*SOUS_TITRE: Sub-title in the .resu file
  
 
Applying this to your comm file should yield the following table:
 
Applying this to your comm file should yield the following table:
Line 64: Line 67:
 
                     TITRE='Principal stress',);
 
                     TITRE='Principal stress',);
  
*INTITULE: Name of the table
+
;Definition
*RESULTAT: Extract from the 'RESU' calculation
+
 
*NOM_CHAM: Name of field, here REAC_NODA and FORC_NODA
+
:*INTITULE: Name of the table
*Default precision
+
:*RESULTAT: Extract from the 'RESU' calculation
*GROUP_NO: the node group - this has to be a node group (I'll describe how to extract from a whole model further down)
+
:*NOM_CHAM: Name of field, here REAC_NODA and FORC_NODA (these two must be included in CALC_NO)
*RESULTANTE: Vectorial components (Instead of RESULTANTE you can use TOUT_CMP=All components to get the values of all nodes in the group)
+
:*Default precision
*MOYE_NOEUD: Average the result around a node
+
:*GROUP_NO: the node group - this has to be a node group (I'll describe how to extract from a whole model further down)
 +
:*RESULTANTE: Vectorial components (Instead of RESULTANTE you can use TOUT_CMP=All components to get the values of all nodes in the group)
 +
:*MOYE_NOEUD: Average the result around a node
  
  
Line 83: Line 88:
  
  
Explanation:
+
;Definition
  
*Write the table 'Table' we just created.
+
:*Write the table 'Table' we just created.
*Format it as 'TABLEAU' - other formats are also available
+
:*Format it as 'TABLEAU' - other formats are also available
*UNITE: this is the unique number of the file you want to write the results to. This number should correspond to the number selected in ASTK, using the 'mast' file format. If you leave this unselected in your comm file, the results will be written to the .resu file
+
:*UNITE: this is the unique number of the file you want to write the results to. This number should correspond to the number selected in ASTK, using the 'mast' file format. If you leave this unselected in your comm file, the results will be written to the .resu file
*SEPARATEUR: using comma (,) as a separator - select any character you want.
+
:*SEPARATEUR: using comma (,) as a separator - select any character you want.
*TITRE: Name of the table
+
:*TITRE: Name of the table
  
 
The result should look something like this (table is a little mangled by the wiki):
 
The result should look something like this (table is a little mangled by the wiki):
  "#",,,,,,,,,,,,,
+
  #
  "#--------------------------------------------------------------------------------",,,,,,,,,,,,,
+
  #--------------------------------------------------------------------------------
  "#",,,,,,,,,,,,,
+
  #
  "#Reac/Force at nodes",,,,,,,,,,,,,
+
  #Claus Andersen
  "#Reac/Force at nodes                                                                 ",,,,,,,,,,,,,
+
  #Claus Andersen                                                                  
                                                              ",,,,,,,,,,,,,
+
  ,INTITULE        ,NOEUD    ,CHAM_GD  ,RESU    ,NOM_CHAM        ,NUME_ORDRE  ,INST        ,ABSC_CURV    ,COOR_X      ,COOR_Y      ,COOR_Z      ,DX          ,DY          ,DZ           ,VMIS        ,TRESCA      ,PRIN_1      ,PRIN_2      ,PRIN_3      ,VMIS_SG      ,TRSIG     
  " ","INTITULE        ","NOEUD    ","RESU    ","NOM_CHAM        ","NUME_ORDRE  ","INST        ","ABSC_CURV    ","COOR_X      ","COOR_Y      ","COOR_Z      ","DX          ","DY          ","DZ         "
+
  ,ReacXYZ          ,-        ,-        ,RESU    ,REAC_NODA        ,           1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-         
  " ","ReacXYZ          ","-        ","RESU    ","REAC_NODA        ",1,0.00E+000,"-            ","-            ","-            ","-            ",-1.36E+006,-1.19E+005,-3.42E+002
+
  ,ForceXYZ        ,-        ,-        ,RESU    ,FORC_NODA        ,           1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-         
  " ","ForceXYZ        ","-        ","RESU    ","FORC_NODA        ",1,0.00E+000,"-            ","-            ","-            ","-            ",-1.36E+006,-1.19E+005,-3.42E+002
+
  
  
Line 112: Line 116:
 
                 NOM_CHAM='EQUI_NOEU_SIGM',);
 
                 NOM_CHAM='EQUI_NOEU_SIGM',);
  
*Create (extract) a field of the type NOEU_SIEF_R; effective stress at the nodes from the calculation (RESU) and use the EQUI_NOEU_SIGM field calculated in RESU (EQUI_NOEU_SIGM: Equivalent node stress)  
+
;Definition
 +
 
 +
:*Create (extract) a field of the type NOEU_SIEF_R; effective stress at the nodes from the calculation (RESU) and use the EQUI_NOEU_SIGM field calculated in RESU (EQUI_NOEU_SIGM: Equivalent node stress)  
  
 
  Table=POST_RELEVE_T(ACTION=(_F(OPERATION='EXTRACTION',
 
  Table=POST_RELEVE_T(ACTION=(_F(OPERATION='EXTRACTION',
Line 122: Line 128:
 
                     TITRE='Principal stress',);
 
                     TITRE='Principal stress',);
  
*CHAM_GD: create the table from the field we created.  
+
;Definition
*TOUT_CMP: All the components
+
 
 +
:*CHAM_GD: create the table from the field we created.  
 +
:*TOUT_CMP: All the components
  
 
  IMPR_TABLE(TABLE=Table,
 
  IMPR_TABLE(TABLE=Table,
Line 131: Line 139:
 
           TITRE='Title',);
 
           TITRE='Title',);
 
*Again, write the table to a file
 
*Again, write the table to a file
 +
 +
The result should look something like this (ReacXYZ and ForceXYZ is from another table):
 +
#
 +
#--------------------------------------------------------------------------------
 +
#
 +
#Claus Andersen
 +
#Claus Andersen                                                                 
 +
,INTITULE        ,NOEUD    ,CHAM_GD  ,RESU    ,NOM_CHAM        ,NUME_ORDRE  ,INST        ,ABSC_CURV    ,COOR_X      ,COOR_Y      ,COOR_Z      ,DX          ,DY          ,DZ          ,VMIS        ,TRESCA      ,PRIN_1      ,PRIN_2      ,PRIN_3      ,VMIS_SG      ,TRSIG     
 +
,ReacXYZ          ,-        ,-        ,RESU    ,REAC_NODA        ,          1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-         
 +
,ForceXYZ        ,-        ,-        ,RESU    ,FORC_NODA        ,          1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-         
 +
,node_reac        ,N37      ,sigm    ,-        ,-                ,-            ,-            , 0.00000E+00 , 3.00000E+03 , 3.75000E+02 ,-2.18889E+01 ,-            ,-            ,-            , 1.07338E+03 , 1.22228E+03 ,-8.83649E+02 ,-2.35115E+02 , 3.38627E+02 ,-1.33675E+03 , 0.00000E+00
 +
,node_reac        ,N97      ,sigm    ,-        ,-                ,-            ,-            , 3.00000E+03 ,-4.16334E-14 , 3.75000E+02 ,-2.18889E+01 ,-            ,-            ,-            , 1.24277E+02 , 1.32194E+02 ,-1.62677E+02 ,-1.52712E+02 ,-3.04834E+01 ,-1.24277E+02 , 0.00000E+00
 +
,node_reac        ,N1166    ,sigm    ,-        ,-                ,-            ,-            , 3.37006E+03 , 3.70027E+02 , 3.75000E+02 ,-1.69688E+01 ,-            ,-            ,-            , 3.29590E+01 , 3.29360E+01 ,-3.30096E+01 , 2.24046E-02 ,-7.35942E-02 ,-3.29590E+01 , 0.00000E+00
 +
,node_reac        ,N1179    ,sigm    ,-        ,-                ,-            ,-            , 3.48084E+03 , 2.59243E+02 , 3.75000E+02 ,-1.69755E+01 ,-            ,-            ,-            , 2.77424E+01 , 2.76690E+01 ,-2.78643E+01 , 1.55714E-02 ,-1.95291E-01 ,-2.77424E+01 , 0.00000E+00
 +
,node_reac        ,N1188    ,sigm    ,-        ,-                ,-            ,-            , 3.70116E+03 , 3.89358E+01 , 3.75000E+02 ,-1.94565E+01 ,-            ,-            ,-            , 3.69730E+01 , 4.25928E+01 ,-3.02343E+01 , 3.00930E+00 , 1.23584E+01 ,-3.69730E+01 , 0.00000E+00
 +
,node_reac        ,N1192    ,sigm    ,-        ,-                ,-            ,-            , 3.81104E+03 , 1.48784E+02 , 3.75000E+02 ,-1.71212E+01 ,-            ,-            ,-            , 1.31783E+01 , 1.57680E+01 ,-1.50357E+01 ,-8.21171E+00 , 7.32377E-01 ,-1.31783E+01 , 0.00000E+00
 +
,node_reac        ,N1202    ,sigm    ,-        ,-                ,-            ,-            , 4.91843E+03 , 1.25618E+03 , 3.75000E+02 ,-1.69688E+01 ,-            ,-            ,-            , 6.07226E+01 , 6.07140E+01 ,-6.08630E+01 ,-1.24418E-01 ,-1.49010E-01 ,-6.07226E+01 , 0.00000E+00
 +
 +
 +
==Creating a node group from the entire model==
 +
 +
Should you want to extract all node values and didn't define one in your CAD program, your can easily do it in C_A:
 +
mesh=DEFI_GROUP(reuse =mesh,
 +
                MAILLAGE=mesh,
 +
                CREA_GROUP_MA=_F(NOM='all_ma',
 +
                                TOUT='OUI',),
 +
                CREA_GROUP_NO=_F(GROUP_MA='all_ma',),);
 +
 +
;Definition
 +
 +
:*Define a group
 +
:*Use the mesh named 'mesh'
 +
:*Create a mesh group called 'all_ma'; TOUT=All
 +
:*Create a node group called 'all_ma'
 +
 +
[[User:Claws|Claws]] 07:08, 4 April 2009 (CEST)

Latest revision as of 23:00, 29 March 2011

<-Link: Back to Contrib:Claws/Code_Aster

Signature transparent scaled small.png
Command file snippets

Contents

Extracting max/min principal stress of a model

IMPR_RESU(FORMAT='RESULTAT',
         RESU=_F(RESULTAT=RESU,
                 NOM_CHAM='EQUI_NOEU_SIGM',
                 FORM_TABL='OUI',
                 VALE_MAX='OUI',
                 VALE_MIN='OUI',
                 SOUS_TITRE='Principal_max_min',),);
Definition
  • IMPR_RESU means 'write result', that can either be written to a 3d-model or printed to the .resu file (or other file)
  • FORMAT = RESULTAT means that the result should be formatted for text as opposed to a 3d-model file format such as 'med', I-DEAS or other.
  • RESULTAT=RESU: Use the calculated result 'RESU'
  • NOM_CHAM: Name of field to write; we want the 'equivalent nodal stress'
  • FORM_TABL: Format as a table
  • VALE_MIN/MAX: Display min/max values of the field
  • SOUS_TITRE: Sub-title in the .resu file

Applying this to your comm file should yield the following table:

======>
------>
Principal_max_min                                                              

LA VALEUR MAXIMALE DE VMIS     EST  1.34509E+03 EN    1 NOEUD(S) : N2      
LA VALEUR MAXIMALE DE TRESCA   EST  1.46813E+03 EN    1 NOEUD(S) : N2      
LA VALEUR MAXIMALE DE PRIN_1   EST  1.54083E+02 EN    1 NOEUD(S) : NS2689  
LA VALEUR MAXIMALE DE PRIN_2   EST  2.19908E+02 EN    1 NOEUD(S) : NS2856  
LA VALEUR MAXIMALE DE PRIN_3   EST  4.36280E+02 EN    1 NOEUD(S) : NS2856  
LA VALEUR MAXIMALE DE VMIS_SG  EST  7.11318E+02 EN    1 NOEUD(S) : NS2835  
LA VALEUR MAXIMALE DE TRSIG    EST  0.00000E+00 EN **** NOEUD(S) : N1      
LA VALEUR MINIMALE DE VMIS     EST -6.91240E+01 EN    1 NOEUD(S) : NS12279 
LA VALEUR MINIMALE DE TRESCA   EST -7.77194E+01 EN    1 NOEUD(S) : NS12279 
LA VALEUR MINIMALE DE PRIN_1   EST -1.25101E+03 EN    1 NOEUD(S) : N2      
LA VALEUR MINIMALE DE PRIN_2   EST -2.95197E+02 EN    1 NOEUD(S) : NS3361  
LA VALEUR MINIMALE DE PRIN_3   EST -1.44362E+02 EN    1 NOEUD(S) : NS10331 
LA VALEUR MINIMALE DE VMIS_SG  EST -1.45302E+03 EN    1 NOEUD(S) : N2      
LA VALEUR MINIMALE DE TRSIG    EST  0.00000E+00 EN **** NOEUD(S) : N1

Extracting node reactions and forces

Extracting the results

Table=POST_RELEVE_T(ACTION=(_F(OPERATION='EXTRACTION',
                              INTITULE='ReacXYZ',
                              RESULTAT=RESU,
                              NOM_CHAM='REAC_NODA',
                              PRECISION=0.0001,
                              GROUP_NO='load',
                              RESULTANTE=('DX','DY','DZ',),
                              MOYE_NOEUD='OUI',),
                           _F(OPERATION='EXTRACTION',
                              INTITULE='ForceXYZ',
                              RESULTAT=RESU,
                              NOM_CHAM='FORC_NODA',
                              TOUT_ORDRE='OUI',
                              GROUP_NO='load',
                              RESULTANTE=('DX','DY','DZ',),),
                   TITRE='Principal stress',);
Definition
  • INTITULE: Name of the table
  • RESULTAT: Extract from the 'RESU' calculation
  • NOM_CHAM: Name of field, here REAC_NODA and FORC_NODA (these two must be included in CALC_NO)
  • Default precision
  • GROUP_NO: the node group - this has to be a node group (I'll describe how to extract from a whole model further down)
  • RESULTANTE: Vectorial components (Instead of RESULTANTE you can use TOUT_CMP=All components to get the values of all nodes in the group)
  • MOYE_NOEUD: Average the result around a node


Writing the table to a file:

IMPR_TABLE(TABLE=Table,
          FORMAT='TABLEAU',
          UNITE=26,
          SEPARATEUR=' ,',
          TITRE='Reac/Force at nodes',);


Definition
  • Write the table 'Table' we just created.
  • Format it as 'TABLEAU' - other formats are also available
  • UNITE: this is the unique number of the file you want to write the results to. This number should correspond to the number selected in ASTK, using the 'mast' file format. If you leave this unselected in your comm file, the results will be written to the .resu file
  • SEPARATEUR: using comma (,) as a separator - select any character you want.
  • TITRE: Name of the table

The result should look something like this (table is a little mangled by the wiki):

#
#--------------------------------------------------------------------------------
#
#Claus Andersen
#Claus Andersen                                                                  
,INTITULE         ,NOEUD    ,CHAM_GD  ,RESU     ,NOM_CHAM         ,NUME_ORDRE   ,INST         ,ABSC_CURV    ,COOR_X       ,COOR_Y       ,COOR_Z       ,DX           ,DY           ,DZ           ,VMIS         ,TRESCA       ,PRIN_1       ,PRIN_2       ,PRIN_3       ,VMIS_SG      ,TRSIG       
,ReacXYZ          ,-        ,-        ,RESU     ,REAC_NODA        ,           1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-           
,ForceXYZ         ,-        ,-        ,RESU     ,FORC_NODA        ,           1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-           


Should you want the values for a whole node group, you can use TOUT_CMP (all the components) instead of the resultant (RESULTANT)

Create a table of the principal stresses from each node

sigm=CREA_CHAMP(TYPE_CHAM='NOEU_SIEF_R',
               OPERATION='EXTR',
               RESULTAT=RESU,
               NOM_CHAM='EQUI_NOEU_SIGM',);
Definition
  • Create (extract) a field of the type NOEU_SIEF_R; effective stress at the nodes from the calculation (RESU) and use the EQUI_NOEU_SIGM field calculated in RESU (EQUI_NOEU_SIGM: Equivalent node stress)
Table=POST_RELEVE_T(ACTION=(_F(OPERATION='EXTRACTION',
                              INTITULE='Principal stress',
                              CHAM_GD=sigm,
                              TOUT='OUI',
                              GROUP_NO='backbone',
                              TOUT_CMP='OUI',),),
                   TITRE='Principal stress',);
Definition
  • CHAM_GD: create the table from the field we created.
  • TOUT_CMP: All the components
IMPR_TABLE(TABLE=Table,
          FORMAT='TABLEAU',
          UNITE=26,
          SEPARATEUR=' ,',
          TITRE='Title',);
  • Again, write the table to a file

The result should look something like this (ReacXYZ and ForceXYZ is from another table):

#
#--------------------------------------------------------------------------------
#
#Claus Andersen
#Claus Andersen                                                                  
,INTITULE         ,NOEUD    ,CHAM_GD  ,RESU     ,NOM_CHAM         ,NUME_ORDRE   ,INST         ,ABSC_CURV    ,COOR_X       ,COOR_Y       ,COOR_Z       ,DX           ,DY           ,DZ           ,VMIS         ,TRESCA       ,PRIN_1       ,PRIN_2       ,PRIN_3       ,VMIS_SG      ,TRSIG       
,ReacXYZ          ,-        ,-        ,RESU     ,REAC_NODA        ,           1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-           
,ForceXYZ         ,-        ,-        ,RESU     ,FORC_NODA        ,           1 , 0.00000E+00 ,-            ,-            ,-            ,-            ,-1.35581E+06 ,-1.19057E+05 ,-3.41824E+02 ,-            ,-            ,-            ,-            ,-            ,-            ,-           
,node_reac        ,N37      ,sigm     ,-        ,-                ,-            ,-            , 0.00000E+00 , 3.00000E+03 , 3.75000E+02 ,-2.18889E+01 ,-            ,-            ,-            , 1.07338E+03 , 1.22228E+03 ,-8.83649E+02 ,-2.35115E+02 , 3.38627E+02 ,-1.33675E+03 , 0.00000E+00
,node_reac        ,N97      ,sigm     ,-        ,-                ,-            ,-            , 3.00000E+03 ,-4.16334E-14 , 3.75000E+02 ,-2.18889E+01 ,-            ,-            ,-            , 1.24277E+02 , 1.32194E+02 ,-1.62677E+02 ,-1.52712E+02 ,-3.04834E+01 ,-1.24277E+02 , 0.00000E+00
,node_reac        ,N1166    ,sigm     ,-        ,-                ,-            ,-            , 3.37006E+03 , 3.70027E+02 , 3.75000E+02 ,-1.69688E+01 ,-            ,-            ,-            , 3.29590E+01 , 3.29360E+01 ,-3.30096E+01 , 2.24046E-02 ,-7.35942E-02 ,-3.29590E+01 , 0.00000E+00
,node_reac        ,N1179    ,sigm     ,-        ,-                ,-            ,-            , 3.48084E+03 , 2.59243E+02 , 3.75000E+02 ,-1.69755E+01 ,-            ,-            ,-            , 2.77424E+01 , 2.76690E+01 ,-2.78643E+01 , 1.55714E-02 ,-1.95291E-01 ,-2.77424E+01 , 0.00000E+00
,node_reac        ,N1188    ,sigm     ,-        ,-                ,-            ,-            , 3.70116E+03 , 3.89358E+01 , 3.75000E+02 ,-1.94565E+01 ,-            ,-            ,-            , 3.69730E+01 , 4.25928E+01 ,-3.02343E+01 , 3.00930E+00 , 1.23584E+01 ,-3.69730E+01 , 0.00000E+00
,node_reac        ,N1192    ,sigm     ,-        ,-                ,-            ,-            , 3.81104E+03 , 1.48784E+02 , 3.75000E+02 ,-1.71212E+01 ,-            ,-            ,-            , 1.31783E+01 , 1.57680E+01 ,-1.50357E+01 ,-8.21171E+00 , 7.32377E-01 ,-1.31783E+01 , 0.00000E+00
,node_reac        ,N1202    ,sigm     ,-        ,-                ,-            ,-            , 4.91843E+03 , 1.25618E+03 , 3.75000E+02 ,-1.69688E+01 ,-            ,-            ,-            , 6.07226E+01 , 6.07140E+01 ,-6.08630E+01 ,-1.24418E-01 ,-1.49010E-01 ,-6.07226E+01 , 0.00000E+00


Creating a node group from the entire model

Should you want to extract all node values and didn't define one in your CAD program, your can easily do it in C_A:

mesh=DEFI_GROUP(reuse =mesh,
               MAILLAGE=mesh,
               CREA_GROUP_MA=_F(NOM='all_ma',
                                TOUT='OUI',),
               CREA_GROUP_NO=_F(GROUP_MA='all_ma',),);
Definition
  • Define a group
  • Use the mesh named 'mesh'
  • Create a mesh group called 'all_ma'; TOUT=All
  • Create a node group called 'all_ma'

Claws 07:08, 4 April 2009 (CEST)