49int main(
int argc,
char *argv[])
55 fprintf(stderr,
"Usage: Fld2DTo2D5 2dmeshfile 2dfieldfile 3dmeshfile "
56 "3dfieldfile outfield\n");
59 string datasave(argv[5]);
61 string mesh2d(argv[1]);
62 string mesh3d(argv[3]);
66 LibUtilities::SessionReader::CreateInstance(2, argv);
67 std::vector<std::string> filenames;
68 filenames.push_back(mesh3d);
71 LibUtilities::SessionReader::CreateInstance(2, argv, filenames,
72 vSession2d->GetComm());
75 SpatialDomains::MeshGraphIO::Read(vSession2d);
77 SpatialDomains::MeshGraphIO::Read(vSession3d);
79 string field2dfile(argv[2]);
80 vector<LibUtilities::FieldDefinitionsSharedPtr> field2ddef;
81 vector<vector<NekDouble>> field2ddata;
84 string field3dfile(argv[4]);
85 vector<LibUtilities::FieldDefinitionsSharedPtr> field3ddef;
86 vector<vector<NekDouble>> field3ddata;
88 vector<vector<NekDouble>> field3ddatanew(field3ddef.size());
90 vector<vector<LibUtilities::PointsType>> pointstype2d;
91 vector<vector<LibUtilities::PointsType>> pointstype3d;
92 for (i = 0; i < field2ddef.size(); ++i)
94 vector<LibUtilities::PointsType> ptype2d;
95 for (j = 0; j < 2; ++j)
99 pointstype2d.push_back(ptype2d);
101 graphShPt2d->SetExpansionInfo(field2ddef, pointstype2d);
102 for (i = 0; i < field3ddef.size(); ++i)
104 vector<LibUtilities::PointsType> ptype3d;
105 for (j = 0; j < 2; ++j)
109 pointstype3d.push_back(ptype3d);
111 graphShPt3d->SetExpansionInfo(field3ddef, pointstype3d);
113 bool dealiasing =
false;
116 int nfields2d = field2ddef[0]->m_fields.size();
118 int nfields3d = field3ddef[0]->m_fields.size();
123 vSession2d, graphShPt2d);
125 for (i = 1; i < nfields2d; ++i)
136 nplanes = field3ddef[0]->m_numModes[2];
137 cout << nplanes << endl;
142 NekDouble lz = field3ddef[0]->m_homogeneousLengths[0];
145 vSession3d, Bkey, lz, useFFT, dealiasing, graphShPt3d);
147 for (j = 1; j < nfields3d; ++j)
154 for (j = 0; j < nfields2d; ++j)
156 if (j < nfields2d - 1)
158 for (
int i = 0; i < field2ddata.size(); ++i)
160 Exp2d[j]->ExtractDataToCoeffs(
161 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
162 Exp3d[j]->GetPlane(k)->UpdateCoeffs());
165 if (j == nfields2d - 1)
167 for (
int i = 0; i < field2ddata.size(); ++i)
169 Exp2d[j]->ExtractDataToCoeffs(
170 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
171 Exp3d[j + 1]->GetPlane(k)->UpdateCoeffs());
176 vSession3d->GetVariables().size());
177 for (j = 0; j < fieldcoeffs.size(); ++j)
179 fieldcoeffs[j] = Exp3d[j]->UpdateCoeffs();
180 for (
int i = 0; i < field3ddef.size(); ++i)
182 Exp3d[0]->AppendFieldData(field3ddef[i], field3ddatanew[i],
int main(int argc, char *argv[])
Describes the specification for a Basis.
Defines a specification for a set of points.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
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...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
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 ...
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr