Commit ac2693cf authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed tnl-lattice-init profileCell setup.

parent af6d900e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ set( headers
     StaticFor.h
     String.h
     Timer.h
     terminal-colors.h
     UniquePointer.h )

set( common_SOURCES
+11 −11
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ class MpiCommunicator
      static bool isDistributed()
      {
         return GetSize()>1;
      };
      }

      static void configSetup( Config::ConfigDescription& config, const String& prefix = "" )
      {
@@ -122,7 +122,7 @@ class MpiCommunicator
            }
         }
#endif
      };
      }

      static void Finalize()
      {
@@ -137,7 +137,7 @@ class MpiCommunicator
         }
         MPI::Finalize();
#endif
      };
      }

      static bool IsInitialized()
      {
@@ -146,7 +146,7 @@ class MpiCommunicator
#else
        return false;
#endif
      };
      }

      static int GetRank()
      {
@@ -157,7 +157,7 @@ class MpiCommunicator
#else
        return 1;
#endif
      };
      }

      static int GetSize()
      {
@@ -167,7 +167,7 @@ class MpiCommunicator
#else
        return 1;
#endif
      };
      }

        //dim-number of dimesions, distr array of guess distr - 0 for computation
        //distr array will be filled by computed distribution
@@ -192,7 +192,7 @@ class MpiCommunicator

            MPI_Dims_create(nproc, dim, distr);
#endif
        };
        }

         static void Barrier()
         {
@@ -202,7 +202,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }

         template <typename T>
         static Request ISend( const T *data, int count, int dest)
@@ -234,7 +234,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }

        template< typename T > 
        static void Bcast(  T& data, int count, int root)
@@ -258,7 +258,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }


         template< typename T >
@@ -273,7 +273,7 @@ class MpiCommunicator
#else
            throw Exceptions::MPISupportMissing();
#endif
        };
        }


      static void writeProlog( Logger& logger ) 
+8 −8
Original line number Diff line number Diff line
@@ -51,22 +51,22 @@ class NoDistrCommunicator
      static bool IsInitialized()
      {   
          return true;
      };
      }

      static bool isDistributed()
      {
          return false;
      };
      }

      static int GetRank()
      {
          return 0;
      };
      }

      static int GetSize()
      {
          return 1;
      };
      }

      static void DimsCreate(int nproc, int dim, int *distr)
      {
@@ -74,7 +74,7 @@ class NoDistrCommunicator
          {
              distr[i]=1;
          }
      };
      }

      static void Barrier()
      {
@@ -94,7 +94,7 @@ class NoDistrCommunicator

      static void WaitAll(Request *reqs, int length)
      {
      };
      }

      template< typename T > 
      static void Bcast(  T& data, int count, int root)
@@ -108,7 +108,7 @@ class NoDistrCommunicator
                             const MPI_Op &op )
      {
         memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) );
      };
      }

      template< typename T >
      static void Reduce( T* data,
@@ -118,7 +118,7 @@ class NoDistrCommunicator
                          int root )
      {
         memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) );
      };
      }

      static void writeProlog( Logger& logger ){};
};
+30 −15
Original line number Diff line number Diff line
@@ -89,6 +89,10 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(),
                                  rotationSin * aux1.x() + rotationCos * aux1.y() );
                  aux1 = profileCenter + aux2;
                  if( aux1.x() >= 0 && aux1.y() >= 0 &&
                      aux1.x() <= profileMesh.getProportions().x() &&
                      aux1.y() <= profileMesh.getProportions().y() )
                  {
                     profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x();
                     profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y();
                     profileCell.refresh();
@@ -96,6 +100,7 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                     if( aux ) f( cell ) = aux;
                  }
               }
            }
            if( profileOrientation == "y" )
            {
               if( p.x() < profileMesh.getOrigin().x() ||
@@ -114,6 +119,10 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(),
                                  rotationSin * aux1.x() + rotationCos * aux1.y() );
                  aux1 = profileCenter + aux2;
                  if( aux1.x() >= 0 && aux1.y() >= 0 &&
                      aux1.x() <= profileMesh.getProportions().x() &&
                      aux1.y() <= profileMesh.getProportions().y() )
                  {
                     profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x();
                     profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y();
                     profileCell.refresh();
@@ -121,6 +130,7 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                     if( aux ) f( cell ) = aux;
                  }
               }
            }            
            if( profileOrientation == "z" )
            {
               if( p.x() < profileMesh.getOrigin().x() ||
@@ -139,6 +149,10 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  ProfilePointType aux2( rotationCos * aux1.x() - rotationSin * aux1.y(),
                                  rotationSin * aux1.x() + rotationCos * aux1.y() );
                  aux1 = profileCenter + aux2;
                  if( aux1.x() >= 0 && aux1.y() >= 0 &&
                      aux1.x() <= profileMesh.getProportions().x() &&
                      aux1.y() <= profileMesh.getProportions().y() )
                  {
                     profileCell.getCoordinates().x() = aux1.x() / profileMesh.getSpaceSteps().x();
                     profileCell.getCoordinates().y() = aux1.y() / profileMesh.getSpaceSteps().y();
                     profileCell.refresh();
@@ -147,6 +161,7 @@ bool performExtrude( const Config::ParameterContainer& parameters,
                  }
               }
            }
         }
   String outputFile = parameters.getParameter< String >( "output-file" );
   if( ! f.save( outputFile ) )
   {