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