From e86c5d23f330fea24410c1a0a236db4f9d13e05c Mon Sep 17 00:00:00 2001 From: Morteza HS Date: Mon, 28 Mar 2022 21:11:06 -0400 Subject: [PATCH 1/4] adds shape for quadratic prism --- apf/apfShape.cc | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/apf/apfShape.cc b/apf/apfShape.cc index 5806b07fe..7686d6acd 100644 --- a/apf/apfShape.cc +++ b/apf/apfShape.cc @@ -522,12 +522,34 @@ class QuadraticBase : public FieldShape } int countNodes() const {return 10;} }; + class Prism : public EntityShape + { + public: + void getValues(Mesh*, MeshEntity*, + Vector3 const& , NewArray& ) const + { + fail("getValue not implemented for quadratic prisms type!"); + } + void getLocalGradients(Mesh*, MeshEntity*, + Vector3 const& , + NewArray& ) const + { + fail("getLocalGradients not implemented for quadratic prisms type!"); + } + void getVectorValues(Mesh*, MeshEntity*, + Vector3 const&, NewArray&) const + { + fail("getVectorValues not defined for nodal shapes"); + } + int countNodes() const {return 15;} + }; EntityShape* getEntityShape(int type) { static Linear::Vertex vertex; static Edge edge; static Triangle triangle; static Tetrahedron tet; + static Prism prism; static EntityShape* shapes[Mesh::TYPES] = {&vertex, //vertex &edge, //edge @@ -535,11 +557,27 @@ class QuadraticBase : public FieldShape NULL, //quad &tet, //tet NULL, //hex - NULL, //prism + &prism, //prism NULL}; //pyramid return shapes[type]; } int getOrder() {return 2;} + bool hasNodesIn(int dimension) + { + if (dimension == 3) + return false; + else + return true; + } + int countNodesOn(int type) + { + if (type == Mesh::VERTEX) + return 1; + if (type == Mesh::EDGE) + return 1; + return 0; + } + void getNodeXi(int, int, Vector3& xi) { /* for vertex nodes, mid-edge nodes, From 27ca7917b21ca3787b3ee0f0f586878554cfb396 Mon Sep 17 00:00:00 2001 From: Morteza HS Date: Tue, 29 Mar 2022 09:03:30 -0400 Subject: [PATCH 2/4] Fixes total num of nodes for 2order prisms --- apf/apfShape.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apf/apfShape.cc b/apf/apfShape.cc index 7686d6acd..3d5f2f1a3 100644 --- a/apf/apfShape.cc +++ b/apf/apfShape.cc @@ -541,7 +541,7 @@ class QuadraticBase : public FieldShape { fail("getVectorValues not defined for nodal shapes"); } - int countNodes() const {return 15;} + int countNodes() const {return 18;} }; EntityShape* getEntityShape(int type) { From 2204aee0885a4277db7818cb7ac33819ef8e8e8a Mon Sep 17 00:00:00 2001 From: Morteza HS Date: Tue, 29 Mar 2022 09:34:19 -0400 Subject: [PATCH 3/4] Reverts some of the changes made for quad prisms --- apf/apfShape.cc | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/apf/apfShape.cc b/apf/apfShape.cc index 3d5f2f1a3..b41f308d0 100644 --- a/apf/apfShape.cc +++ b/apf/apfShape.cc @@ -562,22 +562,6 @@ class QuadraticBase : public FieldShape return shapes[type]; } int getOrder() {return 2;} - bool hasNodesIn(int dimension) - { - if (dimension == 3) - return false; - else - return true; - } - int countNodesOn(int type) - { - if (type == Mesh::VERTEX) - return 1; - if (type == Mesh::EDGE) - return 1; - return 0; - } - void getNodeXi(int, int, Vector3& xi) { /* for vertex nodes, mid-edge nodes, From f4342087d8273f5e15aaef2b57d84362af3a7764 Mon Sep 17 00:00:00 2001 From: Morteza HS Date: Tue, 29 Mar 2022 09:34:53 -0400 Subject: [PATCH 4/4] Adds quadratic prism vtk type --- apf/apfVtk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apf/apfVtk.cc b/apf/apfVtk.cc index e71744a38..c1568db5e 100644 --- a/apf/apfVtk.cc +++ b/apf/apfVtk.cc @@ -557,7 +557,7 @@ static void writeTypes(std::ostream& file, ,{ 9,23}//quad ,{10,24}//tet ,{12,25}//hex - ,{13,-1}//prism + ,{13,32}//prism ,{14,-1}//pyramid }; if (isWritingBinary)