13 fprintf(stderr,
"Usage: ExtractmeanModeFromHomo1DFld fieldfile outfield\n");
27 string fieldfile(argv[argc-2]);
28 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
29 vector<vector<NekDouble> > fielddata;
33 vector<vector<NekDouble> > combineddata;
34 vector<LibUtilities::FieldDefinitionsSharedPtr> newfielddef;
38 for(i = 0; i < fielddata.size(); ++i)
40 ASSERTL0(fielddef[i]->m_numHomogeneousDir == 1,
41 "Expected fieldfile to have one homogeneous direction");
43 if(fielddef[i]->m_homogeneousZIDs[0] != 0)
49 nz = fielddef[i]->m_homogeneousZIDs.size();
51 fielddef[i]->m_numHomogeneousDir = 0;
52 fielddef[i]->m_basis.resize(2);
53 newfielddef.push_back(fielddef[i]);
57 switch(fielddef[i]->m_shapeType)
61 fielddef[i]->m_numModes[0], fielddef[i]->m_numModes[1]);
64 ncoeffs = fielddef[i]->m_numModes[0]*fielddef[i]->m_numModes[1];
67 ASSERTL0(
false,
"Shape not recognised");
73 vector<NekDouble> newdata;
74 vec_iter = fielddata[i].begin();
76 for(k = 0; k < fielddef[i]->m_fields.size(); ++k)
79 for(n = 0; n < fielddef[i]->m_elementIDs.size(); ++n)
82 newdata.insert(newdata.end(),vec_iter, vec_iter+ncoeffs);
83 vec_iter += nz*ncoeffs;
86 combineddata.push_back(newdata);
#define ASSERTL0(condition, msg)
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > ElementiDs)
Imports an FLD file.
int getNumberOfCoefficients(int Na)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Base class for a spectral/hp element mesh.
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap)
Write a field file in serial only.