37 : cgFileNames(
std::move(_cgFileNames)),
38 stitchedMesh(nullptr),
50 for (
int iCg = 0; iCg <
cgFileNames.size(); ++iCg) {
54 std::vector<double> slnData(
partitions[iCg]->getNElement(), iCg);
57 std::vector<std::string> slnNamelist;
58 partitions[iCg]->getSolutionDataNames(slnNamelist);
59 for (
const auto &in : slnNamelist)
60 if (in ==
"partitionOld") {
65 partitions[iCg]->appendSolutionData(
"partitionOld", slnData,
84 std::cout <<
"Meshes stitched successfully." << std::endl;
85 std::cout <<
"Exporting stitched mesh to VTK format." << std::endl;
87 std::size_t pos = newname.find_last_of(
'/');
88 newname = newname.substr(pos + 1);
91 std::cout <<
"Transferring physical quantities to vtk mesh." << std::endl;
93 int outNData, outNDim;
94 std::vector<std::string> slnNameList;
95 std::vector<std::string> appSlnNameList;
96 partitions[0]->getSolutionDataNames(slnNameList);
97 partitions[0]->getAppendedSolutionDataName(appSlnNameList);
98 slnNameList.insert(slnNameList.end(), appSlnNameList.begin(),
99 appSlnNameList.end());
102 for (
auto is = slnNameList.begin(); is < slnNameList.end(); is++) {
103 std::vector<double> physData;
104 partitions[0]->getSolutionDataStitched(*is, physData, outNData, outNDim);
107 std::cout <<
"Embedding nodal " << *is << std::endl;
108 stitchedMesh->setPointDataArray((*is).c_str(), physData);
113 std::cout <<
"Embedding cell-based " << *is << std::endl;
114 stitchedMesh->setCellDataArray((*is).c_str(), physData);
125 if (
cgFileNames[0].find(
"burn") != std::string::npos)
126 cgObj->setBurnBool(
true);
127 cgObj->loadCgSeries();
128 cgObj->stitchGroup();
130 std::cout <<
"Surface mesh stitched successfully." << std::endl;
131 std::cout <<
"Exporting stitched mesh to VTK format." << std::endl;
133 std::size_t pos = newname.find_last_of(
'/');
134 newname = newname.substr(pos + 1);
137 std::cout <<
"Transferring physical quantities to vtk mesh." << std::endl;
139 int outNData, outNDim;
140 std::vector<std::string> slnNameList;
141 std::vector<std::string> appSlnNameList;
142 cgObj->getSolutionDataNames(slnNameList);
143 cgObj->getAppendedSolutionDataName(appSlnNameList);
144 slnNameList.insert(slnNameList.end(), appSlnNameList.begin(),
145 appSlnNameList.end());
147 for (
auto is = slnNameList.begin(); is < slnNameList.end(); is++) {
148 std::vector<double> physData;
149 cgObj->getSolutionDataStitched(*is, physData, outNData, outNDim);
152 std::cout <<
"Embedding nodal " << *is << std::endl;
153 stitchedMesh->setPointDataArray((*is).c_str(), physData);
157 if (*is ==
"mdot_old") {
continue; }
158 std::cout <<
"Embedding cell-based " << *is << std::endl;
159 stitchedMesh->setCellDataArray((*is).c_str(), physData);
171 std::cerr <<
"No stitched mesh to return!" << std::endl;
182 std::cerr <<
"No stitched mesh to return!" << std::endl;
const std::vector< std::string > cgFileNames
std::shared_ptr< meshBase > getStitchedMB() const
std::string trim_fname(const std::string &name, const std::string &ext)
std::shared_ptr< cgnsAnalyzer > getStitchedCGNS() const
std::shared_ptr< rocstarCgns > cgObj
std::shared_ptr< meshBase > stitchedMesh
std::vector< std::shared_ptr< cgnsAnalyzer > > partitions
static std::shared_ptr< meshBase > CreateShared(const std::string &fname)
Create shared ptr from fname.
meshStitcher(std::vector< std::string > cgFileNames, bool surf)