Re: Inverted axis on cavity2d/3d examples
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Inverted axis on cavity2d/3d examples › Re: Inverted axis on cavity2d/3d examples
October 9, 2018 at 10:07 pm
#2951
Markus Mohrhard
Participant
Hey,
thanks for the report. We had already fixed this issue in our development branch.
Find below the fix that is necessary to fix the VTK export:
Code:
diff –git a/src/io/blockVtkWriter2D.hh b/src/io/blockVtkWriter2D.hh
index ea92f0d34..6c8634a3e 100644
— a/src/io/blockVtkWriter2D.hh
+++ b/src/io/blockVtkWriter2D.hh
@@ -189,8 +189,8 @@ void BlockVTKwriter2D<T>::writeRawData(const std::string& fullNameVti, BlockF2D<
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
evaluated[iDim] = T();
}
– for (i[0] = 0; i[0] < ny+1; ++i[0]) {
– for (i[1] = 0; i[1] < nx+1; ++i[1]) {
+ for (i[1] = 0; i[1] < ny+1; ++i[1]) {
+ for (i[0] = 0; i[0] < nx+1; ++i[0]) {
f(evaluated,i);
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
if (singleton::mpi().getRank()==0) {
@@ -251,8 +251,8 @@ void BlockVTKwriter2D<T>::writeRawDataBinary(const std::string& fullNameVti,
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
evaluated[iDim] = T();
}
– for (i[0] = 0; i[0] < ny+1; ++i[0]) {
– for (i[1] = 0; i[1] < nx+1; ++i[1]) {
+ for (i[1] = 0; i[1] < ny+1; ++i[1]) {
+ for (i[0] = 0; i[0] < nx+1; ++i[0]) {
f(evaluated,i);
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
if (singleton::mpi().getRank()==0) {
index ea92f0d34..6c8634a3e 100644
— a/src/io/blockVtkWriter2D.hh
+++ b/src/io/blockVtkWriter2D.hh
@@ -189,8 +189,8 @@ void BlockVTKwriter2D<T>::writeRawData(const std::string& fullNameVti, BlockF2D<
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
evaluated[iDim] = T();
}
– for (i[0] = 0; i[0] < ny+1; ++i[0]) {
– for (i[1] = 0; i[1] < nx+1; ++i[1]) {
+ for (i[1] = 0; i[1] < ny+1; ++i[1]) {
+ for (i[0] = 0; i[0] < nx+1; ++i[0]) {
f(evaluated,i);
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
if (singleton::mpi().getRank()==0) {
@@ -251,8 +251,8 @@ void BlockVTKwriter2D<T>::writeRawDataBinary(const std::string& fullNameVti,
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
evaluated[iDim] = T();
}
– for (i[0] = 0; i[0] < ny+1; ++i[0]) {
– for (i[1] = 0; i[1] < nx+1; ++i[1]) {
+ for (i[1] = 0; i[1] < ny+1; ++i[1]) {
+ for (i[0] = 0; i[0] < nx+1; ++i[0]) {
f(evaluated,i);
for (int iDim = 0; iDim < f.getTargetDim(); ++iDim) {
if (singleton::mpi().getRank()==0) {
Kind regards,
Markus