78 std::string filename = dir +
"pointsVP";
81 if (fileExistTest(filename,
W.getInfo(),
true, {
"txt",
"TXT" }))
92 pt = pt.rotated(-
W.getPassport().rotateAngleVpPoints *
PI / 180.0);
95 pt = pt.rotated(-
W.getPassport().rotateAngleVpPoints *
PI / 180.0);
103 std::string VPFileNameList =
W.getPassport().dir +
"velPres/listPoints";
104 std::ofstream VPFileList(VPFileNameList.c_str());
106 VMlib::PrintLogoToTextFile(VPFileList, VPFileNameList.c_str(),
"List of points, where velocity and pressure are measured in csv-files");
114 std::string VPFileNameCsv;
115 VPFileNameCsv =
W.getPassport().dir +
"velPres/" +
VMlib::fileNameStep(
"VP-atPoint-", 2, q,
"csv");
117 std::ofstream VPFileCsv(VPFileNameCsv.c_str());
119 if (!
W.getPassport().calcCoefficients)
120 VPFileCsv <<
"pt,t,Vx,Vy,p" << std::endl;
122 VPFileCsv <<
"pt,t,CVx,CVy,Cp" << std::endl;
144 pt = pt.rotated(-
W.getPassport().rotateAngleVpPoints *
PI / 180.0);
147 pt = pt.rotated(-
W.getPassport().rotateAngleVpPoints *
PI / 180.0);
153 std::string VPFileNameList =
W.getPassport().dir +
"velPres/listPoints";
154 std::ofstream VPFileList(VPFileNameList.c_str());
156 VMlib::PrintLogoToTextFile(VPFileList, VPFileNameList.c_str(),
"List of points, where velocity and pressure are measured in csv-files");
164 std::string VPFileNameCsv;
165 VPFileNameCsv =
W.getPassport().dir +
"velPres/" +
VMlib::fileNameStep(
"VP-atPoint-", 2, q,
"csv");
167 std::ofstream VPFileCsv(VPFileNameCsv.c_str());
169 if (!
W.getPassport().calcCoefficients)
170 VPFileCsv <<
"pt,t,Vx,Vy,p" << std::endl;
172 VPFileCsv <<
"pt,t,CVx,CVy,Cp" << std::endl;
187 W.getTimers().start(
"VelPres");
192 if ((
W.getPassport().timeDiscretizationProperties.saveVPstep > 0) && (!(
W.getCurrentStep() %
W.getPassport().timeDiscretizationProperties.saveVPstep)))
235 addvtx.
sigma() = 0.0;
236 wakeVP->vtx.push_back(addvtx);
244 addvtx.
sigma() = 0.0;
245 wakeVP->vtx.push_back(addvtx);
254 for (
size_t afl = 0; afl <
W.getNumberOfAirfoil(); ++afl)
264 W.getInfo(
'e') <<
"Only airfoil 0 can be elastic!" << std::endl;
271 for (
size_t q = 0; q < ptr->
chord.size(); ++q)
273 std::pair<size_t, size_t> pnls = ptr->
chord[q].infPanels;
275 0.5 * (
W.getAirfoil(afl).getR(pnls.first) +
W.getAirfoil(afl).getR(pnls.first + 1))
276 + 0.01 *
W.getAirfoil(afl).len[pnls.first] *
W.getAirfoil(afl).nrm[pnls.first]
280 0.5 * (
W.getAirfoil(afl).getR(pnls.second) +
W.getAirfoil(afl).getR(pnls.second + 1))
281 + 0.01 *
W.getAirfoil(afl).len[pnls.second] *
W.getAirfoil(afl).nrm[pnls.second]
294 for (
size_t q = 0; q <
W.getAirfoil(afl).getNumberOfPanels(); ++q)
295 elasticPoints.push_back(0.5 * (
W.getAirfoil(afl).getR(q) +
W.getAirfoil(afl).getR(q + 1)) +
W.getAirfoil(afl).nrm[q] * 1e-10);
318 addvtx.
sigma() = -1.0;
319 wakeVP->vtx.push_back(addvtx);
327 W.getTimers().stop(
"VelPres");
334 W.getTimers().start(
"VelPres");
336 int addWSize = (int)
wakeVP->vtx.size();
344 const double& dt =
W.getPassport().timeDiscretizationProperties.dt;
346 double P0 = 0.5 * V0.
length2();
350#pragma warning (push)
351#pragma warning (disable: 4101)
364 std::vector<WakePressData> wakeData(
W.getWake().vtx.size());
365#pragma omp parallel for
366 for (
int j = 0; j < (int)wakeData.size(); ++j)
368 wakeData[j].r =
W.getWake().vtx[j].r();
369 wakeData[j].V =
W.getVelocity().wakeVortexesParams.convVelo[j] +
W.getVelocity().wakeVortexesParams.diffVelo[j] + V0;
370 wakeData[j].g =
W.getWake().vtx[j].g();
371 wakeData[j].sigma2 =
sqr(
W.getWake().vtx[j].sigma());
374#pragma omp parallel for default(none) private(alpha, lambda, dri, Vi, vi, dst2eps, cPan) shared(P0, dt, V0, addWSize, wakeData, std::cout, IDPI)
375 for (
int i = 0; i < addWSize; ++i)
382 for (
size_t j = 0; j < wakeData.size(); ++j)
384 const WakePressData& wd = wakeData[j];
394 for (
size_t q = 0; q <
W.getNumberOfAirfoil(); ++q)
397 const Airfoil& afl =
W.getAirfoil(q);
408 Point2D skos =
IDPI * ((alpha * u0).kcross() + (lambda * u0));
417 Vi = 0.5 * (afl.
getV(pnl) + afl.
getV(pnl + 1));
426 for (
size_t bou = 0; bou <
W.getNumberOfBoundary(); ++bou)
428 const Point2D& rcm =
W.getAirfoil(bou).rcm;
429 const Point2D& startOfWays =
W.getAirfoil(bou).startOfWays;
470 for (
size_t j = 0; j <
W.getAirfoil(bou).getNumberOfPanels(); ++j)
472 cPan = 0.5 * (
W.getAirfoil(bou).getR(j) +
W.getAirfoil(bou).getR(j + 1));
476 int way =
W.getAirfoil(bou).wayToVertex[j];
482 alpha = atan2((cPan - pt) ^ (startOfWays - pt), (cPan - pt) & (startOfWays - pt));
486 for (
int q = 0; q <
W.getAirfoil(bou).possibleWays[way - 1].size() + 1; ++q)
488 Point2D start = ((q == 0) ? startOfWays :
W.getAirfoil(bou).possibleWays[way - 1][q - 1]);
489 Point2D finish = ((q ==
W.getAirfoil(bou).possibleWays[way - 1].size()) ? cPan :
W.getAirfoil(bou).possibleWays[way - 1][q]);
490 alpha += atan2((finish - pt) ^ (start - pt), (finish - pt) & (start - pt));
496 pressure[i] +=
IDPI * alpha * (
W.getBoundary(bou).sheets.freeVortexSheet(j, 0) +
W.getBoundary(bou).sheets.attachedVortexSheet(j, 0) -
W.getBoundary(bou).oldSheets.attachedVortexSheet(j, 0)) *
W.getAirfoil(bou).len[j] / dt;
498 pressure[i] -=
IDPI * alpha *
W.getAirfoil(bou).gammaThrough[j] / dt;
500 lambda = 0.5 * log((pt - cPan).length2());
501 pressure[i] -=
IDPI * lambda * (
W.getBoundary(bou).sheets.attachedSourceSheet(j, 0) -
W.getBoundary(bou).oldSheets.attachedSourceSheet(j, 0)) *
W.getAirfoil(bou).len[j] / dt;
506 for (
size_t i = 0; i <
pressure.size(); ++i)
507 pressure[i] *=
W.getPassport().physicalProperties.rho;
511 W.getTimers().stop(
"VelPres");
517void MeasureVP::GPUCalcPressure()
525 int addWSize = (int)
wakeVP->vtx.size();
538 std::vector<double> oldAttVortexSheet, oldAttSourceSheet, gammaThroughIntensity;
539 oldAttVortexSheet.reserve(npnl);
540 oldAttSourceSheet.reserve(npnl);
541 gammaThroughIntensity.reserve(npnl);
544 for (
size_t p = 0; p <
W.
getBoundary(bou).afl.getNumberOfPanels(); ++p)
554 double* devOldVortexSheet;
555 cudaMalloc(&devOldVortexSheet, npnl *
sizeof(
double));
556 cudaMemcpy(devOldVortexSheet, oldAttVortexSheet.data(), npnl *
sizeof(
double), cudaMemcpyHostToDevice);
558 double* devOldSourceSheet;
559 cudaMalloc(&devOldSourceSheet, npnl *
sizeof(
double));
560 cudaMemcpy(devOldSourceSheet, oldAttSourceSheet.data(), npnl *
sizeof(
double), cudaMemcpyHostToDevice);
562 double* devGammaThroughIntensity;
563 cudaMalloc(&devGammaThroughIntensity, npnl *
sizeof(
double));
564 cudaMemcpy(devGammaThroughIntensity, gammaThroughIntensity.data(), npnl *
sizeof(
double), cudaMemcpyHostToDevice);
567 cudaMalloc(&devDiffVelo,
W.
getWake().
vtx.size() * 2 *
sizeof(
double));
572 std::vector<double> UVfast;
575 cuCalculatePressure(addWSize,
wakeVP->devVtxPtr,
578 devOldVortexSheet, devOldSourceSheet, devGammaThroughIntensity,
579 this->devPressurePtr,
true,
true);
586 cuCalculatePressure(addWSize,
wakeVP->devVtxPtr,
587 W.getWake().vtx.size(),
W.getWake().devVtxPtr, V0[0], V0[1],
W.getWake().devVelPtr, devDiffVelo,
588 npnl,
W.getAirfoil(0).devRPtr,
W.getAirfoil(0).devFreeVortexSheetPtr,
W.getAirfoil(0).devAttachedVortexSheetPtr,
W.getAirfoil(0).devAttachedSourceSheetPtr,
589 devOldVortexSheet, devOldSourceSheet, devGammaThroughIntensity,
590 this->devPressurePtr,
false,
true);
593 UVfast.resize(addWSize);
594 if (
W.getWake().vtx.size() > 0)
601 cudaMalloc(&gVx_dev,
W.getWake().vtx.size() * 4 *
sizeof(
double));
602 cudaMalloc(&gVy_dev,
W.getWake().vtx.size() * 4 *
sizeof(
double));
603 cuCalcMulGammaVel(
W.getWake().vtx.size(),
W.getWake().devVtxPtr, V0[0], V0[1],
W.getWake().devVelPtr, devDiffVelo, gVx_dev, gVy_dev);
624 treeWakeX.MemoryAllocate((
int)
W.getCuda().n_CUDA_wake);
625 treeWakeY.MemoryAllocate((
int)
W.getCuda().n_CUDA_wake);
626 treeWakeX.Update((
int)
W.getWake().vtx.size(), gVx_dev);
627 treeWakeY.Update((
int)
W.getWake().vtx.size(), gVy_dev);
632 treeWakeX.UpwardTraversal(12);
633 treeWakeY.UpwardTraversal(12);
637 cudaMalloc(&UVx_dev, addWSize * 2 *
sizeof(
double));
638 cudaMalloc(&UVy_dev, addWSize * 2 *
sizeof(
double));
642 treeWakeX.DownwardTraversalVorticesToPoints<32>(*
W.getCuda().cntrTreeVP, (Point2D*)UVx_dev,
nullptr, 1.0, 12,
false,
false);
643 treeWakeY.DownwardTraversalVorticesToPoints<32>(*
W.getCuda().cntrTreeVP, (Point2D*)UVy_dev,
nullptr, 1.0, 12,
false,
false);
645 std::vector<Point2D> UVx(addWSize), UVy(addWSize);
646 cudaMemcpy(UVx.data(), UVx_dev, addWSize * 2 *
sizeof(
double), cudaMemcpyDeviceToHost);
647 cudaMemcpy(UVy.data(), UVy_dev, addWSize * 2 *
sizeof(
double), cudaMemcpyDeviceToHost);
649#pragma omp parallel for
650 for (
int i = 0; i < (int)addWSize; ++i)
651 UVfast[i] = UVx[i][0] + UVy[i][1];
666 cudaFree(devOldVortexSheet);
667 cudaFree(devOldSourceSheet);
668 cudaFree(devGammaThroughIntensity);
669 cudaFree(devDiffVelo);
671 std::vector<double> presGPU(addWSize);
672 cuCopyMemFromDev(presGPU.data(), this->devPressurePtr, addWSize *
sizeof(
double), 18);
673 if (UVfast.size() > 0)
675#pragma omp parallel for
676 for (
int i = 0; i < (int)addWSize; ++i)
677 presGPU[i] += UVfast[i];
692 const double& dt =
W.getPassport().timeDiscretizationProperties.dt;
694 double P0 = 0.5 * V0.
length2();
698#pragma warning (push)
699#pragma warning (disable: 4101)
705 for (
int i = 0; i < addWSize; ++i)
714#pragma omp parallel for default(none) private(alpha, lambda, dri, Vi, vi, dst2eps, cPan) shared(P0, dt, V0, addWSize, std::cout, IDPI)
715 for (
int i = 0; i < addWSize; ++i)
717 const Point2D& pt =
wakeVP->vtx[i].r();
718 for (
size_t bou = 0; bou <
W.getNumberOfBoundary(); ++bou)
720 const Point2D& rcm =
W.getAirfoil(bou).rcm;
722 for (
size_t j = 0; j <
W.getAirfoil(bou).getNumberOfPanels(); ++j)
724 cPan = 0.5 * (
W.getAirfoil(bou).getR(j) +
W.getAirfoil(bou).getR(j + 1));
728 int way =
W.getAirfoil(bou).wayToVertex[j];
733 alpha = atan2((cPan - pt) ^ (
W.getAirfoil(bou).startOfWays - pt), (cPan - pt) & (
W.getAirfoil(bou).startOfWays - pt));
737 for (
int q = 0; q <
W.getAirfoil(bou).possibleWays[way - 1].size() + 1; ++q)
739 Point2D start = ((q == 0) ?
W.getAirfoil(bou).startOfWays :
W.getAirfoil(bou).possibleWays[way - 1][q - 1]);
740 Point2D finish = ((q ==
W.getAirfoil(bou).possibleWays[way - 1].size()) ? cPan :
W.getAirfoil(bou).possibleWays[way - 1][q]);
741 alpha += atan2((finish - pt) ^ (start - pt), (finish - pt) & (start - pt));
746 pressure[i] +=
IDPI * alpha * (
W.getBoundary(bou).sheets.freeVortexSheet(j, 0) +
W.getBoundary(bou).sheets.attachedVortexSheet(j, 0) -
W.getBoundary(bou).oldSheets.attachedVortexSheet(j, 0)) *
W.getAirfoil(bou).len[j] / dt;
748 pressure[i] -=
IDPI * alpha *
W.getAirfoil(bou).gammaThrough[j] / dt;
750 lambda = 0.5 * log((pt - cPan).length2());
751 pressure[i] -=
IDPI * lambda * (
W.getBoundary(bou).sheets.attachedSourceSheet(j, 0) -
W.getBoundary(bou).oldSheets.attachedSourceSheet(j, 0)) *
W.getAirfoil(bou).len[j] / dt;
758 for (
size_t i = 0; i <
pressure.size(); ++i)
761 pressure[i] *=
W.getPassport().physicalProperties.rho;
768 W.getTimers().stop(
"VelPres");
775 W.getTimers().start(
"Save");
777 double scaleV = 1.0, scaleP = 1.0;
778 if (
W.getPassport().calcCoefficients)
780 const double& vRef =
W.getPassport().physicalProperties.vRef;
782 scaleP = 1.0 / (0.5 *
W.getPassport().physicalProperties.rho *
sqr(vRef));
786 std::ofstream outfile;
791 if (
W.getPassport().timeDiscretizationProperties.fileTypeVP.second == 0)
793 std::string fname =
VMlib::fileNameStep(
"VelPres",
W.getPassport().timeDiscretizationProperties.nameLength,
W.getCurrentStep(),
"vtk");
794 outfile.open(
W.getPassport().dir +
"velPres/" + fname);
796 outfile <<
"# vtk DataFile Version 2.0\n";
797 outfile <<
"VM2D VTK result: " << (
W.getPassport().dir +
"velPres/" + fname).c_str() <<
" saved " <<
VMlib::CurrentDataTime() <<
'\n';
798 outfile <<
"ASCII\n";
799 outfile <<
"DATASET UNSTRUCTURED_GRID\n";
800 outfile <<
"POINTS " << nRealPressurePoints <<
" float\n";
802 for (
size_t i = 0; i < nRealPressurePoints; ++i)
804 double xi = (
wakeVP->vtx[i].r())[0];
805 double yi = (
wakeVP->vtx[i].r())[1];
806 outfile << xi <<
" " << yi <<
" " <<
"0.0\n";
809 outfile <<
"CELLS " << nRealPressurePoints <<
" " << 2 * nRealPressurePoints <<
'\n';
810 for (
size_t i = 0; i < nRealPressurePoints; ++i)
811 outfile <<
"1 " << i <<
'\n';
813 outfile <<
"CELL_TYPES " << nRealPressurePoints <<
'\n';
814 for (
size_t i = 0; i < nRealPressurePoints; ++i)
818 outfile <<
"POINT_DATA " << nRealPressurePoints <<
'\n';
820 if (!
W.getPassport().calcCoefficients)
821 outfile <<
"VECTORS V float\n";
823 outfile <<
"VECTORS CV float\n";
825 for (
size_t i = 0; i < nRealPressurePoints; ++i)
827 outfile <<
velocity[i][0] * scaleV <<
" " <<
velocity[i][1] * scaleV <<
" 0.0\n";
832 if (!
W.getPassport().calcCoefficients)
833 outfile <<
"SCALARS P float 1\n";
835 outfile <<
"SCALARS CP float 1\n";
837 outfile <<
"LOOKUP_TABLE default\n";
839 for (
size_t i = 0; i < nRealPressurePoints; ++i)
841 outfile <<
pressure[i] * scaleP <<
'\n';
846 else if (
W.getPassport().timeDiscretizationProperties.fileTypeVP.second == 1)
850 bool littleEndian = (*((uint8_t*)&x));
851 const char eolnBIN[] =
"\n";
853 std::string fname =
VMlib::fileNameStep(
"VelPres",
W.getPassport().timeDiscretizationProperties.nameLength,
W.getCurrentStep(),
"vtk");
854 outfile.open(
W.getPassport().dir +
"velPres/" + fname, std::ios::out | std::ios::binary);
856 outfile <<
"# vtk DataFile Version 3.0" <<
"\r\n" <<
"VM2D VTK result: " << (
W.getPassport().dir +
"velPres/" + fname).c_str() <<
" saved " <<
VMlib::CurrentDataTime() << eolnBIN;
857 outfile <<
"BINARY" << eolnBIN;
858 outfile <<
"DATASET UNSTRUCTURED_GRID" << eolnBIN <<
"POINTS " << nRealPressurePoints <<
" " <<
"float" << eolnBIN;
861 Eigen::VectorXf pData = Eigen::VectorXf::Zero(nRealPressurePoints);
862 Eigen::VectorXf vData = Eigen::VectorXf::Zero(nRealPressurePoints * 3);
863 Eigen::VectorXf rData = Eigen::VectorXf::Zero(nRealPressurePoints * 3);
866 for (
size_t i = 0; i < nRealPressurePoints; ++i)
868 rData(3 * i + 0) = (float)(
wakeVP->vtx[i].r())[0];
869 rData(3 * i + 1) = (float)(
wakeVP->vtx[i].r())[1];
872 for (
size_t i = 0; i < nRealPressurePoints; ++i)
874 vData(3 * i + 0) = (float)(
velocity[i][0] * scaleV);
875 vData(3 * i + 1) = (float)(
velocity[i][1] * scaleV);
878 for (
size_t i = 0; i < nRealPressurePoints; ++i)
880 pData(i) = (float)(
pressure[i] * scaleP);
885 for (
int i = 0; i < nRealPressurePoints * 3; ++i)
887 outfile.write(
reinterpret_cast<char*
>(rData.data()), nRealPressurePoints * 3 *
sizeof(
float));
890 std::vector<int> cells(2 * nRealPressurePoints);
891 for (
size_t i = 0; i < nRealPressurePoints; ++i)
893 cells[2 * i + 0] = 1;
894 cells[2 * i + 1] = (int)i;
897 std::vector<int> cellsTypes;
898 cellsTypes.resize(nRealPressurePoints, 1);
902 for (
int i = 0; i < nRealPressurePoints * 2; ++i)
905 for (
int i = 0; i < nRealPressurePoints; ++i)
909 outfile << eolnBIN <<
"CELLS " << nRealPressurePoints <<
" " << nRealPressurePoints * 2 << eolnBIN;
910 outfile.write(
reinterpret_cast<char*
>(cells.data()), nRealPressurePoints * 2 *
sizeof(
int));
911 outfile << eolnBIN <<
"CELL_TYPES " << nRealPressurePoints << eolnBIN;
912 outfile.write(
reinterpret_cast<char*
>(cellsTypes.data()), nRealPressurePoints *
sizeof(
int));
916 for (
int i = 0; i < nRealPressurePoints * 3; ++i)
919 outfile << eolnBIN <<
"POINT_DATA " << nRealPressurePoints << eolnBIN;
921 if (!
W.getPassport().calcCoefficients)
922 outfile <<
"VECTORS V " <<
"float" << eolnBIN;
924 outfile <<
"VECTORS CV " <<
"float" << eolnBIN;
926 outfile.write(
reinterpret_cast<char*
>(vData.data()), nRealPressurePoints * 3 *
sizeof(
float));
930 for (
int i = 0; i < nRealPressurePoints; ++i)
933 if (!
W.getPassport().calcCoefficients)
934 outfile << eolnBIN <<
"SCALARS P " <<
"float" <<
" 1" << eolnBIN;
936 outfile << eolnBIN <<
"SCALARS CP " <<
"float" <<
" 1" << eolnBIN;
938 outfile <<
"LOOKUP_TABLE default" << eolnBIN;
939 outfile.write(
reinterpret_cast<char*
>(pData.data()), nRealPressurePoints *
sizeof(
float));
945 else if (
W.getPassport().timeDiscretizationProperties.fileTypeVP.second == 2)
947 std::string fname =
VMlib::fileNameStep(
"VelPres",
W.getPassport().timeDiscretizationProperties.nameLength,
W.getCurrentStep(),
"csv");
948 outfile.open(
W.getPassport().dir +
"velPres/" + fname);
950 if (!
W.getPassport().calcCoefficients)
951 outfile <<
"point,x,y,Vx,Vy,P\n";
953 outfile <<
"point,x,y,CVx,CVy,CP\n";
955 for (
size_t i = 0; i < nRealPressurePoints; ++i)
957 double xi = (
wakeVP->vtx[i].r())[0];
958 double yi = (
wakeVP->vtx[i].r())[1];
959 outfile << i <<
"," << xi <<
"," << yi \
961 <<
"," <<
pressure[i] * scaleP <<
'\n';
965 else if (
W.getPassport().timeDiscretizationProperties.fileTypeVP.second == 3)
967 std::string fnameBunCsv =
W.getPassport().dir +
"velPres/" +
"velPresBundle.csv";
968 std::ofstream VPFileBunCsv(fnameBunCsv.c_str(),
W.getCurrentStep() ? std::ios::app : std::ios::out);
970 if (
W.getCurrentStep() == 0)
971 VPFileBunCsv << nRealPressurePoints <<
'\n';
974 for (
size_t q = 0; q < nRealPressurePoints; ++q)
976 VPFileBunCsv <<
W.getCurrentStep() <<
"," \
977 <<
W.getCurrentTime() <<
"," \
979 <<
wakeVP->vtx[q].r()[0] <<
"," <<
wakeVP->vtx[q].r()[1] <<
"," \
989 #pragma omp parallel for
993 if (
W.getCurrentStep() == 0)
995 std::string VPFileNameCsv;
996 VPFileNameCsv =
W.getPassport().dir +
"velPres/" +
VMlib::fileNameStep(
"VP-atPoint-", 2, q,
"csv");
998 std::ofstream VPFileCsv(VPFileNameCsv.c_str(), std::ios::out);
1000 if (!
W.getPassport().calcCoefficients)
1001 VPFileCsv <<
"point,time,Vx,Vy,P\n";
1003 VPFileCsv <<
"point,time,CVx,CVy,CP\n";
1008 sstr[q] << q <<
"," <<
W.getCurrentTime() <<
","
1014 sstrCounter +=
W.getPassport().timeDiscretizationProperties.saveVPstep;
1020 #pragma omp parallel for
1023 std::string VPFileNameCsv;
1024 VPFileNameCsv =
W.getPassport().dir +
"velPres/" +
VMlib::fileNameStep(
"VP-atPoint-", 2, q,
"csv");
1026 std::ofstream VPFileCsv(VPFileNameCsv.c_str(), std::ios::app);
1028 VPFileCsv <<
sstr[q].str();
1041 W.getTimers().stop(
"Save");
1046 std::vector<std::pair<Point2D, double>> result;
1052 result.push_back({ velocity[nRealPressurePoints + q], pressure[nRealPressurePoints + q] });
Заголовочный файл с описанием класса Airfoil.
Заголовочный файл с описанием класса Boundary.
Заголовочный файл с функциями для метода GMRES.
Заголовочный файл с описанием класса MeasureVP.
Заголовочный файл с описанием класса Mechanics.
Заголовочный файл с описанием класса Preprocessor.
Заголовочный файл с описанием класса StreamParser.
T sqr(T x)
Возведение числа в квадрат
Заголовочный файл с описанием класса Velocity.
Заголовочный файл с описанием класса Wake.
Заголовочный файл с описанием класса World2D.
std::vector< double > len
Длины панелей профиля
const Point2D & getR(size_t q) const
Возврат константной ссылки на вершину профиля
const Point2D & getV(size_t q) const
Возврат константной ссылки на скорость вершины профиля
std::vector< Point2D > tau
Касательные к панелям профиля
size_t getNumberOfPanels() const
Возврат количества панелей на профиле
Абстрактный класс, определяющий обтекаемый профиль
std::vector< double > gammaThrough
Суммарные циркуляции вихрей, пересекших панели профиля на прошлом шаге
Абстрактный класс, определяющий способ удовлетворения граничного условия на обтекаемом профиле
Sheet oldSheets
Слои на профиле с предыдущего шага
Sheet sheets
Слои на профиле
std::vector< Point2D > initialPoints
Точки, которые считываются из файла (давление пишется в vtk-файлы).
std::vector< double > pressure
Давление в нужных точках
void ReadPointsFromFile(const std::string &dir)
Чтение точек, в которых нужно посчитать давление и скорость
void SaveVP()
Сохранение в файл вычисленных скоростей и давлений
const World2D & W
Константная ссылка на решаемую задачу
std::vector< Point2D > historyPoints
Точки, которые считываются из файла (давление пишется в vtk и csv-файлы).
std::unique_ptr< WakeDataBase > wakeVP
Умный указатель на точки, в которых нужно вычислять в данный момент времени Хранятся в виде "мнимой" ...
std::vector< Point2D > elasticPoints
Точки, в которых давление нужно вычислять в служебных целях (для задач гидроупругости),...
std::vector< double > domainRadius
Радиусы вихрей в нужных точках
void Initialization()
Инициализация векторов для вычисления скоростей и давлений Вызывается только на тех шагах расчета,...
void SetPoints(const std::vector< Point2D > &points, const std::vector< Point2D > &history)
std::vector< std::pair< Point2D, double > > GetVPinElasticPoints()
Возврат давления в "гидроупругих" точках
void CalcPressure()
Расчет поля давления
MeasureVP(const World2D &W_)
Конструктор
std::vector< Point2D > velocity
Скорости в нужных точках
std::vector< std::ostringstream > sstr
Буферы для накопления временнОй истории сил в соответствующих точках
NumericalSchemes numericalSchemes
Структура с используемыми численными схемами
const double & attachedVortexSheet(size_t n, size_t moment) const
const double & attachedSourceSheet(size_t n, size_t moment) const
const double & freeVortexSheet(size_t n, size_t moment) const
VortexesParams wakeVortexesParams
Струтура, определяющая параметры вихрей в следе
Класс, опеделяющий набор вихрей
std::vector< Vortex2D > vtx
Список вихревых элементов
Класс, опеделяющий текущую решаемую задачу
size_t getNumberOfAirfoil() const
Возврат количества профилей в задаче
const Wake & getWake() const
Возврат константной ссылки на вихревой след
const Airfoil & getAirfoil(size_t i) const
Возврат константной ссылки на объект профиля
Velocity & getNonConstVelocity() const
Возврат неконстантной ссылки на объект для вычисления скоростей
VMlib::TimersGen & getTimers() const
Возврат ссылки на временную статистику выполнения шага расчета по времени
Point2D getV0() const
Возврат текущей скорости набегающего потока
const Velocity & getVelocity() const
Возврат константной ссылки на объект для вычисления скоростей
const Passport & getPassport() const
Возврат константной ссылки на паспорт
const Boundary & getBoundary(size_t i) const
Возврат константной ссылки на объект граничного условия
size_t getNumberOfBoundary() const
Возврат количества граничных условий в задаче
Класс, позволяющий выполнять предварительную обработку файлов
Класс, позволяющий выполнять разбор файлов и строк с настройками и параметрами
bool get(const std::string &name, std::vector< Point2D > &res, const std::vector< Point2D > *defValue=nullptr, bool echoDefault=true) const
Считывание вектора из двумерных точек из базы данных
void start(const std::string &timerLabel)
Запуск счетчика
Класс, опеделяющий двумерный вихревой элемент
HD double & sigma()
Функция для доступа к радиусу вихря
HD Point2D & r()
Функция для доступа к радиус-вектору вихря
HD double & g()
Функция для доступа к циркуляции вихря
numvector< T, 2 > kcross() const
Геометрический поворот двумерного вектора на 90 градусов
auto length2() const -> typename std::remove_const< typename std::remove_reference< decltype(this->data[0])>::type >::type
Вычисление квадрата нормы (длины) вектора
void PrintHeaderToTextFile(std::ofstream &str, const std::string &header)
Формирование подзаголовка в текстовом файле вывода программы VM2D/VM3D.
void CreateUserDirectory(const std::string &dir, const std::string &name)
Создание каталога
double Lambda(const Point2D &p, const Point2D &s)
Вспомогательная функция вычисления логарифма отношения норм векторов
void PrintLogoToTextFile(std::ofstream &str, const std::string &fileName, const std::string &descr)
Формирование заголовка файла программы VM2D/VM3D.
std::string fileNameStep(const std::string &name, int length, size_t number, const std::string &ext)
Формирование имени файла
double boundDenom(double r2, double eps2)
Способ сглаживания скорости вихря (вихрь Рэнкина или вихрь Ламба).
double Alpha(const Point2D &p, const Point2D &s)
Вспомогательная функция вычисления угла между векторами
std::string CurrentDataTime()
Формирование строки с текущем временем и датой
void SwapEnd(T &var)
Вспомогательная функция перестановки байт местами (нужно для сохранения бинарных VTK).
const int defaultHistoryFrequency
Шаг сохранения буферов истории скорости и давления к контрольных точках в файл
std::pair< std::string, int > velocityComputation
std::vector< Point2D > convVelo
Вектор конвективных скоростей вихрей
std::vector< Point2D > diffVelo
Вектор диффузионных скоростей вихрей