36#include <cuda_runtime.h>
37#include <helper_cuda.h>
68 for (
unsigned int it = 0;
it < para->
getParH((
int)
lev)->numberOfPointsCpTop;
it++)
102 std::string
ffname = para->
getFName() + StringUtil::toString<int>(para->
getMyProcessID()) +
"_" + StringUtil::toString<int>(
t) +
"_cp_top.txt";
103 const char* fname =
ffname.c_str();
135 const char* fname =
ffname.c_str();
171 const char* fname =
ffname.c_str();
207 const char* fname =
ffname.c_str();
257 para->
getParH((
int)
lev)->numberOfPointsPressWindow = 0;
258 para->
getParH(
lev + 1)->numberOfPointsPressWindow = 0;
261 for (
unsigned int it = 0;
it < para->
getParH(
lev + 1)->numberOfPointsCpTop;
it++)
274 para->
getParH(
lev + 1)->isOutsideInterface.push_back(
false);
281 para->
getParH(
lev + 1)->isOutsideInterface.push_back(
true);
282 para->
getParH(
lev + 1)->numberOfPointsPressWindow++;
287 for (
unsigned int it = 0;
it < para->
getParH((
int)
lev)->numberOfPointsCpTop;
it++)
293 para->
getParH((
int)
lev)->isOutsideInterface.push_back(
false);
300 para->
getParH((
int)
lev)->isOutsideInterface.push_back(
true);
301 para->
getParH((
int)
lev)->numberOfPointsPressWindow++;
306 std::cout <<
"number of nodes cp top level 7:" << para->
getParH((
int)
lev)->numberOfPointsCpTop <<
endl;
307 std::cout <<
"number of nodes bool level 7:" << para->
getParH((
int)
lev)->isOutsideInterface.size() <<
endl;
308 std::cout <<
"number of nodes press window level 7:" << para->
getParH((
int)
lev)->numberOfPointsPressWindow <<
endl;
309 std::cout <<
"number of nodes cp top level 8:" << para->
getParH(
lev + 1)->numberOfPointsCpTop <<
endl;
310 std::cout <<
"number of nodes bool level 8:" << para->
getParH(
lev + 1)->isOutsideInterface.size() <<
endl;
311 std::cout <<
"number of nodes press window level 8:" << para->
getParH(
lev + 1)->numberOfPointsPressWindow <<
endl;
326 for (
unsigned int it = 0;
it < para->
getParH((
int)
lev)->numberOfPointsCpTop;
it++)
351 const char* fname =
ffname.c_str();
368 ostr <<
"###########################################################" << std::endl;
369 ostr <<
"#### Casefile written by VirtualFluidsGPU" << std::endl;
370 ostr <<
"###########################################################" << std::endl << std::endl;
372 ostr <<
"FORMAT " << std::endl;
373 ostr <<
"type: ensight gold" << std::endl << std::endl;
375 ostr <<
"GEOMETRY " << std::endl;
376 ostr <<
"model: " <<
"Data/" <<
fnameGeo << std::endl << std::endl;
378 ostr <<
"VARIABLE " << std::endl;
379 ostr <<
"scalar per element: 1 Pressure \t" <<
"Data/" <<
fnameScalar << std::endl << std::endl;
381 ostr <<
"TIME " << std::endl;
382 ostr <<
"time set: 1" << std::endl;
383 ostr <<
"number of steps: " << numberOfSteps <<
"\n";
384 ostr <<
"filename start number: 0" << std::endl;
385 ostr <<
"filename increment: 1" << std::endl;
386 ostr <<
"time values:" << std::endl;
388 for (
unsigned int t = 0;
t < numberOfSteps;
t++)
416 unsigned int non = 0;
428 std::ostringstream
temp1;
429 std::ostringstream
temp2;
430 std::ostringstream
temp3;
435 ostr <<
"This geometry File was written by VirtualFluidsGPU\n";
436 ostr <<
"#### Casefile written by VirtualFluidsGPU\n";
438 ostr <<
"node id assign \n";
439 ostr <<
"element id assign \n";
441 ostr <<
"part \n \t 1 \n";
443 ostr <<
"coordinates \n \t" <<
non <<
"\n";
448 for (
unsigned int i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsCpTop;
i++)
450 if (para->
getParH((
int)
lev)->isOutsideInterface[
i])
460 for (
unsigned int i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsCpTop;
i++)
462 if (para->
getParH((
int)
lev)->isOutsideInterface[
i])
472 for (
unsigned int i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsCpTop;
i++)
474 if (para->
getParH((
int)
lev)->isOutsideInterface[
i])
481 ostr <<
"point \n \t" <<
non <<
"\n";
486 for (
size_t i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsPressWindow;
i++)
498 ostr.open(fname, std::ios::out | std::ios::binary);
517 for (
unsigned int i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsCpTop;
i++)
519 if (para->
getParH((
int)
lev)->isOutsideInterface[
i])
530 for (
unsigned int i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsCpTop;
i++)
532 if (para->
getParH((
int)
lev)->isOutsideInterface[
i])
543 for (
unsigned int i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsCpTop;
i++)
545 if (para->
getParH((
int)
lev)->isOutsideInterface[
i])
559 for (
size_t i = 0;
i < para->
getParH((
int)
lev)->numberOfPointsPressWindow;
i++)
596 ostr <<
"part \n\t 1 \n";
617 ostr.open(fname, std::ios::out | std::ios::binary);
648 ofile.write((
char*)&
i,
sizeof(
int));
653 ofile.write((
char*)&f,
sizeof(
float));
void cudaFreeCpTop(int lev)
void cudaFreeCpBottom(int lev)
void cudaFreeCpBottom2(int lev)
void cudaCopyCpTop(int lev)
void cudaCopyCpBottom(int lev)
void cudaCopyCpBottom2(int lev)
Class for LBM-parameter management.
int getMyProcessID() const
unsigned int getTimestepStartOut()
std::vector< real > getTranslateLBMtoSI()
std::shared_ptr< LBMSimulationParameter > getParH(int level) const
Pointer to instance of LBMSimulationParameter - stored on Host System.
std::vector< real > getScaleLBMtoSI()
real getVelocityRatio() const
std::string getOutputPrefix() const
real getDensityRatio() const
std::string getFName() const
void setStepEnsight(unsigned int step)
std::string getOutputPath()
unsigned int getStepEnsight()
unsigned int getTimestepEnd() const
std::shared_ptr< T > SPtr
void printCaseFile(Parameter *para)
void printGeoFile(Parameter *para, bool fileFormat)
void printScalars(Parameter *para, bool fileFormat)
void printCpBottom2(Parameter *para, CudaMemoryManager *cudaMemoryManager)
void writeFloatToFile(const float &f, std::ofstream &ofile)
void printCpBottom(Parameter *para, CudaMemoryManager *cudaMemoryManager)
void calcPressForMirror(Parameter *para, CudaMemoryManager *cudaMemoryManager, int lev)
void writeStringToFile(const std::string &s, std::ofstream &ofile)
void calcCp(Parameter *para, CudaMemoryManager *cudaMemoryManager, int lev)
void printCpTopIntermediateStep(Parameter *para, unsigned int t, int lev)
void printCpTop(Parameter *para, CudaMemoryManager *cudaMemoryManager, int lev)
void excludeGridInterfaceNodesForMirror(Parameter *para, int lev)
void writeIntToFile(const int &i, std::ofstream &ofile)