Commit e88ad4c0 authored by Michael Turner's avatar Michael Turner
Browse files

add quadrilateral to varopti

parent b72651f7
......@@ -137,6 +137,7 @@ SET(FoundationHeaders
./Foundations/NodalTriFekete.h
./Foundations/NodalTriSPIData.h
./Foundations/NodalTriSPI.h
./Foundations/NodalQuadSPI.h
./Foundations/NodalTetSPI.h
./Foundations/NodalPrismSPI.h
./Foundations/NodalTetSPIData.h
......@@ -166,6 +167,7 @@ SET(FoundationSources
./Foundations/NodalTriEvenlySpaced.cpp
./Foundations/NodalTriFekete.cpp
./Foundations/NodalTriSPI.cpp
./Foundations/NodalQuadSPI.cpp
./Foundations/NodalTetSPI.cpp
./Foundations/NodalPrismSPI.cpp
./Foundations/NodalUtil.cpp
......
......@@ -94,6 +94,7 @@ namespace Nektar
"NodalTriFekete",
"NodalTriSPI",
"NodalTriEvenlySpaced",
"NodalQuadSPI",
"NodalTetEvenlySpaced",
"NodalTetElec",
"NodalTetSPI",
......
......@@ -46,6 +46,7 @@
#include <LibUtilities/Foundations/NodalTriEvenlySpaced.h>
#include <LibUtilities/Foundations/NodalTetEvenlySpaced.h>
#include <LibUtilities/Foundations/NodalTetSPI.h>
#include <LibUtilities/Foundations/NodalQuadSPI.h>
#include <LibUtilities/Foundations/NodalPrismSPI.h>
#include <LibUtilities/Foundations/NodalPrismEvenlySpaced.h>
#include <LibUtilities/Foundations/NodalPrismElec.h>
......@@ -86,6 +87,7 @@ namespace Nektar
const bool NodalTriInited0 = PointsManager().RegisterCreator(PointsKey(0, eNodalTriElec), NodalTriElec::Create);
const bool NodalTriInited1 = PointsManager().RegisterCreator(PointsKey(0, eNodalTriFekete), NodalTriFekete::Create);
const bool NodalTriInited2 = PointsManager().RegisterCreator(PointsKey(0, eNodalTriSPI), NodalTriSPI::Create);
const bool NodalquadInited1 = PointsManager().RegisterCreator(PointsKey(0, eNodalQuadSPI), NodalQuadSPI::Create);
const bool nodalTetElecInited = PointsManager().RegisterCreator(PointsKey(0, eNodalTetElec), NodalTetElec::Create);
const bool nodalTetElecInited1 = PointsManager().RegisterCreator(PointsKey(0, eNodalTetSPI), NodalTetSPI::Create);
const bool NodalTriEveInited = PointsManager().RegisterCreator(PointsKey(0, eNodalTriEvenlySpaced), NodalTriEvenlySpaced::Create);
......
///////////////////////////////////////////////////////////////////////////////
//
// File NodalTriElec.cpp
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: 2D Nodal Triangle Fekete Point Definitions
//
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/Foundations/NodalQuadSPI.h>
#include <LibUtilities/Foundations/Points.h>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <LibUtilities/BasicConst/NektarUnivConsts.hpp>
#include <LibUtilities/Foundations/NodalQuadSPIData.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Foundations/NodalUtil.h>
namespace Nektar
{
namespace LibUtilities
{
void NodalQuadSPI::CalculatePoints()
{
// Allocate the storage for points
unsigned int numPoints = GetNumPoints();
for(int i = 0; i < 2; i++)
{
m_points[i] = Array<OneD, DataType>(NodalQuadSPINPTS[numPoints-2]);
}
int index=0;
// initialize values
for(unsigned int i=0; i < numPoints-2; ++i)
{
index += NodalQuadSPINPTS[i];
}
for(int i = 0; i < NodalQuadSPINPTS[numPoints-2]; i++)
{
m_points[0][i] = NodalQuadSPIData[index][0];
m_points[1][i] = NodalQuadSPIData[index][1];
index++;
}
//exit(0);
}
void NodalQuadSPI::CalculateWeights()
{
unsigned int numPoints = GetNumPoints();
m_weights = Array<OneD, DataType>(NodalQuadSPINPTS[numPoints-2]);
int index=0;
// initialize values
for(unsigned int i=0; i < numPoints-2; ++i)
{
index += NodalQuadSPINPTS[i];
}
for(int i = 0; i < NodalQuadSPINPTS[numPoints-2]; i++)
{
m_weights[i] = NodalQuadSPIData[index][2];
index++;
}
}
void NodalQuadSPI::CalculateDerivMatrix()
{
}
boost::shared_ptr<PointsBaseType> NodalQuadSPI::Create(const PointsKey &key)
{
boost::shared_ptr<PointsBaseType> returnval(MemoryManager<NodalQuadSPI>::AllocateSharedPtr(key));
returnval->Initialize();
return returnval;
}
} // end of namespace stdregion
} // end of namespace stdregion
///////////////////////////////////////////////////////////////////////////////
//
// File NodalTriElec.h
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Header file of 2D Nodal Triangle Fekete Points
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NODALTRIQUAD_H
#define NODALTRIQUAD_H
#include <LibUtilities/Foundations/FoundationsFwd.hpp>
#include <boost/shared_ptr.hpp>
#include <LibUtilities/Foundations/ManagerAccess.h>
#include <LibUtilities/LinearAlgebra/NekMatrix.hpp>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <LibUtilities/LibUtilitiesDeclspec.h>
namespace Nektar
{
namespace LibUtilities
{
class NodalQuadSPI: public Points<NekDouble>
{
public:
virtual ~NodalQuadSPI()
{
}
LIB_UTILITIES_EXPORT static boost::shared_ptr<PointsBaseType>
Create(const PointsKey &key);
NodalQuadSPI(const PointsKey &key):PointsBaseType(key)
{
}
int GetNumPointsAlt();
private:
NodalQuadSPI():PointsBaseType(NullPointsKey)
{
}
void CalculatePoints();
void CalculateWeights();
void CalculateDerivMatrix();
};
} // end of namespace
} // end of namespace
#endif //NODALTRIELEC_H
namespace Nektar
{
namespace LibUtilities
{
const unsigned int NodalQuadSPIAvailable = 7;
static const unsigned int NodalQuadSPINPTS[NodalQuadSPIAvailable] = {1,4,4,8,8,12,12};
static const NekDouble NodalQuadSPIData[][3] = {
// %%% x y w
// 1 1 %%% Order / Number of Points
{0, 0, 4},
// 2 3 %%% Order / Number of Points
{ 0.57735026918962576450914878050195745565, 0.57735026918962576450914878050195745565, 1},
{ 0.57735026918962576450914878050195745565, -0.57735026918962576450914878050195745565, 1},
{-0.57735026918962576450914878050195745565, 0.57735026918962576450914878050195745565, 1},
{-0.57735026918962576450914878050195745565, -0.57735026918962576450914878050195745565, 1},
//3 6 %%% Order / Number of Points
{ 0.57735026918962576450914878050195745565, 0.57735026918962576450914878050195745565, 1},
{ 0.57735026918962576450914878050195745565, -0.57735026918962576450914878050195745565, 1},
{-0.57735026918962576450914878050195745565, 0.57735026918962576450914878050195745565, 1},
{-0.57735026918962576450914878050195745565, -0.57735026918962576450914878050195745565, 1},
//4 6 %%% Order / Number of Points
{ 0.68313005106397322554806924536807013272, 0, 0.8163265306122448979591836734693877551},
{ 0, 0.68313005106397322554806924536807013272, 0.8163265306122448979591836734693877551},
{-0.68313005106397322554806924536807013272, 0, 0.8163265306122448979591836734693877551},
{ 0, -0.68313005106397322554806924536807013272, 0.8163265306122448979591836734693877551},
{ 0.8819171036881968635005385845464201419, 0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
{ 0.8819171036881968635005385845464201419, -0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
{ -0.8819171036881968635005385845464201419, 0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
{ -0.8819171036881968635005385845464201419, -0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
// 5 7 %%% Order / Number of Points
{ 0.68313005106397322554806924536807013272, 0, 0.8163265306122448979591836734693877551},
{ 0, 0.68313005106397322554806924536807013272, 0.8163265306122448979591836734693877551},
{-0.68313005106397322554806924536807013272, 0, 0.8163265306122448979591836734693877551},
{ 0, -0.68313005106397322554806924536807013272, 0.8163265306122448979591836734693877551},
{ 0.8819171036881968635005385845464201419, 0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
{ 0.8819171036881968635005385845464201419, -0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
{ -0.8819171036881968635005385845464201419, 0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
{ -0.8819171036881968635005385845464201419, -0.8819171036881968635005385845464201419, 0.1836734693877551020408163265306122449},
// 6 12 %%% Order / Number of Points
{ 0.92582009977255146156656677658399952253, 0, 0.24197530864197530864197530864197530864},
{ 0, 0.92582009977255146156656677658399952253, 0.24197530864197530864197530864197530864},
{-0.92582009977255146156656677658399952253, 0, 0.24197530864197530864197530864197530864},
{ 0, -0.92582009977255146156656677658399952253, 0.24197530864197530864197530864197530864},
{ 0.8059797829185987437078561813507442463, 0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ 0.8059797829185987437078561813507442463, -0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ -0.8059797829185987437078561813507442463, 0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ -0.8059797829185987437078561813507442463, -0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ 0.3805544332083156563791063590863941355, 0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603},
{ 0.3805544332083156563791063590863941355, -0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603},
{ -0.3805544332083156563791063590863941355, 0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603},
{ -0.3805544332083156563791063590863941355, -0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603},
// 7 15 %%% Order / Number of Points
{ 0.92582009977255146156656677658399952253, 0, 0.24197530864197530864197530864197530864},
{ 0, 0.92582009977255146156656677658399952253, 0.24197530864197530864197530864197530864},
{-0.92582009977255146156656677658399952253, 0, 0.24197530864197530864197530864197530864},
{ 0, -0.92582009977255146156656677658399952253, 0.24197530864197530864197530864197530864},
{ 0.8059797829185987437078561813507442463, 0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ 0.8059797829185987437078561813507442463, -0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ -0.8059797829185987437078561813507442463, 0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ -0.8059797829185987437078561813507442463, -0.8059797829185987437078561813507442463, 0.23743177469063023421810525931129352533},
{ 0.3805544332083156563791063590863941355, 0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603},
{ 0.3805544332083156563791063590863941355, -0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603},
{ -0.3805544332083156563791063590863941355, 0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603},
{ -0.3805544332083156563791063590863941355, -0.3805544332083156563791063590863941355, 0.52059291666739445713991943204673116603}};
}
}
......@@ -71,6 +71,7 @@ namespace Nektar
eNodalTriFekete, //!< 2D Nodal Fekete Points on a Triangle
eNodalTriSPI, //!< 2D Nodal Symmetric positive internal triangle (Whitherden, Vincent)
eNodalTriEvenlySpaced, //!< 2D Evenly-spaced points on a Triangle
eNodalQuadSPI, //!< 2d spi on quad
eNodalTetEvenlySpaced, //!< 3D Evenly-spaced points on a Tetrahedron
eNodalTetElec, //!< 3D Nodal Electrostatic Points on a Tetrahedron
eNodalTetSPI, //!< 3D Nodal Symmetric positive internal tet (Whitherden, Vincent)
......
......@@ -92,23 +92,34 @@ void ProcessVarOpti::BuildDerivUtil()
NekVector<NekDouble> quadWi(qds);
derivUtil[st]->quadW = quadWi;
}
/*{
{
LibUtilities::ShapeType st = LibUtilities::eQuadrilateral;
derivUtil[st] = boost::shared_ptr<DerivUtil>(new DerivUtil);
derivUtil[st]->ptsLow = m_mesh->m_nummode*m_mesh->m_nummode;
LibUtilities::PointsKey pkey1(m_mesh->m_nummode,
LibUtilities::eNodalTriElec);
LibUtilities::eGaussLobattoLegendre);
LibUtilities::PointsKey pkey2(m_mesh->m_nummode + 4,
LibUtilities::eNodalTriSPI);
Array<OneD, NekDouble> u1, v1, u2, v2;
LibUtilities::eNodalQuadSPI);
Array<OneD, NekDouble> u1(derivUtil[st]->ptsLow), v1(derivUtil[st]->ptsLow), u2, v2, tmp;
LibUtilities::PointsManager()[pkey1]->GetPoints(u1, v1);
LibUtilities::PointsManager()[pkey1]->GetPoints(tmp);
LibUtilities::PointsManager()[pkey2]->GetPoints(u2, v2);
//Get curved nodes ordering for a Quadrilateral is left to right
//ordering so the we need to use gll and redistrobute it.
for(int i = 0, ct = 0; i < m_mesh->m_nummode; i++)
{
for(int j = 0; j < m_mesh->m_nummode; j++, ct++)
{
u1[ct] = tmp[j];
v1[ct] = tmp[i];
}
}
derivUtil[st]->ptsHigh = u2.num_elements();
LibUtilities::NodalUtilTriangle nodalTri(
LibUtilities::NodalUtilQuad nodalQuad(
m_mesh->m_nummode - 1, u1, v1);
Array<OneD, Array<OneD, NekDouble> > uv2(2), uv1(2);
......@@ -117,21 +128,21 @@ void ProcessVarOpti::BuildDerivUtil()
uv2[0] = u2;
uv2[1] = v2;
NekMatrix<NekDouble> interp = *nodalTri.GetInterpolationMatrix(uv2);
NekMatrix<NekDouble> interp = *nodalQuad.GetInterpolationMatrix(uv2);
NekMatrix<NekDouble> Vandermonde = *nodalTri.GetVandermonde();
NekMatrix<NekDouble> Vandermonde = *nodalQuad.GetVandermonde();
NekMatrix<NekDouble> VandermondeI = Vandermonde;
VandermondeI.Invert();
derivUtil[st]->VdmDL[0] = *nodalTri.GetVandermondeForDeriv(0) * VandermondeI;
derivUtil[st]->VdmDL[1] = *nodalTri.GetVandermondeForDeriv(1) * VandermondeI;
derivUtil[st]->VdmDL[0] = *nodalQuad.GetVandermondeForDeriv(0) * VandermondeI;
derivUtil[st]->VdmDL[1] = *nodalQuad.GetVandermondeForDeriv(1) * VandermondeI;
derivUtil[st]->VdmD[0] = interp * derivUtil[st]->VdmDL[0];
derivUtil[st]->VdmD[1] = interp * derivUtil[st]->VdmDL[1];
//derivUtil->quadW = LibUtilities::MakeQuadratureWeights(U2,V1);
Array<OneD, NekDouble> qds = LibUtilities::PointsManager()[pkey2]->GetW();
NekVector<NekDouble> quadWi(qds);
derivUtil[st]->quadW = quadWi;
}*/
}
}
break;
case 3:
......
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