preCICE
v3.1.2
Loading...
Searching...
No Matches
src
mesh
config
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
"
8
#include "
utils/ManageUniqueIDs.hpp
"
9
#include "
xml/XMLTag.hpp
"
10
11
namespace
precice
{
12
namespace
mesh {
13
15
class
DataConfiguration
:
public
xml::XMLTag::Listener
{
16
public
:
17
struct
ConfiguredData
{
18
std::string
name
;
19
Data::typeName
typeName
;
20
int
waveformDegree
;
21
22
ConfiguredData
(
23
const
std::string
&
name
,
24
const
Data::typeName
typeName
,
25
int
waveformDegree
)
26
:
name
(
name
),
typeName
(
typeName
),
waveformDegree
(
waveformDegree
) {}
27
};
28
29
DataConfiguration
(
xml::XMLTag
&parent);
30
31
const
std::vector<ConfiguredData>
&
data
()
const
;
32
33
ConfiguredData
getRecentlyConfiguredData
()
const
;
34
35
virtual
void
xmlTagCallback
(
36
const
xml::ConfigurationContext
&context,
37
xml::XMLTag
& callingTag);
38
39
virtual
void
xmlEndTagCallback
(
40
const
xml::ConfigurationContext
&context,
41
xml::XMLTag
& callingTag);
42
50
void
addData
(
const
std::string
&
name
,
51
const
Data::typeName
typeName,
52
int
waveformDegree =
time::Time::DEFAULT_WAVEFORM_DEGREE
);
53
54
private
:
55
mutable
logging::Logger
_log
{
"mesh::DataConfiguration"
};
56
57
const
std::string
TAG
=
"data"
;
58
const
std::string
ATTR_NAME
=
"name"
;
59
const
std::string
ATTR_DEGREE
=
"waveform-degree"
;
60
const
std::string
VALUE_VECTOR
=
"vector"
;
61
const
std::string
VALUE_SCALAR
=
"scalar"
;
62
63
std::vector<ConfiguredData>
_data
;
64
65
int
_indexLastConfigured
= -1;
66
};
67
68
}
// namespace mesh
69
}
// namespace precice
Data.hpp
Logger.hpp
ManageUniqueIDs.hpp
name
std::string name
Definition
SocketCommunication.cpp:718
Time.hpp
XMLTag.hpp
std::string
precice::logging::Logger
This class provides a lightweight logger.
Definition
Logger.hpp:16
precice::mesh::DataConfiguration
Performs and provides configuration for Data objects from XML files.
Definition
DataConfiguration.hpp:15
precice::mesh::DataConfiguration::ATTR_DEGREE
const std::string ATTR_DEGREE
Definition
DataConfiguration.hpp:59
precice::mesh::DataConfiguration::VALUE_SCALAR
const std::string VALUE_SCALAR
Definition
DataConfiguration.hpp:61
precice::mesh::DataConfiguration::_indexLastConfigured
int _indexLastConfigured
Definition
DataConfiguration.hpp:65
precice::mesh::DataConfiguration::addData
void addData(const std::string &name, const Data::typeName typeName, int waveformDegree=time::Time::DEFAULT_WAVEFORM_DEGREE)
Adds data manually.
Definition
DataConfiguration.cpp:80
precice::mesh::DataConfiguration::DataConfiguration
DataConfiguration(xml::XMLTag &parent)
Definition
DataConfiguration.cpp:10
precice::mesh::DataConfiguration::getRecentlyConfiguredData
ConfiguredData getRecentlyConfiguredData() const
Definition
DataConfiguration.cpp:41
precice::mesh::DataConfiguration::xmlEndTagCallback
virtual void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at end of XML tag and at end of subtag.
Definition
DataConfiguration.cpp:74
precice::mesh::DataConfiguration::data
const std::vector< ConfiguredData > & data() const
Definition
DataConfiguration.cpp:36
precice::mesh::DataConfiguration::ATTR_NAME
const std::string ATTR_NAME
Definition
DataConfiguration.hpp:58
precice::mesh::DataConfiguration::TAG
const std::string TAG
Definition
DataConfiguration.hpp:57
precice::mesh::DataConfiguration::_data
std::vector< ConfiguredData > _data
Definition
DataConfiguration.hpp:63
precice::mesh::DataConfiguration::_log
logging::Logger _log
Definition
DataConfiguration.hpp:55
precice::mesh::DataConfiguration::VALUE_VECTOR
const std::string VALUE_VECTOR
Definition
DataConfiguration.hpp:60
precice::mesh::DataConfiguration::xmlTagCallback
virtual void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at begin of XML tag.
Definition
DataConfiguration.cpp:49
precice::mesh::Data::typeName
typeName
Definition
Data.hpp:32
precice::time::Time::DEFAULT_WAVEFORM_DEGREE
static const int DEFAULT_WAVEFORM_DEGREE
To be used, when the interpolation degree is not defined.
Definition
Time.hpp:9
precice::xml::XMLTag
Represents an XML tag to be configured automatically.
Definition
XMLTag.hpp:31
precice
Main namespace of the precice library.
Definition
Acceleration.cpp:5
string
precice::mesh::DataConfiguration::ConfiguredData
Definition
DataConfiguration.hpp:17
precice::mesh::DataConfiguration::ConfiguredData::name
std::string name
Definition
DataConfiguration.hpp:18
precice::mesh::DataConfiguration::ConfiguredData::ConfiguredData
ConfiguredData(const std::string &name, const Data::typeName typeName, int waveformDegree)
Definition
DataConfiguration.hpp:22
precice::mesh::DataConfiguration::ConfiguredData::waveformDegree
int waveformDegree
Definition
DataConfiguration.hpp:20
precice::mesh::DataConfiguration::ConfiguredData::typeName
Data::typeName typeName
Definition
DataConfiguration.hpp:19
precice::xml::ConfigurationContext
Tightly coupled to the parameters of Participant()
Definition
XMLTag.hpp:24
precice::xml::XMLTag::Listener
Callback interface for configuration classes using XMLTag.
Definition
XMLTag.hpp:43
vector