preCICE v3.1.2
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 {
20namespace config {
21
26public:
28 xml::XMLTag & parent,
29 mesh::PtrMeshConfiguration meshConfiguration);
30
31 void setExperimental(bool experimental);
32
38 virtual void xmlTagCallback(
39 const xml::ConfigurationContext &context,
40 xml::XMLTag & callingTag);
41
47 virtual void xmlEndTagCallback(
48 const xml::ConfigurationContext &context,
49 xml::XMLTag & callingTag);
50
53
55 const impl::PtrParticipant getParticipant(const std::string &participantName) const;
56
58
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_PROVIDE = "provide";
99 const std::string ATTR_MESH = "mesh";
100 const std::string ATTR_COORDINATE = "coordinate";
101 const std::string ATTR_COMMUNICATION = "communication";
102 const std::string ATTR_CONTEXT = "context";
103 const std::string ATTR_NETWORK = "network";
104 const std::string ATTR_EXCHANGE_DIRECTORY = "exchange-directory";
105 const std::string ATTR_SCALE_WITH_CONN = "scale-with-connectivity";
106
107 const std::string VALUE_FILTER_ON_SECONDARY_RANKS = "on-secondary-ranks";
108 const std::string VALUE_FILTER_ON_PRIMARY_RANK = "on-primary-rank";
109 const std::string VALUE_NO_FILTER = "no-filter";
110
111 const std::string VALUE_VTK = "vtk";
112 const std::string VALUE_VTU = "vtu";
113 const std::string VALUE_VTP = "vtp";
114 const std::string VALUE_CSV = "csv";
115
116 bool _experimental = false;
117
119
121
123
125
127
129
131
133
134 mesh::PtrMesh copy(const mesh::PtrMesh &mesh) const;
135
136 const mesh::PtrData &getData(
137 const mesh::PtrMesh &mesh,
138 const std::string & nameData) const;
139
141
142 // Does this participant already define a primary tag?
143 // This context information is needed in xmlEndTagCallback to create a default
144 // primary com if required (i.e. no solution yet defined and parallel).
146
148 const xml::ConfigurationContext &context,
149 const impl::PtrParticipant & participant);
150
154 const impl::PtrParticipant & participant);
155};
156
157} // namespace config
158} // namespace precice
std::string name
Performs XML configuration of a participant.
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
virtual void xmlEndTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
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.
virtual void xmlTagCallback(const xml::ConfigurationContext &context, xml::XMLTag &callingTag)
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:16
GeometricFilter
Defines the type of geometric filter used.
Represents an XML tag to be configured automatically.
Definition XMLTag.hpp:31
vector< double > getData()
Definition mainA.cpp:19
Main namespace of the precice library.
Tightly coupled to the parameters of Participant()
Definition XMLTag.hpp:24
Callback interface for configuration classes using XMLTag.
Definition XMLTag.hpp:43