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 set "
29 "in tag <precice-configuration>.");
30 tagVector.addAttribute(attrName);
31 tagVector.addAttribute(attrDegree);
57 if (tag.
getName() ==
"scalar") {
59 }
else if (tag.
getName() ==
"vector") {
62 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());
86 for (
auto &elem :
_data) {
88 "Data \"{0}\" has already been defined. Please rename or remove one of the data tags with name=\"{0}\".",
92 _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.
DataConfiguration(xml::XMLTag &parent)
ConfiguredData getRecentlyConfiguredData() const
virtual void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at end of XML tag and at end of subtag.
const std::vector< ConfiguredData > & data() const
const std::string ATTR_NAME
std::vector< ConfiguredData > _data
const std::string VALUE_VECTOR
virtual void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at begin of XML tag.
static const int DEFAULT_WAVEFORM_DEGREE
To be used, when the interpolation degree is not defined.
static const int MAX_WAVEFORM_DEGREE
The maximum allowed interpolation degree.
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.
Tightly coupled to the parameters of Participant()