23 "Usage: Fld2DTo2D5 2dmeshfile 2dfieldfile 3dmeshfile 3dfieldfile outfield\n");
26 string datasave(argv[5]);
28 string mesh2d(argv[1]);
29 string mesh3d(argv[3]);
33 = LibUtilities::SessionReader::CreateInstance(2, argv);
34 std::vector<std::string> filenames;
35 filenames.push_back(mesh3d);
38 = LibUtilities::SessionReader::CreateInstance(2, argv, filenames, vSession2d->GetComm());
43 string field2dfile(argv[2]);
44 vector<LibUtilities::FieldDefinitionsSharedPtr> field2ddef;
45 vector<vector<NekDouble> > field2ddata;
48 string field3dfile(argv[4]);
49 vector<LibUtilities::FieldDefinitionsSharedPtr> field3ddef;
50 vector<vector<NekDouble> > field3ddata;
52 vector<vector<NekDouble> > field3ddatanew(field3ddef.size());
54 vector< vector<LibUtilities::PointsType> > pointstype2d;
55 vector< vector<LibUtilities::PointsType> > pointstype3d;
56 for(i = 0; i < field2ddef.size(); ++i)
58 vector<LibUtilities::PointsType> ptype2d;
59 for(j = 0; j < 2; ++j)
63 pointstype2d.push_back(ptype2d);
65 graphShPt2d->SetExpansions(field2ddef,pointstype2d);
66 for(i = 0; i < field3ddef.size(); ++i)
68 vector<LibUtilities::PointsType> ptype3d;
69 for(j = 0; j < 2; ++j)
73 pointstype3d.push_back(ptype3d);
75 graphShPt3d->SetExpansions(field3ddef,pointstype3d);
77 bool dealiasing =
false;
80 int nfields2d = field2ddef[0]->m_fields.size();
82 int nfields3d = field3ddef[0]->m_fields.size();
88 for(i = 1; i < nfields2d; ++i)
98 nplanes = field3ddef[0]->m_numModes[2];
99 cout<< nplanes << endl;
103 NekDouble lz = field3ddef[0]->m_homogeneousLengths[0];
106 for(j = 1; j < nfields3d; ++j)
112 for(j = 0; j < nfields2d; ++j)
116 for(
int i = 0; i < field2ddata.size(); ++i)
118 Exp2d[j]->ExtractDataToCoeffs(
121 field2ddef[i]->m_fields[j],
122 Exp3d[j]->GetPlane(k)->UpdateCoeffs());
127 for(
int i = 0; i < field2ddata.size(); ++i)
129 Exp2d[j]->ExtractDataToCoeffs(
132 field2ddef[i]->m_fields[j],
133 Exp3d[j+1]->GetPlane(k)->UpdateCoeffs());
138 for(j = 0; j < fieldcoeffs.num_elements(); ++j)
140 fieldcoeffs[j] = Exp3d[j]->UpdateCoeffs();
141 for(
int i = 0; i < field3ddef.size(); ++i)
143 Exp3d[0]->AppendFieldData(field3ddef[i], field3ddatanew[i],fieldcoeffs[j]);
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...
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
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.
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 ...
boost::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Describes the specification for a Basis.