27 "Usage: ProbeFld meshfile fieldfile N x0 y0 z0 dx dy dz\n");
29 " Probes N points along the line from (x0,y0,z0) to "
30 "(x0+dx, y0+dy, z0+dz)\n");
32 "ProbeFld meshfile fieldfile points.txt\n");
34 " Probes the solution at the points in the points.txt file.\n");
36 " Points are given as space-separated x y z on each line.\n");
41 = LibUtilities::SessionReader::CreateInstance(3, argv);
45 string meshfile(argv[1]);
51 string fieldfile(argv[2]);
52 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
53 vector<vector<NekDouble> > fielddata;
59 vector< vector<LibUtilities::PointsType> > pointstype;
60 for(i = 0; i < fielddef.size(); ++i)
62 vector<LibUtilities::PointsType> ptype;
63 for(j = 0; j < 3; ++j)
67 pointstype.push_back(ptype);
69 graphShPt->SetExpansions(fielddef,pointstype);
71 bool dealiasing =
false;
77 int expdim = graphShPt->GetMeshDimension();
78 int nfields = fielddef[0]->m_fields.size();
85 ASSERTL0(fielddef[0]->m_numHomogeneousDir <= 2,
"NumHomogeneousDir is only set up for 1 or 2");
87 if(fielddef[0]->m_numHomogeneousDir == 1)
94 vSession->LoadParameter(
"HomModesZ",nplanes,fielddef[0]->m_numModes[1]);
99 NekDouble ly = fielddef[0]->m_homogeneousLengths[0];
104 for(i = 1; i < nfields; ++i)
109 else if(fielddef[0]->m_numHomogeneousDir == 2)
119 vSession->LoadParameter(
"HomModesY",nylines,fielddef[0]->m_numModes[1]);
120 vSession->LoadParameter(
"HomModesZ",nzlines,fielddef[0]->m_numModes[2]);
129 NekDouble ly = fielddef[0]->m_homogeneousLengths[0];
130 NekDouble lz = fielddef[0]->m_homogeneousLengths[1];
135 for(i = 1; i < nfields; ++i)
146 for(i = 1; i < nfields; ++i)
156 ASSERTL0(fielddef[0]->m_numHomogeneousDir <= 1,
"NumHomogeneousDir is only set up for 1");
158 if(fielddef[0]->m_numHomogeneousDir == 1)
166 vSession->LoadParameter(
"HomModesZ",nplanes,fielddef[0]->m_numModes[2]);
172 NekDouble lz = fielddef[0]->m_homogeneousLengths[0];
177 for(i = 1; i < nfields; ++i)
189 for(i = 1; i < nfields; ++i)
204 for(i = 1; i < nfields; ++i)
213 ASSERTL0(
false,
"Expansion dimension not recognised");
220 for(j = 0; j < nfields; ++j)
222 for(
int i = 0; i < fielddata.size(); ++i)
224 Exp[j]->ExtractDataToCoeffs(fielddef [i],
226 fielddef [i]->m_fields[j],
227 Exp[j]->UpdateCoeffs());
229 Exp[j]->BwdTrans(Exp[j]->GetCoeffs(),Exp[j]->UpdatePhys());
237 ifstream pts(argv[3]);
238 while (getline(pts, line))
240 stringstream ss(line);
244 cout << gloCoord[0] <<
" " << gloCoord[1] <<
" " << gloCoord[2];
247 for (
int j = 0; j < nfields; ++j)
256 cout <<
" " << Exp[j]->GetExp(ExpId)->PhysEvaluate(gloCoord, phys);
271 NekDouble dx = atof(argv[7])/(N>1 ? (N-1) : 1);
272 NekDouble dy = atof(argv[8])/(N>1 ? (N-1) : 1);
273 NekDouble dz = atof(argv[9])/(N>1 ? (N-1) : 1);
275 for (
int i = 0; i < N; ++i)
277 gloCoord[0] = x0 + i*dx;
278 gloCoord[1] = y0 + i*dy;
279 gloCoord[2] = z0 + i*dz;
280 cout << gloCoord[0] <<
" " << gloCoord[1] <<
" " << gloCoord[2];
283 for (
int j = 0; j < nfields; ++j)
292 cout <<
" " << Exp[j]->GetExp(ExpId)->PhysEvaluate(gloCoord, phys);
#define ASSERTL0(condition, msg)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
boost::shared_ptr< ExpList3DHomogeneous2D > ExpList3DHomogeneous2DSharedPtr
Shared pointer to an ExpList3DHomogeneous2D object.
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > ElementiDs)
Imports an FLD file.
1D Evenly-spaced points using Lagrange polynomial
boost::shared_ptr< ExpList1D > ExpList1DSharedPtr
Shared pointer to an ExpList1D object.
Defines a specification for a set of points.
boost::shared_ptr< ExpList2D > ExpList2DSharedPtr
Shared pointer to an ExpList2D object.
boost::shared_ptr< ExpList2DHomogeneous1D > ExpList2DHomogeneous1DSharedPtr
Shared pointer to an ExpList2DHomogeneous1D object.
boost::shared_ptr< ExpList3D > ExpList3DSharedPtr
Shared pointer to an ExpList3D object.
static const NekDouble kGeomFactorsTol
boost::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Describes the specification for a Basis.