preCICE
v3.1.2
Loading...
Searching...
No Matches
src
com
MPISinglePortsCommunicationFactory.cpp
Go to the documentation of this file.
1
#ifndef PRECICE_NO_MPI
2
3
#include "
MPISinglePortsCommunicationFactory.hpp
"
4
#include <
memory
>
5
#include <
utility
>
6
7
#include "
MPISinglePortsCommunication.hpp
"
8
#include "
com/SharedPointer.hpp
"
9
10
namespace
precice::com
{
11
MPISinglePortsCommunicationFactory::MPISinglePortsCommunicationFactory
(
std::string
addressDirectory)
12
: _addressDirectory(
std
::move(addressDirectory))
13
{
14
if
(
_addressDirectory
.
empty
()) {
15
_addressDirectory
=
"."
;
16
}
17
}
18
19
PtrCommunication
MPISinglePortsCommunicationFactory::newCommunication
()
20
{
21
return
std::make_shared<MPISinglePortsCommunication>(
_addressDirectory
);
22
}
23
24
std::string
MPISinglePortsCommunicationFactory::addressDirectory
()
25
{
26
return
_addressDirectory
;
27
}
28
}
// namespace precice::com
29
30
#endif
// not PRECICE_NO_MPI
MPISinglePortsCommunicationFactory.hpp
MPISinglePortsCommunication.hpp
std::string
precice::com::MPISinglePortsCommunicationFactory::addressDirectory
std::string addressDirectory() override
Definition
MPISinglePortsCommunicationFactory.cpp:24
precice::com::MPISinglePortsCommunicationFactory::newCommunication
PtrCommunication newCommunication() override
Definition
MPISinglePortsCommunicationFactory.cpp:19
precice::com::MPISinglePortsCommunicationFactory::MPISinglePortsCommunicationFactory
MPISinglePortsCommunicationFactory(std::string addressDirectory=".")
Definition
MPISinglePortsCommunicationFactory.cpp:11
precice::com::MPISinglePortsCommunicationFactory::_addressDirectory
std::string _addressDirectory
Definition
MPISinglePortsCommunicationFactory.hpp:21
SharedPointer.hpp
std::string::empty
T empty(T... args)
memory
precice::com
contains the data communication abstraction layer.
Definition
Communication.cpp:12
std
STL namespace.
std::shared_ptr< Communication >
utility