37 fprintf(stderr,
"Usage: ./StreamFunction2D file.xml file.fld\n");
42 = LibUtilities::SessionReader::CreateInstance(argc, argv);
47 string meshfile(argv[argc-2]);
53 string fieldfile(argv[argc-1]);
54 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
55 vector<vector<NekDouble> > fielddata;
60 int expdim = graphShPt->GetMeshDimension();
61 int nfields = fielddef[0]->m_fields.size();
86 for(i = 1; i < nfields + vorticitydim; ++i)
96 ASSERTL0(
false,
"The input file must be two-dimensional");
102 for(j = 0; j < nfields; ++j)
104 for(
unsigned int i = 0; i < fielddata.size(); ++i)
106 Exp[j]->ExtractDataToCoeffs(fielddef [i],
108 fielddef [i]->m_fields[j],
109 Exp[j]->UpdateCoeffs());
111 Exp[j]->BwdTrans(Exp[j]->GetCoeffs(),Exp[j]->UpdatePhys());
115 int nq = Exp[0]->GetNpoints();
136 Exp[3]->FwdTrans(Qz, Exp[3]->UpdateCoeffs());
146 FieldVar[0]->HelmSolve(Qz, Exp[4]->UpdateCoeffs(),
NullFlagList, factor);
153 ASSERTL0(
false,
"The input file must be two-dimensional");
160 string fldfilename(argv[2]);
161 string out = fldfilename.substr(0, fldfilename.find_last_of(
"."));
162 string endfile(
"_with_2DstremFunction.fld");
164 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
165 = Exp[0]->GetFieldDefinitions();
166 std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
168 for(j = 0; j < nfields + vorticitydim; ++j)
170 for(i = 0; i < FieldDef.size(); ++i)
176 FieldDef[i]->m_fields.push_back(
"StreamFunc");
180 FieldDef[i]->m_fields.push_back(
"Qz");
185 FieldDef[i]->m_fields.push_back(fielddef[i]->m_fields[j]);
187 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.