40#include <boost/format.hpp>
52 m_config[
"RECEIVEFUNCTION"] =
"CouplingIn";
53 m_config[
"SENDFILENAME"] =
"CouplingOut_%14.8E.pts";
71 std::vector<std::string> &varNames)
85 m_evalField->GetSession()->DefinesCmdLineArgument(
"verbose"))
87 std::cout <<
"sending fields at i = " << step <<
", t = " << time
91 std::vector<int> sendVarsToVars =
94#if (defined _WIN32 && _MSC_VER < 1900)
97 unsigned int old_exponent_format;
98 old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
99 std::string filename =
101 _set_output_format(old_exponent_format);
103 std::string filename =
108 for (
int i = 0; i < 3; ++i)
116 pts[3 + i] =
field[sendVarsToVars[i]];
125 std::string tmpFn = filename +
".tmp";
126 ptsIO.
Write(tmpFn, sPts);
127 fs::rename(tmpFn, filename);
132 std::vector<std::string> &varNames)
146 m_evalField->GetSession()->DefinesCmdLineArgument(
"verbose"))
148 std::cout <<
"receiving fields at i = " << step <<
", t = " << time
152 std::string filename =
m_evalField->GetSession()->GetFunctionFilename(
155#if (defined _WIN32 && _MSC_VER < 1900)
158 unsigned int old_exponent_format;
159 old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
161 _set_output_format(old_exponent_format);
169 exists = fs::exists(filename);
176 std::vector<int> recvVarsToVars =
179 for (
int i = 0; i < recvVarsToVars.size(); ++i)
182 field[recvVarsToVars[i]], 1);
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
void Write(const std::string &outFile, const PtsFieldSharedPtr &ptsField, const bool backup=false)
Save a pts field to a file.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
SessionFunctionSharedPtr m_inputFunction
SOLVER_UTILS_EXPORT void v_Send(const int step, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble > > &field, std::vector< std::string > &varNames) override
SOLVER_UTILS_EXPORT void v_Init() override
SOLVER_UTILS_EXPORT void v_Receive(const int step, const NekDouble time, Array< OneD, Array< OneD, NekDouble > > &field, std::vector< std::string > &varNames) override
SOLVER_UTILS_EXPORT CouplingFile(MultiRegions::ExpListSharedPtr field)
static SOLVER_UTILS_EXPORT CouplingSharedPtr create(MultiRegions::ExpListSharedPtr field)
Creates an instance of this class.
static std::string className
virtual SOLVER_UTILS_EXPORT void v_Init()
MultiRegions::ExpListSharedPtr m_evalField
std::vector< std::string > m_sendFieldNames
CouplingConfigMap m_config
std::vector< std::string > m_recvFieldNames
SOLVER_UTILS_EXPORT std::vector< int > GenerateVariableMapping(std::vector< std::string > &vars, std::vector< std::string > &transVars)
std::shared_ptr< PtsField > PtsFieldSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
CouplingFactory & GetCouplingFactory()
Declaration of the Coupling factory singleton.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)