43int main(
int argc,
char *argv[])
48 "Usage: ExtractmeanModeFromHomo1DFld fieldfile outfield\n");
60 string fieldfile(argv[argc - 2]);
61 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
62 vector<vector<NekDouble>> fielddata;
66 vector<vector<NekDouble>> combineddata;
67 vector<LibUtilities::FieldDefinitionsSharedPtr> newfielddef;
71 for (i = 0; i < fielddata.size(); ++i)
73 ASSERTL0(fielddef[i]->m_numHomogeneousDir == 1,
74 "Expected fieldfile to have one homogeneous direction");
76 if (fielddef[i]->m_homogeneousZIDs[0] != 0)
82 nz = fielddef[i]->m_homogeneousZIDs.size();
84 fielddef[i]->m_numHomogeneousDir = 0;
85 fielddef[i]->m_basis.resize(2);
86 newfielddef.push_back(fielddef[i]);
89 switch (fielddef[i]->m_shapeType)
93 fielddef[i]->m_numModes[0], fielddef[i]->m_numModes[1]);
97 fielddef[i]->m_numModes[0] * fielddef[i]->m_numModes[1];
100 ASSERTL0(
false,
"Shape not recognised");
104 vector<NekDouble> newdata;
105 auto vec_iter = fielddata[i].begin();
107 for (k = 0; k < fielddef[i]->m_fields.size(); ++k)
110 for (n = 0; n < fielddef[i]->m_elementIDs.size(); ++n)
113 newdata.insert(newdata.end(), vec_iter, vec_iter + ncoeffs);
114 vec_iter += nz * ncoeffs;
117 combineddata.push_back(newdata);
#define ASSERTL0(condition, msg)
int getNumberOfCoefficients(int Na)
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > &ElementIDs)
This function allows for data to be imported from an FLD file when a session and/or communicator is n...
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap, const bool backup)
This function allows for data to be written to an FLD file when a session and/or communicator is not ...