Loading src/TNL/CMakeLists.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ set( headers StaticFor.h String.h Timer.h terminal-colors.h UniquePointer.h ) set( common_SOURCES Loading src/TNL/Communicators/MpiCommunicator.h +11 −11 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class MpiCommunicator static bool isDistributed() { return GetSize()>1; }; } static void configSetup( Config::ConfigDescription& config, const String& prefix = "" ) { Loading Loading @@ -122,7 +122,7 @@ class MpiCommunicator } } #endif }; } static void Finalize() { Loading @@ -137,7 +137,7 @@ class MpiCommunicator } MPI::Finalize(); #endif }; } static bool IsInitialized() { Loading @@ -146,7 +146,7 @@ class MpiCommunicator #else return false; #endif }; } static int GetRank() { Loading @@ -157,7 +157,7 @@ class MpiCommunicator #else return 1; #endif }; } static int GetSize() { Loading @@ -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 Loading @@ -192,7 +192,7 @@ class MpiCommunicator MPI_Dims_create(nproc, dim, distr); #endif }; } static void Barrier() { Loading @@ -202,7 +202,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template <typename T> static Request ISend( const T *data, int count, int dest) Loading Loading @@ -234,7 +234,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > static void Bcast( T& data, int count, int root) Loading @@ -258,7 +258,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > Loading @@ -273,7 +273,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } static void writeProlog( Logger& logger ) Loading src/TNL/Communicators/NoDistrCommunicator.h +8 −8 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -74,7 +74,7 @@ class NoDistrCommunicator { distr[i]=1; } }; } static void Barrier() { Loading @@ -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) Loading @@ -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, Loading @@ -118,7 +118,7 @@ class NoDistrCommunicator int root ) { memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; } static void writeProlog( Logger& logger ){}; }; Loading src/Tools/tnl-lattice-init.h +30 −15 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -96,6 +100,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "y" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -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(); Loading @@ -121,6 +130,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "z" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -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(); Loading @@ -147,6 +161,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, } } } } String outputFile = parameters.getParameter< String >( "output-file" ); if( ! f.save( outputFile ) ) { Loading Loading
src/TNL/CMakeLists.txt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ set( headers StaticFor.h String.h Timer.h terminal-colors.h UniquePointer.h ) set( common_SOURCES Loading
src/TNL/Communicators/MpiCommunicator.h +11 −11 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class MpiCommunicator static bool isDistributed() { return GetSize()>1; }; } static void configSetup( Config::ConfigDescription& config, const String& prefix = "" ) { Loading Loading @@ -122,7 +122,7 @@ class MpiCommunicator } } #endif }; } static void Finalize() { Loading @@ -137,7 +137,7 @@ class MpiCommunicator } MPI::Finalize(); #endif }; } static bool IsInitialized() { Loading @@ -146,7 +146,7 @@ class MpiCommunicator #else return false; #endif }; } static int GetRank() { Loading @@ -157,7 +157,7 @@ class MpiCommunicator #else return 1; #endif }; } static int GetSize() { Loading @@ -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 Loading @@ -192,7 +192,7 @@ class MpiCommunicator MPI_Dims_create(nproc, dim, distr); #endif }; } static void Barrier() { Loading @@ -202,7 +202,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template <typename T> static Request ISend( const T *data, int count, int dest) Loading Loading @@ -234,7 +234,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > static void Bcast( T& data, int count, int root) Loading @@ -258,7 +258,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } template< typename T > Loading @@ -273,7 +273,7 @@ class MpiCommunicator #else throw Exceptions::MPISupportMissing(); #endif }; } static void writeProlog( Logger& logger ) Loading
src/TNL/Communicators/NoDistrCommunicator.h +8 −8 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -74,7 +74,7 @@ class NoDistrCommunicator { distr[i]=1; } }; } static void Barrier() { Loading @@ -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) Loading @@ -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, Loading @@ -118,7 +118,7 @@ class NoDistrCommunicator int root ) { memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; } static void writeProlog( Logger& logger ){}; }; Loading
src/Tools/tnl-lattice-init.h +30 −15 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -96,6 +100,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "y" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -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(); Loading @@ -121,6 +130,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, if( aux ) f( cell ) = aux; } } } if( profileOrientation == "z" ) { if( p.x() < profileMesh.getOrigin().x() || Loading @@ -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(); Loading @@ -147,6 +161,7 @@ bool performExtrude( const Config::ParameterContainer& parameters, } } } } String outputFile = parameters.getParameter< String >( "output-file" ); if( ! f.save( outputFile ) ) { Loading