Commit aea9a3a1 authored by Dave Moxey's avatar Dave Moxey
Browse files

Add StdRegions tests to pyramid

parent 1c2a0c02
......@@ -71,6 +71,7 @@ ADD_NEKTAR_TEST(StdProject3D_Tet_Orth_P6_Q7)
ADD_NEKTAR_TEST(StdProject3D_Tet_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject3D_Prism_Orth_P6_Q7)
ADD_NEKTAR_TEST(StdProject3D_Prism_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject3D_Pyr_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject3D_Hex_Orth_P6_Q7)
ADD_NEKTAR_TEST(StdProject3D_Hex_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject3D_Hex_Lagrange_P6_Q7)
......@@ -80,6 +81,7 @@ ADD_NEKTAR_TEST(StdProject_Diff3D_Tet_Orth_P6_Q7)
ADD_NEKTAR_TEST(StdProject_Diff3D_Tet_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject_Diff3D_Prism_Orth_P6_Q7)
ADD_NEKTAR_TEST(StdProject_Diff3D_Prism_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject_Diff3D_Pyr_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject_Diff3D_Hex_Orth_P6_Q7)
ADD_NEKTAR_TEST(StdProject_Diff3D_Hex_Mod_P6_Q7)
ADD_NEKTAR_TEST(StdProject_Diff3D_Hex_Lagrange_P6_Q7)
......
......@@ -4,6 +4,7 @@
#include <StdRegions/StdHexExp.h>
#include <StdRegions/StdPrismExp.h>
#include <StdRegions/StdPyrExp.h>
#include <StdRegions/StdTetExp.h>
#include <LibUtilities/Foundations/Foundations.hpp>
......@@ -72,6 +73,7 @@ int main(int argc, char *argv[]){
fprintf(stderr,"Where RegionShape is an integer value which "
"dictates the region shape:\n");
fprintf(stderr,"\t Tetrahedron = 5\n");
fprintf(stderr,"\t Pyramid = 6\n");
fprintf(stderr,"\t Prism = 7\n");
fprintf(stderr,"\t Hexahedron = 8\n");
......@@ -99,6 +101,7 @@ int main(int argc, char *argv[]){
// Check to see if 3D region
if (regionshape != LibUtilities::eTetrahedron &&
regionshape != LibUtilities::ePyramid &&
regionshape != LibUtilities::ePrism &&
regionshape != LibUtilities::eHexahedron)
{
......@@ -144,6 +147,26 @@ int main(int argc, char *argv[]){
"Ortho_B, Modified_A or Modified_B");
}
break;
case LibUtilities::ePyramid:
if((btype1 == eOrtho_B) || (btype1 == eOrtho_C)
|| (btype1 == eModified_B) || (btype1 == eModified_C))
{
NEKERROR(ErrorUtil::efatal, "Basis 1 cannot be of type Ortho_B, "
"Ortho_C, Modified_B or Modified_C");
}
if((btype2 == eOrtho_B) || (btype2 == eOrtho_C)
|| (btype2 == eModified_B) || (btype2 == eModified_C))
{
NEKERROR(ErrorUtil::efatal, "Basis 2 cannot be of type Ortho_B, "
"Ortho_C, Modified_B or Modified_C");
}
if((btype3 == eOrtho_A) || (btype3 == eOrtho_B)
|| (btype3 == eModified_A) || (btype3 == eModified_B))
{
NEKERROR(ErrorUtil::efatal, "Basis 3 cannot be of type Ortho_A, "
"Ortho_B, Modified_A or Modified_B");
}
break;
case LibUtilities::ePrism:
if((btype1 == eOrtho_B) || (btype1 == eOrtho_C)
|| (btype1 == eModified_B) || (btype1 == eModified_C))
......@@ -227,7 +250,8 @@ int main(int argc, char *argv[]){
if(btype3 != LibUtilities::eFourier)
{
if (regionshape == LibUtilities::eTetrahedron)
if (regionshape == LibUtilities::eTetrahedron ||
regionshape == LibUtilities::ePyramid)
{
Qtype3 = LibUtilities::eGaussRadauMAlpha2Beta0;
}
......@@ -271,6 +295,27 @@ int main(int argc, char *argv[]){
//----------------------------------------------
}
break;
case LibUtilities::ePyramid:
{
const LibUtilities::PointsKey Pkey1(nq1,Qtype1);
const LibUtilities::PointsKey Pkey2(nq2,Qtype2);
const LibUtilities::PointsKey Pkey3(nq3,Qtype3);
const LibUtilities::BasisKey Bkey1(btype1,order1,Pkey1);
const LibUtilities::BasisKey Bkey2(btype2,order2,Pkey2);
const LibUtilities::BasisKey Bkey3(btype3,order3,Pkey3);
E = new StdRegions::StdPyrExp(Bkey1,Bkey2,Bkey3);
E->GetCoords(x,y,z);
//----------------------------------------------
// Define solution to be projected
for(i = 0; i < nq1*nq2*nq3; ++i)
{
sol[i] = Tet_sol(x[i],y[i],z[i],order1,order2,order3);
}
//----------------------------------------------
}
break;
case LibUtilities::ePrism:
{
const LibUtilities::PointsKey Pkey1(nq1,Qtype1);
......@@ -344,6 +389,7 @@ int main(int argc, char *argv[]){
switch(regionshape)
{
case LibUtilities::eTetrahedron:
case LibUtilities::ePyramid:
{
for(i = 0; i < nq1*nq2*nq3; ++i)
{
......
<?xml version="1.0" encoding="utf-8" ?>
<test>
<description>StdProject3D Pyramid Modified basis P=6 Q=7</description>
<executable>StdProject3D</executable>
<parameters>6 4 4 6 6 6 6 7 7 6</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">1.35652e-12</value>
</metric>
<metric type="Linf" id="2">
<value tolerance="1e-12">3.8245e-12</value>
</metric>
</metrics>
</test>
<?xml version="1.0" encoding="utf-8" ?>
<test>
<description>StdProject_Diff3D Pyramid Modified basis P=6 Q=7</description>
<executable>StdProject_Diff3D</executable>
<parameters>6 4 4 6 6 6 6 7 7 6</parameters>
<metrics>
<metric type="L2" id="1">
<value tolerance="1e-12">4.99628e-12</value>
</metric>
<metric type="Linf" id="2">
<value tolerance="1e-12">2.5608e-11</value>
</metric>
</metrics>
</test>
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