|
preCICE
|
Holds coupling state of one participating solver in coupled simulation. More...
#include <ParticipantState.hpp>
Classes | |
| struct | IntermediateExport |
Public Types | |
| enum | MappingConstants { MAPPING_LINEAR_CONSERVATIVE , MAPPING_LINEAR_CONSISTENT , MAPPING_DIRECT } |
Public Member Functions | |
| ParticipantState (std::string name, mesh::PtrMeshConfiguration &meshConfig) | |
| Constructor. | |
| void | initializeMappingDataCache (std::string_view mappingType) |
| Initializes the MappingDataCache in the DataContext after having computed the mappings. | |
| void | configureInputMeshContext (std::string_view fromMesh, impl::MappingContext &mappingContext, mapping::Mapping::MeshRequirement requirement) |
| Configures the mesh context with connectivity requirements and adds it to the mappingcontext. | |
| void | configureOutputMeshContext (std::string_view toMesh, impl::MappingContext &mappingContext, mapping::Mapping::MeshRequirement requirement) |
| Configures the mesh context with connectivity requirements and adds it to the mappingcontext. | |
Configuration interface | |
Adds a configured write Data to the ParticipantState | |
| void | addWriteData (const mesh::PtrData &data, const mesh::PtrMesh &mesh) |
| void | addReadData (const mesh::PtrData &data, const mesh::PtrMesh &mesh) |
| Adds a configured read Data to the ParticipantState. | |
| void | addReadMappingContext (const MappingContext &mappingContext) |
| Adds a configured read Mapping to the ParticipantState. | |
| void | addWriteMappingContext (const MappingContext &mappingContext) |
| Adds a configured write Mapping to the ParticipantState. | |
| void | addWatchPoint (const PtrWatchPoint &watchPoint) |
| Adds a configured WatchPoint to the ParticipantState. | |
| void | addWatchIntegral (const PtrWatchIntegral &watchIntegral) |
| Adds a configured WatchIntegral to the ParticipantState. | |
| void | setUsePrimaryRank (bool useIntraComm) |
| Sets weather the participant was configured with a primary tag. | |
| void | addAction (action::PtrAction &&action) |
| Adds a configured Action to the participant. | |
| void | addExportContext (const io::ExportContext &context) |
| Adds a configured ExportContext to export meshes and data. | |
| void | provideMesh (mesh::PtrMesh mesh) |
| Adds a mesh to be provided by the participant. | |
| void | receiveMesh (mesh::PtrMesh mesh, const std::string &fromParticipant, double safetyFactor, partition::ReceivedPartition::GeometricFilter geoFilter, const bool allowDirectAccess) |
| Adds a mesh to be received by the participant. | |
Data queries | |
| const ReadDataContext & | readDataContext (std::string_view mesh, std::string_view data) const |
| ReadDataContext & | readDataContext (std::string_view mesh, std::string_view data) |
| mesh::PtrMesh | findMesh (std::string_view data) const |
| Returns the mesh associated with ReadDataContext with given data name in _readDataContexts of this Participant. | |
| const WriteDataContext & | writeDataContext (std::string_view mesh, std::string_view data) const |
| WriteDataContext & | writeDataContext (std::string_view mesh, std::string_view data) |
| auto | writeDataContexts () |
| auto | readDataContexts () |
| bool | hasData (std::string_view mesh, std::string_view data) const |
| Is the dataID know to preCICE? | |
| bool | isDataUsed (std::string_view mesh, std::string_view data) const |
| Is the data used by this participant? | |
| bool | isDataRead (std::string_view mesh, std::string_view data) const |
| Is the participant allowed to read the data? | |
| bool | isDataWrite (std::string_view mesh, std::string_view data) const |
| Is the participant allowed to write the data? | |
Mesh queries | |
| const MeshContext & | meshContext (std::string_view mesh) const |
| Mesh queries. | |
| MeshContext & | meshContext (std::string_view mesh) |
| const std::vector< MeshContextVariant > & | usedMeshContexts () const |
| std::vector< MeshContextVariant > & | usedMeshContexts () |
| bool | hasMesh (std::string_view mesh) const |
| Does preCICE know a mesh with this name? | |
| bool | isMeshUsed (std::string_view mesh) const |
| Is a mesh with this name used by this participant? | |
| bool | isMeshProvided (std::string_view mesh) const |
| Is a mesh with this name provided by this participant? | |
| bool | isMeshReceived (std::string_view mesh) const |
| Is a mesh with this name received by this participant? | |
| bool | isDirectAccessAllowed (std::string_view mesh) const |
| ReceivedMeshContext & | receivedMeshContext (std::string_view mesh) |
| const ReceivedMeshContext & | receivedMeshContext (std::string_view mesh) const |
| ProvidedMeshContext & | providedMeshContext (std::string_view mesh) |
| const ProvidedMeshContext & | providedMeshContext (std::string_view mesh) const |
| std::deque< ProvidedMeshContext > & | providedMeshContexts () |
| const std::deque< ProvidedMeshContext > & | providedMeshContexts () const |
| std::deque< ReceivedMeshContext > & | receivedMeshContexts () |
| const std::deque< ReceivedMeshContext > & | receivedMeshContexts () const |
Exporting interface | |
Exports the initial state of meshes | |
| void | exportInitial () |
| void | exportIntermediate (IntermediateExport exp) |
| Exports timewindows and iterations of meshes and watchpoints. | |
Other queries | |
Returns the name of the participant. | |
| const std::string & | getName () const |
| bool | useIntraComm () const |
| Returns true, if the participant uses a primary tag. | |
| bool | hasReadMappings () const |
| Returns true, if the participant has at least one read mapping. | |
| bool | hasWriteMappings () const |
| Returns true, if the participant has at least one write mapping. | |
| std::vector< MappingContext > & | readMappingContexts () |
| Provided access to all read MappingContext. | |
| std::vector< MappingContext > & | writeMappingContexts () |
| Provided access to all write MappingContext. | |
| std::vector< PtrWatchPoint > & | watchPoints () |
| Provided access to all WatchPoints. | |
| std::vector< PtrWatchIntegral > & | watchIntegrals () |
| Provided access to all WatchIntegrals. | |
| std::vector< action::PtrAction > & | actions () |
| Provided access to all Action. | |
| const std::vector< action::PtrAction > & | actions () const |
| Provided access to all Action. | |
| const std::vector< io::ExportContext > & | exportContexts () const |
| Returns all ExportContext for exporting meshes and data. | |
| bool | hasExports () const |
| Returns true, if the participant has any exports enabled. | |
Error helpers | |
| std::string | hintForMesh (std::string_view mesh) const |
| std::string | hintForMeshData (std::string_view mesh, std::string_view data) const |
Private Types | |
| template<typename T> | |
| using | MeshMap = std::map<std::string, T, std::less<>> |
| template<typename T> | |
| using | DataMap = std::map<MeshDataKey<std::string>, T, std::less<>> |
Private Member Functions | |
| template<typename ELEMENT_T> | |
| bool | isDataValid (const std::vector< ELEMENT_T > &data, const ELEMENT_T &newElement) const |
| void | checkDuplicatedUse (std::string_view mesh) |
| void | checkDuplicatedData (std::string_view mesh, std::string_view data) |
Private Attributes | |
| logging::Logger | _log {"impl::ParticipantState"} |
| std::string | _name |
| std::vector< PtrWatchPoint > | _watchPoints |
| std::vector< PtrWatchIntegral > | _watchIntegrals |
| std::vector< io::ExportContext > | _exportContexts |
| Export contexts to export meshes, data, and more. | |
| std::vector< action::PtrAction > | _actions |
| MeshMap< MeshContext * > | _meshContexts |
| All mesh contexts involved in a simulation (for name-based lookup) | |
| std::deque< ProvidedMeshContext > | _providedMeshContexts |
| Provided mesh contexts (owning container) | |
| std::deque< ReceivedMeshContext > | _receivedMeshContexts |
| Received mesh contexts (owning container) | |
| std::vector< MappingContext > | _readMappingContexts |
| Read mapping contexts used by the participant. | |
| std::vector< MappingContext > | _writeMappingContexts |
| Write mapping contexts used by the participant. | |
| std::vector< MeshContextVariant > | _usedMeshContexts |
| Mesh contexts used by the participant. | |
| DataMap< WriteDataContext > | _writeDataContexts |
| DataMap< ReadDataContext > | _readDataContexts |
| bool | _useIntraComm = false |
Friends | |
| struct | Integration::Serial::Whitebox::TestConfigurationPeano |
| To allow white box tests. | |
| struct | Integration::Serial::Whitebox::TestConfigurationComsol |
Holds coupling state of one participating solver in coupled simulation.
Definition at line 95 of file ParticipantState.hpp.
|
private |
Definition at line 396 of file ParticipantState.hpp.
|
private |
Definition at line 393 of file ParticipantState.hpp.
| Enumerator | |
|---|---|
| MAPPING_LINEAR_CONSERVATIVE | |
| MAPPING_LINEAR_CONSISTENT | |
| MAPPING_DIRECT | |
Definition at line 97 of file ParticipantState.hpp.
| precice::impl::ParticipantState::ParticipantState | ( | std::string | name, |
| mesh::PtrMeshConfiguration & | meshConfig ) |
Constructor.
| [in] | name | Name of the participant. Has to be unique. |
Definition at line 29 of file ParticipantState.cpp.
| std::vector< action::PtrAction > & precice::impl::ParticipantState::actions | ( | ) |
Provided access to all Action.
Definition at line 333 of file ParticipantState.cpp.
| const std::vector< action::PtrAction > & precice::impl::ParticipantState::actions | ( | ) | const |
Provided access to all Action.
Definition at line 338 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::addAction | ( | action::PtrAction && | action | ) |
Adds a configured Action to the participant.
Configuration interface.
Definition at line 38 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::addExportContext | ( | const io::ExportContext & | context | ) |
Adds a configured ExportContext to export meshes and data.
Definition at line 343 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::addReadData | ( | const mesh::PtrData & | data, |
| const mesh::PtrMesh & | mesh ) |
Adds a configured read Data to the ParticipantState.
Definition at line 106 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::addReadMappingContext | ( | const MappingContext & | mappingContext | ) |
Adds a configured read Mapping to the ParticipantState.
Definition at line 114 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::addWatchIntegral | ( | const PtrWatchIntegral & | watchIntegral | ) |
Adds a configured WatchIntegral to the ParticipantState.
Definition at line 56 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::addWatchPoint | ( | const PtrWatchPoint & | watchPoint | ) |
Adds a configured WatchPoint to the ParticipantState.
Definition at line 50 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::addWriteData | ( | const mesh::PtrData & | data, |
| const mesh::PtrMesh & | mesh ) |
| void precice::impl::ParticipantState::addWriteMappingContext | ( | const MappingContext & | mappingContext | ) |
Adds a configured write Mapping to the ParticipantState.
Definition at line 120 of file ParticipantState.cpp.
|
private |
|
private |
| void precice::impl::ParticipantState::configureInputMeshContext | ( | std::string_view | fromMesh, |
| impl::MappingContext & | mappingContext, | ||
| mapping::Mapping::MeshRequirement | requirement ) |
Configures the mesh context with connectivity requirements and adds it to the mappingcontext.
Definition at line 513 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::configureOutputMeshContext | ( | std::string_view | toMesh, |
| impl::MappingContext & | mappingContext, | ||
| mapping::Mapping::MeshRequirement | requirement ) |
Configures the mesh context with connectivity requirements and adds it to the mappingcontext.
Definition at line 519 of file ParticipantState.cpp.
| const std::vector< io::ExportContext > & precice::impl::ParticipantState::exportContexts | ( | ) | const |
Returns all ExportContext for exporting meshes and data.
Definition at line 349 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::exportInitial | ( | ) |
| void precice::impl::ParticipantState::exportIntermediate | ( | IntermediateExport | exp | ) |
Exports timewindows and iterations of meshes and watchpoints.
Definition at line 404 of file ParticipantState.cpp.
| mesh::PtrMesh precice::impl::ParticipantState::findMesh | ( | std::string_view | data | ) | const |
Returns the mesh associated with ReadDataContext with given data name in _readDataContexts of this Participant.
| data | name of the data |
Definition at line 141 of file ParticipantState.cpp.
| const std::string & precice::impl::ParticipantState::getName | ( | ) | const |
| bool precice::impl::ParticipantState::hasData | ( | std::string_view | mesh, |
| std::string_view | data ) const |
Is the dataID know to preCICE?
Definition at line 168 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::hasExports | ( | ) | const |
Returns true, if the participant has any exports enabled.
Definition at line 399 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::hasMesh | ( | std::string_view | mesh | ) | const |
Does preCICE know a mesh with this name?
Definition at line 223 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::hasReadMappings | ( | ) | const |
Returns true, if the participant has at least one read mapping.
Definition at line 313 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::hasWriteMappings | ( | ) | const |
Returns true, if the participant has at least one write mapping.
Definition at line 318 of file ParticipantState.cpp.
| std::string precice::impl::ParticipantState::hintForMesh | ( | std::string_view | mesh | ) | const |
| std::string precice::impl::ParticipantState::hintForMeshData | ( | std::string_view | mesh, |
| std::string_view | data ) const |
| void precice::impl::ParticipantState::initializeMappingDataCache | ( | std::string_view | mappingType | ) |
Initializes the MappingDataCache in the DataContext after having computed the mappings.
Definition at line 500 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::isDataRead | ( | std::string_view | mesh, |
| std::string_view | data ) const |
Is the participant allowed to read the data?
Definition at line 187 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::isDataUsed | ( | std::string_view | mesh, |
| std::string_view | data ) const |
Is the data used by this participant?
Definition at line 180 of file ParticipantState.cpp.
|
private |
Definition at line 439 of file ParticipantState.hpp.
| bool precice::impl::ParticipantState::isDataWrite | ( | std::string_view | mesh, |
| std::string_view | data ) const |
Is the participant allowed to write the data?
Definition at line 192 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::isDirectAccessAllowed | ( | std::string_view | mesh | ) | const |
Returns whether we are allowed to access a received mesh direct which requires the config tag <receive-mesh ... direct-access="true"
Definition at line 249 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::isMeshProvided | ( | std::string_view | mesh | ) | const |
Is a mesh with this name provided by this participant?
Definition at line 237 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::isMeshReceived | ( | std::string_view | mesh | ) | const |
Is a mesh with this name received by this participant?
Definition at line 243 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::isMeshUsed | ( | std::string_view | mesh | ) | const |
Is a mesh with this name used by this participant?
Definition at line 228 of file ParticipantState.cpp.
| MeshContext & precice::impl::ParticipantState::meshContext | ( | std::string_view | mesh | ) |
| const MeshContext & precice::impl::ParticipantState::meshContext | ( | std::string_view | mesh | ) | const |
Mesh queries.
Definition at line 199 of file ParticipantState.cpp.
| ProvidedMeshContext & precice::impl::ParticipantState::providedMeshContext | ( | std::string_view | mesh | ) |
Provides access to a ProvidedMeshContext given the mesh name.
| [in] | mesh | the name of the mesh |
Definition at line 275 of file ParticipantState.cpp.
| const ProvidedMeshContext & precice::impl::ParticipantState::providedMeshContext | ( | std::string_view | mesh | ) | const |
Provides const access to a ProvidedMeshContext given the mesh name.
| [in] | mesh | the name of the mesh |
Definition at line 283 of file ParticipantState.cpp.
| std::deque< ProvidedMeshContext > & precice::impl::ParticipantState::providedMeshContexts | ( | ) |
Provides access to all ProvidedMeshContexts.
Definition at line 291 of file ParticipantState.cpp.
| const std::deque< ProvidedMeshContext > & precice::impl::ParticipantState::providedMeshContexts | ( | ) | const |
Provides const access to all ProvidedMeshContexts.
Definition at line 296 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::provideMesh | ( | mesh::PtrMesh | mesh | ) |
Adds a mesh to be provided by the participant.
Definition at line 62 of file ParticipantState.cpp.
| ReadDataContext & precice::impl::ParticipantState::readDataContext | ( | std::string_view | mesh, |
| std::string_view | data ) |
Provides access to ReadDataContext
Definition at line 134 of file ParticipantState.cpp.
| const ReadDataContext & precice::impl::ParticipantState::readDataContext | ( | std::string_view | mesh, |
| std::string_view | data ) const |
Provides access to ReadDataContext
Definition at line 127 of file ParticipantState.cpp.
|
inline |
Provides access to all ReadDataContext objects
Definition at line 197 of file ParticipantState.hpp.
| std::vector< MappingContext > & precice::impl::ParticipantState::readMappingContexts | ( | ) |
Provided access to all read MappingContext.
Definition at line 323 of file ParticipantState.cpp.
| ReceivedMeshContext & precice::impl::ParticipantState::receivedMeshContext | ( | std::string_view | mesh | ) |
Provides access to a ReceivedMeshContext given the mesh name.
| [in] | mesh | the name of the mesh |
Definition at line 259 of file ParticipantState.cpp.
| const ReceivedMeshContext & precice::impl::ParticipantState::receivedMeshContext | ( | std::string_view | mesh | ) | const |
Provides const access to a ReceivedMeshContext given the mesh name.
| [in] | mesh | the name of the mesh |
Definition at line 267 of file ParticipantState.cpp.
| std::deque< ReceivedMeshContext > & precice::impl::ParticipantState::receivedMeshContexts | ( | ) |
Provides access to all ReceivedMeshContexts.
Definition at line 301 of file ParticipantState.cpp.
| const std::deque< ReceivedMeshContext > & precice::impl::ParticipantState::receivedMeshContexts | ( | ) | const |
Provides const access to all ReceivedMeshContexts.
Definition at line 306 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::receiveMesh | ( | mesh::PtrMesh | mesh, |
| const std::string & | fromParticipant, | ||
| double | safetyFactor, | ||
| partition::ReceivedPartition::GeometricFilter | geoFilter, | ||
| const bool | allowDirectAccess ) |
Adds a mesh to be received by the participant.
Definition at line 74 of file ParticipantState.cpp.
| void precice::impl::ParticipantState::setUsePrimaryRank | ( | bool | useIntraComm | ) |
Sets weather the participant was configured with a primary tag.
Definition at line 45 of file ParticipantState.cpp.
| std::vector< MeshContextVariant > & precice::impl::ParticipantState::usedMeshContexts | ( | ) |
Provides unordered access to all MeshContext.used by this ParticipantState
Definition at line 218 of file ParticipantState.cpp.
| const std::vector< MeshContextVariant > & precice::impl::ParticipantState::usedMeshContexts | ( | ) | const |
Provides unordered access to all MeshContext.used by this ParticipantState
Definition at line 213 of file ParticipantState.cpp.
| bool precice::impl::ParticipantState::useIntraComm | ( | ) | const |
Returns true, if the participant uses a primary tag.
Definition at line 364 of file ParticipantState.cpp.
| std::vector< PtrWatchIntegral > & precice::impl::ParticipantState::watchIntegrals | ( | ) |
Provided access to all WatchIntegrals.
Definition at line 359 of file ParticipantState.cpp.
| std::vector< PtrWatchPoint > & precice::impl::ParticipantState::watchPoints | ( | ) |
Provided access to all WatchPoints.
Definition at line 354 of file ParticipantState.cpp.
| WriteDataContext & precice::impl::ParticipantState::writeDataContext | ( | std::string_view | mesh, |
| std::string_view | data ) |
Provides access to WriteDataContext
Definition at line 161 of file ParticipantState.cpp.
| const WriteDataContext & precice::impl::ParticipantState::writeDataContext | ( | std::string_view | mesh, |
| std::string_view | data ) const |
Provides access to WriteDataContext
Definition at line 154 of file ParticipantState.cpp.
|
inline |
Provides access to all WriteDataContext objects
Definition at line 189 of file ParticipantState.hpp.
| std::vector< MappingContext > & precice::impl::ParticipantState::writeMappingContexts | ( | ) |
Provided access to all write MappingContext.
Definition at line 328 of file ParticipantState.cpp.
|
friend |
Definition at line 433 of file ParticipantState.hpp.
|
friend |
To allow white box tests.
Definition at line 432 of file ParticipantState.hpp.
|
private |
Definition at line 390 of file ParticipantState.hpp.
|
private |
Export contexts to export meshes, data, and more.
Definition at line 388 of file ParticipantState.hpp.
|
mutableprivate |
Definition at line 379 of file ParticipantState.hpp.
|
private |
All mesh contexts involved in a simulation (for name-based lookup)
Definition at line 399 of file ParticipantState.hpp.
|
private |
Definition at line 381 of file ParticipantState.hpp.
|
private |
Provided mesh contexts (owning container)
Definition at line 402 of file ParticipantState.hpp.
|
private |
Definition at line 418 of file ParticipantState.hpp.
|
private |
Read mapping contexts used by the participant.
Definition at line 408 of file ParticipantState.hpp.
|
private |
Received mesh contexts (owning container)
Definition at line 405 of file ParticipantState.hpp.
|
private |
Mesh contexts used by the participant.
Definition at line 414 of file ParticipantState.hpp.
|
private |
Definition at line 420 of file ParticipantState.hpp.
|
private |
Definition at line 385 of file ParticipantState.hpp.
|
private |
Definition at line 383 of file ParticipantState.hpp.
|
private |
Definition at line 416 of file ParticipantState.hpp.
|
private |
Write mapping contexts used by the participant.
Definition at line 411 of file ParticipantState.hpp.