Commit 11f1c397 authored by Christophe Geuzaine's avatar Christophe Geuzaine

Merge branch 'HighOrder' into 'master'

High order See merge request !43
parents 62aaf4af eb50dfe8
Pipeline #1849 passed with stage
in 15 minutes 15 seconds
......@@ -1691,6 +1691,9 @@ struct Element {
#define PRISM_2 (1<<13)
#define PYRAMID_2 (1<<14)
#define QUADRANGLE_2_8N (1<<16)
#define LINE_4 (1<<17)
#define TRIANGLE_4 (1<<18)
#define TETRAHEDRON_4 (1<<19)
/* Adapt.Type */
#define P1 1
......
......@@ -124,6 +124,9 @@ struct StringXDefine Element_Type[] = {
{"Triangle2" , TRIANGLE_2},
{"Quadrangle2" , QUADRANGLE_2},
{"Quadrangle2_8N" , QUADRANGLE_2_8N},
{"Line4" , LINE_4},
{"Triangle4" , TRIANGLE_4},
{"Tetrahedron4" , TETRAHEDRON_4},
{NULL , TRIANGLE}
} ;
......@@ -432,10 +435,10 @@ struct DefineXFunction FunctionForGaussLegendre[] = {
} ;
#define POI POINT
#define LIN LINE | LINE_2
#define TRI TRIANGLE | TRIANGLE_2
#define LIN LINE | LINE_2 | LINE_4
#define TRI TRIANGLE | TRIANGLE_2 | TRIANGLE_4
#define QUA QUADRANGLE | QUADRANGLE_2 | QUADRANGLE_2_8N
#define TET TETRAHEDRON | TETRAHEDRON_2
#define TET TETRAHEDRON | TETRAHEDRON_2 | TETRAHEDRON_4
#define HEX HEXAHEDRON | HEXAHEDRON_2
#define PRI PRISM | PRISM_2
#define PYR PYRAMID | PYRAMID_2
......
......@@ -194,6 +194,9 @@ int Geo_GetElementType(int Format, int Type)
case 13 : return PRISM_2;
case 14 : return PYRAMID_2;
case 16 : return QUADRANGLE_2_8N;
case 27 : return LINE_4;
case 23 : return TRIANGLE_4;
case 30 : return TETRAHEDRON_4;
default :
Message::Error("Unknown type of Element in Gmsh format (%d)", FORMAT_GMSH);
return -1;
......@@ -226,6 +229,9 @@ int Geo_GetElementTypeInv(int Format, int Type)
case PRISM_2 : return 13;
case PYRAMID_2 : return 14;
case QUADRANGLE_2_8N: return 16;
case LINE_4 : return 27;
case TRIANGLE_4 : return 23;
case TETRAHEDRON_4 : return 30;
default :
Message::Error("Unknown type of Element in Gmsh format");
return -1;
......@@ -256,6 +262,9 @@ int Geo_GetNbNodesPerElement(int Type)
case PRISM_2 : return 15;
case PYRAMID_2 : return 13;
case QUADRANGLE_2_8N: return 8;
case LINE_4 : return 5;
case TRIANGLE_4 : return 15;
case TETRAHEDRON_4 : return 35;
default :
Message::Error("Unknown type of Element");
return -1;
......@@ -281,6 +290,9 @@ int Geo_GetDimOfElement(int Type)
case PRISM_2 : return 3;
case PYRAMID_2 : return 3;
case QUADRANGLE_2_8N: return 2;
case LINE_4 : return 1;
case TRIANGLE_4 : return 2;
case TETRAHEDRON_4 : return 3;
default :
Message::Error("Unknown type of Element");
return -1;
......
......@@ -814,25 +814,21 @@ static PetscErrorCode PrintMatrix(Mat A, const char* filename, const char* varna
// in Kernel/LinAlg_PETSC.cpp
std::string tmp(filename);
PetscInt m,n, m_max = 600;
PetscInt m,n;
_try(PetscObjectSetName((PetscObject)A, varname));
// ASCII (if the matrix is not too large)
_try(MatGetSize(A, &m, &n));
if(m < m_max){
PetscViewer viewer;
_try(PetscViewerASCIIOpen(PETSC_COMM_WORLD, filename, &viewer));
_try(PetscViewerSetFormat(viewer, PETSC_VIEWER_ASCII_MATLAB));
_try(MatView(A, viewer));
PetscViewer viewer;
_try(PetscViewerASCIIOpen(PETSC_COMM_WORLD, filename, &viewer));
_try(PetscViewerSetFormat(viewer, PETSC_VIEWER_ASCII_MATLAB));
_try(MatView(A, viewer));
#if (PETSC_VERSION_RELEASE == 0 || ((PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR >= 2)))
_try(PetscViewerDestroy(&viewer));
_try(PetscViewerDestroy(&viewer));
#else
_try(PetscViewerDestroy(viewer));
_try(PetscViewerDestroy(viewer));
#endif
}
else{
Message::Warning("Matrix is too large, no ASCII Output (m=%d>%d)", m, m_max);
}
// BINARY
// Add the petscfolder/bin/matlab path to your matlab paths and
// type the following command in matlab, for real arithmetic :
......
......@@ -3890,6 +3890,16 @@ identical.
Counts the elements of physical numbers in @var{expression-cst-list}
or of the actual region if @var{expression-cst-list} is empty.
@item ElementNum
@code{[]}
Returns the tag (number) of the current element.
@item QuadraturePointIndex
@code{[]}
Returns the index of the current quadrature point.
@item AtIndex
@code{[@var{expression}]@{@var{expression-cst-list}@}}
......
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