69 nodeDataNames.resize(NUMBER_Of_DIRECTIONS);
71 for (
uint dir = STARTDIR; dir <= ENDDIR; dir++) {
76 numberString +
" [" + vf::lbm::dir::directionNames.at(dir) +
"]";
88 std::vector<std::string> nodeDataNames;
100 if (distributions.
f[0] ==
nullptr)
101 throw std::runtime_error(
"Distributions (distributions.f[0]) at level " + std::to_string(level) +
102 " are not allocated on the host. Can't write distributions.");
112 std::vector<UbTupleUInt8> cells;
113 std::vector<std::vector<double>>
nodeData(nodeDataNames.size());
114 for (
uint i = 0;
i < (
uint)nodeDataNames.size();
i++)
117 for (
unsigned int pos = startPosition;
pos < endPosition;
pos++) {
131 for (
uint dir = STARTDIR; dir <= ENDDIR; dir++) {
148 VF_LOG_DEBUG(
"DistributionDebugWriter wrote to {} ", fileName);
164 for (
int level = 0; level <= para.
getMaxLevel(); level++)
173 throw std::runtime_error(
"Distributions (distributions.f[0]) at level " + std::to_string(level) +
174 " are not allocated on the host. Can't copy distributions to host");
#define VF_LOG_DEBUG(...)
static WbWriterVtkXmlBinary * getInstance()
void cudaCopyFsForCheckPoint(int lev) const
copy distributions from device to host
void cudaAllocFsForAllLevelsOnHost() const
void cudaAllocFsForCheckPointAndRestart(int lev) const
static void copyDistributionsToHost(const Parameter ¶, const CudaMemoryManager &cudaMemoryManager)
Copy distributions from device to host. Call this function before writing data.
static void writeDistributions(const Parameter ¶, uint timestep)
write the distributions for all levels
static void writeDistributionsForLevel(const Parameter ¶, uint level, uint timestep)
write the distributions for one level
static void allocateDistributionsOnHost(const CudaMemoryManager &cudaMemoryManager)
allocate memory for the distributions on the host
static uint calculateNumberOfParts(uint numberOfNodes)
calculate how many output vtk-files are created for one timestep of the given grid level
static uint calculateStartingPostionOfPart(uint indexOfPart)
static uint calculateNumberOfNodesInPart(uint numberOfNodes, uint indexOfFilePart)
calculate how many grid nodes are written to the file with the given index
Class for LBM-parameter management.
int getMyProcessID() const
std::string getFName() const
LBMSimulationParameter & getParHostAsReference(int level) const
static void getIndicesOfAllNodesInOct(std::array< uint, 8 > &nodeIndices, uint baseNodeOfOct, const LBMSimulationParameter &parH)
use the neighbor relations to find the indices of all nodes in an oct cell
static bool isPeriodicCell(const LBMSimulationParameter &parH, unsigned int baseNodeOfCell, unsigned int otherNodeInCell)
check whether a grid cell is part of a periodic boundary condition
static std::string makePartFileNameEnding(uint level, int processID, int part, int timestep)
create the ending of the file name for a file part
static void calculateRelativeNodeIndexInPart(std::array< uint, 8 > &relativePositionInPart, const std::array< uint, 8 > &indicesOfOct, uint startPositionOfPart)
calculate the node index relative to the start position of the part
static bool areAllNodesInOctValidForWriting(const std::array< uint, 8 > &indicesOfOct, const LBMSimulationParameter &parH, uint endPositionOfPart)
check if all nodes in an oct are valid to be written into an output file
std::shared_ptr< T > SPtr
UbTuple< T, T, T, T, T, T, T, T > makeUbTupleFromArray(const std::array< T, 8 > &array)
UbTuple< T1 > makeUbTuple(T1 const &a1)
std::string writeOctsWithNodeData(const std::string &filename, std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleUInt8 > &cells, std::vector< std::string > &datanames, std::vector< std::vector< double > > &nodedata) override
constexpr void getPreCollisionDistribution(real *local, const Distributions27 &global, const ListIndices &indices)
void createNodeDataNames(std::vector< std::string > &nodeDataNames)
constexpr void getPointersToDistributions(Distributions27 &dist, real *distributionArray, const unsigned long long numberOfLBnodes, const bool isEvenTimestep)
void createFileNames(std::vector< std::string > &fileNames, uint numberOfParts, uint level, uint timestep, const Parameter ¶)
real * f[vf::lbm::dir::NUMBER_Of_DIRECTIONS]
struct holds and manages the LB-parameter of the simulation
uint * typeOfGridNode
stores the type for every lattice node (f.e. fluid node)
Distributions27 distributions
store all distribution functions for the D3Q27
real * coordinateX
store the coordinates for every lattice node
unsigned long long numberOfNodes
stores the number of nodes (based on indirect addressing scheme)
uint * neighborX
store the neighbors in +X, +Y, +Z, and in diagonal negative direction