38 fprintf(stderr,
"Usage: ./StreamFunction2D file.xml file.fld\n");
43 = LibUtilities::SessionReader::CreateInstance(argc, argv);
48 string meshfile(argv[argc-2]);
54 string fieldfile(argv[argc-1]);
55 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
56 vector<vector<NekDouble> > fielddata;
61 int expdim = graphShPt->GetMeshDimension();
62 int nfields = fielddef[0]->m_fields.size();
87 for(i = 1; i < nfields + vorticitydim; ++i)
97 ASSERTL0(
false,
"The input file must be two-dimensional");
103 for(j = 0; j < nfields; ++j)
105 for(
unsigned int i = 0; i < fielddata.size(); ++i)
107 Exp[j]->ExtractDataToCoeffs(fielddef [i],
109 fielddef [i]->m_fields[j],
110 Exp[j]->UpdateCoeffs());
112 Exp[j]->BwdTrans(Exp[j]->GetCoeffs(),Exp[j]->UpdatePhys());
116 int nq = Exp[0]->GetNpoints();
137 Exp[3]->FwdTrans(Qz, Exp[3]->UpdateCoeffs());
147 FieldVar[0]->HelmSolve(Qz, Exp[4]->UpdateCoeffs(),
NullFlagList, factor);
154 ASSERTL0(
false,
"The input file must be two-dimensional");
161 string fldfilename(argv[2]);
162 string out = fldfilename.substr(0, fldfilename.find_last_of(
"."));
163 string endfile(
"_with_2DstremFunction.fld");
165 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
166 = Exp[0]->GetFieldDefinitions();
167 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
169 for(j = 0; j < nfields + vorticitydim; ++j)
171 for(i = 0; i < FieldDef.size(); ++i)
177 FieldDef[i]->m_fields.push_back(
"StreamFunc");
181 FieldDef[i]->m_fields.push_back(
"Qz");
186 FieldDef[i]->m_fields.push_back(fielddef[i]->m_fields[j]);
188 Exp[j]->AppendFieldData(FieldDef[i], FieldData[i]);
#define ASSERTL0(condition, msg)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::map< ConstFactorType, NekDouble > ConstFactorMap
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
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.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
boost::shared_ptr< ExpList2D > ExpList2DSharedPtr
Shared pointer to an ExpList2D object.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
MultiRegions::Direction const DirCartesianMap[]
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.
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
static FlagList NullFlagList
An empty flag list.