29 :
_tag(*this,
"precice-configuration",
xml::XMLTag::OCCUR_ONCE),
33 _tag.setDocumentation(
"Main tag containing preCICE configuration.");
34 _tag.addNamespace(
"data");
35 _tag.addNamespace(
"communication");
36 _tag.addNamespace(
"mapping");
37 _tag.addNamespace(
"export");
38 _tag.addNamespace(
"action");
39 _tag.addNamespace(
"coupling-scheme");
40 _tag.addNamespace(
"acceleration");
43 .setDocumentation(
"Enable experimental features.");
44 _tag.addAttribute(attrExperimental);
47 .setDocumentation(
"Enable experimental remeshing feature, requires experimental to be true.");
48 _tag.addAttribute(attrRemeshing);
51 .setDocumentation(
"Connected participants wait for each other in finalize, which can be helpful in SLURM sessions.");
52 _tag.addAttribute(attrWaitInFinalize);
73 if (tag.
getName() ==
"precice-configuration") {
95 typedef std::map<std::string, std::vector<std::string>>::value_type neededMeshPair;
97 bool participantFound =
false;
99 if (participant->getName() == neededMeshes.first) {
100 for (
const std::string &neededMesh : neededMeshes.second) {
102 "Participant \"{}\" needs to use the mesh \"{}\" to be able to use it in the coupling scheme. "
103 "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.",
104 neededMeshes.first, neededMesh);
106 participantFound =
true;
116 "The acceptor in <m2n:... acceptor=\"{}\" connector=\"{}\" /> is an unknown. {}",
120 "The connector in <m2n:... acceptor=\"{}\" connector=\"{}\" /> is an unknown. {}",
133 std::map<std::string, m2n::BoundM2N> result;
136 if (m2nConf.acceptor != participantName && m2nConf.connector != participantName) {
140 std::string comPartner(
"");
142 if (m2nConf.acceptor == participantName) {
143 comPartner = m2nConf.connector;
146 comPartner = m2nConf.acceptor;
147 isRequesting =
false;
152 if (participant->getName() == comPartner) {
156 result[comPartner] = [&] {
158 bound.
m2n = m2nConf.m2n;
178 for (
auto &context : participant->providedMeshContexts()) {
180 context.partition = std::make_shared<partition::ProvidedPartition>(context.mesh);
183 for (
auto &receivedMeshContext : receiver->receivedMeshContexts()) {
184 if (receivedMeshContext.receiveMeshFrom == participantName && receivedMeshContext.mesh->getName() == context.mesh->getName()) {
187 if (receivedMeshContext.meshRequirement > context.meshRequirement) {
188 context.meshRequirement = receivedMeshContext.meshRequirement;
192 m2n->createDistributedCommunication(context.mesh);
193 context.partition->addM2N(
m2n);
200 for (
auto &receivedContext : participant->receivedMeshContexts()) {
202 std::string receiver(participantName);
203 std::string provider(receivedContext.receiveMeshFrom);
207 receivedContext.partition = std::make_shared<partition::ReceivedPartition>(receivedContext.mesh, receivedContext.geoFilter, receivedContext.safetyFactor, receivedContext.allowDirectAccess);
210 m2n->createDistributedCommunication(receivedContext.mesh);
211 receivedContext.partition->addM2N(
m2n);
213 receivedContext.partition->addFromMapping(mappingContext.
mapping);
216 receivedContext.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.
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
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.
Tightly coupled to the parameters of Participant()