Commit 57554425 authored by Axel Modave's avatar Axel Modave

add High-Order export for LIN_2,TRI_2,TET_2

parent 6fc30e19
Pipeline #1861 passed with stage
in 52 seconds
......@@ -10,6 +10,7 @@
#include <math.h>
#include "Pos_Element.h"
#include "GeoData.h"
#include "GeoEntity.h"
#include "Get_Geometry.h"
#include "Get_DofOfElement.h"
#include "Cal_Value.h"
......@@ -353,10 +354,10 @@ 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 DecomposeInSimplex, int HighOrder)
{
struct PostElement * PE ;
int Nbr_EP, i_EP;
int Nbr_EP, i_EP, Type, NbrNodes;
if(!Depth){
......@@ -392,8 +393,20 @@ void Fill_PostElement(struct Geo_Element * GE, List_T * PE_L,
POS_CUT_FILL ;
break ;
case LINE :
case LINE_2 :
Type = (HighOrder) ? LINE_2 : LINE;
NbrNodes = (HighOrder) ? NbrNodes_Line_2 : NbrNodes_Line;
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->v[i] = Nodes_Line_2[i][1] ;
PE->w[i] = Nodes_Line_2[i][2] ;
}
POS_CUT_FILL ;
break ;
case LINE :
PE = Create_PostElement(Index, LINE, 2, 1) ; /* nodes 1 2 */
PE->NumNodes[0] = GE->NumNodes[0] ;
PE->NumNodes[1] = GE->NumNodes[1] ;
......@@ -402,8 +415,20 @@ void Fill_PostElement(struct Geo_Element * GE, List_T * PE_L,
POS_CUT_FILL ;
break ;
case TRIANGLE :
case TRIANGLE_2 :
Type = (HighOrder) ? TRIANGLE_2 : TRIANGLE;
NbrNodes = (HighOrder) ? NbrNodes_Triangle_2 : NbrNodes_Triangle;
PE = Create_PostElement(Index, Type, NbrNodes, 1) ;
for(int i=0; i<NbrNodes; i++){
PE->NumNodes[i] = GE->NumNodes[i] ;
PE->u[i] = Nodes_Triangle_2[i][0] ;
PE->v[i] = Nodes_Triangle_2[i][1] ;
PE->w[i] = Nodes_Triangle_2[i][2] ;
}
POS_CUT_FILL ;
break ;
case TRIANGLE :
PE = Create_PostElement(Index, TRIANGLE, 3, 1) ; /* nodes 1 2 3 */
PE->NumNodes[0] = GE->NumNodes[0] ;
PE->NumNodes[1] = GE->NumNodes[1] ;
......@@ -413,7 +438,6 @@ void Fill_PostElement(struct Geo_Element * GE, List_T * PE_L,
PE->u[2] = 0. ; PE->v[2] = 1. ; PE->w[2] = 0. ;
POS_CUT_FILL ;
break ;
case QUADRANGLE :
case QUADRANGLE_2 :
case QUADRANGLE_2_8N:
......@@ -461,8 +485,20 @@ void Fill_PostElement(struct Geo_Element * GE, List_T * PE_L,
}
break ;
case TETRAHEDRON :
case TETRAHEDRON_2 :
Type = (HighOrder) ? TETRAHEDRON_2 : TETRAHEDRON;
NbrNodes = (HighOrder) ? NbrNodes_Tetrahedron_2 : NbrNodes_Tetrahedron;
PE = Create_PostElement(Index, Type, NbrNodes, 1) ;
for(int i=0; i<NbrNodes; i++){
PE->NumNodes[i] = GE->NumNodes[i] ;
PE->u[i] = Nodes_Tetrahedron_2[i][0] ;
PE->v[i] = Nodes_Tetrahedron_2[i][1] ;
PE->w[i] = Nodes_Tetrahedron_2[i][2] ;
}
POS_CUT_FILL ;
break ;
case TETRAHEDRON :
PE = Create_PostElement(Index, TETRAHEDRON, 4, 1) ; /* nodes 1 2 3 4 */
PE->NumNodes[0] = GE->NumNodes[0] ;
PE->NumNodes[1] = GE->NumNodes[1] ;
......
......@@ -27,7 +27,7 @@ struct PostElement * PartialCopy_PostElement(struct PostElement *PostElement);
void Fill_PostElement(struct Geo_Element *GE, List_T *PostElement_L,
int Index, int Depth, int Skin, List_T * EvaluationPoints_L,
int DecomposeInSimplex) ;
int DecomposeInSimplex, int HighOrder) ;
void Cut_PostElement(struct PostElement * PE, struct Geo_Element * GE,
List_T * PE_L, int Index, int Depth, int Skin,
int DecomposeInSimplex) ;
......
......@@ -31,7 +31,7 @@
extern struct Problem Problem_S ;
extern struct CurrentData Current ;
extern int Flag_BIN ;
extern int Flag_BIN, Flag_GMSH_VERSION;
extern FILE *PostStream ;
......@@ -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) ;
DecomposeInSimplex, 0) ;
}
Message::ProgressMeter(iGeo + 1, NbrGeo, "Post-processing (Generate)");
if(Message::GetErrorCount()) break;
......@@ -406,10 +406,11 @@ 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; // [AM]
Fill_PostElement(Element.GeoElement, PostElement_L, iGeo,
PSO_P->Depth, PSO_P->Skin,
PSO_P->EvaluationPoints,
DecomposeInSimplex) ;
DecomposeInSimplex, HighOrder) ;
}
}
......
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