preCICE v3.1.2
Loading...
Searching...
No Matches
Participant.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <precice/Version.h>
5#include <precice/export.h>
6#include <precice/span.hpp>
7#include "precice/Types.hpp"
8
12namespace precice {
13namespace impl {
14class ParticipantImpl;
15}
16namespace testing {
17struct WhiteboxAccessor;
18}
19} // namespace precice
20
21// ----------------------------------------------------------- CLASS DEFINITION
22
23namespace precice {
24
64
168class PRECICE_API Participant {
169public:
201 ::precice::string_view participantName,
202 ::precice::string_view configurationFileName,
203 int solverProcessIndex,
204 int solverProcessSize);
205
219 ::precice::string_view participantName,
220 ::precice::string_view configurationFileName,
221 int solverProcessIndex,
222 int solverProcessSize,
223 void * communicator);
224
226
228
259 void initialize();
260
299 void advance(double computedTimeStepSize);
300
325 void finalize();
326
328
386 bool requiresWritingCheckpoint();
387
400 bool requiresReadingCheckpoint();
401
403
424 int getMeshDimensions(::precice::string_view meshName) const;
425
438 int getDataDimensions(::precice::string_view meshName, ::precice::string_view dataName) const;
439
456 bool isCouplingOngoing() const;
457
477 bool isTimeWindowComplete() const;
478
489 double getMaxTimeStepSize() const;
490
492
526 bool requiresMeshConnectivityFor(::precice::string_view meshName) const;
527
540 VertexID setMeshVertex(
541 ::precice::string_view meshName,
543
555 int getMeshVertexSize(::precice::string_view meshName) const;
556
572 void setMeshVertices(
573 ::precice::string_view meshName,
576
590 void setMeshEdge(
591 ::precice::string_view meshName,
592 VertexID first,
593 VertexID second);
594
612 void setMeshEdges(
613 ::precice::string_view meshName,
615
632 void setMeshTriangle(
633 ::precice::string_view meshName,
634 VertexID first,
635 VertexID second,
636 VertexID third);
637
655 void setMeshTriangles(
656 ::precice::string_view meshName,
658
677 void setMeshQuad(
678 ::precice::string_view meshName,
679 VertexID first,
680 VertexID second,
681 VertexID third,
682 VertexID fourth);
683
703 void setMeshQuads(
704 ::precice::string_view meshName,
706
722 void setMeshTetrahedron(
723 ::precice::string_view meshName,
724 VertexID first,
725 VertexID second,
726 VertexID third,
727 VertexID fourth);
728
746 void setMeshTetrahedra(
747 ::precice::string_view meshName,
749
751
783 bool requiresInitialData();
784
808 void writeData(
809 ::precice::string_view meshName,
810 ::precice::string_view dataName,
813
844 void readData(
845 ::precice::string_view meshName,
846 ::precice::string_view dataName,
848 double relativeReadTime,
849 ::precice::span<double> values) const;
850
852
921 void setMeshAccessRegion(
922 ::precice::string_view meshName,
923 ::precice::span<const double> boundingBox) const;
924
946 void getMeshVertexIDsAndCoordinates(
947 ::precice::string_view meshName,
949 ::precice::span<double> coordinates) const;
950
952
957
972 bool requiresGradientDataFor(::precice::string_view meshName,
973 ::precice::string_view dataName) const;
974
1017 void writeGradientData(
1018 ::precice::string_view meshName,
1019 ::precice::string_view dataName,
1022
1024
1026 Participant(const Participant &copy) = delete;
1027
1029 Participant &operator=(const Participant &assign) = delete;
1030
1031private:
1034
1035 // @brief To allow white box tests.
1037};
1038
1039} // namespace precice
Main Application Programming Interface of preCICE. Include using #include <precice/precice....
Participant(const Participant &copy)=delete
Disable copy construction.
std::unique_ptr< impl::ParticipantImpl > _impl
Pointer to implementation of Participant.
Participant & operator=(const Participant &assign)=delete
Disable assignment construction.
A C++ 11 implementation of the non-owning C++20 std::span type.
Definition span.hpp:284
Main namespace of the precice library.
int VertexID
Definition Types.hpp:13
static std::unique_ptr< precice::Participant > impl
Definition preciceC.cpp:21
struct giving access to the impl of a befriended class or struct
Definition Testing.hpp:37