25 "Usage: ProbeFld meshfile fieldfile N x0 y0 z0 dx dy dz\n");
27 " Probes N points along the line from (x0,y0,z0) to "
28 "(x0+dx, y0+dy, z0+dz)\n");
30 "ProbeFld meshfile fieldfile points.txt\n");
32 " Probes the solution at the points in the points.txt file.\n");
34 " Points are given as space-separated x y z on each line.\n");
39 = LibUtilities::SessionReader::CreateInstance(3, argv);
43 string meshfile(argv[1]);
49 string fieldfile(argv[2]);
50 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
51 vector<vector<NekDouble> > fielddata;
57 vector< vector<LibUtilities::PointsType> > pointstype;
58 for(i = 0; i < fielddef.size(); ++i)
60 vector<LibUtilities::PointsType> ptype;
61 for(j = 0; j < 3; ++j)
65 pointstype.push_back(ptype);
67 graphShPt->SetExpansions(fielddef,pointstype);
69 bool dealiasing =
false;
75 int expdim = graphShPt->GetMeshDimension();
76 int nfields = fielddef[0]->m_fields.size();
83 ASSERTL0(fielddef[0]->m_numHomogeneousDir <= 2,
"NumHomogeneousDir is only set up for 1 or 2");
85 if(fielddef[0]->m_numHomogeneousDir == 1)
92 vSession->LoadParameter(
"HomModesZ",nplanes,fielddef[0]->m_numModes[1]);
97 NekDouble ly = fielddef[0]->m_homogeneousLengths[0];
102 for(i = 1; i < nfields; ++i)
107 else if(fielddef[0]->m_numHomogeneousDir == 2)
117 vSession->LoadParameter(
"HomModesY",nylines,fielddef[0]->m_numModes[1]);
118 vSession->LoadParameter(
"HomModesZ",nzlines,fielddef[0]->m_numModes[2]);
127 NekDouble ly = fielddef[0]->m_homogeneousLengths[0];
128 NekDouble lz = fielddef[0]->m_homogeneousLengths[1];
133 for(i = 1; i < nfields; ++i)
144 for(i = 1; i < nfields; ++i)
154 ASSERTL0(fielddef[0]->m_numHomogeneousDir <= 1,
"NumHomogeneousDir is only set up for 1");
156 if(fielddef[0]->m_numHomogeneousDir == 1)
164 vSession->LoadParameter(
"HomModesZ",nplanes,fielddef[0]->m_numModes[2]);
170 NekDouble lz = fielddef[0]->m_homogeneousLengths[0];
175 for(i = 1; i < nfields; ++i)
187 for(i = 1; i < nfields; ++i)
202 for(i = 1; i < nfields; ++i)
211 ASSERTL0(
false,
"Expansion dimension not recognised");
218 for(j = 0; j < nfields; ++j)
220 for(
int i = 0; i < fielddata.size(); ++i)
222 Exp[j]->ExtractDataToCoeffs(fielddef [i],
224 fielddef [i]->m_fields[j],
225 Exp[j]->UpdateCoeffs());
227 Exp[j]->BwdTrans(Exp[j]->GetCoeffs(),Exp[j]->UpdatePhys());
235 ifstream pts(argv[3]);
236 while (getline(pts, line))
238 stringstream ss(line);
242 cout << gloCoord[0] <<
" " << gloCoord[1] <<
" " << gloCoord[2];
245 for (
int j = 0; j < nfields; ++j)
254 cout <<
" " << Exp[j]->GetExp(ExpId)->PhysEvaluate(gloCoord, phys);
269 NekDouble dx = atof(argv[7])/(N>1 ? (N-1) : 1);
270 NekDouble dy = atof(argv[8])/(N>1 ? (N-1) : 1);
271 NekDouble dz = atof(argv[9])/(N>1 ? (N-1) : 1);
273 for (
int i = 0; i < N; ++i)
275 gloCoord[0] = x0 + i*dx;
276 gloCoord[1] = y0 + i*dy;
277 gloCoord[2] = z0 + i*dz;
278 cout << gloCoord[0] <<
" " << gloCoord[1] <<
" " << gloCoord[2];
281 for (
int j = 0; j < nfields; ++j)
290 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.