21 "Usage: Fld2DTo2D5 2dmeshfile 2dfieldfile 3dmeshfile 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, vSession2d->GetComm());
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();
86 for(i = 1; i < nfields2d; ++i)
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());
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]);
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > ElementiDs)
Imports an FLD file.
1D Evenly-spaced points using Lagrange polynomial
Defines a specification for a set of points.
boost::shared_ptr< ExpList2D > ExpList2DSharedPtr
Shared pointer to an ExpList2D object.
boost::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap)
Write a field file in serial only.
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Describes the specification for a Basis.