MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
iovtk.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef VtkIo_H
8#define VtkIo_H
9
16#include "MEMORY/collector.h"
17#include "MEMORY/scratch.h"
18#include "contexttypes.h"
19
20template <MInt nDim, class SysEqn>
22
23template <MInt nDim, class SysEqn>
24class VtkIo {
25 private:
31
33
34 static constexpr MInt m_noDirs = 2 * nDim;
35
36 public:
38
40 ~VtkIo();
41
42
43 SysEqn sysEqn() const { return m_solver->m_sysEqn; };
44 SysEqn& sysEqn() { return m_solver->m_sysEqn; };
45 MInt solverCount() const { return m_noSolver; };
46 MInt noDomains() const { return m_solver->noDomains(); }
47 MInt domainId() const { return m_solver->domainId(); }
48 MPI_Comm mpiComm() const { return m_solver->mpiComm(); }
49
50 MInt writeVtuArrayParallel(MPI_File&, void*, MPI_Offset, MPI_Offset, MPI_Offset);
51
52 void insertDataHeader(char* data, uint64_t& memsize, uint64_t& memsizeGlobal, uint64_t& offset);
53 void updateDataOffsets(uint64_t memsize, uint64_t& memsizeGlobal, uint64_t& offset, uint64_t& oldMemsizeGlobal);
54
56
58 void writeVtkXmlOutput(const MChar* fileName);
59
60
61 template <typename uint_t = uint32_t>
63 const MString fileName, const MString geomFileName, const MInt noSolverSpecificVars = 0,
64 const MFloatScratchSpace& solverSpecificVars = MFloatScratchSpace(1, "writeVtuOutputParallel",
65 "defaultParameter1"),
66 const MInt noUserVars = 0,
67 const MFloatScratchSpace& userVars = MFloatScratchSpace(1, "writeVtuOutputParallel", "defaultParameter2"));
68
69 template <typename T>
70 uint64_t vtuAssembleFaceStream(std::vector<T>*&, std::vector<T>*&, uint64_t&, ScratchSpace<MInt>&, MInt&,
71 const MBool);
72
73
93};
94
95#endif
Definition: list.h:16
This class is a ScratchSpace.
Definition: scratch.h:758
virtual MInt domainId() const
Return the domainId (rank)
Definition: solver.h:383
MPI_Comm mpiComm() const
Return the MPI communicator used by this solver.
Definition: solver.h:380
virtual MInt noDomains() const
Definition: solver.h:387
Definition: iovtk.h:24
void insertDataHeader(char *data, uint64_t &memsize, uint64_t &memsizeGlobal, uint64_t &offset)
The zeroth domain stores the header for an uncompressed vtu file appended data array specifying its n...
Definition: iovtk.cpp:1157
void writeVtkXmlOutput(const MChar *fileName)
Copy of parallel single-file VTU output using MPI I/O.
Definition: iovtk.cpp:180
static constexpr MInt m_noDirs
Definition: iovtk.h:34
MInt noDomains() const
Definition: iovtk.h:46
Collector< FvBndryCell< nDim, SysEqn > > * m_bndryCells
Definition: iovtk.h:27
MInt m_noSolver
Definition: iovtk.h:32
void writeVtuOutputParallel(const MString fileName, const MString geomFileName, const MInt noSolverSpecificVars=0, const MFloatScratchSpace &solverSpecificVars=MFloatScratchSpace(1, "writeVtuOutputParallel", "defaultParameter1"), const MInt noUserVars=0, const MFloatScratchSpace &userVars=MFloatScratchSpace(1, "writeVtuOutputParallel", "defaultParameter2"))
Definition: iovtk.cpp:2818
MInt writeVtuArrayParallel(MPI_File &, void *, MPI_Offset, MPI_Offset, MPI_Offset)
Definition: iovtk.cpp:134
MInt solverCount() const
Definition: iovtk.h:45
FvCartesianSolverXD< nDim, SysEqn > * m_solver
Definition: iovtk.h:26
Collector< PointBasedCell< nDim > > * m_extractedCells
Definition: iovtk.h:28
~VtkIo()
Definition: iovtk.cpp:22
MPI_Comm mpiComm() const
Definition: iovtk.h:48
Collector< CartesianGridPoint< nDim > > * m_gridPoints
Definition: iovtk.h:29
MBool initializeVtkXmlOutput(const MChar *, MString, MInt, MBool, MBool)
Definition: iovtk.cpp:29
SysEqn sysEqn() const
Definition: iovtk.h:43
void updateDataOffsets(uint64_t memsize, uint64_t &memsizeGlobal, uint64_t &offset, uint64_t &oldMemsizeGlobal)
Recomputes global offsets and data size given the local memsize.
Definition: iovtk.cpp:1177
MInt domainId() const
Definition: iovtk.h:47
SysEqn & sysEqn()
Definition: iovtk.h:44
List< MInt > * m_bndryCellIds
Definition: iovtk.h:30
uint64_t vtuAssembleFaceStream(std::vector< T > *&, std::vector< T > *&, uint64_t &, ScratchSpace< MInt > &, MInt &, const MBool)
Definition: iovtk.cpp:1195
MInt estimateMemorySizeSolverwise(uint64_t, ScratchSpace< uint64_t > &, uint64_t)
Definition: iovtk.cpp:1142
FvCell
FV cell Property Labels.
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
bool MBool
Definition: maiatypes.h:58
char MChar
Definition: maiatypes.h:56
ScratchSpace< MFloat > MFloatScratchSpace
Definition: scratch.h:65