14 int main(
int argc,
char *argv[])
20 fprintf(stderr,
"Usage: Fld2DTo2D5 2dmeshfile 2dfieldfile 3dmeshfile "
21 "3dfieldfile outfield\n");
24 string datasave(argv[5]);
26 string mesh2d(argv[1]);
27 string mesh3d(argv[3]);
31 LibUtilities::SessionReader::CreateInstance(2, argv);
32 std::vector<std::string> filenames;
33 filenames.push_back(mesh3d);
36 LibUtilities::SessionReader::CreateInstance(2, argv, filenames,
37 vSession2d->GetComm());
40 SpatialDomains::MeshGraph::Read(vSession2d);
42 SpatialDomains::MeshGraph::Read(vSession3d);
44 string field2dfile(argv[2]);
45 vector<LibUtilities::FieldDefinitionsSharedPtr> field2ddef;
46 vector<vector<NekDouble>> field2ddata;
49 string field3dfile(argv[4]);
50 vector<LibUtilities::FieldDefinitionsSharedPtr> field3ddef;
51 vector<vector<NekDouble>> field3ddata;
53 vector<vector<NekDouble>> field3ddatanew(field3ddef.size());
55 vector<vector<LibUtilities::PointsType>> pointstype2d;
56 vector<vector<LibUtilities::PointsType>> pointstype3d;
57 for (i = 0; i < field2ddef.size(); ++i)
59 vector<LibUtilities::PointsType> ptype2d;
60 for (j = 0; j < 2; ++j)
64 pointstype2d.push_back(ptype2d);
66 graphShPt2d->SetExpansionInfo(field2ddef, pointstype2d);
67 for (i = 0; i < field3ddef.size(); ++i)
69 vector<LibUtilities::PointsType> ptype3d;
70 for (j = 0; j < 2; ++j)
74 pointstype3d.push_back(ptype3d);
76 graphShPt3d->SetExpansionInfo(field3ddef, pointstype3d);
78 bool dealiasing =
false;
81 int nfields2d = field2ddef[0]->m_fields.size();
83 int nfields3d = field3ddef[0]->m_fields.size();
88 vSession2d, graphShPt2d);
90 for (i = 1; i < nfields2d; ++i)
101 nplanes = field3ddef[0]->m_numModes[2];
102 cout << nplanes << endl;
107 NekDouble lz = field3ddef[0]->m_homogeneousLengths[0];
110 vSession3d, Bkey, lz, useFFT, dealiasing, graphShPt3d);
112 for (j = 1; j < nfields3d; ++j)
119 for (j = 0; j < nfields2d; ++j)
121 if (j < nfields2d - 1)
123 for (
int i = 0; i < field2ddata.size(); ++i)
125 Exp2d[j]->ExtractDataToCoeffs(
126 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
127 Exp3d[j]->GetPlane(k)->UpdateCoeffs());
130 if (j == nfields2d - 1)
132 for (
int i = 0; i < field2ddata.size(); ++i)
134 Exp2d[j]->ExtractDataToCoeffs(
135 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
136 Exp3d[j + 1]->GetPlane(k)->UpdateCoeffs());
141 vSession3d->GetVariables().size());
142 for (j = 0; j < fieldcoeffs.size(); ++j)
144 fieldcoeffs[j] = Exp3d[j]->UpdateCoeffs();
145 for (
int i = 0; i < field3ddef.size(); ++i)
147 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 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 ...
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
@ 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
The above copyright notice and this permission notice shall be included.