Commit efff9efd authored by Christophe Geuzaine's avatar Christophe Geuzaine

new AtGaussPoints option for PostOperation

parent e424c9f2
Pipeline #2737 passed with stage
in 9 minutes and 48 seconds
......@@ -1447,6 +1447,7 @@ struct PostSubOperation {
double TimeInterval[2];
List_T *ChangeOfValues;
List_T *EvaluationPoints;
int Gauss;
union {
struct { int RegionIndex; } OnRegion;
struct { double x[4], y[4], z[4]; int n[3]; } OnGrid;
......
......@@ -95,6 +95,7 @@ AppendStringToFileName return tAppendStringToFileName;
AppendToExistingFile return tAppendToExistingFile;
Asin return tAsin;
AtAnteriorTimeStep return tAtAnteriorTimeStep;
AtGaussPoints return tAtGaussPoints;
MaxOverTime return tMaxOverTime;
FourierSteinmetz return tFourierSteinmetz;
Atan return tAtan;
......
This diff is collapsed.
......@@ -405,30 +405,31 @@
tTimeValue = 621,
tTimeImagValue = 622,
tTimeInterval = 623,
tAppendExpressionToFileName = 624,
tAppendExpressionFormat = 625,
tOverrideTimeStepValue = 626,
tNoMesh = 627,
tSendToServer = 628,
tDate = 629,
tOnelabAction = 630,
tCodeName = 631,
tFixRelativePath = 632,
tAppendToExistingFile = 633,
tAppendStringToFileName = 634,
tDEF = 635,
tOR = 636,
tAND = 637,
tAPPROXEQUAL = 638,
tNOTEQUAL = 639,
tEQUAL = 640,
tGREATERGREATER = 641,
tLESSLESS = 642,
tGREATEROREQUAL = 643,
tLESSOREQUAL = 644,
tCROSSPRODUCT = 645,
UNARYPREC = 646,
tSHOW = 647
tAtGaussPoints = 624,
tAppendExpressionToFileName = 625,
tAppendExpressionFormat = 626,
tOverrideTimeStepValue = 627,
tNoMesh = 628,
tSendToServer = 629,
tDate = 630,
tOnelabAction = 631,
tCodeName = 632,
tFixRelativePath = 633,
tAppendToExistingFile = 634,
tAppendStringToFileName = 635,
tDEF = 636,
tOR = 637,
tAND = 638,
tAPPROXEQUAL = 639,
tNOTEQUAL = 640,
tEQUAL = 641,
tGREATERGREATER = 642,
tLESSLESS = 643,
tGREATEROREQUAL = 644,
tLESSOREQUAL = 645,
tCROSSPRODUCT = 646,
UNARYPREC = 647,
tSHOW = 648
};
#endif
/* Tokens. */
......@@ -798,30 +799,31 @@
#define tTimeValue 621
#define tTimeImagValue 622
#define tTimeInterval 623
#define tAppendExpressionToFileName 624
#define tAppendExpressionFormat 625
#define tOverrideTimeStepValue 626
#define tNoMesh 627
#define tSendToServer 628
#define tDate 629
#define tOnelabAction 630
#define tCodeName 631
#define tFixRelativePath 632
#define tAppendToExistingFile 633
#define tAppendStringToFileName 634
#define tDEF 635
#define tOR 636
#define tAND 637
#define tAPPROXEQUAL 638
#define tNOTEQUAL 639
#define tEQUAL 640
#define tGREATERGREATER 641
#define tLESSLESS 642
#define tGREATEROREQUAL 643
#define tLESSOREQUAL 644
#define tCROSSPRODUCT 645
#define UNARYPREC 646
#define tSHOW 647
#define tAtGaussPoints 624
#define tAppendExpressionToFileName 625
#define tAppendExpressionFormat 626
#define tOverrideTimeStepValue 627
#define tNoMesh 628
#define tSendToServer 629
#define tDate 630
#define tOnelabAction 631
#define tCodeName 632
#define tFixRelativePath 633
#define tAppendToExistingFile 634
#define tAppendStringToFileName 635
#define tDEF 636
#define tOR 637
#define tAND 638
#define tAPPROXEQUAL 639
#define tNOTEQUAL 640
#define tEQUAL 641
#define tGREATERGREATER 642
#define tLESSLESS 643
#define tGREATEROREQUAL 644
#define tLESSOREQUAL 645
#define tCROSSPRODUCT 646
#define UNARYPREC 647
#define tSHOW 648
......@@ -838,7 +840,7 @@ typedef union YYSTYPE
struct TwoChar c2;
}
/* Line 1529 of yacc.c. */
#line 842 "ProParser.tab.hpp"
#line 844 "ProParser.tab.hpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
......
......@@ -363,7 +363,7 @@ struct doubleXstring{
%token tStoreMaxZinRegister tStoreMinInRegister tStoreMinXinRegister
%token tStoreMinYinRegister tStoreMinZinRegister
%token tLastTimeStepOnly tAppendTimeStepToFileName tTimeValue tTimeImagValue
%token tTimeInterval
%token tTimeInterval tAtGaussPoints
%token tAppendExpressionToFileName tAppendExpressionFormat
%token tOverrideTimeStepValue tNoMesh
%token tSendToServer
......@@ -6972,6 +6972,7 @@ PostSubOperations :
PostSubOperation_S.LegendPosition[1] = 0.;
PostSubOperation_S.LegendPosition[2] = 0.;
PostSubOperation_S.EvaluationPoints = NULL;
PostSubOperation_S.Gauss = 0;
PostSubOperation_S.StoreInVariable = NULL;
PostSubOperation_S.StoreInRegister = -1;
PostSubOperation_S.StoreMinInRegister = -1;
......@@ -7624,6 +7625,10 @@ PrintOption :
{
PostSubOperation_S.StoreInVariable = $4;
}
| ',' tAtGaussPoints FExpr
{
PostSubOperation_S.Gauss = $3;
}
| ',' tStoreInRegister FExpr
{
PostSubOperation_S.StoreInRegister = (int)$3 - 1;
......
This diff is collapsed.
......@@ -16,6 +16,7 @@
#include "Cal_Value.h"
#include "MallocUtils.h"
#include "Message.h"
#include "ProDefine.h"
extern struct CurrentData Current ;
......@@ -354,12 +355,28 @@ void Cut_PostElement(struct PostElement * PE, struct Geo_Element * GE,
void Fill_PostElement(struct Geo_Element * GE, List_T * PE_L,
int Index, int Depth, int Skin, List_T * EvaluationPoints_L,
int DecomposeInSimplex, int HighOrder)
int DecomposeInSimplex, int HighOrder, int Gauss)
{
struct PostElement * PE ;
int Nbr_EP, i_EP, Type, NbrNodes;
if(!Depth){
if(Gauss > 0){
Depth = 0;
int error;
void (*f)(int, int, double *, double *, double *, double *);
Get_FunctionForDefine(FunctionForGauss, GE->Type, &error, (void (**)())&f);
if(!error){
double dummy;
for(int i = 0; i < Gauss; i++){
PE = Create_PostElement(Index, POINT, 1, 0) ;
f(Gauss, i, &PE->u[0], &PE->v[0], &PE->w[0], &dummy);
POS_CUT_FILL ;
}
}
}
else if(!Depth){
PE = Create_PostElement(Index, POINT, 1, 0) ;
switch(GE->Type){
......@@ -399,7 +416,7 @@ void Fill_PostElement(struct Geo_Element * GE, List_T * PE_L,
PE = Create_PostElement(Index, Type, NbrNodes, 1) ;
for(int i=0; i<NbrNodes; i++){
PE->NumNodes[i] = GE->NumNodes[i] ;
PE->u[i] = Nodes_Line_2[i][0] ;
PE->u[i] = Nodes_Line_2[i][0] ;
PE->v[i] = Nodes_Line_2[i][1] ;
PE->w[i] = Nodes_Line_2[i][2] ;
}
......
......@@ -13,7 +13,7 @@
/* P o s t E l e m e n t */
/* ------------------------------------------------------------------------ */
struct PostElement {
struct PostElement {
int Index, Type, Depth;
int NbrNodes, * NumNodes;
double * u, * v, * w, * x, * y, * z;
......@@ -25,9 +25,9 @@ void Destroy_PostElement(struct PostElement * PostElement) ;
struct PostElement * NodeCopy_PostElement(struct PostElement *PostElement);
struct PostElement * PartialCopy_PostElement(struct PostElement *PostElement);
void Fill_PostElement(struct Geo_Element *GE, List_T *PostElement_L,
void Fill_PostElement(struct Geo_Element *GE, List_T *PostElement_L,
int Index, int Depth, int Skin, List_T * EvaluationPoints_L,
int DecomposeInSimplex, int HighOrder) ;
int DecomposeInSimplex, int HighOrder, int Gauss) ;
void Cut_PostElement(struct PostElement * PE, struct Geo_Element * GE,
List_T * PE_L, int Index, int Depth, int Skin,
int DecomposeInSimplex) ;
......
......@@ -338,7 +338,7 @@ void Pos_PrintOnElementsOf(struct PostQuantity *NCPQ_P,
Fill_PostElement(Element.GeoElement, PostElement_L, iGeo,
Depth, PSO_P->Skin,
PSO_P->EvaluationPoints,
DecomposeInSimplex, 0) ;
DecomposeInSimplex, 0, PSO_P->Gauss) ;
}
Message::ProgressMeter(iGeo + 1, NbrGeo, "Post-processing (Generate)");
if(Message::GetErrorCount()) break;
......@@ -406,11 +406,14 @@ void Pos_PrintOnElementsOf(struct PostQuantity *NCPQ_P,
(Group_P->Type == ELEMENTLIST &&
Check_IsEntityInExtendedGroup(Group_P, Element.GeoElement->Num, 0))
) {
int HighOrder = (PSO_P->Format == FORMAT_GMSH && (PSO_P->StoreInField >= 0 || PSO_P->StoreInMeshBasedField >= 0 || Flag_GMSH_VERSION == 2 || Flag_BIN)) ? 1 : 0;
int HighOrder =
(PSO_P->Format == FORMAT_GMSH && (PSO_P->StoreInField >= 0 ||
PSO_P->StoreInMeshBasedField >= 0 ||
Flag_GMSH_VERSION == 2 || Flag_BIN)) ? 1 : 0;
Fill_PostElement(Element.GeoElement, PostElement_L, iGeo,
PSO_P->Depth, PSO_P->Skin,
PSO_P->EvaluationPoints,
DecomposeInSimplex, HighOrder) ;
DecomposeInSimplex, HighOrder, PSO_P->Gauss) ;
}
}
......@@ -1710,7 +1713,7 @@ void Pos_PrintGroup(struct PostSubOperation *PSO_P)
SL->z[0] = z[abs(NumNodes[0])-1]; SL->z[1] = z[abs(NumNodes[1])-1];
SL->Value[0].Type = SL->Value[1].Type = SCALAR ;
// SL->Value[0].Val[0] = SL->Value[1].Val[0] = fabs(GeoElement->NumEdges[i]);
// SL->Value[0].Val[0] = SL->Value[1].Val[0] = fabs(GeoElement->NumEdges[i]);
// Dof : type, num, 0
if (List_Nbr(PSO_P->Value_L)<2)
......@@ -1726,9 +1729,11 @@ void Pos_PrintGroup(struct PostSubOperation *PSO_P)
!= NULL) ;
if (CodeExist) {
sizeEdge = sqrt( SQU(SL->x[1]-SL->x[0]) + SQU(SL->y[1]-SL->y[0]) + SQU(SL->z[1]-SL->z[0]) );
sizeEdge = sqrt( SQU(SL->x[1]-SL->x[0]) +
SQU(SL->y[1]-SL->y[0]) +
SQU(SL->z[1]-SL->z[0]) );
if(Current.NbrHar==1){
Dof_GetRealDofValue(Current.DofData_P0+ numDofData, Dof_P, &Val_Dof) ;
Dof_GetRealDofValue(Current.DofData_P0 + numDofData, Dof_P, &Val_Dof) ;
Val_Dof = Val_Dof / sizeEdge ;
......
......@@ -5415,6 +5415,11 @@ zero, derefinement if @var{expression-cst} is smaller than zero. If
@var{expression-cst} is equal to zero, evaluation at the barycenter of the
elements.
@item AtGaussPoints
@var{expression-cst}
Print result at the specified number of Gauss points.
@item Skin
Computes the result on the boundary of the region.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment