51 const std::map<std::string, std::string> &pParams) :
54 if (pParams.find(
"OutputFile") == pParams.end())
60 ASSERTL0(!(pParams.find(
"OutputFile")->second.empty()),
61 "Missing parameter 'OutputFile'.");
70 if (pParams.find(
"OutputFrequency") == pParams.end())
84 if (pParams.find(
"OutputPlane") == pParams.end())
90 m_outputPlane = atoi(pParams.find(
"OutputPlane")->second.c_str());
94 ASSERTL0(pParams.find(
"Points") != pParams.end(),
95 "Missing parameter 'Points'.");
118 "No history points in stream.");
125 int dim = pFields[0]->GetGraph()->GetSpaceDimension();
134 NekDouble Z = (pFields[0]->GetHomogeneousBasis()
138 cout <<
"Reseting History point from " << gloCoord[2]
139 <<
" to " << Z << endl;
149 gloCoord[1], gloCoord[2]);
160 int vRank = vComm->GetRank();
166 std::vector<Array<OneD, NekDouble> > LocCoords;
171 for (i = 0; i < vHP; ++i)
179 idList[i] = pFields[0]->GetExpIndex(gloCoord,locCoords,
183 LocCoords.push_back(locCoords);
191 pFields[0]->GetExp(idList[i])->GetGeom();
195 for (
int j = 0; j < g->GetCoordim(); ++j)
197 e->BwdTrans(g->GetCoeffs(j), coordVals);
198 NekDouble x = e->PhysEvaluate(locCoords, coordVals)
213 for (i = 0; i < vHP; ++i)
215 if (dist_loc[i] == dist[i])
234 = pFields[0]->GetZIDs();
235 for(j = 0; j < IDs.num_elements(); ++j)
243 if(j != IDs.num_elements())
263 for (i = 0; i < vHP; ++i)
267 if (procList[i] != vRank)
287 if (vComm->GetRank() == 0)
289 for (i = 0; i < vHP; ++i)
298 + boost::lexical_cast<std::string>(gloCoord[0])
300 + boost::lexical_cast<std::string>(gloCoord[1])
302 + boost::lexical_cast<std::string>(gloCoord[2])
303 +
" cannot be found in the mesh.");
309 cout <<
"Warning: History point " << i <<
" at ("
310 << gloCoord[0] <<
"," << gloCoord[1] <<
","
311 << gloCoord[2] <<
") lies a distance of "
312 << sqrt(dist[i]) <<
" from the manifold." << endl;
320 for (i = 0; i < pFields.num_elements(); ++i)
334 for (i = 0; i < vHP; ++i)
373 int numFields = pFields.num_elements();
377 std::list<std::pair<SpatialDomains::PointGeomSharedPtr, Array<OneD, NekDouble> > >
::iterator x;
384 for (j = 0; j < numFields; ++j)
391 locCoord = (*x).second;
392 expId = (*x).first->GetVid();
394 physvals = pFields[j]->GetPlane(
m_outputPlane)->UpdatePhys() + pFields[j]->GetPhys_Offset(expId);
397 if(pFields[j]->GetPhysState() ==
false)
399 pFields[j]->GetPlane(
m_outputPlane)->GetExp(expId)->BwdTrans(pFields[j]->GetPlane(
m_outputPlane)->GetCoeffs() + pFields[j]->GetCoeff_Offset(expId),physvals);
403 data[
m_historyLocalPointMap[k]*numFields+j] = pFields[j]->GetExp(expId)->StdPhysEvaluate(locCoord,physvals);
411 locCoord = (*x).second;
412 expId = (*x).first->GetVid();
414 physvals = pFields[j]->UpdatePhys() + pFields[j]->GetPhys_Offset(expId);
417 if(pFields[j]->GetPhysState() ==
false)
419 pFields[j]->GetExp(expId)->BwdTrans(pFields[j]->GetCoeffs() + pFields[j]->GetCoeff_Offset(expId),physvals);
423 data[
m_historyLocalPointMap[k]*numFields+j] = pFields[j]->GetExp(expId)->StdPhysEvaluate(locCoord,physvals);
433 if (vComm->GetRank() == 0)
441 for (
int j = 0; j < numFields; ++j)
457 if (pFields[0]->GetComm()->GetRank() == 0)
std::ofstream m_outputStream
#define ASSERTL0(condition, msg)
std::map< int, int > m_historyLocalPointMap
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
static const NekDouble kVertexTheSameDouble
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
std::stringstream m_historyPointStream
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
unsigned int m_outputPlane
plane to take history point from if using a homogeneous1D expansion
SpatialDomains::PointGeomVector m_historyPoints
static std::string className
Name of the class.
unsigned int m_outputFrequency
LibUtilities::SessionReaderSharedPtr m_session
SOLVER_UTILS_EXPORT ~FilterHistoryPoints()
virtual SOLVER_UTILS_EXPORT void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
virtual SOLVER_UTILS_EXPORT void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual SOLVER_UTILS_EXPORT bool v_IsTimeDependent()
SOLVER_UTILS_EXPORT FilterHistoryPoints(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
static const NekDouble kGeomFactorsTol
FilterFactory & GetFilterFactory()
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual SOLVER_UTILS_EXPORT void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
boost::shared_ptr< Geometry > GeometrySharedPtr
std::list< std::pair< SpatialDomains::PointGeomSharedPtr, Array< OneD, NekDouble > > > m_historyList
boost::shared_ptr< PointGeom > PointGeomSharedPtr
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.