preCICE v3.3.0
Loading...
Searching...
No Matches
Configuration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include "SharedPointer.hpp"
5#include "boost/smart_ptr.hpp"
7#include "logging/Logger.hpp"
9#include "m2n/BoundM2N.hpp"
10#include "m2n/M2N.hpp"
15#include "xml/XMLTag.hpp"
16
17namespace precice::config {
18
26public:
28
32 ~Configuration() override = default;
33
38
44 void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &tag) override;
45
51 void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &tag) override;
52
54 bool allowsExperimental() const
55 {
56 return _experimental;
57 }
58
60 bool allowsRemeshing() const
61 {
62 return _remeshing;
63 }
64
66 bool waitInFinalize() const
67 {
68 return _waitInFinalize;
69 }
70
75
80
85
87
92
100
108
116
118
119 void configurePartitionsFor(std::string_view participantName);
120
121private:
122 logging::Logger _log{"config::Configuration"};
123
125 bool _experimental = false;
126
128 bool _remeshing = false;
129
131 bool _waitInFinalize = false;
132
133 // @brief Root tag of preCICE configuration.
135
136 // The log configuration must be constructed first to prevent log clutter
138
139 // Handle other configuration afterwards
141
143
145
147
149
151};
152
153} // namespace precice::config
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
const mesh::PtrMeshConfiguration getMeshConfiguration() const
const m2n::M2NConfiguration::SharedPointer getM2NConfiguration() const
bool waitInFinalize() const
Returns whether participants wait for each other in finalize.
logging::LogConfiguration _logConfig
bool _remeshing
Allow the use of experimental remeshing features.
std::map< std::string, m2n::BoundM2N > getBoundM2NsFor(std::string_view participant) const
void setDataConfiguration(mesh::PtrDataConfiguration config)
For manual configuration in test cases.
void setMeshConfiguration(mesh::PtrMeshConfiguration config)
For manual configuration in test cases.
const cplscheme::PtrCouplingSchemeConfiguration getCouplingSchemeConfiguration() const
precice::profiling::ProfilingConfiguration _profilingConfig
const mesh::PtrDataConfiguration getDataConfiguration() const
void configurePartitionsFor(std::string_view participantName)
~Configuration() override=default
Destructor, empty.
bool _experimental
Allow the use of experimental features.
m2n::M2NConfiguration::SharedPointer _m2nConfiguration
bool allowsExperimental() const
Returns whether experimental features are allowed or not.
PtrParticipantConfiguration _participantConfiguration
void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &tag) override
Callback function required for use of automatic configuration.
bool allowsRemeshing() const
Returns whether experimental remeshing is allowed or not.
xml::XMLTag & getXMLTag()
Returns root xml tag to start the automatic configuration process.
bool _waitInFinalize
Synchronize participants in finalize.
cplscheme::PtrCouplingSchemeConfiguration _couplingSchemeConfiguration
void setParticipantConfiguration(PtrParticipantConfiguration config)
For manual configuration in test cases.
mesh::PtrDataConfiguration _dataConfiguration
Configures the log config file to use.
This class provides a lightweight logger.
Definition Logger.hpp:17
std::shared_ptr< M2NConfiguration > SharedPointer
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:28
std::shared_ptr< ParticipantConfiguration > PtrParticipantConfiguration
std::shared_ptr< CouplingSchemeConfiguration > PtrCouplingSchemeConfiguration
std::shared_ptr< DataConfiguration > PtrDataConfiguration
std::shared_ptr< MeshConfiguration > PtrMeshConfiguration
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:21
Callback interface for configuration classes using XMLTag.
Definition XMLTag.hpp:46