12 using namespace Nektar;
14 int main(
int argc,
char *argv[])
21 "Usage: Fld2DTo2D5 2dmeshfile 2dfieldfile 3dmeshfile 3dfieldfile outfield\n");
24 string datasave(argv[5]);
26 string mesh2d(argv[1]);
27 string mesh3d(argv[3]);
32 std::vector<std::string> filenames;
33 filenames.push_back(mesh3d);
41 string field2dfile(argv[2]);
42 vector<LibUtilities::FieldDefinitionsSharedPtr> field2ddef;
43 vector<vector<NekDouble> > field2ddata;
46 string field3dfile(argv[4]);
47 vector<LibUtilities::FieldDefinitionsSharedPtr> field3ddef;
48 vector<vector<NekDouble> > field3ddata;
50 vector<vector<NekDouble> > field3ddatanew(field3ddef.size());
52 vector< vector<LibUtilities::PointsType> > pointstype2d;
53 vector< vector<LibUtilities::PointsType> > pointstype3d;
54 for(i = 0; i < field2ddef.size(); ++i)
56 vector<LibUtilities::PointsType> ptype2d;
57 for(j = 0; j < 2; ++j)
61 pointstype2d.push_back(ptype2d);
63 graphShPt2d->SetExpansions(field2ddef,pointstype2d);
64 for(i = 0; i < field3ddef.size(); ++i)
66 vector<LibUtilities::PointsType> ptype3d;
67 for(j = 0; j < 2; ++j)
71 pointstype3d.push_back(ptype3d);
73 graphShPt3d->SetExpansions(field3ddef,pointstype3d);
75 bool dealiasing =
false;
78 int nfields2d = field2ddef[0]->m_fields.size();
80 int nfields3d = field3ddef[0]->m_fields.size();
82 Array<OneD, MultiRegions::ExpListSharedPtr> Exp2d(nfields2d);
86 for(i = 1; i < nfields2d; ++i)
91 Array<OneD, MultiRegions::ExpListSharedPtr> Exp3d(nfields3d);
96 nplanes = field3ddef[0]->m_numModes[2];
97 cout<< nplanes << endl;
101 NekDouble lz = field3ddef[0]->m_homogeneousLengths[0];
104 for(j = 1; j < nfields3d; ++j)
110 for(j = 0; j < nfields2d; ++j)
114 for(
int i = 0; i < field2ddata.size(); ++i)
116 Exp2d[j]->ExtractDataToCoeffs(
119 field2ddef[i]->m_fields[j],
120 Exp3d[j]->GetPlane(k)->UpdateCoeffs());
125 for(
int i = 0; i < field2ddata.size(); ++i)
127 Exp2d[j]->ExtractDataToCoeffs(
130 field2ddef[i]->m_fields[j],
131 Exp3d[j+1]->GetPlane(k)->UpdateCoeffs());
135 Array<OneD, Array<OneD, NekDouble> > fieldcoeffs(vSession3d->GetVariables().size());
136 for(j = 0; j < fieldcoeffs.num_elements(); ++j)
138 fieldcoeffs[j] = Exp3d[j]->UpdateCoeffs();
139 for(
int i = 0; i < field3ddef.size(); ++i)
141 Exp3d[0]->AppendFieldData(field3ddef[i], field3ddatanew[i],fieldcoeffs[j]);