preCICE v3.1.2
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 {
14namespace mesh {
15class Vertex;
16}
17} // namespace precice
18
19namespace precice {
20namespace impl {
21
24public:
31 Eigen::VectorXd pointCoords,
32 mesh::PtrMesh meshToWatch,
33 const std::string &exportFilename);
34
35 const mesh::PtrMesh &mesh() const;
36
37 const std::string &filename() const;
38
43 void initialize();
44
46 void exportPointData(double time);
47
48 bool isClosest() const
49 {
50 return _isClosest;
51 }
52
53private:
54 logging::Logger _log{"impl::WatchPoint"};
55
56 Eigen::VectorXd _point;
57
59
61
63
65
67
69 bool _isClosest = true;
70
71 void getValue(
72 Eigen::VectorXd &value,
73 mesh::PtrData & data);
74
75 void getValue(
76 double & value,
77 mesh::PtrData &data);
78};
79
80} // namespace impl
81} // namespace precice
Observes and exports coordinates of a point on the geometry.
void getValue(Eigen::VectorXd &value, mesh::PtrData &data)
const std::string & filename() const
void exportPointData(double time)
Writes one line with data of the watchpoint into the output file.
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:16
T max(T... args)
Main namespace of the precice library.
static std::unique_ptr< precice::Participant > impl
Definition preciceC.cpp:21