49 : m_couplingName(
""), m_evalField(
field), m_nSendVars(0), m_sendSteps(0),
50 m_nRecvVars(0), m_recvSteps(0)
63 TiXmlElement *vCoupling = session->GetElement(
"Nektar/Coupling");
64 ASSERTL0(vCoupling,
"Invalid Coupling config");
69 TiXmlElement *element = vCoupling->FirstChildElement(
"I");
72 std::stringstream tagcontent;
73 tagcontent << *element;
75 ASSERTL0(element->Attribute(
"PROPERTY"),
76 "Missing PROPERTY attribute in Coupling section "
77 "XML element: \n\t'" +
78 tagcontent.str() +
"'");
79 std::string
property = element->Attribute(
"PROPERTY");
81 "PROPERTY attribute must be non-empty in XML "
83 tagcontent.str() +
"'");
86 std::string propertyUpper = boost::to_upper_copy(property);
88 CouplingConfigMap::const_iterator x =
m_config.find(propertyUpper);
90 "Invalid PROPERTY attribute in Coupling section "
91 "XML element: \n\t'" +
92 tagcontent.str() +
"'");
95 ASSERTL0(element->Attribute(
"VALUE"),
96 "Missing VALUE attribute in Coupling section "
97 "XML element: \n\t'" +
98 tagcontent.str() +
"'");
99 std::string value = element->Attribute(
"VALUE");
100 ASSERTL0(!value.empty(),
"VALUE attribute must be non-empty in XML "
102 tagcontent.str() +
"'");
107 element = element->NextSiblingElement(
"I");
120 if (session->GetComm()->GetRank() == 0 &&
121 session->DefinesCmdLineArgument(
"verbose") &&
m_config.size() > 0)
123 cout <<
"Coupling Config:" << endl;
124 CouplingConfigMap::iterator x;
127 cout <<
"\t" << x->first <<
" = '" << x->second <<
"'" << endl;
133 vector<string> &transVars)
135 vector<int> transToVars;
137 for (
int i = 0; i < transVars.size(); ++i)
139 auto it2 =
find(vars.begin(), vars.end(), transVars[i]);
141 "send variable " + transVars[i] +
" not found");
142 int id = distance(vars.begin(), it2);
144 transToVars.push_back(
id);
#define ASSERTL0(condition, msg)
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
virtual SOLVER_UTILS_EXPORT void v_Init()
MultiRegions::ExpListSharedPtr m_evalField
std::string m_couplingName
std::vector< std::string > m_sendFieldNames
CouplingConfigMap m_config
std::vector< std::string > m_recvFieldNames
SOLVER_UTILS_EXPORT Coupling(MultiRegions::ExpListSharedPtr field)
SOLVER_UTILS_EXPORT std::vector< int > GenerateVariableMapping(std::vector< std::string > &vars, std::vector< std::string > &transVars)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
SOLVER_UTILS_EXPORT typedef LibUtilities::NekFactory< std::string, Coupling, MultiRegions::ExpListSharedPtr > CouplingFactory
Declaration of the Coupling factory.
CouplingFactory & GetCouplingFactory()
Declaration of the Coupling factory singleton.
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)