27 :
_tag(*this,
"precice-configuration",
xml::XMLTag::OCCUR_ONCE),
31 _tag.setDocumentation(
"Main tag containing preCICE configuration.");
32 _tag.addNamespace(
"data");
33 _tag.addNamespace(
"communication");
34 _tag.addNamespace(
"mapping");
35 _tag.addNamespace(
"export");
36 _tag.addNamespace(
"action");
37 _tag.addNamespace(
"coupling-scheme");
38 _tag.addNamespace(
"acceleration");
41 .setDocumentation(
"Enable experimental features.");
42 _tag.addAttribute(attrExperimental);
45 .setDocumentation(
"Enable experimental remeshing feature, requires experimental to be true.");
46 _tag.addAttribute(attrRemeshing);
49 .setDocumentation(
"Connected participants wait for each other in finalize, which can be helpful in SLURM sessions.");
50 _tag.addAttribute(attrWaitInFinalize);
71 if (tag.
getName() ==
"precice-configuration") {
95 bool participantFound =
false;
97 if (participant->getName() == neededMeshes.first) {
98 for (
const std::string &neededMesh : neededMeshes.second) {
100 "Participant \"{}\" needs to use the mesh \"{}\" to be able to use it in the coupling scheme. "
101 "Please either add a provide-mesh or a receive-mesh tag in this participant's configuration, or use a different mesh in the coupling scheme.",
102 neededMeshes.first, neededMesh);
104 participantFound =
true;
114 "The acceptor in <m2n:... acceptor=\"{}\" connector=\"{}\" /> is an unknown. {}",
118 "The connector in <m2n:... acceptor=\"{}\" connector=\"{}\" /> is an unknown. {}",
134 if (m2nConf.acceptor != participantName && m2nConf.connector != participantName) {
140 if (m2nConf.acceptor == participantName) {
141 comPartner = m2nConf.connector;
144 comPartner = m2nConf.acceptor;
145 isRequesting =
false;
150 if (participant->getName() == comPartner) {
154 result[comPartner] = [&] {
156 bound.
m2n = m2nConf.m2n;
176 if (context->provideMesh) {
178 "Participant \"{}\" cannot provide and receive mesh {}!",
179 participantName, context->mesh->getName());
184 for (
auto &receiverContext : receiver->usedMeshContexts()) {
185 if (receiverContext->receiveMeshFrom == participantName && receiverContext->mesh->getName() == context->mesh->getName()) {
188 if (receiverContext->meshRequirement > context->meshRequirement) {
189 context->meshRequirement = receiverContext->meshRequirement;
193 m2n->createDistributedCommunication(context->mesh);
194 context->partition->addM2N(
m2n);
208 m2n->createDistributedCommunication(context->mesh);
209 context->partition->addM2N(
m2n);
211 context->partition->addFromMapping(mappingContext.
mapping);
214 context->partition->addToMapping(mappingContext.
mapping);
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
#define PRECICE_CHECK(check,...)
#define PRECICE_ASSERT(...)
#define PRECICE_UNREACHABLE(...)
const PtrParticipantConfiguration & getParticipantConfiguration() const
void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &tag) override
Callback function required for use of automatic configuration.
mesh::PtrMeshConfiguration _meshConfiguration
logging::LogConfiguration _logConfig
bool _remeshing
Allow the use of experimental remeshing features.
std::map< std::string, m2n::BoundM2N > getBoundM2NsFor(std::string_view participant) const
precice::profiling::ProfilingConfiguration _profilingConfig
void configurePartitionsFor(std::string_view participantName)
bool _experimental
Allow the use of experimental features.
m2n::M2NConfiguration::SharedPointer _m2nConfiguration
PtrParticipantConfiguration _participantConfiguration
void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &tag) override
Callback function required for use of automatic configuration.
xml::XMLTag & getXMLTag()
Returns root xml tag to start the automatic configuration process.
bool _waitInFinalize
Synchronize participants in finalize.
cplscheme::PtrCouplingSchemeConfiguration _couplingSchemeConfiguration
mesh::PtrDataConfiguration _dataConfiguration
An M2N between participants with a configured direction.
A partition that is provided by the participant.
A partition that is computed from a mesh received from another participant.
Represents an XML tag to be configured automatically.
bool getBooleanAttributeValue(const std::string &name, std::optional< bool > default_value=std::nullopt) const
const std::string & getName() const
Returns name (without namespace).
std::shared_ptr< ParticipantConfiguration > PtrParticipantConfiguration
std::shared_ptr< ParticipantState > PtrParticipant
contains the logic of the parallel communication between participants.
std::shared_ptr< M2N > PtrM2N
std::shared_ptr< Partition > PtrPartition
bool contained(const ELEMENT_T &element, const std::vector< ELEMENT_T > &vec)
Returns true, if given element is in vector, otherwise false.
contains the XML configuration parser.
XMLAttribute< std::string > makeXMLAttribute(std::string name, const char *defaultValue)
Holds a data mapping and related information.
mapping::PtrMapping mapping
Data mapping.
Stores a mesh and related objects and data.
Tightly coupled to the parameters of Participant()