40#include <boost/format.hpp>
54 m_config[
"RECEIVEFUNCTION"] =
"CouplingIn";
55 m_config[
"SENDFILENAME"] =
"CouplingOut_%14.8E.pts";
77 vector<string> &varNames)
91 m_evalField->GetSession()->DefinesCmdLineArgument(
"verbose"))
93 cout <<
"sending fields at i = " << step <<
", t = " << time << endl;
96 vector<int> sendVarsToVars =
99#if (defined _WIN32 && _MSC_VER < 1900)
102 unsigned int old_exponent_format;
103 old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
104 std::string filename =
106 _set_output_format(old_exponent_format);
108 std::string filename =
113 for (
int i = 0; i < 3; ++i)
121 pts[3 + i] =
field[sendVarsToVars[i]];
130 string tmpFn = filename +
".tmp";
131 ptsIO.
Write(tmpFn, sPts);
132 fs::rename(tmpFn, filename);
137 vector<string> &varNames)
151 m_evalField->GetSession()->DefinesCmdLineArgument(
"verbose"))
153 cout <<
"receiving fields at i = " << step <<
", t = " << time << endl;
156 string filename =
m_evalField->GetSession()->GetFunctionFilename(
159#if (defined _WIN32 && _MSC_VER < 1900)
162 unsigned int old_exponent_format;
163 old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
165 _set_output_format(old_exponent_format);
173 exists = fs::exists(filename);
180 vector<int> recvVarsToVars =
183 for (
int i = 0; i < recvVarsToVars.size(); ++i)
186 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.
SOLVER_UTILS_EXPORT ~CouplingFile() override
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)