14 auto attrName = XMLAttribute<std::string>(
ATTR_NAME)
15 .setDocumentation(
"Unique name for the data set.");
18 attrDegree.setDocumentation(
"Polynomial degree of waveform that is used for time interpolation.");
21 tagScalar.setDocumentation(
"Defines a scalar data set to be assigned to meshes.");
22 tagScalar.addAttribute(attrName);
23 tagScalar.addAttribute(attrDegree);
27 tagVector.setDocumentation(
"Defines a vector data set to be assigned to meshes. The number of "
28 "components of each data entry depends on the spatial dimensions of the mesh.");
29 tagVector.addAttribute(attrName);
30 tagVector.addAttribute(attrDegree);
56 if (tag.
getName() ==
"scalar") {
58 }
else if (tag.
getName() ==
"vector") {
61 PRECICE_ERROR(
"You configured data with name=\"{}\" to be of type \"{}\", but this type is unknown. Known types are \"scalar\" and \"vector\".", name, tag.
getName());
66 "You tried to configure the data with name \"{}\" to use the waveform-degree=\"{}\", but the degree must be at least \"{}\".", name, waveformDegree,
time::Time::MIN_WAVEFORM_DEGREE);
67 addData(name, typeName, waveformDegree);
85 for (
auto &elem :
_data) {
87 "Data \"{0}\" has already been defined. Please rename or remove one of the data tags with name=\"{0}\".",
91 _data.emplace_back(name, typeName, waveformDegree);
#define PRECICE_ERROR(...)
#define PRECICE_CHECK(check,...)
#define PRECICE_ASSERT(...)
const std::string ATTR_DEGREE
const std::string VALUE_SCALAR
void addData(const std::string &name, const Data::typeName typeName, int waveformDegree=time::Time::DEFAULT_WAVEFORM_DEGREE)
Adds data manually.
void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override
Callback at begin of XML tag.
DataConfiguration(xml::XMLTag &parent)
ConfiguredData getRecentlyConfiguredData() const
const std::vector< ConfiguredData > & data() const
const std::string ATTR_NAME
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.
const std::string VALUE_VECTOR
static const int DEFAULT_WAVEFORM_DEGREE
To be used, when the interpolation degree is not defined.
static const int MIN_WAVEFORM_DEGREE
The minimum required interpolation degree.
Represents an XML tag to be configured automatically.
const std::string & getNamespace() const
Returns xml namespace.
std::string getStringAttributeValue(const std::string &name, std::optional< std::string > default_value=std::nullopt) const
const std::string & getName() const
Returns name (without namespace).
int getIntAttributeValue(const std::string &name, std::optional< int > default_value=std::nullopt) const
XMLTag & addSubtag(const XMLTag &tag)
Adds an XML tag as subtag by making a copy of the given tag.
provides Mesh, Data and primitives.
contains the XML configuration parser.
Tightly coupled to the parameters of Participant()