Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Nektar::SolverUtils::FilterHistoryPoints Class Reference

#include <FilterHistoryPoints.h>

Inheritance diagram for Nektar::SolverUtils::FilterHistoryPoints:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SolverUtils::FilterHistoryPoints:
Collaboration graph
[legend]

Public Member Functions

SOLVER_UTILS_EXPORT FilterHistoryPoints (const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
 
SOLVER_UTILS_EXPORT ~FilterHistoryPoints ()
 
- Public Member Functions inherited from Nektar::SolverUtils::Filter
SOLVER_UTILS_EXPORT Filter (const LibUtilities::SessionReaderSharedPtr &pSession)
 
virtual SOLVER_UTILS_EXPORT ~Filter ()
 
SOLVER_UTILS_EXPORT void Initialise (const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
 
SOLVER_UTILS_EXPORT void Update (const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
 
SOLVER_UTILS_EXPORT void Finalise (const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
 
SOLVER_UTILS_EXPORT bool IsTimeDependent ()
 

Static Public Member Functions

static FilterSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className = GetFilterFactory().RegisterCreatorFunction("HistoryPoints", FilterHistoryPoints::create)
 Name of the class. More...
 

Protected Member Functions

virtual SOLVER_UTILS_EXPORT void v_Initialise (const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
 
virtual SOLVER_UTILS_EXPORT void v_Update (const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
 
virtual SOLVER_UTILS_EXPORT void v_Finalise (const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
 
virtual SOLVER_UTILS_EXPORT bool v_IsTimeDependent ()
 

Protected Attributes

SpatialDomains::PointGeomVector m_historyPoints
 
unsigned int m_index
 
unsigned int m_outputFrequency
 
unsigned int m_outputPlane
 plane to take history point from if using a homogeneous1D expansion More...
 
Array< OneD, int > m_planeIDs
 
bool m_isHomogeneous1D
 
bool m_waveSpace
 
std::string m_outputFile
 
std::ofstream m_outputStream
 
std::stringstream m_historyPointStream
 
std::list< std::pair
< SpatialDomains::PointGeomSharedPtr,
Array< OneD, NekDouble > > > 
m_historyList
 
std::map< int, int > m_historyLocalPointMap
 
- Protected Attributes inherited from Nektar::SolverUtils::Filter
LibUtilities::SessionReaderSharedPtr m_session
 

Friends

class MemoryManager< FilterHistoryPoints >
 

Additional Inherited Members

- Public Types inherited from Nektar::SolverUtils::Filter
typedef std::map< std::string,
std::string > 
ParamMap
 

Detailed Description

Definition at line 46 of file FilterHistoryPoints.h.

Constructor & Destructor Documentation

Nektar::SolverUtils::FilterHistoryPoints::FilterHistoryPoints ( const LibUtilities::SessionReaderSharedPtr pSession,
const ParamMap pParams 
)

Definition at line 54 of file FilterHistoryPoints.cpp.

References ASSERTL0, Nektar::LibUtilities::Equation::Evaluate(), m_historyPointStream, m_index, m_isHomogeneous1D, m_outputFile, m_outputFrequency, m_outputPlane, Nektar::SolverUtils::Filter::m_session, and m_waveSpace.

56  :
57  Filter(pSession)
58 {
59  ParamMap::const_iterator it;
60 
61  // OutputFile
62  it = pParams.find("OutputFile");
63  if (it == pParams.end())
64  {
65  m_outputFile = m_session->GetSessionName();
66  }
67  else
68  {
69  ASSERTL0(it->second.length() > 0, "Missing parameter 'OutputFile'.");
70  m_outputFile = it->second;
71  }
72  if (!(m_outputFile.length() >= 4
73  && m_outputFile.substr(m_outputFile.length() - 4) == ".his"))
74  {
75  m_outputFile += ".his";
76  }
77 
78  // OutputFrequency
79  it = pParams.find("OutputFrequency");
80  if (it == pParams.end())
81  {
83  }
84  else
85  {
86  LibUtilities::Equation equ(m_session, it->second);
87  m_outputFrequency = floor(equ.Evaluate());
88  }
89 
90  // OutputPlane
91  m_session->MatchSolverInfo("Homogeneous", "1D", m_isHomogeneous1D, false);
93  {
94  it = pParams.find("OutputPlane");
95  if (it == pParams.end())
96  {
97  m_outputPlane = -1;
98  }
99  else
100  {
101  LibUtilities::Equation equ(m_session, it->second);
102  m_outputPlane = floor(equ.Evaluate());
103  }
104 
105  it = pParams.find("WaveSpace");
106  if (it == pParams.end())
107  {
108  m_waveSpace = false;
109  }
110  else
111  {
112  std::string sOption = it->second.c_str();
113  m_waveSpace = ( boost::iequals(sOption,"true")) ||
114  ( boost::iequals(sOption,"yes"));
115  }
116  }
117 
118  // Points
119  it = pParams.find("Points");
120  ASSERTL0(it != pParams.end(), "Missing parameter 'Points'.");
121  m_historyPointStream.str(it->second);
122  m_index = 0;
123 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
SOLVER_UTILS_EXPORT Filter(const LibUtilities::SessionReaderSharedPtr &pSession)
Definition: Filter.cpp:52
unsigned int m_outputPlane
plane to take history point from if using a homogeneous1D expansion
LibUtilities::SessionReaderSharedPtr m_session
Definition: Filter.h:84
Nektar::SolverUtils::FilterHistoryPoints::~FilterHistoryPoints ( )

Definition at line 129 of file FilterHistoryPoints.cpp.

130 {
131 
132 }

Member Function Documentation

static FilterSharedPtr Nektar::SolverUtils::FilterHistoryPoints::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const std::map< std::string, std::string > &  pParams 
)
inlinestatic

Creates an instance of this class.

Definition at line 52 of file FilterHistoryPoints.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

54  {
56  ::AllocateSharedPtr(pSession, pParams);
57  return p;
58  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< Filter > FilterSharedPtr
A shared pointer to a Driver object.
Definition: Filter.h:50
void Nektar::SolverUtils::FilterHistoryPoints::v_Finalise ( const Array< OneD, const MultiRegions::ExpListSharedPtr > &  pFields,
const NekDouble time 
)
protectedvirtual

Implements Nektar::SolverUtils::Filter.

Definition at line 582 of file FilterHistoryPoints.cpp.

References m_outputStream.

583 {
584  if (pFields[0]->GetComm()->GetRank() == 0)
585  {
586  m_outputStream.close();
587  }
588 }
void Nektar::SolverUtils::FilterHistoryPoints::v_Initialise ( const Array< OneD, const MultiRegions::ExpListSharedPtr > &  pFields,
const NekDouble time 
)
protectedvirtual

Implements Nektar::SolverUtils::Filter.

Definition at line 138 of file FilterHistoryPoints.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::NekConstants::kGeomFactorsTol, Nektar::NekConstants::kNekZeroTol, Nektar::NekConstants::kVertexTheSameDouble, m_historyList, m_historyLocalPointMap, m_historyPoints, m_historyPointStream, m_index, m_isHomogeneous1D, m_outputFile, m_outputPlane, m_outputStream, m_planeIDs, Nektar::SolverUtils::Filter::m_session, m_waveSpace, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, v_Update(), Vmath::Vcopy(), and Nektar::NekMeshUtils::vert.

141 {
143  "No history points in stream.");
144 
145  m_index = 0;
146  m_historyList.clear();
147 
148  vector<unsigned int> planeIDs;
149  // Read history points
150  Array<OneD, NekDouble> gloCoord(3,0.0);
151  int dim = pFields[0]->GetGraph()->GetSpaceDimension();
152  if (m_isHomogeneous1D)
153  {
154  dim++;
155  }
156  int i = 0;
157  while (!m_historyPointStream.fail())
158  {
159  m_historyPointStream >> gloCoord[0]
160  >> gloCoord[1]
161  >> gloCoord[2];
162 
163  if (!m_historyPointStream.fail())
164  {
165  // Overwrite gloCoord[2] for 3DH1D using m_outputPlane if it is
166  // defined, or a nearby plane otherwise
168  {
169  int nplanes = pFields[0]->GetHomogeneousBasis()
170  ->GetZ().num_elements();
171  NekDouble lhom = pFields[0]->GetHomoLen();
172  int plane;
173  if (m_outputPlane == -1)
174  {
175  // Pick plane immediately before the point
176  plane = floor((gloCoord[2]*nplanes)/lhom);
177  }
178  else
179  {
180  plane = m_outputPlane;
181  }
182 
183  NekDouble Z = (pFields[0]->GetHomogeneousBasis()
184  ->GetZ())[plane];
185  Z = (Z+1)*lhom/2;
186  if(fabs(gloCoord[2]-Z) > NekConstants::kVertexTheSameDouble)
187  {
188  cout << "Reseting History point from z = " << gloCoord[2]
189  << " to z = " << Z << endl;
190  }
191  gloCoord[2] = Z;
192  planeIDs.push_back(plane);
193  }
194 
197  ::AllocateSharedPtr(dim, i, gloCoord[0],
198  gloCoord[1], gloCoord[2]);
199 
200  m_historyPoints.push_back(vert);
201  ++i;
202  }
203  }
204 
205 
206  // Determine the unique process responsible for each history point
207  // For points on a partition boundary, must select a single process
208  LibUtilities::CommSharedPtr vComm = pFields[0]->GetComm();
209  int vRank = vComm->GetRowComm()->GetRank();
210  int vHP = m_historyPoints.size();
211  Array<OneD, int> procList(vHP, -1 );
212  Array<OneD, int> idList (vHP, -1 );
213  Array<OneD, NekDouble> dist (vHP, 1e16);
214  Array<OneD, NekDouble> dist_loc(vHP, 1e16);
215  std::vector<Array<OneD, NekDouble> > LocCoords;
216 
217  // Find the nearest element on this process to which the history
218  // point could belong and note down the distance from the element
219  // and the process ID.
220  for (i = 0; i < vHP; ++i)
221  {
222  Array<OneD, NekDouble> locCoords(3);
223  m_historyPoints[i]->GetCoords( gloCoord[0],
224  gloCoord[1],
225  gloCoord[2]);
226 
227  // Determine the expansion and local coordinates
228  if (m_isHomogeneous1D)
229  {
230  idList[i] = pFields[0]->GetPlane(0)->GetExpIndex(gloCoord,locCoords,
232  }
233  else
234  {
235  idList[i] = pFields[0]->GetExpIndex(gloCoord,locCoords,
237  }
238 
239  // Save Local coordinates for later
240  LocCoords.push_back(locCoords);
241 
242  // For those points for which a potential nearby element exists
243  // compute the perp. distance from the point to the element and
244  // store in the distances array.
245  if (idList[i] != -1)
246  {
248  pFields[0]->GetExp(idList[i])->GetGeom();
249  StdRegions::StdExpansionSharedPtr e = g->GetXmap();
250  Array<OneD, NekDouble> coordVals(e->GetTotPoints());
251  dist_loc[i] = 0.0;
252  for (int j = 0; j < g->GetCoordim(); ++j)
253  {
254  e->BwdTrans(g->GetCoeffs(j), coordVals);
255  NekDouble x = e->PhysEvaluate(locCoords, coordVals)
256  - gloCoord[j];
257  dist_loc[i] += x*x;
258  }
259  }
260  }
261 
262  // Reduce distances of points from elements, keeping the smallest
263  // distance.
264  Vmath::Vcopy(vHP, dist_loc, 1, dist, 1);
265  vComm->AllReduce(dist, LibUtilities::ReduceMin);
266 
267  // If multiple processes find they are the nearest (e.g. point lies
268  // on a partition boundary, we will choose the process of highest
269  // rank.
270  m_planeIDs = Array<OneD, int> (planeIDs.size(),-1);
271  for (i = 0; i < vHP; ++i)
272  {
273  if (dist_loc[i] == dist[i])
274  {
275  // Set element id to Vid of m_history point for later use
276  m_historyPoints[i]->SetVid(idList[i]);
277  }
278  else
279  {
280  // This history point is not handled by this process
281  idList[i] = -1;
282  }
283 
284  // If a matching element is found on this process, note the
285  // process ID
286  if (idList[i] != -1)
287  {
288  procList[i] = vRank;
290  {
291  int j;
292  Array<OneD, const unsigned int> IDs
293  = pFields[0]->GetZIDs();
294  for(j = 0; j < IDs.num_elements(); ++j)
295  {
296  if(IDs[j] == planeIDs[i])
297  {
298  break;
299  }
300  }
301 
302  if(j != IDs.num_elements())
303  {
304  m_planeIDs[i] = j;
305  }
306  }
307  }
308  }
309 
310  // Reduce process IDs for all history points. The process with
311  // largest rank will handle the history point in the case where the
312  // distance was the same.
313  vComm->AllReduce(procList, LibUtilities::ReduceMax);
314 
315  // Determine the element in which each history point resides.
316  // If point is not in mesh (on this process), id is -1.
317  for (i = 0; i < vHP; ++i)
318  {
319  // If point lies on partition boundary, only the proc with max
320  // rank retains possession.
321  if (procList[i] != vRank)
322  {
323  idList[i] = -1;
324  }
325 
326  // If the current process owns this history point, add it to its
327  // local list of history points.
328  if (idList[i] != -1)
329  {
331  m_historyList.push_back(
333  Array<OneD, NekDouble> >
334  (m_historyPoints[i], LocCoords[i]));
335  }
336  }
337 
338  // Collate the element ID list across processes and check each
339  // history point is allocated to a process
340  vComm->AllReduce(idList, LibUtilities::ReduceMax);
341  if (vComm->GetRank() == 0)
342  {
343  for (i = 0; i < vHP; ++i)
344  {
345  m_historyPoints[i]->GetCoords( gloCoord[0],
346  gloCoord[1],
347  gloCoord[2]);
348 
349  // Write an error if no process owns history point
350  ASSERTL0(idList[i] != -1,
351  "History point "
352  + boost::lexical_cast<std::string>(gloCoord[0])
353  + ", "
354  + boost::lexical_cast<std::string>(gloCoord[1])
355  + ", "
356  + boost::lexical_cast<std::string>(gloCoord[2])
357  + " cannot be found in the mesh.");
358 
359  // Print a warning if a process owns it but it is not close
360  // enough to the element.
361  if (dist[i] > NekConstants::kGeomFactorsTol)
362  {
363  cout << "Warning: History point " << i << " at ("
364  << gloCoord[0] << "," << gloCoord[1] << ","
365  << gloCoord[2] << ") lies a distance of "
366  << sqrt(dist[i]) << " from the manifold." << endl;
367  }
368  }
369 
370  // Open output stream
371  m_outputStream.open(m_outputFile.c_str());
372  m_outputStream << "# History data for variables (:";
373 
374  for (i = 0; i < pFields.num_elements(); ++i)
375  {
376  m_outputStream << m_session->GetVariable(i) <<",";
377  }
378 
380  {
381  m_outputStream << ") at points:" << endl;
382  }
383  else
384  {
385  m_outputStream << ") at points:" << endl;
386  }
387 
388  for (i = 0; i < vHP; ++i)
389  {
390  m_historyPoints[i]->GetCoords( gloCoord[0],
391  gloCoord[1],
392  gloCoord[2]);
393 
394  m_outputStream << "# " << boost::format("%6.0f") % i;
395  m_outputStream << " " << boost::format("%25e") % gloCoord[0];
396  m_outputStream << " " << boost::format("%25e") % gloCoord[1];
397  m_outputStream << " " << boost::format("%25e") % gloCoord[2];
398  m_outputStream << endl;
399  }
400 
402  {
403  if (m_waveSpace)
404  {
405  m_outputStream << "# (in Wavespace)" << endl;
406  }
407  }
408  }
409  v_Update(pFields, time);
410 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
static const NekDouble kVertexTheSameDouble
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:53
static const NekDouble kNekZeroTol
unsigned int m_outputPlane
plane to take history point from if using a homogeneous1D expansion
SpatialDomains::PointGeomVector m_historyPoints
double NekDouble
LibUtilities::SessionReaderSharedPtr m_session
Definition: Filter.h:84
static const NekDouble kGeomFactorsTol
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)
Definition: Vmath.cpp:1047
boost::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:53
std::list< std::pair< SpatialDomains::PointGeomSharedPtr, Array< OneD, NekDouble > > > m_historyList
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
bool Nektar::SolverUtils::FilterHistoryPoints::v_IsTimeDependent ( )
protectedvirtual

Implements Nektar::SolverUtils::Filter.

Definition at line 594 of file FilterHistoryPoints.cpp.

595 {
596  return true;
597 }
void Nektar::SolverUtils::FilterHistoryPoints::v_Update ( const Array< OneD, const MultiRegions::ExpListSharedPtr > &  pFields,
const NekDouble time 
)
protectedvirtual

Implements Nektar::SolverUtils::Filter.

Reimplemented in Nektar::FilterCellHistoryPoints.

Definition at line 416 of file FilterHistoryPoints.cpp.

References ASSERTL0, Nektar::iterator, m_historyList, m_historyLocalPointMap, m_historyPoints, m_index, m_isHomogeneous1D, m_outputFrequency, m_outputStream, m_planeIDs, m_waveSpace, Nektar::LibUtilities::ReduceSum, and Vmath::Vcopy().

Referenced by v_Initialise().

417 {
418  // Only output every m_outputFrequency.
419  if ((m_index++) % m_outputFrequency)
420  {
421  return;
422  }
423 
424  int j = 0;
425  int k = 0;
426  int numPoints = m_historyPoints.size();
427  int numFields = pFields.num_elements();
428  LibUtilities::CommSharedPtr vComm = pFields[0]->GetComm();
429  Array<OneD, NekDouble> data(numPoints*numFields, 0.0);
430  std::list<std::pair<SpatialDomains::PointGeomSharedPtr, Array<OneD, NekDouble> > >::iterator x;
431 
432  Array<OneD, NekDouble> physvals;
433  Array<OneD, NekDouble> locCoord;
434  int expId;
435 
436  // Pull out data values field by field
437  for (j = 0; j < numFields; ++j)
438  {
440  {
441  for (k = 0, x = m_historyList.begin(); x != m_historyList.end();
442  ++x, ++k)
443  {
444  locCoord = (*x).second;
445  expId = (*x).first->GetVid();
446  NekDouble value;
447  int plane = m_planeIDs[m_historyLocalPointMap[k]];
448 
449  if (m_waveSpace)
450  {
451  ASSERTL0( pFields[j]->GetWaveSpace() == true,
452  "HistoryPoints in wavespace require that solution is in wavespace");
453  }
454  if ( pFields[j]->GetWaveSpace() == false || m_waveSpace)
455  {
456  if (plane != -1)
457  {
458  physvals = pFields[j]->GetPlane(plane)->
459  UpdatePhys() + pFields[j]->GetPhys_Offset(expId);
460 
461  // transform elemental data if required.
462  if(pFields[j]->GetPhysState() == false)
463  {
464  pFields[j]->GetPlane(plane)->GetExp(expId)->
465  BwdTrans(pFields[j]->GetPlane(plane)->
466  GetCoeffs() + pFields[j]->
467  GetCoeff_Offset(expId),physvals);
468  }
469  // Interpolate data
470  value = pFields[j]->GetPlane(plane)->GetExp(expId)->
471  StdPhysEvaluate(locCoord,physvals);
472  }
473  }
474  else
475  {
476  // Create vector with eIDs across all planes
477  std::vector<unsigned int> eIDs;
478  int nPlanes = pFields[j]->GetZIDs().num_elements();
479  int elmtsPerPlane = pFields[j]->GetExpSize()/nPlanes;
480 
481  for ( int n = 0; n < nPlanes; n++)
482  {
483  eIDs.push_back(expId + n*elmtsPerPlane);
484  }
485 
486  // Create new 3DH1D expansion with one element per plane
488  boost::dynamic_pointer_cast<MultiRegions::
489  ExpList3DHomogeneous1D>(pFields[j]);
490  ASSERTL0(tmp,"Failed to type cast expansion");
491 
493  MemoryManager<MultiRegions::
494  ExpList3DHomogeneous1D>::
495  AllocateSharedPtr(*tmp, eIDs);
496  // Fill phys array of new expansion and apply HomoBwdTrans
497  for ( int n = 0; n < nPlanes; n++)
498  {
499  Array<OneD, NekDouble> toPhys =
500  exp->GetPlane(n)->UpdatePhys();
501  if(pFields[j]->GetPhysState())
502  {
503  int nq = exp->GetPlane(0)->GetTotPoints();
504  Array<OneD, NekDouble> fromPhys =
505  pFields[j]->GetPlane(n)->GetPhys() +
506  pFields[j]->GetPhys_Offset(expId);
507  Vmath::Vcopy(nq, fromPhys, 1, toPhys, 1);
508  }
509  else
510  {
511  Array<OneD, NekDouble> fromCoeffs =
512  pFields[j]->GetPlane(n)->GetCoeffs() +
513  pFields[j]->GetCoeff_Offset(expId);
514  exp->GetPlane(n)->GetExp(0)->
515  BwdTrans(fromCoeffs, toPhys);
516  }
517  }
518  exp->HomogeneousBwdTrans(exp->GetPhys(), exp->UpdatePhys());
519  // Interpolate data
520  if (plane != -1)
521  {
522  physvals = exp->GetPlane(plane)->UpdatePhys();
523 
524  value = exp->GetPlane(plane)->GetExp(0)->
525  StdPhysEvaluate(locCoord,physvals);
526  }
527  }
528 
529  // store data
530  if (plane != -1)
531  {
532  data[m_historyLocalPointMap[k]*numFields+j] = value;
533  }
534  }
535  }
536  else
537  {
538  for (k = 0, x = m_historyList.begin(); x != m_historyList.end(); ++x, ++k)
539  {
540  locCoord = (*x).second;
541  expId = (*x).first->GetVid();
542 
543  physvals = pFields[j]->UpdatePhys() + pFields[j]->GetPhys_Offset(expId);
544 
545  // transform elemental data if required.
546  if(pFields[j]->GetPhysState() == false)
547  {
548  pFields[j]->GetExp(expId)->BwdTrans(pFields[j]->GetCoeffs() + pFields[j]->GetCoeff_Offset(expId),physvals);
549  }
550 
551  // interpolate point
552  data[m_historyLocalPointMap[k]*numFields+j] = pFields[j]->GetExp(expId)->StdPhysEvaluate(locCoord,physvals);
553  }
554  }
555  }
556 
557  // Exchange history data
558  // This could be improved to reduce communication but works for now
559  vComm->AllReduce(data, LibUtilities::ReduceSum);
560 
561  // Only the root process writes out history data
562  if (vComm->GetRank() == 0)
563  {
564 
565  // Write data values point by point
566  for (k = 0; k < m_historyPoints.size(); ++k)
567  {
568  m_outputStream << boost::format("%25e") % time;
569  for (int j = 0; j < numFields; ++j)
570  {
571  m_outputStream << " " << boost::format("%25e") % data[k*numFields+j];
572  }
573  m_outputStream << endl;
574  }
575  }
576 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:53
SpatialDomains::PointGeomVector m_historyPoints
double NekDouble
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
std::list< std::pair< SpatialDomains::PointGeomSharedPtr, Array< OneD, NekDouble > > > m_historyList

Friends And Related Function Documentation

friend class MemoryManager< FilterHistoryPoints >
friend

Definition at line 49 of file FilterHistoryPoints.h.

Member Data Documentation

std::string Nektar::SolverUtils::FilterHistoryPoints::className = GetFilterFactory().RegisterCreatorFunction("HistoryPoints", FilterHistoryPoints::create)
static

Name of the class.

Definition at line 61 of file FilterHistoryPoints.h.

std::list<std::pair<SpatialDomains::PointGeomSharedPtr, Array<OneD, NekDouble> > > Nektar::SolverUtils::FilterHistoryPoints::m_historyList
protected
std::map<int, int > Nektar::SolverUtils::FilterHistoryPoints::m_historyLocalPointMap
protected
SpatialDomains::PointGeomVector Nektar::SolverUtils::FilterHistoryPoints::m_historyPoints
protected
std::stringstream Nektar::SolverUtils::FilterHistoryPoints::m_historyPointStream
protected

Definition at line 90 of file FilterHistoryPoints.h.

Referenced by FilterHistoryPoints(), and v_Initialise().

unsigned int Nektar::SolverUtils::FilterHistoryPoints::m_index
protected
bool Nektar::SolverUtils::FilterHistoryPoints::m_isHomogeneous1D
protected
std::string Nektar::SolverUtils::FilterHistoryPoints::m_outputFile
protected

Definition at line 88 of file FilterHistoryPoints.h.

Referenced by FilterHistoryPoints(), and v_Initialise().

unsigned int Nektar::SolverUtils::FilterHistoryPoints::m_outputFrequency
protected
unsigned int Nektar::SolverUtils::FilterHistoryPoints::m_outputPlane
protected

plane to take history point from if using a homogeneous1D expansion

Definition at line 84 of file FilterHistoryPoints.h.

Referenced by FilterHistoryPoints(), v_Initialise(), and Nektar::FilterCellHistoryPoints::v_Update().

std::ofstream Nektar::SolverUtils::FilterHistoryPoints::m_outputStream
protected
Array<OneD, int> Nektar::SolverUtils::FilterHistoryPoints::m_planeIDs
protected

Definition at line 85 of file FilterHistoryPoints.h.

Referenced by v_Initialise(), and v_Update().

bool Nektar::SolverUtils::FilterHistoryPoints::m_waveSpace
protected

Definition at line 87 of file FilterHistoryPoints.h.

Referenced by FilterHistoryPoints(), v_Initialise(), and v_Update().