50{
51 int i, j, k;
52
53 if (argc != 6)
54 {
55 fprintf(stderr, "Usage: Fld2DTo2D5 2dmeshfile 2dfieldfile 3dmeshfile "
56 "3dfieldfile outfield\n");
57 exit(1);
58 }
59 string datasave(argv[5]);
60
61 string mesh2d(argv[1]);
62 string mesh3d(argv[3]);
63
64
66 LibUtilities::SessionReader::CreateInstance(2, argv);
67 std::vector<std::string> filenames;
68 filenames.push_back(mesh3d);
69
71 LibUtilities::SessionReader::CreateInstance(2, argv, filenames,
72 vSession2d->GetComm());
73
75 SpatialDomains::MeshGraphIO::Read(vSession2d);
77 SpatialDomains::MeshGraphIO::Read(vSession3d);
78
79 string field2dfile(argv[2]);
80 vector<LibUtilities::FieldDefinitionsSharedPtr> field2ddef;
81 vector<vector<NekDouble>> field2ddata;
83
84 string field3dfile(argv[4]);
85 vector<LibUtilities::FieldDefinitionsSharedPtr> field3ddef;
86 vector<vector<NekDouble>> field3ddata;
88 vector<vector<NekDouble>> field3ddatanew(field3ddef.size());
89
90 vector<vector<LibUtilities::PointsType>> pointstype2d;
91 vector<vector<LibUtilities::PointsType>> pointstype3d;
92 for (i = 0; i < field2ddef.size(); ++i)
93 {
94 vector<LibUtilities::PointsType> ptype2d;
95 for (j = 0; j < 2; ++j)
96 {
98 }
99 pointstype2d.push_back(ptype2d);
100 }
101 graphShPt2d->SetExpansionInfo(field2ddef, pointstype2d);
102 for (i = 0; i < field3ddef.size(); ++i)
103 {
104 vector<LibUtilities::PointsType> ptype3d;
105 for (j = 0; j < 2; ++j)
106 {
108 }
109 pointstype3d.push_back(ptype3d);
110 }
111 graphShPt3d->SetExpansionInfo(field3ddef, pointstype3d);
112 bool useFFT = false;
113 bool dealiasing = false;
114
115
116 int nfields2d = field2ddef[0]->m_fields.size();
117
118 int nfields3d = field3ddef[0]->m_fields.size();
119
123 vSession2d, graphShPt2d);
124 Exp2d[0] = Exp2D;
125 for (i = 1; i < nfields2d; ++i)
126 {
127 Exp2d[i] =
129 }
130
133
134 int nplanes;
135
136 nplanes = field3ddef[0]->m_numModes[2];
137 cout << nplanes << endl;
138
142 NekDouble lz = field3ddef[0]->m_homogeneousLengths[0];
143 Exp3DH1 =
145 vSession3d, Bkey, lz, useFFT, dealiasing, graphShPt3d);
146 Exp3d[0] = Exp3DH1;
147 for (j = 1; j < nfields3d; ++j)
148 {
151 }
152
153 k = 0;
154 for (j = 0; j < nfields2d; ++j)
155 {
156 if (j < nfields2d - 1)
157 {
158 for (int i = 0; i < field2ddata.size(); ++i)
159 {
160 Exp2d[j]->ExtractDataToCoeffs(
161 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
162 Exp3d[j]->GetPlane(k)->UpdateCoeffs());
163 }
164 }
165 if (j == nfields2d - 1)
166 {
167 for (int i = 0; i < field2ddata.size(); ++i)
168 {
169 Exp2d[j]->ExtractDataToCoeffs(
170 field2ddef[i], field2ddata[i], field2ddef[i]->m_fields[j],
171 Exp3d[j + 1]->GetPlane(k)->UpdateCoeffs());
172 }
173 }
174 }
176 vSession3d->GetVariables().size());
177 for (j = 0; j < fieldcoeffs.size(); ++j)
178 {
179 fieldcoeffs[j] = Exp3d[j]->UpdateCoeffs();
180 for (int i = 0; i < field3ddef.size(); ++i)
181 {
182 Exp3d[0]->AppendFieldData(field3ddef[i], field3ddatanew[i],
183 fieldcoeffs[j]);
184 }
185 }
187 return 0;
188}
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