Commit 26551aac authored by Dave Moxey's avatar Dave Moxey

Import most files from feature/hdf5-mesh without moving SessionReader

parent ded2bb02
......@@ -9,7 +9,7 @@ using namespace Nektar;
static double solutionpoly(double x, int order);
static double solutionfourier(double x, int order, double a, double b);
// This routine projects a polynomial or trigonmetric functions which
// This routine projects a polynomial or trigonmetric functions which
// has energy in all mdoes of the expansions and report an error.
int main(int argc, char *argv[])
......@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
fprintf(stderr,"\t Chebyshev = 13\n");
fprintf(stderr,"\t Monomial = 14\n");
fprintf(stderr,"\t FourierSingleMode = 15\n");
fprintf(stderr,"Note type = 1,2,4,5,7,8 are for higher dimensional basis\n");
exit(1);
......@@ -81,8 +81,8 @@ int main(int argc, char *argv[])
const double dZero=0.0;
SpatialDomains::PointGeomSharedPtr vert1 = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(one,zero,x[0],dZero,dZero);
SpatialDomains::PointGeomSharedPtr vert2 = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(one,zero,x[1],dZero,dZero);
SpatialDomains::SegGeomSharedPtr geom = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(zero,vert1,vert2);
geom->SetOwnData();
SpatialDomains::PointGeomSharedPtr verts[2] = {vert1,vert2};
SpatialDomains::SegGeomSharedPtr geom = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(zero,1,verts);
const LibUtilities::PointsKey Pkey(nq,Qtype);
const LibUtilities::BasisKey Bkey(btype,order,Pkey);
......@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
//-----------------------------------------------
//----------------------------------------------
// Define solution to be projected
// Define solution to be projected
Array<OneD,NekDouble> xc(nq);
E->GetCoords(xc);
......@@ -116,14 +116,14 @@ int main(int argc, char *argv[])
Array<OneD, NekDouble> phys (nq);
E->FwdTrans(sol, coeffs);
//---------------------------------------------
//-------------------------------------------
// Backward Transform Solution to get projected values
E->BwdTrans(coeffs, phys);
//-------------------------------------------
//-------------------------------------------
//--------------------------------------------
// Calculate L_inf error
// Calculate L_inf error
cout << "L infinity error: " << E->Linf(phys, sol) << endl;
cout << "L 2 error: " << E->L2 (phys, sol) << endl;
//--------------------------------------------
......
This diff is collapsed.
......@@ -10,7 +10,6 @@
#include <LibUtilities/Foundations/Foundations.hpp>
#include <LibUtilities/Foundations/Basis.h>
#include <SpatialDomains/MeshComponents.h>
#include <LibUtilities/BasicConst/NektarUnivTypeDefs.hpp>
using namespace std;
......@@ -322,7 +321,7 @@ int main(int argc, char *argv[]){
SpatialDomains::PrismGeomSharedPtr geom = CreatePrismGeom(argc, argv);
E = new LocalRegions::PrismExp(Bkey1, Bkey2, Bkey3, geom);
E->GetCoords(x,y,z);
//----------------------------------------------
// Define solution to be projected
for(i = 0; i < nq1*nq2*nq3; ++i)
......@@ -400,7 +399,7 @@ NekDouble Prism_sol(NekDouble x, NekDouble y, NekDouble z,
{
int k, l, m;
NekDouble sol = 0;
for(k = 0; k < order1; ++k)
{
for(l = 0; l < order2; ++l)
......@@ -510,27 +509,20 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
{0,1,2,3}, {0,5,8,4}, {1,6,9,5},
{2,7,10,6}, {3,7,11,4}, {8,9,10,11}
};
const bool isEdgeFlipped[][4] = {
{0,0,0,1}, {0,0,1,1}, {0,0,1,1},
{0,0, 1,1}, {0,0, 1,1}, {0,0, 0, 1}
};
// Populate the list of faces
QuadGeomSharedPtr faces[nFaces];
for( int i = 0; i < nFaces; ++i ) {
SegGeomSharedPtr edgeArray[4];
Orientation eorientArray[4];
for( int j = 0; j < 4; ++j ) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
}
faces[i] = MemoryManager<QuadGeom>
::AllocateSharedPtr( i, edgeArray, eorientArray);
::AllocateSharedPtr( i, edgeArray);
}
SpatialDomains::HexGeomSharedPtr geom =
MemoryManager<SpatialDomains::HexGeom>::AllocateSharedPtr(faces);
geom->SetOwnData();
MemoryManager<SpatialDomains::HexGeom>::AllocateSharedPtr(0,faces);
return geom;
}
......@@ -541,7 +533,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
{
cout << "Insufficient points for a prism!" << endl;
}
// /////////////////////////////////////////////////////////////////////
// Set up Prism vertex coordinates
// PointGeom (const int coordim, const int vid, double x,
......@@ -559,7 +551,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
// Populate the list of verts
PointGeomSharedPtr verts[nVerts];
const int three = 3;
for( int i = 0; i < nVerts; ++i ) {
verts[i] = MemoryManager<PointGeom>
::AllocateSharedPtr( three, i, point[i][0],
......@@ -571,10 +563,10 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
// SegGeom (int id, const int coordim), EdgeComponent(id, coordim)
const int nEdges = 9;
const int vertexConnectivity[][2] = {
{0,1}, {1,2}, {3,2}, {0,3}, {0,4},
{0,1}, {1,2}, {3,2}, {0,3}, {0,4},
{1,4}, {2,5}, {3,5}, {4,5}
};
// Populate the list of edges
SegGeomSharedPtr edges[nEdges];
for( int i = 0; i < nEdges; ++i ) {
......@@ -585,59 +577,47 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
edges[i] = MemoryManager<SegGeom>
::AllocateSharedPtr( i, three, vertsArray);
}
// ////////////////////////////////////////////////////////////////////
// Set up Prism faces
const int nFaces = 5;
const int edgeConnectivity[][4] = {
{0,1,2,3},
{0,1,2,3},
{0,5,4,-1}, // Triangular face
{1,6,8,5},
{2,6,7,-1}, // Triangular face
{2,6,7,-1}, // Triangular face
{3,7,8,4}
};
const bool isEdgeFlipped[][4] = {
{0,0,1,1},
{0,0,1,0},
{0,0,1,1},
{0,0,1,0},
{0,0,1,1}
};
// Populate the list of faces
Geometry2DSharedPtr faces[5];
for (int i = 0; i < nFaces; ++i) {
if (i == 1 || i == 3)
if (i == 1 || i == 3)
{
SegGeomSharedPtr edgeArray[3];
Orientation eorientArray[3];
for (int j = 0; j < 3; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
}
faces[i] = MemoryManager<TriGeom>
::AllocateSharedPtr( i, edgeArray, eorientArray);
::AllocateSharedPtr( i, edgeArray);
}
else
{
SegGeomSharedPtr edgeArray[4];
Orientation eorientArray[4];
for (int j = 0; j < 4; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
}
faces[i] = MemoryManager<QuadGeom>
::AllocateSharedPtr( i, edgeArray, eorientArray);
::AllocateSharedPtr( i, edgeArray);
}
}
SpatialDomains::PrismGeomSharedPtr geom =
MemoryManager<SpatialDomains::PrismGeom>::AllocateSharedPtr(faces);
geom->SetOwnData();
MemoryManager<SpatialDomains::PrismGeom>::AllocateSharedPtr(0,faces);
return geom;
}
......@@ -648,7 +628,7 @@ SpatialDomains::PyrGeomSharedPtr CreatePyrGeom(int argc, char *argv[])
{
cout << "Insufficient points for a pyramid!" << endl;
}
// /////////////////////////////////////////////////////////////////////
// Set up Pyramid vertex coordinates
// PointGeom (const int coordim, const int vid, double x,
......@@ -665,7 +645,7 @@ SpatialDomains::PyrGeomSharedPtr CreatePyrGeom(int argc, char *argv[])
// Populate the list of verts
PointGeomSharedPtr verts[nVerts];
const int three = 3;
for( int i = 0; i < nVerts; ++i ) {
verts[i] = MemoryManager<PointGeom>
::AllocateSharedPtr( three, i, point[i][0],
......@@ -691,25 +671,18 @@ SpatialDomains::PyrGeomSharedPtr CreatePyrGeom(int argc, char *argv[])
edges[i] = MemoryManager<SegGeom>
::AllocateSharedPtr( i, three, vertsArray);
}
// ////////////////////////////////////////////////////////////////////
// Set up Pyramid faces
const int nFaces = 5;
const int edgeConnectivity[][4] = {
{0,1,2,3},
{0,1,2,3},
{0,5,4,-1}, // Triangular face
{1,6,5,-1}, // Triangular face
{2,6,7,-1}, // Triangular face
{2,6,7,-1}, // Triangular face
{3,7,4,-1} // Triangular face
};
const bool isEdgeFlipped[][4] = {
{0,0,1,1},
{0,0,1,0},
{0,0,1,0},
{0,0,1,0},
{0,0,1,0}
};
// Populate the list of faces
Geometry2DSharedPtr faces[5];
......@@ -717,33 +690,28 @@ SpatialDomains::PyrGeomSharedPtr CreatePyrGeom(int argc, char *argv[])
if (i > 0)
{
SegGeomSharedPtr edgeArray[3];
Orientation eorientArray[3];
for (int j = 0; j < 3; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
}
faces[i] = MemoryManager<TriGeom>
::AllocateSharedPtr( i, edgeArray, eorientArray);
::AllocateSharedPtr( i, edgeArray);
}
else
{
SegGeomSharedPtr edgeArray[4];
Orientation eorientArray[4];
for (int j = 0; j < 4; ++j) {
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
}
faces[i] = MemoryManager<QuadGeom>
::AllocateSharedPtr( i, edgeArray, eorientArray);
::AllocateSharedPtr( i, edgeArray);
}
}
SpatialDomains::PyrGeomSharedPtr geom =
MemoryManager<SpatialDomains::PyrGeom>::AllocateSharedPtr(faces);
geom->SetOwnData();
MemoryManager<SpatialDomains::PyrGeom>::AllocateSharedPtr(0,faces);
return geom;
}
......@@ -800,27 +768,19 @@ SpatialDomains::TetGeomSharedPtr CreateTetGeom(int argc, char *argv[])
const int edgeConnectivity[][3] = {
{0,1,2}, {0,4,3}, {1,5,4}, {2,5,3}
};
const bool isEdgeFlipped[][3] = {
{0,0,1}, {0,0,1}, {0,0,1}, {0,0,1}
};
// Populate the list of faces
TriGeomSharedPtr faces[nFaces];
for(int i=0; i < nFaces; ++i){
SegGeomSharedPtr edgeArray[3];
Orientation eorientArray[3];
for(int j=0; j < 3; ++j){
edgeArray[j] = edges[edgeConnectivity[i][j]];
eorientArray[j] = isEdgeFlipped[i][j] ? eBackwards : eForwards;
}
faces[i] = MemoryManager<TriGeom>
::AllocateSharedPtr(i, edgeArray, eorientArray);
::AllocateSharedPtr(i, edgeArray);
}
SpatialDomains::TetGeomSharedPtr geom =
MemoryManager<SpatialDomains::TetGeom>::AllocateSharedPtr(faces);
geom->SetOwnData();
MemoryManager<SpatialDomains::TetGeom>::AllocateSharedPtr(0,faces);
return geom;
}
......@@ -12,7 +12,7 @@ static double solutionfourier(double x, int order, double a, double b);
static double deriv_solutionpoly(double x, int order);
static double deriv_solutionfourier(double x, int order, double a, double b);
// This routine projects a polynomial or trigonmetric functions which
// This routine projects a polynomial or trigonmetric functions which
// has energy in all mdoes of the expansions and report an error.
int main(int argc, char *argv[])
......@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
x[1] = atof(argv[5]);
Array<OneD,NekDouble> sol(nq);
if(btype== LibUtilities::eFourier)
{
Qtype = LibUtilities::eFourierEvenlySpaced;
......@@ -81,8 +81,8 @@ int main(int argc, char *argv[])
// Define a segment expansion based on basis definition
SpatialDomains::PointGeomSharedPtr vert1(new SpatialDomains::PointGeom(1,0,x[0],0,0));
SpatialDomains::PointGeomSharedPtr vert2(new SpatialDomains::PointGeom(1,0,x[1],0,0));
SpatialDomains::SegGeomSharedPtr geom(new SpatialDomains::SegGeom(0,vert1,vert2));
geom->SetOwnData();
SpatialDomains::PointGeomSharedPtr pts[2] = {vert1,vert2};
SpatialDomains::SegGeomSharedPtr geom(new SpatialDomains::SegGeom(0,1,pts));
const LibUtilities::PointsKey Pkey(nq,Qtype);
const LibUtilities::BasisKey Bkey(btype,order,Pkey);
......@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
//-----------------------------------------------
//----------------------------------------------
// Define solution to be projected
// Define solution to be projected
Array<OneD,NekDouble> xc(nq);
E->GetCoords(xc);
......@@ -122,11 +122,11 @@ int main(int argc, char *argv[])
Array<OneD, NekDouble> phys(nq);
E->FwdTrans(sol, coeffs);
//---------------------------------------------
//-------------------------------------------
// Backward Transform Solution to get projected values
E->BwdTrans(coeffs, phys);
//-------------------------------------------
//-------------------------------------------
//-------------------------------------------------
// Define derivative of the solution
......@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
//---------------------------------------------------
//--------------------------------------------
// Calculate L_inf error
// Calculate L_inf error
cout << "L infinity error: " << E->Linf(phys, sol) << endl;
cout << "L 2 error: " << E->L2 (phys, sol) << endl;
//--------------------------------------------
......
......@@ -41,7 +41,6 @@ int main(int argc, char *argv[])
StdRegions::StdExpansion2D *E = NULL;
Array<OneD, NekDouble> sol,x,y,dx,dy;
Array<OneD, NekDouble> coords(8);
StdRegions::Orientation edgeDir = StdRegions::eForwards;
if((argc != 16)&&(argc != 14))
......@@ -120,7 +119,7 @@ int main(int argc, char *argv[])
NEKERROR(ErrorUtil::efatal,
"Basis 1 cannot be of type Ortho_B or Modified_B");
}
break;
case LibUtilities::eQuadrilateral:
if((btype1 == LibUtilities::eOrtho_B)||(btype1 == LibUtilities::eOrtho_C)||
......@@ -129,7 +128,7 @@ int main(int argc, char *argv[])
NEKERROR(ErrorUtil::efatal,
"Basis 1 is for 2 or 3D expansions");
}
if((btype2 == LibUtilities::eOrtho_B)||(btype2 == LibUtilities::eOrtho_C)||
(btype2 == LibUtilities::eModified_B)||(btype2 == LibUtilities::eModified_C))
{
......@@ -141,8 +140,8 @@ int main(int argc, char *argv[])
ASSERTL0(false, "Not a 2D expansion.");
break;
}
order1 = atoi(argv[4]);
order2 = atoi(argv[5]);
nq1 = atoi(argv[6]);
......@@ -165,7 +164,7 @@ int main(int argc, char *argv[])
if(btype2 != LibUtilities::eFourier)
{
if (regionshape == LibUtilities::eTriangle)
if (regionshape == LibUtilities::eTriangle)
{
Qtype2 = LibUtilities::eGaussRadauMAlpha1Beta0;
}
......@@ -186,7 +185,7 @@ int main(int argc, char *argv[])
{
case LibUtilities::eTriangle:
{
coords[0] = atof(argv[8]);
coords[1] = atof(argv[9]);
coords[2] = atof(argv[10]);
......@@ -203,20 +202,17 @@ int main(int argc, char *argv[])
verts[0] = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(two,zero,coords[0],coords[1],dZero);
verts[1] = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(two,one,coords[2],coords[3],dZero);
verts[2] = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(two,two,coords[4],coords[5],dZero);
SpatialDomains::PointGeomSharedPtr verta[2] = {verts[0],verts[1]};
SpatialDomains::PointGeomSharedPtr vertb[2] = {verts[1],verts[2]};
SpatialDomains::PointGeomSharedPtr vertc[2] = {verts[2],verts[0]};
// Set up Edges
SpatialDomains::SegGeomSharedPtr edges[3];
edges[0] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(zero,verts[0],verts[1]);
edges[1] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(one,verts[1],verts[2]);
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,verts[2],verts[0]);
edges[0] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(zero,2,verta);
edges[1] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(one,2,vertb);
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,2,vertc);
StdRegions::Orientation eorient[3];
eorient[0] = edgeDir;
eorient[1] = edgeDir;
eorient[2] = edgeDir;
SpatialDomains::TriGeomSharedPtr geom = MemoryManager<SpatialDomains::TriGeom>::AllocateSharedPtr(zero,verts,edges,eorient);
geom->SetOwnData();
SpatialDomains::TriGeomSharedPtr geom = MemoryManager<SpatialDomains::TriGeom>::AllocateSharedPtr(zero,edges);
const LibUtilities::PointsKey Pkey1(nq1,Qtype1);
const LibUtilities::PointsKey Pkey2(nq2,Qtype2);
......@@ -255,7 +251,7 @@ int main(int argc, char *argv[])
coords[5] = atof(argv[13]);
coords[6] = atof(argv[14]);
coords[7] = atof(argv[15]);
// Set up coordinates
const int zero=0;
const int one=1;
......@@ -267,34 +263,32 @@ int main(int argc, char *argv[])
verts[1] = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(two,one,coords[2],coords[3],dZero);
verts[2] = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(two,two,coords[4],coords[5],dZero);
verts[3] = MemoryManager<SpatialDomains::PointGeom>::AllocateSharedPtr(two,three,coords[6],coords[7],dZero);
SpatialDomains::PointGeomSharedPtr verta[2] = {verts[0],verts[1]};
SpatialDomains::PointGeomSharedPtr vertb[2] = {verts[1],verts[2]};
SpatialDomains::PointGeomSharedPtr vertc[2] = {verts[2],verts[3]};
SpatialDomains::PointGeomSharedPtr vertd[2] = {verts[3],verts[0]};
// Set up Edges
SpatialDomains::SegGeomSharedPtr edges[4];
edges[0] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(zero,verts[0],verts[1]);
edges[1] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(one,verts[1],verts[2]);
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,verts[2],verts[3]);
edges[3] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(three,verts[3],verts[0]);
StdRegions::Orientation eorient[4];
eorient[0] = edgeDir;
eorient[1] = edgeDir;
eorient[2] = edgeDir;
eorient[3] = edgeDir;
SpatialDomains::QuadGeomSharedPtr geom = MemoryManager<SpatialDomains::QuadGeom>::AllocateSharedPtr(zero,verts,edges,eorient);
geom->SetOwnData();
edges[0] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(zero,2,verta);
edges[1] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(one,2,vertb);
edges[2] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(two,2,vertc);
edges[3] = MemoryManager<SpatialDomains::SegGeom>::AllocateSharedPtr(three,2,vertd);
SpatialDomains::QuadGeomSharedPtr geom = MemoryManager<SpatialDomains::QuadGeom>::AllocateSharedPtr(zero,edges);
const LibUtilities::PointsKey Pkey1(nq1,Qtype1);
const LibUtilities::PointsKey Pkey2(nq2,Qtype2);
const LibUtilities::BasisKey Bkey1(btype1,order1,Pkey1);
const LibUtilities::BasisKey Bkey2(btype2,order2,Pkey2);
E = new LocalRegions::QuadExp(Bkey1,Bkey2,geom);
//----------------------------------------------
// Define solution to be projected
E->GetCoords(x,y);
for(i = 0; i < nq1*nq2; ++i)
{
sol[i] = Quad_sol(x[i],y[i],order1,order2,btype1,btype2);
......@@ -306,14 +300,14 @@ int main(int argc, char *argv[])
ASSERTL0(false, "Not a 2D expansion.");
break;
}
//--------------------------------------------
// Take the numerical derivative of the solution and add together in sol
E->PhysDeriv(sol,dx,dy);
Vmath::Vadd(nq1*nq2,dx,1,dy,1,sol,1);
//---------------------------------------------
//---------------------------------------------
// Project onto Expansion
Array<OneD, NekDouble> coeffs(E->GetNcoeffs());
......
......@@ -35,7 +35,6 @@
#define NOMINMAX
#include <LibUtilities/BasicUtils/CompressData.h>
#include <LibUtilities/BasicUtils/MeshEntities.hpp>
#include <LibUtilities/BasicConst/GitRevision.h>
#include <boost/archive/iterators/base64_from_binary.hpp>
......
......@@ -63,13 +63,13 @@ namespace Nektar
{
}
LIB_UTILITIES_EXPORT Equation(const SessionReaderSharedPtr& session,
LIB_UTILITIES_EXPORT Equation(ExpressionEvaluatorShPtr evaluator,
const std::string& expr = "",
const std::string& vlist = ""):
m_vlist (vlist),
m_expr (expr),
m_expr_id (-1),
m_evaluator (session->GetExpressionEvaluator())
m_evaluator (evaluator)
{
boost::algorithm::trim(m_expr);
boost::algorithm::trim(m_vlist);
......@@ -83,7 +83,7 @@ namespace Nektar
{
if (!m_expr.empty())
{
m_expr_id = m_evaluator.DefineFunction(m_vlist, m_expr);
m_expr_id = m_evaluator->DefineFunction(m_vlist, m_expr);
}
}
catch (const std::runtime_error& e)
......@@ -115,7 +115,7 @@ namespace Nektar
{
if (m_expr_id != -1)
{
return m_evaluator.Evaluate(m_expr_id);
return m_evaluator->Evaluate(m_expr_id);
}
}
catch (const std::runtime_error& e)
......@@ -137,7 +137,7 @@ namespace Nektar
{
if (m_expr_id != -1)
{
return m_evaluator.Evaluate(m_expr_id, x,y,z,t);
return m_evaluator->Evaluate(m_expr_id, x,y,z,t);
}
}
catch (const std::runtime_error& e)
......@@ -198,7 +198,7 @@ namespace Nektar
{
if (m_expr_id != -1)
{
m_evaluator.Evaluate(m_expr_id, points, result);
m_evaluator->Evaluate(m_expr_id, points, result);
}
}
catch (const std::runtime_error& e)
......@@ -217,12 +217,12 @@ namespace Nektar
LIB_UTILITIES_EXPORT void SetParameter(const std::string& name, NekDouble value)
{
m_evaluator.SetParameter(name, value);
m_evaluator->SetParameter(name, value);
}
LIB_UTILITIES_EXPORT void SetConstants(const std::map<std::string, NekDouble> &constants)
{
m_evaluator.AddConstants(constants);
m_evaluator->AddConstants(constants);
}
LIB_UTILITIES_EXPORT std::string GetExpression(void) const
......@@ -239,14 +239,14 @@ namespace Nektar
/// points (it does not include parse/pre-processing time).
LIB_UTILITIES_EXPORT NekDouble GetTime() const
{
return m_evaluator.GetTime();
return m_evaluator->GetTime();
}
private:
std::string m_vlist;
std::string m_expr;
int m_expr_id;
AnalyticExpressionEvaluator& m_evaluator;
ExpressionEvaluatorShPtr m_evaluator;
};
}
}
......
This diff is collapsed.
////////////////////////////////////////////////////////////////////////////////
//
// File: MeshPartition.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.