preCICE v3.2.0
Loading...
Searching...
No Matches
WatchPoint.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4#include <limits>
5#include <string>
6#include <vector>
7#include "SharedPointer.hpp"
9#include "logging/Logger.hpp"
10#include "mapping/Polation.hpp"
12
13namespace precice::mesh {
14class Vertex;
15}
16
17namespace precice::impl {
18
21public:
28 Eigen::VectorXd pointCoords,
29 mesh::PtrMesh meshToWatch,
30 const std::string &exportFilename);
31
32 const mesh::PtrMesh &mesh() const;
33
34 const std::string &filename() const;
35
40 void initialize();
41
43 void exportPointData(double time);
44
45 bool isClosest() const
46 {
47 return _isClosest;
48 }
49
50private:
51 logging::Logger _log{"impl::WatchPoint"};
52
53 Eigen::VectorXd _point;
54
56
58
60
62
64
66 bool _isClosest = true;
67
68 void getValue(
69 Eigen::VectorXd &value,
70 mesh::PtrData &data,
71 double time);
72
73 void getValue(
74 double &value,
75 mesh::PtrData &data,
76 double time);
77};
78
79} // namespace precice::impl
const std::string & filename() const
void exportPointData(double time)
Writes one line with data of the watchpoint into the output file.
void getValue(Eigen::VectorXd &value, mesh::PtrData &data, double time)
std::vector< mesh::PtrData > _dataToExport
io::TXTTableWriter _txtWriter
WatchPoint(Eigen::VectorXd pointCoords, mesh::PtrMesh meshToWatch, const std::string &exportFilename)
Constructor.
const mesh::PtrMesh & mesh() const
std::unique_ptr< mapping::Polation > _interpolation
bool _isClosest
Holds the information if this processor is the closest.
File writer for table-data in text-format.
This class provides a lightweight logger.
Definition Logger.hpp:17
Vertex of a mesh.
Definition Vertex.hpp:16
T max(T... args)
provides Mesh, Data and primitives.
std::shared_ptr< Data > PtrData
std::shared_ptr< Mesh > PtrMesh
contains the time interpolation logic.
Definition Sample.hpp:8