24 ATTR_DIMENSIONS(
"dimensions"),
26 ATTR_SIDE_INDEX(
"side"),
28 _dataConfig(
std::move(config)),
31 _meshIdManager(new utils::ManageUniqueIDs())
36 doc =
"Surface mesh consisting of vertices and optional connectivity information. "
37 "The vertices of a mesh can carry data, "
38 "configured by tags <use-data>. The mesh coordinates have to be "
39 "defined by a participant (see tag <provide-mesh>).";
40 tag.setDocumentation(doc);
42 auto attrName = XMLAttribute<std::string>(
ATTR_NAME)
43 .setDocumentation(
"Unique name for the mesh.");
44 tag.addAttribute(attrName);
47 .setDocumentation(
"Spatial dimensions of mesh")
49 tag.addAttribute(attrDimensions);
51 XMLTag subtagData(*
this,
TAG_DATA, XMLTag::OCCUR_ARBITRARY);
52 doc =
"Assigns a before defined data set (see tag <data>) to the mesh.";
53 subtagData.setDocumentation(doc);
54 attrName.setDocumentation(
"Name of the data set.");
55 subtagData.addAttribute(attrName);
56 tag.addSubtag(subtagData);
78 if (data.name ==
name) {
85 "Data with name \"{}\" used by mesh \"{}\" is not defined. "
86 "Please define a data tag with name=\"{}\".",
105 for (
const PtrData &dataNewMesh : mesh->data()) {
108 if (dataNewMesh->getName() == data.name && dataNewMesh->getDimensions() ==
getDataDimensions(mesh->getName(), data.typeName)) {
113 PRECICE_CHECK(found,
"Data {0} is not defined. Please define a data tag with name=\"{0}\".", dataNewMesh->getName());
131 return mptr->getName() == meshName;
140 if (mesh->getName() == meshName) {
#define PRECICE_TRACE(...)
#define PRECICE_CHECK(check,...)
#define PRECICE_ASSERT(...)
#define PRECICE_UNREACHABLE(...)
std::map< std::string, std::vector< std::string > > _neededMeshes
to check later if all meshes that any coupling scheme needs are actually used by the participants
std::vector< PtrMesh > _meshes
Configured meshes.
void addNeededMesh(const std::string &participant, const std::string &mesh)
const std::string TAG_DATA
void addMesh(const mesh::PtrMesh &mesh)
mesh::PtrMesh getMesh(const std::string &meshName) const
Returns the configured mesh with given name, or NULL.
std::unique_ptr< utils::ManageUniqueIDs > _meshIdManager
const std::string ATTR_NAME
MeshConfiguration(xml::XMLTag &parent, PtrDataConfiguration config)
Constructor, takes a valid data configuration as argument.
const PtrDataConfiguration & getDataConfiguration() const
virtual void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at begin of XML tag.
utils::ManageUniqueIDs _dataIDManager
bool hasMeshName(const std::string &meshName) const
Returns whether Mesh has Data with the dataName.
virtual void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at end of XML tag and at end of subtag.
const std::string ATTR_DIMENSIONS
std::map< std::string, int > _meshDimensionsMap
int getDataDimensions(const std::string &meshName, const Data::typeName typeName) const
Get the number of dimensions that data values of this type (scalar/vector) have on this mesh.
PtrDataConfiguration _dataConfig
Data configuration.
void insertMeshToMeshDimensionsMap(const std::string &mesh, int dimensions)
Initialize the map between meshes and dimensions, for unit tests that directly create mesh objects wi...
const std::vector< PtrMesh > & meshes() const
Returns all configured meshes.
Represents an XML tag to be configured automatically.
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.
std::shared_ptr< Mesh > PtrMesh
bool contained(const ELEMENT_T &element, const std::vector< ELEMENT_T > &vec)
Returns true, if given element is in vector, otherwise false.
Tightly coupled to the parameters of Participant()