54 ParamMap::const_iterator it;
57 it = pParams.find(
"OutputFile");
58 if (it == pParams.end())
64 ASSERTL0(it->second.length() > 0,
"Missing parameter 'OutputFile'.");
74 it = pParams.find(
"OutputFrequency");
75 if (it == pParams.end())
89 it = pParams.find(
"OutputPlane");
90 if (it == pParams.end())
102 it = pParams.find(
"Points");
103 ASSERTL0(it != pParams.end(),
"Missing parameter 'Points'.");
126 "No history points in stream.");
133 int dim = pFields[0]->GetGraph()->GetSpaceDimension();
142 NekDouble Z = (pFields[0]->GetHomogeneousBasis()
146 cout <<
"Reseting History point from " << gloCoord[2]
147 <<
" to " << Z << endl;
157 gloCoord[1], gloCoord[2]);
168 int vRank = vComm->GetRank();
174 std::vector<Array<OneD, NekDouble> > LocCoords;
179 for (i = 0; i < vHP; ++i)
187 idList[i] = pFields[0]->GetExpIndex(gloCoord,locCoords,
191 LocCoords.push_back(locCoords);
199 pFields[0]->GetExp(idList[i])->GetGeom();
203 for (
int j = 0; j < g->GetCoordim(); ++j)
205 e->BwdTrans(g->GetCoeffs(j), coordVals);
206 NekDouble x = e->PhysEvaluate(locCoords, coordVals)
221 for (i = 0; i < vHP; ++i)
223 if (dist_loc[i] == dist[i])
242 = pFields[0]->GetZIDs();
243 for(j = 0; j < IDs.num_elements(); ++j)
251 if(j != IDs.num_elements())
271 for (i = 0; i < vHP; ++i)
275 if (procList[i] != vRank)
295 if (vComm->GetRank() == 0)
297 for (i = 0; i < vHP; ++i)
306 + boost::lexical_cast<std::string>(gloCoord[0])
308 + boost::lexical_cast<std::string>(gloCoord[1])
310 + boost::lexical_cast<std::string>(gloCoord[2])
311 +
" cannot be found in the mesh.");
317 cout <<
"Warning: History point " << i <<
" at ("
318 << gloCoord[0] <<
"," << gloCoord[1] <<
","
319 << gloCoord[2] <<
") lies a distance of "
320 << sqrt(dist[i]) <<
" from the manifold." << endl;
328 for (i = 0; i < pFields.num_elements(); ++i)
342 for (i = 0; i < vHP; ++i)
381 int numFields = pFields.num_elements();
385 std::list<std::pair<SpatialDomains::PointGeomSharedPtr, Array<OneD, NekDouble> > >
::iterator x;
392 for (j = 0; j < numFields; ++j)
399 locCoord = (*x).second;
400 expId = (*x).first->GetVid();
402 physvals = pFields[j]->GetPlane(
m_outputPlane)->UpdatePhys() + pFields[j]->GetPhys_Offset(expId);
405 if(pFields[j]->GetPhysState() ==
false)
407 pFields[j]->GetPlane(
m_outputPlane)->GetExp(expId)->BwdTrans(pFields[j]->GetPlane(
m_outputPlane)->GetCoeffs() + pFields[j]->GetCoeff_Offset(expId),physvals);
411 data[
m_historyLocalPointMap[k]*numFields+j] = pFields[j]->GetExp(expId)->StdPhysEvaluate(locCoord,physvals);
419 locCoord = (*x).second;
420 expId = (*x).first->GetVid();
422 physvals = pFields[j]->UpdatePhys() + pFields[j]->GetPhys_Offset(expId);
425 if(pFields[j]->GetPhysState() ==
false)
427 pFields[j]->GetExp(expId)->BwdTrans(pFields[j]->GetCoeffs() + pFields[j]->GetCoeff_Offset(expId),physvals);
431 data[
m_historyLocalPointMap[k]*numFields+j] = pFields[j]->GetExp(expId)->StdPhysEvaluate(locCoord,physvals);
441 if (vComm->GetRank() == 0)
449 for (
int j = 0; j < numFields; ++j)
465 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
NekDouble Evaluate() const
SpatialDomains::PointGeomVector m_historyPoints
static std::string className
Name of the class.
unsigned int m_outputFrequency
std::map< std::string, std::string > ParamMap
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()
static const NekDouble kGeomFactorsTol
SOLVER_UTILS_EXPORT FilterHistoryPoints(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
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.