preCICE
Loading...
Searching...
No Matches
DataConfiguration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5#include "logging/Logger.hpp"
6#include "mesh/Data.hpp"
7#include "time/Time.hpp"
9#include "xml/XMLTag.hpp"
10
11namespace precice::mesh {
12
15public:
17 std::string name;
20 std::vector<std::optional<double>> lowerBound;
21 std::vector<std::optional<double>> upperBound;
22
24 const std::string &name,
27 std::vector<std::optional<double>> lowerBound,
28 std::vector<std::optional<double>> upperBound)
30 };
31
33
34 const std::vector<ConfiguredData> &data() const;
35
36 ConfiguredData getRecentlyConfiguredData() const;
37
38 void xmlTagCallback(
39 const xml::ConfigurationContext &context,
40 xml::XMLTag &callingTag) override;
41
43 const xml::ConfigurationContext &context,
44 xml::XMLTag &callingTag) override;
45
55 void addData(const std::string &name,
56 const Data::typeName typeName,
57 int waveformDegree = time::Time::DEFAULT_WAVEFORM_DEGREE,
58 std::vector<std::optional<double>> lowerBound = std::vector<std::optional<double>>(3),
59 std::vector<std::optional<double>> upperBound = std::vector<std::optional<double>>(3));
60
61private:
62 mutable logging::Logger _log{"mesh::DataConfiguration"};
63
64 const std::string TAG = "data";
65 const std::string ATTR_NAME = "name";
66 const std::string ATTR_DEGREE = "waveform-degree";
67 const std::string ATTR_LOWER_BOUND = "lower-bound";
68 const std::string ATTR_UPPER_BOUND = "upper-bound";
69 const std::string ATTR_LOWER_BOUND_X = "lower-bound-x";
70 const std::string ATTR_LOWER_BOUND_Y = "lower-bound-y";
71 const std::string ATTR_LOWER_BOUND_Z = "lower-bound-z";
72 const std::string ATTR_UPPER_BOUND_X = "upper-bound-x";
73 const std::string ATTR_UPPER_BOUND_Y = "upper-bound-y";
74 const std::string ATTR_UPPER_BOUND_Z = "upper-bound-z";
75 const std::string VALUE_VECTOR = "vector";
76 const std::string VALUE_SCALAR = "scalar";
77
78 std::vector<ConfiguredData> _data;
79
81};
82
83} // namespace precice::mesh
This class provides a lightweight logger.
Definition Logger.hpp:17
void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override
Callback at begin of XML tag.
void addData(const std::string &name, const Data::typeName typeName, int waveformDegree=time::Time::DEFAULT_WAVEFORM_DEGREE, std::vector< std::optional< double > > lowerBound=std::vector< std::optional< double > >(3), std::vector< std::optional< double > > upperBound=std::vector< std::optional< double > >(3))
Adds data manually.
ConfiguredData getRecentlyConfiguredData() const
const std::vector< ConfiguredData > & data() const
std::vector< ConfiguredData > _data
void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override
Callback at end of XML tag and at end of subtag.
static const int DEFAULT_WAVEFORM_DEGREE
To be used, when the interpolation degree is not defined.
Definition Time.hpp:8
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:28
provides Mesh, Data and primitives.
std::vector< std::optional< double > > lowerBound
std::vector< std::optional< double > > upperBound
ConfiguredData(const std::string &name, const Data::typeName typeName, int waveformDegree, std::vector< std::optional< double > > lowerBound, std::vector< std::optional< double > > upperBound)
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:21
Callback interface for configuration classes using XMLTag.
Definition XMLTag.hpp:46