From b27521b43acbc16a8138302e8a2382ac11a4a731 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Fri, 8 Apr 2016 12:29:42 +0100 Subject: [PATCH 01/11] Start working on AssemblyMapCG for varP in 3D --- .../AssemblyMap/AssemblyMapCG.cpp | 192 +++++++++++++----- 1 file changed, 143 insertions(+), 49 deletions(-) diff --git a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp index 60c53fa60..20e7e60a1 100644 --- a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp +++ b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp @@ -826,7 +826,7 @@ namespace Nektar for(j = 0; j < nEdges; ++j) { - nEdgeIntCoeffs = exp->GetEdgeNcoeffs(j) - 2; + nEdgeIntCoeffs = EdgeSize[meshEdgeId]; meshEdgeId = exp->GetGeom()->GetEid(j); if(graph[1].count(meshEdgeId) == 0) { @@ -1270,12 +1270,12 @@ namespace Nektar : AssemblyMap(pSession, variable) { int i, j, k, l; + int p, q, numModes0, numModes1; int cnt = 0; int intDofCnt; int meshVertId, meshEdgeId, meshFaceId; int globalId; int nEdgeInteriorCoeffs; - int nFaceInteriorCoeffs; int firstNonDirGraphVertId; LibUtilities::CommSharedPtr vComm = m_comm->GetRowComm(); LocalRegions::ExpansionSharedPtr exp, bndExp; @@ -1295,6 +1295,8 @@ namespace Nektar // Stores vertex, edge and face reordered vertices. DofGraph graph(3); DofGraph dofs(3); + vector > faceModes(2); + map faceType; set extraDirVerts, extraDirEdges; BottomUpSubStructuredGraphSharedPtr bottomUpGraph; @@ -1305,25 +1307,26 @@ namespace Nektar { exp = locExpVector[i]; - for(j = 0; j < locExpVector[i]->GetNverts(); ++j) + for(j = 0; j < exp->GetNverts(); ++j) { dofs[0][exp->GetGeom()->GetVid(j)] = 1; } - for(j = 0; j < locExpVector[i]->GetNedges(); ++j) + for(j = 0; j < exp->GetNedges(); ++j) { if (dofs[1].count(exp->GetGeom()->GetEid(j)) > 0) { if (dofs[1][exp->GetGeom()->GetEid(j)] != - locExpVector[i]->GetEdgeNcoeffs(j)-2) + exp->GetEdgeNcoeffs(j)-2) { ASSERTL0( (exp->GetEdgeBasisType(j) == LibUtilities::eModified_A) || - (exp->GetEdgeBasisType(j) == LibUtilities::eModified_B), + (exp->GetEdgeBasisType(j) == LibUtilities::eModified_B) || + (exp->GetEdgeBasisType(j) == LibUtilities::eModified_C), "CG with variable order only available with modal expansion"); } dofs[1][exp->GetGeom()->GetEid(j)] = min(dofs[1][exp->GetGeom()->GetEid(j)], - locExpVector[i]->GetEdgeNcoeffs(j)-2); + exp->GetEdgeNcoeffs(j)-2); } else { @@ -1332,24 +1335,31 @@ namespace Nektar } } - for(j = 0; j < locExpVector[i]->GetNfaces(); ++j) + for(j = 0; j < exp->GetNfaces(); ++j) { - if (dofs[2].count(exp->GetGeom()->GetFid(j)) > 0) + faceOrient = exp->GetGeom()->GetForient(j); + meshFaceId = exp->GetGeom()->GetFid(j); + exp->GetFaceNumModes(j, faceOrient, numModes0, numModes1); + + if (faceModes[0].count(meshFaceId) > 0) { - if (dofs[2][exp->GetGeom()->GetFid(j)] != - exp->GetFaceIntNcoeffs(j)) - { - ASSERTL0( false, - "CG with variable order not available in 3D"); - } - dofs[2][exp->GetGeom()->GetFid(j)] = - min(dofs[2][exp->GetGeom()->GetFid(j)], - exp->GetFaceIntNcoeffs(j)); + faceModes[0][meshFaceId] = + min(faceModes[0][meshFaceId], numModes0); + + faceModes[1][meshFaceId] = + min(faceModes[1][meshFaceId], numModes1); } else { - dofs[2][exp->GetGeom()->GetFid(j)] = - exp->GetFaceIntNcoeffs(j); + faceModes[0][meshFaceId] = numModes0; + faceModes[1][meshFaceId] = numModes1; + + // Get shape of this face + SpatialDomains::Geometry3DSharedPtr geom; + geom = boost::dynamic_pointer_cast (exp->GetGeom()); + faceType[meshFaceId] = + geom->GetFace(j)->GetShapeType(); } } } @@ -1372,19 +1382,36 @@ namespace Nektar dofs[1][edgeId[i]] = (int) (edgeDof[i]+0.5); } // faces - Array faceId (dofs[2].size()); - Array faceDof (dofs[2].size()); - for(dofIt = dofs[2].begin(), i=0; dofIt != dofs[2].end(); dofIt++, i++) + Array faceId (faceModes[0].size()); + Array faceP (faceModes[0].size()); + Array faceQ (faceModes[0].size()); + for(dofIt = faceOrder[0].begin(), i=0; dofIt != faceOrder[0].end(); dofIt++, i++) { faceId[i] = dofIt->first; - faceDof[i] = (NekDouble) dofIt->second; + faceP[i] = (NekDouble) dofIt->second; + faceQ[i] = (NekDouble) faceOrder[1][dofIt->first]; } Gs::gs_data *tmp2 = Gs::Init(faceId, vComm); - Gs::Gather(faceDof, Gs::gs_min, tmp2); + Gs::Gather(faceP, Gs::gs_min, tmp2); + Gs::Gather(faceQ, Gs::gs_min, tmp2); Gs::Finalise(tmp2); - for (i=0; i < dofs[2].size(); i++) + for (i=0; i < faceModes[0].size(); i++) { - dofs[2][faceId[i]] = (int) (faceDof[i]+0.5); + faceModes[0][faceId[i]] = (int) (faceP[i]+0.5); + faceModes[1][faceId[i]] = (int) (faceQ[i]+0.5); + if (faceType[faceId[i]] == LibUtilities::eQuadrilateral) + { + // Quad face + dofs[2][faceId[i]] = (faceModes[0][faceId[i]] - 2) * + (faceModes[1][faceId[i]] - 2); + } + else + { + // Tri face + dofs[2][faceId[i]] = (faceModes[0][faceId[i]]-2) * + (2*(faceModes[1][faceId[i]]-2) - + (faceModes[0][faceId[i]]-2) -1)/2; + } } Array bndCondVec(1, bndConditions); @@ -1447,7 +1474,6 @@ namespace Nektar for(j = 0; j < exp->GetNfaces(); ++j) { - nFaceInteriorCoeffs = exp->GetFaceIntNcoeffs(j); meshFaceId = exp->GetGeom()->GetFid(j); graphVertOffset[graph[2][meshFaceId]+1] = dofs[2][meshFaceId]; } @@ -1559,7 +1585,6 @@ namespace Nektar for(j = 0; j < exp->GetNfaces(); ++j) { - nFaceInteriorCoeffs = exp->GetFaceIntNcoeffs(j); faceOrient = exp->GetGeom()->GetForient(j); meshFaceId = exp->GetGeom()->GetFid(j); @@ -1574,29 +1599,81 @@ namespace Nektar exp->GetFaceInteriorMap(j,faceOrient,faceInteriorMap,faceInteriorSign); // Set the global DOF's for the interior modes of face j - for(k = 0; k < dofs[2][exp->GetGeom()->GetFid(j)]; ++k) - { - m_localToGlobalMap[cnt+faceInteriorMap[k]] = - graphVertOffset[graph[2][meshFaceId]]+k; - } - for(k = dofs[2][exp->GetGeom()->GetFid(j)]; k < nFaceInteriorCoeffs; ++k) + exp->GetFaceNumModes(j, faceOrient, numModes0, numModes1); + switch(faceType[meshFaceId]) { - m_localToGlobalMap[cnt+faceInteriorMap[k]] = - graphVertOffset[graph[2][meshFaceId]]; - } - - if(m_signChange) + case LibUtilities::eQuadrilateral: { - for(k = 0; k < dofs[2][exp->GetGeom()->GetFid(j)]; ++k) + int kLoc=0; + k = 0; + for( q = 2; q < numModes1; q++) { - m_localToGlobalSign[cnt+faceInteriorMap[k]] = (NekDouble) faceInteriorSign[k]; + for( p = 2; p < numModes0; p++) + { + if( (p < faceModes[0][meshFaceId]) && + (q < faceModes[1][meshFaceId])) + { + m_localToGlobalMap[cnt+faceInteriorMap[kLoc]] = + graphVertOffset[graph[2][meshFaceId]]+k; + if(m_signChange) + { + m_localToGlobalSign[cnt+faceInteriorMap[kLoc]] = + (NekDouble) faceInteriorSign[kLoc]; + } + k++; + } + else + { + m_localToGlobalMap[cnt+faceInteriorMap[kLoc]] = + graphVertOffset[graph[2][meshFaceId]]; + if(m_signChange) + { + m_localToGlobalSign[cnt+faceInteriorMap[kLoc]] = 0.0; + } + } + kLoc++; + } } - for(k = dofs[2][exp->GetGeom()->GetFid(j)]; k < nFaceInteriorCoeffs; ++k) + } + break; + case LibUtilities::eTriangle: + { + int kLoc=0; + k = 0; + for( p = 2; p < numModes0; p++) { - m_localToGlobalSign[cnt+faceInteriorMap[k]] = 0; + for( q = 1; q < numModes1-p; q++) + { + if( (p < faceModes[0][meshFaceId]) && + (p+q < faceModes[1][meshFaceId])) + { + m_localToGlobalMap[cnt+faceInteriorMap[kLoc]] = + graphVertOffset[graph[2][meshFaceId]]+k; + if(m_signChange) + { + m_localToGlobalSign[cnt+faceInteriorMap[kLoc]] = + (NekDouble) faceInteriorSign[kLoc]; + } + k++; + } + else + { + m_localToGlobalMap[cnt+faceInteriorMap[kLoc]] = + graphVertOffset[graph[2][meshFaceId]]; + if(m_signChange) + { + m_localToGlobalSign[cnt+faceInteriorMap[kLoc]] = 0.0; + } + } + kLoc++; + } } } - + break; + default: + ASSERTL0(false,"Shape not recognised"); + break; + } } } @@ -1657,19 +1734,28 @@ namespace Nektar bndExp->GetEdgeInteriorMap( k,edgeOrient,edgeInteriorMap,edgeInteriorSign); - for(l = 0; l < nEdgeInteriorCoeffs; ++l) + for(l = 0; l < dofs[1][meshEdgeId]; ++l) { m_bndCondCoeffsToGlobalCoeffsMap[cnt+edgeInteriorMap[l]] = graphVertOffset[graph[1][meshEdgeId]]+l; } + for(l = dofs[1][meshEdgeId]; l < nEdgeInteriorCoeffs; ++l) + { + m_bndCondCoeffsToGlobalCoeffsMap[cnt+edgeInteriorMap[l]] = + graphVertOffset[graph[1][meshEdgeId]]; + } // Fill the sign vector if required if(m_signChange) { - for(l = 0; l < nEdgeInteriorCoeffs; ++l) + for(l = 0; l < dofs[1][meshEdgeId]; ++l) { m_bndCondCoeffsToGlobalCoeffsSign[cnt+edgeInteriorMap[l]] = (NekDouble) edgeInteriorSign[l]; } + for(l = dofs[1][meshEdgeId]; l < nEdgeInteriorCoeffs; ++l) + { + m_bndCondCoeffsToGlobalCoeffsSign[cnt+edgeInteriorMap[l]] = 0.0; + } } if (bndConditions[i]->GetBoundaryConditionType() != @@ -1683,7 +1769,7 @@ namespace Nektar foundExtraEdges.count(meshEdgeId) == 0 && nEdgeInteriorCoeffs > 0) { - for(l = 0; l < nEdgeInteriorCoeffs; ++l) + for(l = 0; l < dofs[1][meshEdgeId]; ++l) { int loc = bndCondExp[i]->GetCoeff_Offset(j) + edgeInteriorMap[l]; @@ -1692,6 +1778,15 @@ namespace Nektar ExtraDirDof t(loc, gid, edgeInteriorSign[l]); m_extraDirDofs[i].push_back(t); } + for(l = dofs[1][meshEdgeId]; l < nEdgeInteriorCoeffs; ++l) + { + int loc = bndCondExp[i]->GetCoeff_Offset(j) + + edgeInteriorMap[l]; + int gid = graphVertOffset[ + graph[1][meshEdgeId]]; + ExtraDirDof t(loc, gid, 0.0); + m_extraDirDofs[i].push_back(t); + } foundExtraEdges.insert(meshEdgeId); } } @@ -2109,7 +2204,6 @@ namespace Nektar exp->GetFaceInteriorMap(j,faceOrient,faceInteriorMap,faceInteriorSign); dof = exp->GetFaceIntNcoeffs(j); - for(k = dof-1; k >= 0; --k) { vGlobalId = m_localToGlobalMap[cnt+faceInteriorMap[k]]; -- GitLab From 5e78bcaf8e4b6c3dbe02d1abec4df8d1695fbec0 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Fri, 8 Apr 2016 12:42:56 +0100 Subject: [PATCH 02/11] Create GetFaceNumModes function --- library/StdRegions/StdExpansion.cpp | 11 ++++- library/StdRegions/StdExpansion.h | 13 ++++++ library/StdRegions/StdHexExp.cpp | 63 +++++++++++++++++++++++++++++ library/StdRegions/StdHexExp.h | 6 ++- library/StdRegions/StdPrismExp.cpp | 52 ++++++++++++++++++++++++ library/StdRegions/StdPrismExp.h | 5 +++ library/StdRegions/StdPyrExp.cpp | 46 ++++++++++++++++++++- library/StdRegions/StdPyrExp.h | 5 +++ library/StdRegions/StdTetExp.cpp | 32 +++++++++++++++ library/StdRegions/StdTetExp.h | 6 ++- 10 files changed, 234 insertions(+), 5 deletions(-) diff --git a/library/StdRegions/StdExpansion.cpp b/library/StdRegions/StdExpansion.cpp index 555263478..810042ec0 100644 --- a/library/StdRegions/StdExpansion.cpp +++ b/library/StdRegions/StdExpansion.cpp @@ -1414,7 +1414,7 @@ namespace Nektar NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" ); } - int StdExpansion::v_GetVertexMap(const int localVertexId, + int StdExpansion::v_GetVertexMap(const int localVertexId, bool useCoeffPacking) { NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" ); @@ -1428,6 +1428,15 @@ namespace Nektar NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" ); } + void StdExpansion::v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1) + { + NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" ); + } + void StdExpansion::v_GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array &maparray, Array &signarray) diff --git a/library/StdRegions/StdExpansion.h b/library/StdRegions/StdExpansion.h index 3d8812d0f..a30a8face 100644 --- a/library/StdRegions/StdExpansion.h +++ b/library/StdRegions/StdExpansion.h @@ -836,6 +836,13 @@ namespace Nektar v_GetEdgeInteriorMap(eid,edgeOrient,maparray,signarray); } + void GetFaceNumModes(const int fid, const Orientation faceOrient, + int &numModes0, + int &numModes1) + { + v_GetFaceNumModes(fid,faceOrient,numModes0,numModes1); + } + void GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array &maparray, Array &signarray) @@ -1706,6 +1713,12 @@ namespace Nektar Array &maparray, Array &signarray); + STD_REGIONS_EXPORT virtual void v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1); + STD_REGIONS_EXPORT virtual void v_GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array &maparray, Array &signarray); diff --git a/library/StdRegions/StdHexExp.cpp b/library/StdRegions/StdHexExp.cpp index 0a40beaa6..4425cfee2 100644 --- a/library/StdRegions/StdHexExp.cpp +++ b/library/StdRegions/StdHexExp.cpp @@ -925,6 +925,69 @@ namespace Nektar } } + void StdHexExp::v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1) + { + int nummodes [3] = {m_base[0]->GetNumModes(), + m_base[1]->GetNumModes(), + m_base[2]->GetNumModes()}; + switch(fid) + { + case 0: + case 5: + { + if( faceOrient < 9 ) + { + numModes0 = nummodes[0]; + numModes1 = nummodes[1]; + } + else + { + numModes0 = nummodes[1]; + numModes1 = nummodes[0]; + } + } + break; + case 1: + case 3: + { + if( faceOrient < 9 ) + { + numModes0 = nummodes[0]; + numModes1 = nummodes[2]; + } + else + { + numModes0 = nummodes[2]; + numModes1 = nummodes[0]; + } + } + break; + case 2: + case 4: + { + if( faceOrient < 9 ) + { + numModes0 = nummodes[1]; + numModes1 = nummodes[2]; + } + else + { + numModes0 = nummodes[2]; + numModes1 = nummodes[1]; + } + } + break; + default: + { + ASSERTL0(false,"fid out of range"); + } + break; + } + } /** * Only for basis type Modified_A or GLL_LAGRANGE in all directions. diff --git a/library/StdRegions/StdHexExp.h b/library/StdRegions/StdHexExp.h index df3baf52a..8e3143454 100644 --- a/library/StdRegions/StdHexExp.h +++ b/library/StdRegions/StdHexExp.h @@ -199,7 +199,11 @@ namespace Nektar Array &coords_x, Array &coords_y, Array &coords_z); - + STD_REGIONS_EXPORT virtual void v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1); //-------------------------- // Mappings diff --git a/library/StdRegions/StdPrismExp.cpp b/library/StdRegions/StdPrismExp.cpp index d0b584204..174cda21b 100644 --- a/library/StdRegions/StdPrismExp.cpp +++ b/library/StdRegions/StdPrismExp.cpp @@ -726,6 +726,58 @@ namespace Nektar StdPrismExp::v_BwdTrans(tmp, outarray); } + void StdPrismExp::v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1) + { + int nummodes [3] = {m_base[0]->GetNumModes(), + m_base[1]->GetNumModes(), + m_base[2]->GetNumModes()}; + switch(fid) + { + // base quad + case 0: + { + if( faceOrient < 9 ) + { + numModes0 = nummodes[0]; + numModes1 = nummodes[1]; + } + else + { + numModes0 = nummodes[1]; + numModes1 = nummodes[0]; + } + } + break; + // front and back quad + case 2: + case 4: + { + if( faceOrient < 9 ) + { + numModes0 = nummodes[1]; + numModes1 = nummodes[2]; + } + else + { + numModes0 = nummodes[2]; + numModes1 = nummodes[1]; + } + } + break; + // triangles + case 1: + case 3: + { + numModes0 = nummodes[0]; + numModes1 = nummodes[2]; + } + break; + } + } //--------------------------------------- // Helper functions diff --git a/library/StdRegions/StdPrismExp.h b/library/StdRegions/StdPrismExp.h index 9b82bc899..31ac7b45b 100644 --- a/library/StdRegions/StdPrismExp.h +++ b/library/StdRegions/StdPrismExp.h @@ -165,6 +165,11 @@ namespace Nektar STD_REGIONS_EXPORT virtual void v_FillMode( const int mode, Array &outarray); + STD_REGIONS_EXPORT virtual void v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1); //--------------------------------------- // Helper functions diff --git a/library/StdRegions/StdPyrExp.cpp b/library/StdRegions/StdPyrExp.cpp index 32e34dd45..8687e628b 100644 --- a/library/StdRegions/StdPyrExp.cpp +++ b/library/StdRegions/StdPyrExp.cpp @@ -865,8 +865,50 @@ namespace Nektar tmp[mode] = 1.0; v_BwdTrans(tmp, outarray); } - - + + void StdPyrExp::v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1) + { + int nummodes [3] = {m_base[0]->GetNumModes(), + m_base[1]->GetNumModes(), + m_base[2]->GetNumModes()}; + switch(fid) + { + // quad + case 0: + { + if( faceOrient < 9 ) + { + numModes0 = nummodes[0]; + numModes1 = nummodes[1]; + } + else + { + numModes0 = nummodes[1]; + numModes1 = nummodes[0]; + } + } + break; + case 1: + case 3: + { + numModes0 = nummodes[0]; + numModes1 = nummodes[2]; + } + break; + case 2: + case 4: + { + numModes0 = nummodes[1]; + numModes1 = nummodes[2]; + } + break; + } + } + //--------------------------------------- // Helper functions //--------------------------------------- diff --git a/library/StdRegions/StdPyrExp.h b/library/StdRegions/StdPyrExp.h index 0188cd5a9..446efb439 100644 --- a/library/StdRegions/StdPyrExp.h +++ b/library/StdRegions/StdPyrExp.h @@ -191,6 +191,11 @@ namespace Nektar STD_REGIONS_EXPORT virtual void v_FillMode( const int mode, Array &outarray); + STD_REGIONS_EXPORT virtual void v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1); //--------------------------------------- // Helper functions diff --git a/library/StdRegions/StdTetExp.cpp b/library/StdRegions/StdTetExp.cpp index 3117e2e05..1a4bc98ae 100644 --- a/library/StdRegions/StdTetExp.cpp +++ b/library/StdRegions/StdTetExp.cpp @@ -904,6 +904,38 @@ namespace Nektar StdTetExp::v_BwdTrans(tmp, outarray); } + void StdTetExp::v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1) + { + int nummodes [3] = {m_base[0]->GetNumModes(), + m_base[1]->GetNumModes(), + m_base[2]->GetNumModes()}; + switch(fid) + { + case 0: + { + numModes0 = nummodes[0]; + numModes1 = nummodes[1]; + } + break; + case 1: + { + numModes0 = nummodes[0]; + numModes1 = nummodes[2]; + } + break; + case 2: + case 3: + { + numModes0 = nummodes[1]; + numModes1 = nummodes[2]; + } + break; + } + } //--------------------------- // Helper functions diff --git a/library/StdRegions/StdTetExp.h b/library/StdRegions/StdTetExp.h index 224329c2e..9c6d2d449 100644 --- a/library/StdRegions/StdTetExp.h +++ b/library/StdRegions/StdTetExp.h @@ -173,7 +173,11 @@ namespace Nektar STD_REGIONS_EXPORT virtual void v_FillMode( const int mode, Array& outarray); - + STD_REGIONS_EXPORT virtual void v_GetFaceNumModes( + const int fid, + const Orientation faceOrient, + int &numModes0, + int &numModes1); //--------------------------- // Helper functions -- GitLab From f7eaff1344f6e20db734edd4836d497c67b9ea03 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Fri, 8 Apr 2016 12:57:31 +0100 Subject: [PATCH 03/11] Fix small mistake in assembly map --- library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp index 20e7e60a1..5e6d301a9 100644 --- a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp +++ b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp @@ -1385,11 +1385,11 @@ namespace Nektar Array faceId (faceModes[0].size()); Array faceP (faceModes[0].size()); Array faceQ (faceModes[0].size()); - for(dofIt = faceOrder[0].begin(), i=0; dofIt != faceOrder[0].end(); dofIt++, i++) + for(dofIt = faceModes[0].begin(), i=0; dofIt != faceModes[0].end(); dofIt++, i++) { faceId[i] = dofIt->first; faceP[i] = (NekDouble) dofIt->second; - faceQ[i] = (NekDouble) faceOrder[1][dofIt->first]; + faceQ[i] = (NekDouble) faceModes[1][dofIt->first]; } Gs::gs_data *tmp2 = Gs::Init(faceId, vComm); Gs::Gather(faceP, Gs::gs_min, tmp2); -- GitLab From 7fe8fe94532027f8a0a7e2052fad6e379ce9ae53 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Fri, 8 Apr 2016 14:34:25 +0100 Subject: [PATCH 04/11] Fix 3D varP in parallel --- .../AssemblyMap/AssemblyMapCG.cpp | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp index 5e6d301a9..17c391a37 100644 --- a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp +++ b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp @@ -2071,7 +2071,7 @@ namespace Nektar int maxIntDof = 0; int dof = 0; int cnt; - int i,j,k; + int i,j,k,l; int meshVertId; int meshEdgeId; int meshFaceId; @@ -2172,14 +2172,22 @@ namespace Nektar dof = exp->GetEdgeNcoeffs(j)-2; // Set the global DOF's for the interior modes of edge j - // run backwards because of variable P case "ghost" modes - for(k = dof-1; k >= 0; --k) + // for varP, ignore modes with sign == 0 + for(k = 0, l = 0; k < dof; ++k) { + if (m_signChange) + { + if (m_localToGlobalSign[cnt+edgeInteriorMap[k]]==0) + { + continue; + } + } vGlobalId = m_localToGlobalMap[cnt+edgeInteriorMap[k]]; m_globalToUniversalMap[vGlobalId] - = nVert + meshEdgeId * maxEdgeDof + k + 1; + = nVert + meshEdgeId * maxEdgeDof + l + 1; m_globalToUniversalBndMap[vGlobalId]=m_globalToUniversalMap[vGlobalId]; maxBndGlobalId = (vGlobalId > maxBndGlobalId ? vGlobalId : maxBndGlobalId); + l++; } } @@ -2204,15 +2212,23 @@ namespace Nektar exp->GetFaceInteriorMap(j,faceOrient,faceInteriorMap,faceInteriorSign); dof = exp->GetFaceIntNcoeffs(j); - for(k = dof-1; k >= 0; --k) + for(k = 0, l = 0; k < dof; ++k) { + if (m_signChange) + { + if (m_localToGlobalSign[cnt+faceInteriorMap[k]]==0) + { + continue; + } + } vGlobalId = m_localToGlobalMap[cnt+faceInteriorMap[k]]; m_globalToUniversalMap[vGlobalId] = nVert + nEdge*maxEdgeDof + meshFaceId * maxFaceDof - + k + 1; + + l + 1; m_globalToUniversalBndMap[vGlobalId]=m_globalToUniversalMap[vGlobalId]; maxBndGlobalId = (vGlobalId > maxBndGlobalId ? vGlobalId : maxBndGlobalId); + l++; } } -- GitLab From aa14747a91211aa6b7bb3e437c77bcd83fc5e849 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Fri, 8 Apr 2016 15:06:31 +0100 Subject: [PATCH 05/11] Modify Scatr operation inside ContField3D --- library/MultiRegions/ContField3D.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/library/MultiRegions/ContField3D.cpp b/library/MultiRegions/ContField3D.cpp index 3914e3537..01867ac7a 100644 --- a/library/MultiRegions/ContField3D.cpp +++ b/library/MultiRegions/ContField3D.cpp @@ -336,7 +336,14 @@ namespace Nektar for(int j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); ++j) { sign = m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt); - inout[map[bndcnt++]] = sign * coeffs[j]; + if(sign) + { + inout[map[bndcnt++]] = sign * coeffs[j]; + } + else + { + bndcnt++; + } } } else @@ -462,7 +469,14 @@ namespace Nektar { sign = m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign( bndcnt); - tmp[bndMap[bndcnt++]] = sign * coeffs[j]; + if (sign) + { + tmp[bndMap[bndcnt++]] = sign * coeffs[j]; + } + else + { + bndcnt++; + } } } else -- GitLab From 52566cbf1ab1d476cb06b602cfa344343b408ea5 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Sat, 9 Apr 2016 17:13:44 +0100 Subject: [PATCH 06/11] Add tests for 3D variable P --- solvers/IncNavierStokesSolver/CMakeLists.txt | 5 + .../Tests/Hex_channel_varP.tst | 24 + .../Tests/Hex_channel_varP.xml | 242 +++++++++++ .../Tests/Hex_channel_varP_par.tst | 24 + .../Tests/Prism_channel_varP.tst | 23 + .../Tests/Prism_channel_varP.xml | 280 ++++++++++++ .../Tests/Pyr_channel_varP.tst | 23 + .../Tests/Pyr_channel_varP.xml | 168 +++++++ .../Tests/Tet_channel_varP.tst | 24 + .../Tests/Tet_channel_varP.xml | 411 ++++++++++++++++++ 10 files changed, 1224 insertions(+) create mode 100644 solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst create mode 100644 solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.xml create mode 100644 solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst create mode 100644 solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.tst create mode 100644 solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.xml create mode 100644 solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.tst create mode 100644 solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.xml create mode 100644 solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.tst create mode 100644 solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.xml diff --git a/solvers/IncNavierStokesSolver/CMakeLists.txt b/solvers/IncNavierStokesSolver/CMakeLists.txt index 1fc6e37dd..b029ef580 100644 --- a/solvers/IncNavierStokesSolver/CMakeLists.txt +++ b/solvers/IncNavierStokesSolver/CMakeLists.txt @@ -49,7 +49,9 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES ) ADD_NEKTAR_TEST(Channel_Flow_3modes_rad) ADD_NEKTAR_TEST(Couette_3DH2D_MVM) ADD_NEKTAR_TEST(Hex_channel_m3) + ADD_NEKTAR_TEST(Hex_channel_varP) ADD_NEKTAR_TEST(Pyr_channel_m3) + ADD_NEKTAR_TEST(Pyr_channel_varP) ADD_NEKTAR_TEST_LENGTHY(Hex_channel_m8) ADD_NEKTAR_TEST_LENGTHY(Hex_channel_m8_srhs) ADD_NEKTAR_TEST(Hex_Kovasnay_SubStep) @@ -77,10 +79,12 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES ) ADD_NEKTAR_TEST(Tet_channel_m3_dealiasing) ADD_NEKTAR_TEST(Tet_channel_robin_m3) ADD_NEKTAR_TEST(Tet_channel_m4_per) + ADD_NEKTAR_TEST(Tet_channel_varP) ADD_NEKTAR_TEST_LENGTHY(Tet_prism_channel_rad) ADD_NEKTAR_TEST_LENGTHY(Tet_equitri) ADD_NEKTAR_TEST_LENGTHY(Prism_channel_m6) ADD_NEKTAR_TEST_LENGTHY(Prism_channel_m6_dealiasing) + ADD_NEKTAR_TEST(Prism_channel_varP) ADD_NEKTAR_TEST(ChannelSpongeNSE) ADD_NEKTAR_TEST(ChannelSpongeLNSE) ADD_NEKTAR_TEST(ChanFlow_Standard_BodyForce) @@ -117,6 +121,7 @@ IF( NEKTAR_SOLVER_INCNAVIERSTOKES ) ADD_NEKTAR_TEST(ChanFlow_m3_par) ADD_NEKTAR_TEST_LENGTHY(ChanFlow_m8_BodyForce_par) ADD_NEKTAR_TEST_LENGTHY(Hex_channel_m8_par) + ADD_NEKTAR_TEST(Hex_channel_varP_par) ADD_NEKTAR_TEST_LENGTHY(Pyr_channel_m6_par) ADD_NEKTAR_TEST_LENGTHY(Hex_channel_m8_srhs_par) ADD_NEKTAR_TEST(Tet_channel_m8_par) diff --git a/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst new file mode 100644 index 000000000..617063fe8 --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst @@ -0,0 +1,24 @@ + + + 3D channel flow, Hexahedral elements, variable P + IncNavierStokesSolver + Hex_channel_varP.xml + + Hex_channel_varP.xml + + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 3.68816e-12 + + + + diff --git a/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.xml b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.xml new file mode 100644 index 000000000..04361fab0 --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.xml @@ -0,0 +1,242 @@ + + + + + 0.00000000e+00 0.00000000e+00 0.00000000e+00 + 5.00000000e-01 0.00000000e+00 0.00000000e+00 + 5.00000000e-01 5.00000000e-01 0.00000000e+00 + 0.00000000e+00 5.00000000e-01 0.00000000e+00 + 0.00000000e+00 0.00000000e+00 5.00000000e-01 + 5.00000000e-01 0.00000000e+00 5.00000000e-01 + 5.00000000e-01 5.00000000e-01 5.00000000e-01 + 0.00000000e+00 5.00000000e-01 5.00000000e-01 + 0.00000000e+00 0.00000000e+00 1.00000000e+00 + 5.00000000e-01 0.00000000e+00 1.00000000e+00 + 5.00000000e-01 5.00000000e-01 1.00000000e+00 + 0.00000000e+00 5.00000000e-01 1.00000000e+00 + 5.00000000e-01 1.00000000e+00 0.00000000e+00 + 0.00000000e+00 1.00000000e+00 0.00000000e+00 + 5.00000000e-01 1.00000000e+00 5.00000000e-01 + 0.00000000e+00 1.00000000e+00 5.00000000e-01 + 5.00000000e-01 1.00000000e+00 1.00000000e+00 + 0.00000000e+00 1.00000000e+00 1.00000000e+00 + 1.00000000e+00 0.00000000e+00 0.00000000e+00 + 1.00000000e+00 5.00000000e-01 0.00000000e+00 + 1.00000000e+00 0.00000000e+00 5.00000000e-01 + 1.00000000e+00 5.00000000e-01 5.00000000e-01 + 1.00000000e+00 0.00000000e+00 1.00000000e+00 + 1.00000000e+00 5.00000000e-01 1.00000000e+00 + 1.00000000e+00 1.00000000e+00 0.00000000e+00 + 1.00000000e+00 1.00000000e+00 5.00000000e-01 + 1.00000000e+00 1.00000000e+00 1.00000000e+00 + + + 0 1 + 0 3 + 0 4 + 1 2 + 1 5 + 2 3 + 2 6 + 3 7 + 4 5 + 4 7 + 5 6 + 6 7 + 4 8 + 5 9 + 6 10 + 7 11 + 8 9 + 8 11 + 9 10 + 10 11 + 3 13 + 2 12 + 12 13 + 12 14 + 13 15 + 7 15 + 6 14 + 14 15 + 14 16 + 15 17 + 11 17 + 10 16 + 16 17 + 1 18 + 18 19 + 18 20 + 19 2 + 19 21 + 5 20 + 20 21 + 21 6 + 20 22 + 21 23 + 9 22 + 22 23 + 23 10 + 19 24 + 24 12 + 24 25 + 21 25 + 25 14 + 25 26 + 23 26 + 26 16 + + + 0 3 5 1 + 0 4 8 2 + 3 6 10 4 + 5 7 11 6 + 1 2 9 7 + 8 10 11 9 + 8 13 16 12 + 10 14 18 13 + 11 15 19 14 + 9 12 17 15 + 16 18 19 17 + 5 21 22 20 + 21 23 26 6 + 22 24 27 23 + 20 7 25 24 + 11 26 27 25 + 26 28 31 14 + 27 29 32 28 + 25 15 30 29 + 19 31 32 30 + 33 34 36 3 + 33 35 38 4 + 34 37 39 35 + 36 6 40 37 + 38 39 40 10 + 38 41 43 13 + 39 42 44 41 + 40 14 45 42 + 43 44 45 18 + 36 46 47 21 + 46 48 49 37 + 47 23 50 48 + 40 49 50 26 + 49 51 52 42 + 50 28 53 51 + 45 52 53 31 + + + 0 1 2 3 4 5 + 5 6 7 8 9 10 + 11 3 12 13 14 15 + 15 8 16 17 18 19 + 20 21 22 23 2 24 + 24 25 26 27 7 28 + 29 23 30 31 12 32 + 32 27 33 34 16 35 + + + H[0-2] + H[3-4] + H[5-6] + H[7] + F[0,11,20,29] + F[1,6,21,25] + F[22,26,30,33] + F[13,17,31,34] + F[4,9,14,18] + F[10,19,28,35] + + C[10-13] + + + + + + + + + + + + + + + + + +

TimeStep = 0.001

+

NumSteps = 10

+

IO_CheckSteps = 10

+

IO_InfoSteps = 10

+

Kinvis = 1

+
+ + + u + v + w + p + + + + C[1] + C[6] + C[2] + C[3] + C[4] + C[5] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst new file mode 100644 index 000000000..e8540e545 --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst @@ -0,0 +1,24 @@ + + + 3D channel flow, Hex elements, par(2), varP + IncNavierStokesSolver + -I GlobalSysSoln=XxtMultiLevelStaticCond Hex_channel_varP.xml + 2 + + Hex_channel_varP.xml + + + + 0 + 0 + 0 + 2.13991e-12 + + + 0 + 0 + 0 + 4.18088e-12 + + + diff --git a/solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.tst b/solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.tst new file mode 100644 index 000000000..928b5bb15 --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.tst @@ -0,0 +1,23 @@ + + + 3D channel flow, Prismatic elements, variable P + IncNavierStokesSolver + Prism_channel_varP.xml + + Prism_channel_varP.xml + + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + + + diff --git a/solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.xml b/solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.xml new file mode 100644 index 000000000..05a2df29b --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Prism_channel_varP.xml @@ -0,0 +1,280 @@ + + + + + 0.00000000e+00 0.00000000e+00 5.00000000e-01 + 5.00000000e-01 0.00000000e+00 5.00000000e-01 + 5.00000000e-01 0.00000000e+00 0.00000000e+00 + 0.00000000e+00 0.00000000e+00 0.00000000e+00 + 5.00000000e-01 5.00000000e-01 5.00000000e-01 + 5.00000000e-01 5.00000000e-01 0.00000000e+00 + 0.00000000e+00 0.00000000e+00 1.00000000e+00 + 5.00000000e-01 0.00000000e+00 1.00000000e+00 + 5.00000000e-01 5.00000000e-01 1.00000000e+00 + 0.00000000e+00 5.00000000e-01 5.00000000e-01 + 0.00000000e+00 5.00000000e-01 0.00000000e+00 + 0.00000000e+00 5.00000000e-01 1.00000000e+00 + 5.00000000e-01 1.00000000e+00 5.00000000e-01 + 5.00000000e-01 1.00000000e+00 0.00000000e+00 + 5.00000000e-01 1.00000000e+00 1.00000000e+00 + 0.00000000e+00 1.00000000e+00 5.00000000e-01 + 0.00000000e+00 1.00000000e+00 0.00000000e+00 + 0.00000000e+00 1.00000000e+00 1.00000000e+00 + 1.00000000e+00 0.00000000e+00 5.00000000e-01 + 1.00000000e+00 0.00000000e+00 0.00000000e+00 + 1.00000000e+00 5.00000000e-01 5.00000000e-01 + 1.00000000e+00 5.00000000e-01 0.00000000e+00 + 1.00000000e+00 0.00000000e+00 1.00000000e+00 + 1.00000000e+00 5.00000000e-01 1.00000000e+00 + 1.00000000e+00 1.00000000e+00 5.00000000e-01 + 1.00000000e+00 1.00000000e+00 0.00000000e+00 + 1.00000000e+00 1.00000000e+00 1.00000000e+00 + + + 0 1 + 0 3 + 0 4 + 1 2 + 1 4 + 2 5 + 3 2 + 3 5 + 4 5 + 6 7 + 6 0 + 6 8 + 7 1 + 7 8 + 8 4 + 0 9 + 4 9 + 5 10 + 3 10 + 9 10 + 6 11 + 8 11 + 11 9 + 9 12 + 4 12 + 5 13 + 10 13 + 12 13 + 11 14 + 8 14 + 14 12 + 9 15 + 12 15 + 13 16 + 10 16 + 15 16 + 11 17 + 14 17 + 17 15 + 1 18 + 1 20 + 18 19 + 18 20 + 19 21 + 2 19 + 2 21 + 20 21 + 7 22 + 7 23 + 22 18 + 22 23 + 23 20 + 20 4 + 21 5 + 23 8 + 4 24 + 20 24 + 21 25 + 5 25 + 24 25 + 8 26 + 23 26 + 26 24 + 24 12 + 25 13 + 26 14 + + + 0 3 6 1 + 0 4 2 + 3 5 8 4 + 6 5 7 + 1 7 8 2 + 9 12 0 10 + 9 13 11 + 12 4 14 13 + 10 2 14 11 + 15 1 18 19 + 15 2 16 + 18 7 17 + 19 17 8 16 + 20 10 15 22 + 20 11 21 + 22 16 14 21 + 23 19 26 27 + 23 16 24 + 26 17 25 + 27 25 8 24 + 28 22 23 30 + 28 21 29 + 30 24 14 29 + 32 35 33 27 + 32 31 23 + 35 34 19 31 + 33 34 26 + 37 38 32 30 + 37 36 28 + 38 31 22 36 + 39 41 44 3 + 39 42 40 + 41 43 46 42 + 44 43 45 + 3 45 46 40 + 47 49 39 12 + 47 50 48 + 49 42 51 50 + 12 40 51 48 + 40 52 4 + 46 53 8 52 + 45 53 5 + 48 54 13 + 51 52 14 54 + 56 59 57 46 + 56 55 52 + 59 58 8 55 + 57 58 53 + 61 62 56 51 + 61 60 54 + 62 55 14 60 + 63 27 64 59 + 63 24 55 + 64 25 58 + 65 30 63 62 + 65 29 60 + + + 0 1 2 3 4 + 5 6 7 1 8 + 9 10 4 11 12 + 13 14 8 10 15 + 16 17 12 18 19 + 20 21 15 17 22 + 23 24 25 26 16 + 27 28 29 24 20 + 30 31 32 33 34 + 35 36 37 31 38 + 34 39 40 41 2 + 38 42 43 39 7 + 44 45 46 47 40 + 48 49 50 45 43 + 51 52 19 53 46 + 54 55 22 52 50 + + + R[0-5] + R[6-10] + R[11-15] + F[3,11,18,26,33,41,47,53] + F[0,5,30,35] + F[32,37,44,48] + F[23,27,51,54] + F[9,13,25,29] + F[6,14,21,28,36,42,49,55] + + C[10-12] + + + + + + + + + + + + + + + + +

TimeStep = 0.001

+

NumSteps = 10

+

IO_CheckSteps = 10

+

IO_InfoSteps = 10

+

Kinvis = 1

+
+ + + u + v + w + p + + + + C[1] + C[6] + C[2] + C[3] + C[4] + C[5] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.tst b/solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.tst new file mode 100644 index 000000000..4cdc04b9d --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.tst @@ -0,0 +1,23 @@ + + + 3D channel flow, Pyramidic elements, variable P + IncNavierStokesSolver + Pyr_channel_varP.xml + + Pyr_channel_varP.xml + + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + + + diff --git a/solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.xml b/solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.xml new file mode 100644 index 000000000..25b08d337 --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Pyr_channel_varP.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + +

TimeStep = 0.001

+

NumSteps = 100

+

IO_InfoSteps = 100

+

Kinvis = 1

+
+ + + u + v + w + p + + + + C[1] + C[6] + C[2] + C[3] + C[4] + C[5] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + 0.00000000e+00 0.00000000e+00 0.00000000e+00 + 1.00000000e+00 0.00000000e+00 0.00000000e+00 + 1.00000000e+00 1.00000000e+00 0.00000000e+00 + 0.00000000e+00 1.00000000e+00 0.00000000e+00 + 5.00000000e-01 5.00000000e-01 5.00000000e-01 + 0.00000000e+00 0.00000000e+00 1.00000000e+00 + 1.00000000e+00 0.00000000e+00 1.00000000e+00 + 1.00000000e+00 1.00000000e+00 1.00000000e+00 + 0.00000000e+00 1.00000000e+00 1.00000000e+00 + + + 0 1 + 1 2 + 3 2 + 0 3 + 0 4 + 1 4 + 2 4 + 3 4 + 0 5 + 5 6 + 1 6 + 5 4 + 6 4 + 6 7 + 2 7 + 7 4 + 7 8 + 3 8 + 8 4 + 8 5 + + + 0 1 2 3 + 0 5 4 + 1 6 5 + 2 6 7 + 3 7 4 + 8 9 10 0 + 8 11 4 + 9 12 11 + 10 12 5 + 10 13 14 1 + 13 15 12 + 14 15 6 + 14 16 17 2 + 16 18 15 + 17 18 7 + 17 19 8 3 + 19 11 18 + 19 16 13 9 + + +

0 1 2 3 4

+

5 6 7 8 1

+

9 8 10 11 2

+

12 11 13 14 3

+

15 14 16 6 4

+

17 16 13 10 7

+
+ + P[0-2] + P[3-4] + P[5] + F[0] + F[5] + F[9] + F[12] + F[15] + F[17] + + C[10-12] +
+
diff --git a/solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.tst b/solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.tst new file mode 100644 index 000000000..edb538e00 --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.tst @@ -0,0 +1,24 @@ + + + 3D channel flow, Tetrahedral elements, variable P + IncNavierStokesSolver + Tet_channel_varP.xml + + Tet_channel_varP.xml + + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + + + + diff --git a/solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.xml b/solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.xml new file mode 100644 index 000000000..c3d55e4f4 --- /dev/null +++ b/solvers/IncNavierStokesSolver/Tests/Tet_channel_varP.xml @@ -0,0 +1,411 @@ + + + + + 0.00000000e+00 0.00000000e+00 0.00000000e+00 + 5.00000000e-01 0.00000000e+00 0.00000000e+00 + 5.00000000e-01 5.00000000e-01 0.00000000e+00 + 5.00000000e-01 0.00000000e+00 5.00000000e-01 + 0.00000000e+00 0.00000000e+00 5.00000000e-01 + 5.00000000e-01 5.00000000e-01 5.00000000e-01 + 0.00000000e+00 0.00000000e+00 1.00000000e+00 + 5.00000000e-01 0.00000000e+00 1.00000000e+00 + 5.00000000e-01 5.00000000e-01 1.00000000e+00 + 0.00000000e+00 5.00000000e-01 0.00000000e+00 + 0.00000000e+00 5.00000000e-01 5.00000000e-01 + 0.00000000e+00 5.00000000e-01 1.00000000e+00 + 5.00000000e-01 1.00000000e+00 0.00000000e+00 + 5.00000000e-01 1.00000000e+00 5.00000000e-01 + 5.00000000e-01 1.00000000e+00 1.00000000e+00 + 0.00000000e+00 1.00000000e+00 0.00000000e+00 + 0.00000000e+00 1.00000000e+00 5.00000000e-01 + 0.00000000e+00 1.00000000e+00 1.00000000e+00 + 1.00000000e+00 0.00000000e+00 0.00000000e+00 + 1.00000000e+00 5.00000000e-01 0.00000000e+00 + 1.00000000e+00 0.00000000e+00 5.00000000e-01 + 1.00000000e+00 5.00000000e-01 5.00000000e-01 + 1.00000000e+00 0.00000000e+00 1.00000000e+00 + 1.00000000e+00 5.00000000e-01 1.00000000e+00 + 1.00000000e+00 1.00000000e+00 0.00000000e+00 + 1.00000000e+00 1.00000000e+00 5.00000000e-01 + 1.00000000e+00 1.00000000e+00 1.00000000e+00 + + + 0 1 + 0 2 + 0 3 + 1 2 + 1 3 + 2 3 + 3 4 + 3 5 + 4 5 + 4 0 + 5 0 + 2 5 + 4 6 + 3 6 + 5 6 + 7 6 + 7 8 + 7 3 + 6 8 + 8 3 + 8 5 + 0 9 + 0 10 + 2 9 + 2 10 + 9 10 + 5 10 + 4 10 + 10 6 + 8 11 + 8 10 + 6 11 + 11 10 + 9 12 + 9 13 + 2 12 + 2 13 + 12 13 + 5 13 + 10 13 + 13 8 + 8 14 + 11 14 + 11 13 + 14 13 + 9 15 + 12 15 + 15 13 + 13 16 + 10 16 + 10 15 + 16 15 + 10 17 + 13 17 + 16 17 + 14 17 + 11 17 + 1 18 + 1 19 + 18 19 + 18 3 + 19 3 + 20 3 + 20 21 + 20 18 + 3 21 + 21 18 + 21 19 + 3 22 + 20 22 + 21 22 + 22 7 + 22 23 + 7 23 + 23 3 + 21 23 + 19 2 + 21 5 + 21 2 + 21 8 + 23 8 + 2 24 + 19 24 + 24 21 + 21 25 + 5 25 + 5 24 + 25 24 + 5 26 + 21 26 + 25 26 + 23 26 + 8 26 + 24 12 + 24 13 + 25 13 + 13 26 + 26 14 + + + 0 3 1 + 0 4 2 + 3 5 4 + 1 5 2 + 9 6 2 + 9 8 10 + 6 7 8 + 2 7 10 + 1 10 11 + 5 7 11 + 12 13 6 + 12 14 8 + 13 7 14 + 15 17 13 + 15 16 18 + 17 19 16 + 13 19 18 + 18 20 14 + 19 20 7 + 21 1 23 + 21 22 25 + 1 24 22 + 23 24 25 + 9 22 27 + 22 26 10 + 27 26 8 + 24 26 11 + 12 27 28 + 28 26 14 + 31 28 32 + 31 18 29 + 28 30 18 + 32 30 29 + 30 20 26 + 33 23 35 + 33 34 37 + 23 36 34 + 35 36 37 + 36 39 24 + 36 38 11 + 39 26 38 + 34 39 25 + 39 40 30 + 40 20 38 + 42 43 44 + 42 29 41 + 43 40 29 + 44 40 41 + 43 32 39 + 46 45 33 + 46 47 37 + 45 34 47 + 51 47 48 + 51 50 49 + 47 39 50 + 48 39 49 + 45 25 50 + 54 48 53 + 54 49 52 + 53 39 52 + 55 42 56 + 55 44 53 + 56 43 53 + 56 52 32 + 57 59 58 + 57 60 4 + 59 61 60 + 58 61 4 + 64 60 62 + 64 66 63 + 60 65 66 + 62 65 63 + 59 67 66 + 61 65 67 + 69 62 68 + 69 63 70 + 68 65 70 + 71 73 72 + 71 17 68 + 73 74 17 + 72 74 68 + 72 70 75 + 74 65 75 + 58 76 3 + 76 5 61 + 5 65 78 + 65 77 7 + 78 77 11 + 76 78 67 + 65 19 79 + 79 20 77 + 73 80 16 + 74 19 80 + 75 79 80 + 82 81 76 + 82 83 67 + 81 78 83 + 87 83 84 + 87 86 85 + 83 77 86 + 84 77 85 + 81 11 86 + 90 84 89 + 90 85 88 + 89 77 88 + 91 89 75 + 91 92 80 + 89 79 92 + 92 20 88 + 93 35 81 + 93 37 94 + 81 36 94 + 87 95 94 + 95 38 85 + 94 38 86 + 90 96 95 + 96 38 88 + 97 44 96 + 97 41 92 + 96 40 92 + + + 0 1 2 3 + 4 5 6 7 + 3 8 7 9 + 10 11 12 6 + 13 14 15 16 + 16 12 17 18 + 19 20 21 22 + 23 5 24 25 + 21 8 26 24 + 27 11 25 28 + 29 30 31 32 + 31 28 33 17 + 34 35 36 37 + 38 39 40 26 + 36 22 38 41 + 42 40 43 33 + 44 45 46 47 + 48 46 32 42 + 49 50 51 35 + 52 53 54 55 + 51 56 41 54 + 57 58 55 59 + 60 61 44 62 + 62 63 59 48 + 64 65 66 67 + 68 69 70 71 + 66 72 73 70 + 74 75 71 76 + 77 78 79 80 + 80 81 76 82 + 83 67 84 2 + 85 9 86 87 + 84 88 85 73 + 89 86 18 90 + 79 91 92 15 + 82 92 93 89 + 94 95 96 88 + 97 98 99 100 + 96 101 87 99 + 102 103 100 104 + 105 106 107 93 + 107 104 90 108 + 109 110 37 111 + 112 98 113 114 + 111 101 114 39 + 115 103 116 113 + 117 118 47 119 + 119 116 108 43 + + + A[0-10] + A[11-25] + A[26-40] + A[41-47] + F[0,19,34,49,64,83,94,109] + F[1,4,10,13,65,68,74,78] + F[69,72,75,81,95,97,102,105] + F[50,52,57,61,110,112,115,117] + F[20,23,27,29,53,56,58,63] + F[14,30,45,60,77,91,106,118] + + C[10-13] + + + + + + + + + + + + + + + + + +

TimeStep = 0.001

+

NumSteps = 10

+

IO_CheckSteps = 10

+

IO_InfoSteps = 10

+

Kinvis = 1

+
+ + + u + v + w + p + + + + C[1] + C[6] + C[2] + C[3] + C[4] + C[5] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ -- GitLab From 4c4df358599750787f931f5214d0fa1d4ad7dbbd Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Sat, 9 Apr 2016 17:55:11 +0100 Subject: [PATCH 07/11] Attempt to extend DriverAdaptive to 3D --- library/SolverUtils/DriverAdaptive.cpp | 103 +++++++++++++++++++------ 1 file changed, 81 insertions(+), 22 deletions(-) diff --git a/library/SolverUtils/DriverAdaptive.cpp b/library/SolverUtils/DriverAdaptive.cpp index b5fc4803d..e938ca56f 100644 --- a/library/SolverUtils/DriverAdaptive.cpp +++ b/library/SolverUtils/DriverAdaptive.cpp @@ -38,6 +38,10 @@ #include #include #include +#include +#include +#include +#include #include namespace Nektar @@ -113,6 +117,7 @@ void DriverAdaptive::v_Execute(ostream &out) nExp = m_equ[0]->UpdateFields()[0]->GetExpSize(); nPlanes = 1; } + int expdim = m_equ[0]->UpdateFields()[0]->GetGraph()->GetMeshDimension(); int nFields = m_equ[0]->UpdateFields().num_elements(); int numSteps = m_session->GetParameter("NumSteps"); @@ -126,6 +131,9 @@ void DriverAdaptive::v_Execute(ostream &out) m_equ[0]->UpdateFields()); // Adaptive loop + Array P(expdim); + Array numPoints(expdim); + Array ptsKey(expdim); LocalRegions::ExpansionSharedPtr Exp; for (int i = 1; i < nRuns; i++) { @@ -141,39 +149,91 @@ void DriverAdaptive::v_Execute(ostream &out) offset = fields[sensorVar]->GetPhys_Offset(n); Exp = fields[sensorVar]->GetExp(n); - int P = Exp->GetBasis(0)->GetNumModes(); - int Q = Exp->GetBasis(1)->GetNumModes(); - int qa = Exp->GetBasis(0)->GetNumPoints(); - int qb = Exp->GetBasis(1)->GetNumPoints(); + for( int k = 0; k < expdim; ++k) + { + P[k] = Exp->GetBasis(k)->GetNumModes(); + numPoints[k] = Exp->GetBasis(k)->GetNumPoints(); + ptsKey[k] = LibUtilities::PointsKey (numPoints[k], + Exp->GetBasis(k)->GetPointsType()); + } // Declare orthogonal basis. - LibUtilities::PointsKey pa(qa, Exp->GetBasis(0)->GetPointsType()); - LibUtilities::PointsKey pb(qb, Exp->GetBasis(1)->GetPointsType()); - StdRegions::StdExpansionSharedPtr OrthoExp; switch (Exp->GetGeom()->GetShapeType()) { case LibUtilities::eQuadrilateral: { - LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P - 1, - pa); - LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A, Q - 1, - pb); + LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P[0] - 1, + ptsKey[0]); + LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A, P[1] - 1, + ptsKey[1]); OrthoExp = MemoryManager< StdRegions::StdQuadExp>::AllocateSharedPtr(Ba, Bb); break; } case LibUtilities::eTriangle: { - LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P - 1, - pa); - LibUtilities::BasisKey Bb(LibUtilities::eOrtho_B, Q - 1, - pb); + LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P[0] - 1, + ptsKey[0]); + LibUtilities::BasisKey Bb(LibUtilities::eOrtho_B, P[1] - 1, + ptsKey[1]); OrthoExp = MemoryManager::AllocateSharedPtr( Ba, Bb); break; } + case LibUtilities::eTetrahedron: + { + LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P[0] - 1, + ptsKey[0]); + LibUtilities::BasisKey Bb(LibUtilities::eOrtho_B, P[1] - 1, + ptsKey[1]); + LibUtilities::BasisKey Bc(LibUtilities::eOrtho_C, P[2] - 1, + ptsKey[2]); + OrthoExp = + MemoryManager::AllocateSharedPtr( + Ba, Bb, Bc); + break; + } + case LibUtilities::ePyramid: + { + LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P[0] - 1, + ptsKey[0]); + LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A, P[1] - 1, + ptsKey[1]); + LibUtilities::BasisKey Bc(LibUtilities::eOrtho_C, P[2] - 1, + ptsKey[2]); + OrthoExp = + MemoryManager::AllocateSharedPtr( + Ba, Bb, Bc); + break; + } + case LibUtilities::ePrism: + { + LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P[0] - 1, + ptsKey[0]); + LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A, P[1] - 1, + ptsKey[1]); + LibUtilities::BasisKey Bc(LibUtilities::eOrtho_B, P[2] - 1, + ptsKey[2]); + OrthoExp = + MemoryManager::AllocateSharedPtr( + Ba, Bb, Bc); + break; + } + case LibUtilities::eHexahedron: + { + LibUtilities::BasisKey Ba(LibUtilities::eOrtho_A, P[0] - 1, + ptsKey[0]); + LibUtilities::BasisKey Bb(LibUtilities::eOrtho_A, P[1] - 1, + ptsKey[1]); + LibUtilities::BasisKey Bc(LibUtilities::eOrtho_A, P[2] - 1, + ptsKey[2]); + OrthoExp = + MemoryManager::AllocateSharedPtr( + Ba, Bb, Bc); + break; + } default: ASSERTL0(false, "Shape not supported."); break; @@ -270,11 +330,11 @@ void DriverAdaptive::v_Execute(ostream &out) } // Determine what to do with the polynomial order - if ((error > upperTol) && (P < maxP)) + if ((error > upperTol) && (P[0] < maxP)) { deltaP[Exp->GetGeom()->GetGlobalID()] = 1; } - else if ((error < lowerTol) && P > minP) + else if ((error < lowerTol) && P[0] > minP) { deltaP[Exp->GetGeom()->GetGlobalID()] = -1; } @@ -380,20 +440,19 @@ void DriverAdaptive::ReplaceExpansion( map deltaP) { int nExp, nDim; + int expdim = m_equ[0]->UpdateFields()[0]->GetGraph()->GetMeshDimension(); // Get field definitions std::vector fielddefs = fields[0]->GetFieldDefinitions(); - int expDim = 2; - if (fielddefs[0]->m_numHomogeneousDir == 1) { - nDim = 3; + nDim = expdim+1; } else { - nDim = 2; + nDim = expdim; } // Add variables to field definition @@ -562,7 +621,7 @@ void DriverAdaptive::ReplaceExpansion( { eId = fielddefs[f]->m_elementIDs[n]; - for (int i = 0; i < expDim; i++) + for (int i = 0; i < expdim; i++) { order[i] = deltaP[eId]; } -- GitLab From b07eb943ff4af99d29cf5e6ecac534d307521c85 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Mon, 11 Apr 2016 17:13:08 +0100 Subject: [PATCH 08/11] Adjust tolerances for buildbot --- solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst | 4 ++-- solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst index 617063fe8..16f0efd01 100644 --- a/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst +++ b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP.tst @@ -11,13 +11,13 @@ 0 0 0 - 0 + 0 0 0 0 - 3.68816e-12 + 0 diff --git a/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst index e8540e545..4a60f5498 100644 --- a/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst +++ b/solvers/IncNavierStokesSolver/Tests/Hex_channel_varP_par.tst @@ -12,13 +12,13 @@ 0 0 0 - 2.13991e-12 + 0 0 0 0 - 4.18088e-12 + 0 -- GitLab From e76b0286ca9ab1fd403c2ff04272bc32ec1aa866 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Thu, 7 Jul 2016 16:23:14 +0100 Subject: [PATCH 09/11] Address Spencers comment --- library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp index 17c391a37..8cd67b1bf 100644 --- a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp +++ b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp @@ -826,8 +826,8 @@ namespace Nektar for(j = 0; j < nEdges; ++j) { - nEdgeIntCoeffs = EdgeSize[meshEdgeId]; meshEdgeId = exp->GetGeom()->GetEid(j); + nEdgeIntCoeffs = EdgeSize[meshEdgeId]; if(graph[1].count(meshEdgeId) == 0) { if(tempGraph[1].count(meshEdgeId) == 0) -- GitLab From 67b866c5319f0e0c59cc946ea47269a1e7d594e3 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Thu, 7 Jul 2016 17:06:21 +0100 Subject: [PATCH 10/11] Address (most of) Daves comments --- .../AssemblyMap/AssemblyMapCG.cpp | 22 ++++++---- library/StdRegions/StdHexExp.cpp | 41 +++++-------------- library/StdRegions/StdPrismExp.cpp | 29 ++++--------- library/StdRegions/StdPyrExp.cpp | 17 ++++---- 4 files changed, 41 insertions(+), 68 deletions(-) diff --git a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp index 8cd67b1bf..823f31a5f 100644 --- a/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp +++ b/library/MultiRegions/AssemblyMap/AssemblyMapCG.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include @@ -1365,7 +1366,7 @@ namespace Nektar } // Now use information from all partitions to determine // the correct size - map::iterator dofIt; + map::iterator dofIt, dofIt2; // edges Array edgeId (dofs[1].size()); Array edgeDof (dofs[1].size()); @@ -1385,32 +1386,37 @@ namespace Nektar Array faceId (faceModes[0].size()); Array faceP (faceModes[0].size()); Array faceQ (faceModes[0].size()); - for(dofIt = faceModes[0].begin(), i=0; dofIt != faceModes[0].end(); dofIt++, i++) + for(dofIt = faceModes[0].begin(), dofIt2 = faceModes[1].begin(),i=0; + dofIt != faceModes[0].end(); dofIt++, dofIt2++, i++) { faceId[i] = dofIt->first; faceP[i] = (NekDouble) dofIt->second; - faceQ[i] = (NekDouble) faceModes[1][dofIt->first]; + faceQ[i] = (NekDouble) dofIt2->second; } Gs::gs_data *tmp2 = Gs::Init(faceId, vComm); Gs::Gather(faceP, Gs::gs_min, tmp2); Gs::Gather(faceQ, Gs::gs_min, tmp2); Gs::Finalise(tmp2); + int P, Q; for (i=0; i < faceModes[0].size(); i++) { faceModes[0][faceId[i]] = (int) (faceP[i]+0.5); faceModes[1][faceId[i]] = (int) (faceQ[i]+0.5); + P = faceModes[0][faceId[i]]; + Q = faceModes[1][faceId[i]]; if (faceType[faceId[i]] == LibUtilities::eQuadrilateral) { // Quad face - dofs[2][faceId[i]] = (faceModes[0][faceId[i]] - 2) * - (faceModes[1][faceId[i]] - 2); + dofs[2][faceId[i]] = + LibUtilities::StdQuadData::getNumberOfCoefficients(P,Q) - + LibUtilities::StdQuadData::getNumberOfBndCoefficients(P,Q); } else { // Tri face - dofs[2][faceId[i]] = (faceModes[0][faceId[i]]-2) * - (2*(faceModes[1][faceId[i]]-2) - - (faceModes[0][faceId[i]]-2) -1)/2; + dofs[2][faceId[i]] = + LibUtilities::StdTriData::getNumberOfCoefficients(P,Q) - + LibUtilities::StdTriData::getNumberOfBndCoefficients(P,Q); } } diff --git a/library/StdRegions/StdHexExp.cpp b/library/StdRegions/StdHexExp.cpp index 4425cfee2..3a026ab86 100644 --- a/library/StdRegions/StdHexExp.cpp +++ b/library/StdRegions/StdHexExp.cpp @@ -939,46 +939,22 @@ namespace Nektar case 0: case 5: { - if( faceOrient < 9 ) - { - numModes0 = nummodes[0]; - numModes1 = nummodes[1]; - } - else - { - numModes0 = nummodes[1]; - numModes1 = nummodes[0]; - } + numModes0 = nummodes[0]; + numModes1 = nummodes[1]; } break; case 1: case 3: { - if( faceOrient < 9 ) - { - numModes0 = nummodes[0]; - numModes1 = nummodes[2]; - } - else - { - numModes0 = nummodes[2]; - numModes1 = nummodes[0]; - } + numModes0 = nummodes[0]; + numModes1 = nummodes[2]; } break; case 2: case 4: { - if( faceOrient < 9 ) - { - numModes0 = nummodes[1]; - numModes1 = nummodes[2]; - } - else - { - numModes0 = nummodes[2]; - numModes1 = nummodes[1]; - } + numModes0 = nummodes[1]; + numModes1 = nummodes[2]; } break; default: @@ -987,6 +963,11 @@ namespace Nektar } break; } + + if ( faceOrient >= 9 ) + { + std::swap(numModes0, numModes1); + } } /** diff --git a/library/StdRegions/StdPrismExp.cpp b/library/StdRegions/StdPrismExp.cpp index 174cda21b..49be0a372 100644 --- a/library/StdRegions/StdPrismExp.cpp +++ b/library/StdRegions/StdPrismExp.cpp @@ -740,32 +740,16 @@ namespace Nektar // base quad case 0: { - if( faceOrient < 9 ) - { - numModes0 = nummodes[0]; - numModes1 = nummodes[1]; - } - else - { - numModes0 = nummodes[1]; - numModes1 = nummodes[0]; - } + numModes0 = nummodes[0]; + numModes1 = nummodes[1]; } break; // front and back quad case 2: case 4: { - if( faceOrient < 9 ) - { - numModes0 = nummodes[1]; - numModes1 = nummodes[2]; - } - else - { - numModes0 = nummodes[2]; - numModes1 = nummodes[1]; - } + numModes0 = nummodes[1]; + numModes1 = nummodes[2]; } break; // triangles @@ -777,6 +761,11 @@ namespace Nektar } break; } + + if ( faceOrient >= 9 ) + { + std::swap(numModes0, numModes1); + } } //--------------------------------------- diff --git a/library/StdRegions/StdPyrExp.cpp b/library/StdRegions/StdPyrExp.cpp index 8687e628b..3d90d79e8 100644 --- a/library/StdRegions/StdPyrExp.cpp +++ b/library/StdRegions/StdPyrExp.cpp @@ -880,16 +880,8 @@ namespace Nektar // quad case 0: { - if( faceOrient < 9 ) - { - numModes0 = nummodes[0]; - numModes1 = nummodes[1]; - } - else - { - numModes0 = nummodes[1]; - numModes1 = nummodes[0]; - } + numModes0 = nummodes[0]; + numModes1 = nummodes[1]; } break; case 1: @@ -907,6 +899,11 @@ namespace Nektar } break; } + + if ( faceOrient >= 9 ) + { + std::swap(numModes0, numModes1); + } } //--------------------------------------- -- GitLab From 7e6f41b8839dad14df96942ce05040f45e3a4d09 Mon Sep 17 00:00:00 2001 From: David Moxey Date: Mon, 11 Jul 2016 10:52:51 +0100 Subject: [PATCH 11/11] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ba79164..39b317397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Changelog v4.4.0 ------ +**Library:** +- Add support for variable polynomial order for 3D simulations with continuous + Galerkin discretisation (!604) + **IncNavierStokesSolver:** - Add ability to simulate additional scalar fields (!624) -- GitLab