12 fprintf(stderr,
"Usage: ExtractmeanModeFromHomo1DFld fieldfile outfield\n");
26 string fieldfile(argv[argc-2]);
27 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
28 vector<vector<NekDouble> > fielddata;
32 vector<vector<NekDouble> > combineddata;
33 vector<LibUtilities::FieldDefinitionsSharedPtr> newfielddef;
37 for(i = 0; i < fielddata.size(); ++i)
39 ASSERTL0(fielddef[i]->m_numHomogeneousDir == 1,
40 "Expected fieldfile to have one homogeneous direction");
42 if(fielddef[i]->m_homogeneousZIDs[0] != 0)
48 nz = fielddef[i]->m_homogeneousZIDs.size();
50 fielddef[i]->m_numHomogeneousDir = 0;
51 fielddef[i]->m_basis.resize(2);
52 newfielddef.push_back(fielddef[i]);
56 switch(fielddef[i]->m_shapeType)
60 fielddef[i]->m_numModes[0], fielddef[i]->m_numModes[1]);
63 ncoeffs = fielddef[i]->m_numModes[0]*fielddef[i]->m_numModes[1];
66 ASSERTL0(
false,
"Shape not recognised");
72 vector<NekDouble> newdata;
73 vec_iter = fielddata[i].begin();
75 for(k = 0; k < fielddef[i]->m_fields.size(); ++k)
78 for(n = 0; n < fielddef[i]->m_elementIDs.size(); ++n)
81 newdata.insert(newdata.end(),vec_iter, vec_iter+ncoeffs);
82 vec_iter += nz*ncoeffs;
85 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.