48int main(
int argc,
char *argv[])
54 fprintf(stderr,
"Usage: Fld2DTo2D5 2dmeshfile 2dfieldfile 3dmeshfile "
55 "3dfieldfile outfield\n");
58 string datasave(argv[5]);
60 string mesh2d(argv[1]);
61 string mesh3d(argv[3]);
65 LibUtilities::SessionReader::CreateInstance(2, argv);
66 std::vector<std::string> filenames;
67 filenames.push_back(mesh3d);
70 LibUtilities::SessionReader::CreateInstance(2, argv, filenames,
71 vSession2d->GetComm());
74 SpatialDomains::MeshGraph::Read(vSession2d);
76 SpatialDomains::MeshGraph::Read(vSession3d);
78 string field2dfile(argv[2]);
79 vector<LibUtilities::FieldDefinitionsSharedPtr> field2ddef;
80 vector<vector<NekDouble>> field2ddata;
83 string field3dfile(argv[4]);
84 vector<LibUtilities::FieldDefinitionsSharedPtr> field3ddef;
85 vector<vector<NekDouble>> field3ddata;
87 vector<vector<NekDouble>> field3ddatanew(field3ddef.size());
89 vector<vector<LibUtilities::PointsType>> pointstype2d;
90 vector<vector<LibUtilities::PointsType>> pointstype3d;
91 for (i = 0; i < field2ddef.size(); ++i)
93 vector<LibUtilities::PointsType> ptype2d;
94 for (j = 0; j < 2; ++j)
98 pointstype2d.push_back(ptype2d);
100 graphShPt2d->SetExpansionInfo(field2ddef, pointstype2d);
101 for (i = 0; i < field3ddef.size(); ++i)
103 vector<LibUtilities::PointsType> ptype3d;
104 for (j = 0; j < 2; ++j)
108 pointstype3d.push_back(ptype3d);
110 graphShPt3d->SetExpansionInfo(field3ddef, pointstype3d);
112 bool dealiasing =
false;
115 int nfields2d = field2ddef[0]->m_fields.size();
117 int nfields3d = field3ddef[0]->m_fields.size();
122 vSession2d, graphShPt2d);
124 for (i = 1; i < nfields2d; ++i)
135 nplanes = field3ddef[0]->m_numModes[2];
136 cout << nplanes << endl;
141 NekDouble lz = field3ddef[0]->m_homogeneousLengths[0];
144 vSession3d, Bkey, lz, useFFT, dealiasing, graphShPt3d);
146 for (j = 1; j < nfields3d; ++j)
153 for (j = 0; j < nfields2d; ++j)
155 if (j < nfields2d - 1)
157 for (
int i = 0; i < field2ddata.size(); ++i)
159 Exp2d[j]->ExtractDataToCoeffs(
160 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
161 Exp3d[j]->GetPlane(k)->UpdateCoeffs());
164 if (j == nfields2d - 1)
166 for (
int i = 0; i < field2ddata.size(); ++i)
168 Exp2d[j]->ExtractDataToCoeffs(
169 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
170 Exp3d[j + 1]->GetPlane(k)->UpdateCoeffs());
175 vSession3d->GetVariables().size());
176 for (j = 0; j < fieldcoeffs.size(); ++j)
178 fieldcoeffs[j] = Exp3d[j]->UpdateCoeffs();
179 for (
int i = 0; i < field3ddef.size(); ++i)
181 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
The above copyright notice and this permission notice shall be included.