preCICE v3.1.1
Loading...
Searching...
No Matches
M2NConfiguration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "logging/Logger.hpp"
5#include "xml/XMLTag.hpp"
6
7#include <tuple>
8
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace precice {
14namespace m2n {
15
18public:
28
29public:
30 explicit M2NConfiguration(xml::XMLTag &parent);
31
32 virtual ~M2NConfiguration() {}
33
41 const std::string &acceptor,
42 const std::string &connector);
43
46 {
47 return _m2ns;
48 }
49
50 bool isM2NConfigured(const std::string &acceptor, const std::string &connector);
51
52 virtual void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag);
53
54 virtual void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) {}
55
56private:
57 logging::Logger _log{"m2n::M2NConfiguration"};
58
59 const std::string TAG = "m2n";
60 const std::string ATTR_EXCHANGE_DIRECTORY = "exchange-directory";
61 const std::string ATTR_ENFORCE_GATHER_SCATTER = "enforce-gather-scatter";
62 const std::string ATTR_USE_TWO_LEVEL_INIT = "use-two-level-initialization";
63
65
66 void checkDuplicates(
67 const std::string &acceptor,
68 const std::string &connector);
69};
70
71} // namespace m2n
72} // namespace precice
This class provides a lightweight logger.
Definition Logger.hpp:16
Configuration for communication channels between solvers.
const std::string ATTR_EXCHANGE_DIRECTORY
bool isM2NConfigured(const std::string &acceptor, const std::string &connector)
std::vector< ConfiguredM2N > _m2ns
const std::string ATTR_USE_TWO_LEVEL_INIT
m2n::PtrM2N getM2N(const std::string &acceptor, const std::string &connector)
Returns the communication object for the given user names.
virtual void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at begin of XML tag.
std::vector< ConfiguredM2N > & m2ns()
Returns all configured communication objects.
virtual void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
Callback at end of XML tag and at end of subtag.
M2NConfiguration(xml::XMLTag &parent)
void checkDuplicates(const std::string &acceptor, const std::string &connector)
const std::string ATTR_ENFORCE_GATHER_SCATTER
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:31
Main namespace of the precice library.
std::string acceptor
The name of the acceptor.
std::string connector
The name of the connector.
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:24
Callback interface for configuration classes using XMLTag.
Definition XMLTag.hpp:43