preCICE v3.3.0
Loading...
Searching...
No Matches
ParticipantConfiguration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4#include <string>
5#include <vector>
8#include "logging/Logger.hpp"
15#include "time/Time.hpp"
16#include "utils/networking.hpp"
17#include "xml/XMLTag.hpp"
18
19namespace precice::config {
20
25public:
27 xml::XMLTag &parent,
28 mesh::PtrMeshConfiguration meshConfiguration);
29
30 void setExperimental(bool experimental);
31 void setRemeshing(bool allowed);
32
38 void xmlTagCallback(
39 const xml::ConfigurationContext &context,
40 xml::XMLTag &callingTag) override;
41
48 const xml::ConfigurationContext &context,
49 xml::XMLTag &callingTag) override;
50
52
55
57 const impl::PtrParticipant getParticipant(std::string_view participantName) const;
58
60
61 bool hasParticipant(std::string_view name) const;
62
63 std::string hintFor(std::string_view wrongName) const;
64
65private:
71
77
78 mutable logging::Logger _log{"config::ParticipantConfiguration"};
79
80 const std::string TAG = "participant";
81 const std::string TAG_WRITE = "write-data";
82 const std::string TAG_READ = "read-data";
83 const std::string TAG_DATA_ACTION = "data-action";
84 const std::string TAG_PROVIDE_MESH = "provide-mesh";
85 const std::string TAG_RECEIVE_MESH = "receive-mesh";
86 const std::string TAG_WATCH_INTEGRAL = "watch-integral";
87 const std::string TAG_WATCH_POINT = "watch-point";
88 const std::string TAG_INTRA_COMM = "intra-comm";
89
90 const std::string ATTR_NAME = "name";
91 const std::string ATTR_SOURCE_DATA = "source-data";
92 const std::string ATTR_TARGET_DATA = "target-data";
93 const std::string ATTR_TIMING = "timing";
96 const std::string ATTR_FROM = "from";
97 const std::string ATTR_SAFETY_FACTOR = "safety-factor";
98 const std::string ATTR_GEOMETRIC_FILTER = "geometric-filter";
99 const std::string ATTR_DIRECT_ACCESS = "direct-access";
100 const std::string ATTR_API_ACCESS = "api-access";
101 const std::string ATTR_PROVIDE = "provide";
102 const std::string ATTR_MESH = "mesh";
103 const std::string ATTR_COORDINATE = "coordinate";
104 const std::string ATTR_COMMUNICATION = "communication";
105 const std::string ATTR_CONTEXT = "context";
106 const std::string ATTR_NETWORK = "network";
107 const std::string ATTR_EXCHANGE_DIRECTORY = "exchange-directory";
108 const std::string ATTR_SCALE_WITH_CONN = "scale-with-connectivity";
109
110 const std::string VALUE_FILTER_ON_SECONDARY_RANKS = "on-secondary-ranks";
111 const std::string VALUE_FILTER_ON_PRIMARY_RANK = "on-primary-rank";
112 const std::string VALUE_NO_FILTER = "no-filter";
113
114 const std::string VALUE_VTK = "vtk";
115 const std::string VALUE_VTU = "vtu";
116 const std::string VALUE_VTP = "vtp";
117 const std::string VALUE_CSV = "csv";
118
119 bool _experimental = false;
120 bool _remeshing = false;
121
123
125
127
129
131
133
135
137
139
140 const mesh::PtrData &getData(
141 const mesh::PtrMesh &mesh,
142 const std::string &nameData) const;
143
145
146 // Does this participant already define a primary tag?
147 // This context information is needed in xmlEndTagCallback to create a default
148 // primary com if required (i.e. no solution yet defined and parallel).
150
152 const xml::ConfigurationContext &context,
153 const impl::PtrParticipant &participant);
154
158 const impl::PtrParticipant &participant);
159};
160
161} // namespace precice::config
const std::vector< impl::PtrParticipant > & getParticipants() const
Returns all configured participants.
std::vector< impl::PtrParticipant > _participants
ParticipantConfiguration(xml::XMLTag &parent, mesh::PtrMeshConfiguration meshConfiguration)
partition::ReceivedPartition::GeometricFilter getGeoFilter(const std::string &geoFilter) const
mesh::PtrMesh copy(const mesh::PtrMesh &mesh) const
void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override
Callback function required for use of automatic configuration.
void finishParticipantConfiguration(const xml::ConfigurationContext &context, const impl::PtrParticipant &participant)
std::string hintFor(std::string_view wrongName) const
void checkIllDefinedMappings(const mapping::MappingConfiguration::ConfiguredMapping &mapping, const impl::PtrParticipant &participant)
Check whether a mapping to the same mesh and with similar data fields already exists.
void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag) override
Callback function required for use of automatic configuration.
mapping::PtrMapping getMapping(const std::string &mappingName)
std::vector< WatchIntegralConfig > _watchIntegralConfigs
const impl::PtrParticipant getParticipant(std::string_view participantName) const
Returns a participant with the given name.
This class provides a lightweight logger.
Definition Logger.hpp:17
GeometricFilter
Defines the type of geometric filter used.
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:28
vector< double > getData()
Definition mainA.cpp:19
std::shared_ptr< ActionConfiguration > PtrActionConfiguration
std::shared_ptr< ParticipantState > PtrParticipant
std::shared_ptr< ExportConfiguration > PtrExportConfiguration
contains data mapping from points to meshes.
std::shared_ptr< MappingConfiguration > PtrMappingConfiguration
std::shared_ptr< Mapping > PtrMapping
provides Mesh, Data and primitives.
std::shared_ptr< Data > PtrData
std::shared_ptr< Mesh > PtrMesh
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