hex20 WIP

This commit is contained in:
Joachim Schöberl 2019-01-17 22:08:35 +01:00
parent c0d0a3a1ab
commit 66ac2f1a4f
5 changed files with 33 additions and 8 deletions

View File

@ -43,10 +43,10 @@
enum NG_ELEMENT_TYPE {
NG_PNT = 0,
NG_SEGM = 1, NG_SEGM3 = 2,
NG_TRIG = 10, NG_QUAD=11, NG_TRIG6 = 12, NG_QUAD6 = 13,
NG_TRIG = 10, NG_QUAD=11, NG_TRIG6 = 12, NG_QUAD6 = 13, NG_QUAD8 = 14,
NG_TET = 20, NG_TET10 = 21,
NG_PYRAMID = 22, NG_PRISM = 23, NG_PRISM12 = 24,
NG_HEX = 25
NG_HEX = 25, NG_HEX20 = 26
};
typedef double NG_POINT[3]; // coordinates

View File

@ -17,10 +17,10 @@
enum NG_ELEMENT_TYPE {
NG_PNT = 0,
NG_SEGM = 1, NG_SEGM3 = 2,
NG_TRIG = 10, NG_QUAD=11, NG_TRIG6 = 12, NG_QUAD6 = 13,
NG_TRIG = 10, NG_QUAD=11, NG_TRIG6 = 12, NG_QUAD6 = 13, NG_QUAD8 = 14,
NG_TET = 20, NG_TET10 = 21,
NG_PYRAMID = 22, NG_PRISM = 23, NG_PRISM12 = 24,
NG_HEX = 25
NG_HEX = 25, NG_HEX20 = 26
};
enum NG_REFINEMENT_TYPE { NG_REFINE_H = 0, NG_REFINE_P = 1, NG_REFINE_HP = 2 };

View File

@ -22,7 +22,7 @@ namespace netgen
TRIG = 10, QUAD=11, TRIG6 = 12, QUAD6 = 13, QUAD8 = 14,
TET = 20, TET10 = 21,
PYRAMID = 22, PRISM = 23, PRISM12 = 24,
HEX = 25
HEX = 25, HEX20 = 26
};
/*
@ -45,7 +45,7 @@ namespace netgen
};
#define ELEMENT_MAXPOINTS 12
#define ELEMENT_MAXPOINTS 20
#define ELEMENT2D_MAXPOINTS 8

View File

@ -263,6 +263,13 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
(*newel)[i] = py::extract<PointIndex>(vertices[i])();
newel->SetIndex(index);
}
else if (py::len(vertices) == 20)
{
newel = new Element(HEX20);
for (int i = 0; i < 20; i++)
(*newel)[i] = py::extract<PointIndex>(vertices[i])();
newel->SetIndex(index);
}
else
throw NgException ("cannot create element");
return newel;
@ -316,6 +323,13 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
(*newel)[i] = py::extract<PointIndex>(vertices[i])();
newel->SetIndex(index);
}
else if (py::len(vertices) == 8)
{
newel = new Element2d(QUAD8);
for(int i = 0; i<8; i++)
(*newel)[i] = py::extract<PointIndex>(vertices[i])();
newel->SetIndex(index);
}
else
throw NgException("Inconsistent number of vertices in Element2D");
return newel;

View File

@ -219,6 +219,7 @@ inline short int MeshTopology :: GetNVertices (ELEMENT_TYPE et)
return 6;
case HEX:
case HEX20:
return 8;
// default:
@ -244,9 +245,11 @@ inline short int MeshTopology :: GetNPoints (ELEMENT_TYPE et)
case QUAD:
case QUAD6:
case QUAD8:
return 4;
case QUAD8:
return 8;
case TET:
return 4;
case TET10:
@ -262,6 +265,8 @@ inline short int MeshTopology :: GetNPoints (ELEMENT_TYPE et)
case HEX:
return 8;
case HEX20:
return 20;
// default:
// cerr << "Ng_ME_GetNVertices, illegal element type " << et << endl;
}
@ -300,6 +305,7 @@ inline short int MeshTopology :: GetNEdges (ELEMENT_TYPE et)
return 9;
case HEX:
case HEX20:
return 12;
default:
return 0;
@ -340,6 +346,7 @@ inline short int MeshTopology :: GetNFaces (ELEMENT_TYPE et)
return 5;
case HEX:
case HEX20:
return 6;
default:
@ -443,6 +450,7 @@ const ELEMENT_EDGE * MeshTopology :: GetEdges1 (ELEMENT_TYPE et)
return prism_edges;
case HEX:
case HEX20:
return hex_edges;
// default:
// cerr << "Ng_ME_GetEdges, illegal element type " << et << endl;
@ -513,7 +521,7 @@ const ELEMENT_EDGE * MeshTopology :: GetEdges0 (ELEMENT_TYPE et)
{ 2, 6 },
{ 3, 7 },
};
switch (et)
{
case SEGMENT:
@ -541,6 +549,7 @@ const ELEMENT_EDGE * MeshTopology :: GetEdges0 (ELEMENT_TYPE et)
return prism_edges;
case HEX:
case HEX20:
return hex_edges;
// default:
// cerr << "Ng_ME_GetEdges, illegal element type " << et << endl;
@ -627,6 +636,7 @@ inline const ELEMENT_FACE * MeshTopology :: GetFaces1 (ELEMENT_TYPE et)
case SEGMENT3:
case HEX:
case HEX20:
return hex_faces;
// default:
@ -709,6 +719,7 @@ inline const ELEMENT_FACE * MeshTopology :: GetFaces0 (ELEMENT_TYPE et)
case SEGMENT3:
case HEX:
case HEX20:
return hex_faces;
// default: