preCICE v3.2.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
53
55 const impl::PtrParticipant getParticipant(const std::string &participantName) const;
56
58
59 bool hasParticipant(std::string_view name) const;
60
61 std::string hintFor(std::string_view wrongName) const;
62
63private:
69
75
76 mutable logging::Logger _log{"config::ParticipantConfiguration"};
77
78 const std::string TAG = "participant";
79 const std::string TAG_WRITE = "write-data";
80 const std::string TAG_READ = "read-data";
81 const std::string TAG_DATA_ACTION = "data-action";
82 const std::string TAG_PROVIDE_MESH = "provide-mesh";
83 const std::string TAG_RECEIVE_MESH = "receive-mesh";
84 const std::string TAG_WATCH_INTEGRAL = "watch-integral";
85 const std::string TAG_WATCH_POINT = "watch-point";
86 const std::string TAG_INTRA_COMM = "intra-comm";
87
88 const std::string ATTR_NAME = "name";
89 const std::string ATTR_SOURCE_DATA = "source-data";
90 const std::string ATTR_TARGET_DATA = "target-data";
91 const std::string ATTR_TIMING = "timing";
94 const std::string ATTR_FROM = "from";
95 const std::string ATTR_SAFETY_FACTOR = "safety-factor";
96 const std::string ATTR_GEOMETRIC_FILTER = "geometric-filter";
97 const std::string ATTR_DIRECT_ACCESS = "direct-access";
98 const std::string ATTR_API_ACCESS = "api-access";
99 const std::string ATTR_PROVIDE = "provide";
100 const std::string ATTR_MESH = "mesh";
101 const std::string ATTR_COORDINATE = "coordinate";
102 const std::string ATTR_COMMUNICATION = "communication";
103 const std::string ATTR_CONTEXT = "context";
104 const std::string ATTR_NETWORK = "network";
105 const std::string ATTR_EXCHANGE_DIRECTORY = "exchange-directory";
106 const std::string ATTR_SCALE_WITH_CONN = "scale-with-connectivity";
107
108 const std::string VALUE_FILTER_ON_SECONDARY_RANKS = "on-secondary-ranks";
109 const std::string VALUE_FILTER_ON_PRIMARY_RANK = "on-primary-rank";
110 const std::string VALUE_NO_FILTER = "no-filter";
111
112 const std::string VALUE_VTK = "vtk";
113 const std::string VALUE_VTU = "vtu";
114 const std::string VALUE_VTP = "vtp";
115 const std::string VALUE_CSV = "csv";
116
117 bool _experimental = false;
118 bool _remeshing = false;
119
121
123
125
127
129
131
133
135
137
138 const mesh::PtrData &getData(
139 const mesh::PtrMesh &mesh,
140 const std::string &nameData) const;
141
143
144 // Does this participant already define a primary tag?
145 // This context information is needed in xmlEndTagCallback to create a default
146 // primary com if required (i.e. no solution yet defined and parallel).
148
150 const xml::ConfigurationContext &context,
151 const impl::PtrParticipant &participant);
152
156 const impl::PtrParticipant &participant);
157};
158
159} // 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(const std::string &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