preCICE v3.2.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/M2N.hpp"
14#include "xml/XMLTag.hpp"
15
16namespace precice::config {
17
25public:
27
31 ~Configuration() override = default;
32
37
43 void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &tag) override;
44
50 void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &tag) override;
51
53 bool allowsExperimental() const
54 {
55 return _experimental;
56 }
57
59 bool allowsRemeshing() const
60 {
61 return _remeshing;
62 }
63
65 bool waitInFinalize() const
66 {
67 return _waitInFinalize;
68 }
69
74
79
84
86
91
99
107
115
116private:
117 logging::Logger _log{"config::Configuration"};
118
120 bool _experimental = false;
121
123 bool _remeshing = false;
124
126 bool _waitInFinalize = false;
127
128 // @brief Root tag of preCICE configuration.
130
131 // The log configuration must be constructed first to prevent log clutter
133
134 // Handle other configuration afterwards
136
138
140
142
144
146};
147
148} // 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.
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
~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